:root {
  --bg: #0b0a16; --bg2: #15142a; --panel: #15142a; --panel2: #1f1d3a; --line: #2b2a4d;
  --text: #ece4d6; --muted: #a5a3cc; --brass: #9d7bff; --brass2: #c3adff; --danger: #d9534a; --ok: #58b368;
  --radius: 14px; --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: radial-gradient(1200px 600px at 20% -10%, #1c1a38 0%, var(--bg) 60%) fixed; color: var(--text); font: 15px/1.4 var(--sans); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .01em; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* кнопки и поля */
.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; min-height: 40px; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--brass); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brass); color: #0d0a24; border-color: var(--brass2); font-weight: 600; }
.btn.danger { background: #3a1d1b; border-color: #6d2a26; color: #ffb4ad; }
.btn.danger:hover { background: #512320; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { border-color: var(--line); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: 13px; }
.btn.big { min-height: 48px; font-size: 17px; width: 100%; }
.icon-btn { background: none; border: 0; border-radius: 8px; min-width: 36px; min-height: 36px; color: var(--muted); }
.icon-btn:hover { color: var(--text); background: var(--panel2); }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-height: 40px; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
input[type=range] { accent-color: var(--brass); width: 100%; min-height: 28px; }
.field { display: grid; gap: 5px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.field > input, .field > select, .field > textarea { color: var(--text); font-size: 15px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.grow > * { flex: 1; }
.form-error { color: #ff8f86; min-height: 1.3em; margin: 4px 0; }

/* верхняя панель */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: rgba(12, 11, 26,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brass); color: #0d0a24; font-size: 18px; }
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.master { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; max-width: 320px; color: var(--muted); font-size: 13px; }
.master output { width: 38px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.top-nav { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.short { display: none; }
.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(157, 123, 255,.55); } 50% { box-shadow: 0 0 0 9px rgba(157, 123, 255,0); } }

/* каркас */
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr) 310px; gap: 14px; padding: 14px; align-items: start; max-width: 1700px; margin: 0 auto; }
.scenes, .mixer { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; position: sticky; top: calc(var(--top-h, 52px) + 10px); max-height: calc(100vh - var(--top-h, 52px) - 24px); overflow: auto; }
.scenes h3, .mixer h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-family: var(--sans); margin: 4px 0 10px; }
.mixer-toggle { display: none; }

/* сцены */
.scene-item { display: flex; align-items: stretch; gap: 4px; margin-bottom: 6px; }
.scene-pick { flex: 1; text-align: left; display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); min-height: 44px; border-left: 5px solid var(--c, var(--brass)); }
.scene-item.view .scene-pick { background: #2a2850; border-color: var(--brass); }
.scene-item.live .scene-pick::after { content: "● играет"; margin-left: auto; font-size: 11px; color: var(--ok); }

/* главный экран */
.main { min-width: 0; }
.scene-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.scene-head h1 { font-size: 26px; flex: 1 1 180px; border-left: 6px solid var(--c, var(--brass)); padding-left: 12px; }
.music-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
.music-strip .np { flex: 1 1 200px; min-width: 0; }
.music-strip .np b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-strip .vol { width: 150px; }
.pads { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pad { position: relative; min-height: 124px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--c) 55%, #000); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 34%, #15142a) 0%, color-mix(in srgb, var(--c) 14%, #15142a) 100%); padding: 10px 12px 14px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; user-select: none; -webkit-user-select: none; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 10px rgba(0,0,0,.35); transition: transform .06s, box-shadow .15s; }
.pad:active { transform: scale(.975); }
.pad .icon { font-size: 30px; line-height: 1; }
.pad .name { font-weight: 600; font-size: 16px; line-height: 1.15; overflow-wrap: anywhere; }
.pad .state { font-size: 12px; color: color-mix(in srgb, var(--c) 45%, #fff); }
.pad .key { position: absolute; top: 9px; right: 9px; min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 6px; font: 600 12px var(--sans); background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.18); }
.pad .bar { position: absolute; left: 0; bottom: 0; height: 5px; width: 100%; background: rgba(0,0,0,.4); }
.pad .bar i { display: block; height: 100%; width: 0; background: var(--c); }
.pad.playing { box-shadow: 0 0 0 2px var(--c), 0 0 22px color-mix(in srgb, var(--c) 60%, transparent); }
.pad.fading { opacity: .65; }
.pad.empty .state { color: var(--muted); }
.pad .mode { position: absolute; top: 40px; right: 9px; font-size: 11px; color: rgba(255,255,255,.55); }
.pad-wrap { position: relative; display: flex; }
.pad-wrap > .pad { width: 100%; }
.pad-tools { position: absolute; inset: auto 6px 10px auto; display: flex; gap: 3px; z-index: 2; }
.pad-tools button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.65); font-size: 14px; }
.pad-wrap.dragover .pad { outline: 2px dashed var(--brass); }
.pad-add { min-height: 124px; border: 2px dashed var(--line); border-radius: 16px; background: transparent; color: var(--muted); font-size: 28px; }
.pad-add:hover { color: var(--brass); border-color: var(--brass); }
.editing .pad { cursor: pointer; }

/* случайные события */
.events { margin-top: 20px; }
.events h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-family: var(--sans); margin-bottom: 8px; }
.event { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; flex-wrap: wrap; }
.event .info { flex: 1 1 180px; min-width: 0; }
.event .info small { color: var(--muted); display: block; }
.event.on { border-color: var(--ok); }

/* переключатель */
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: .15s; }
.switch span::after { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--brass); }

/* микшер */
.group-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; margin-bottom: 10px; }
.group-row .gname { font-weight: 600; }
.group-row input[type=range] { grid-column: 1 / 3; }
.mute { min-width: 44px; min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); }
.mute.on { background: #5a2623; border-color: #8c3a35; }
.voice { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--brass)); border-radius: 10px; padding: 7px 9px; margin-bottom: 7px; }
.voice .vt { display: flex; align-items: center; gap: 6px; }
.voice .vt b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.voice .vt small { color: var(--muted); }
.voice .vprog { height: 3px; background: var(--bg); border-radius: 2px; margin: 4px 0; }
.voice .vprog i { display: block; height: 100%; width: 0; background: var(--c, var(--brass)); }
.voice.fading { opacity: .55; }
.empty-note { color: var(--muted); font-size: 13px; padding: 6px 2px; }

/* модальные окна */
dialog.modal { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(560px, 96vw); max-height: 92vh; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
dialog.modal.wide { width: min(860px, 96vw); }
dialog.modal::backdrop { background: rgba(0,0,0,.65); }
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal > header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
dialog.modal > header h2 { font-size: 20px; }
.modal-body { padding: 16px; overflow: auto; flex: 1; }
dialog.modal > footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; }
.swatch.on { border-color: #fff; }
.icons { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.icons button { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); font-size: 20px; }
.icons button.on { border-color: var(--brass); background: #2a2850; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; background: var(--bg); border: 0; padding: 9px 6px; min-height: 40px; border-right: 1px solid var(--line); font-size: 14px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brass); color: #0d0a24; font-weight: 600; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.keycap { min-width: 120px; }
.snd-list { display: grid; gap: 6px; }
.snd { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); flex-wrap: wrap; }
.snd .nm { flex: 1 1 160px; min-width: 0; }
.snd .nm b { display: block; overflow-wrap: anywhere; }
.snd .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 11px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; color: var(--muted); }
.snd.sel { border-color: var(--brass); background: #2a2850; }
.chosen { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 3px 4px 3px 10px; font-size: 13px; }
.chip button { border: 0; background: none; color: var(--muted); border-radius: 50%; width: 22px; height: 22px; padding: 0; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); margin-bottom: 12px; }
.dropzone.over { border-color: var(--brass); color: var(--text); }
.upl { font-size: 13px; padding: 4px 0; }
.upl.err { color: #ff8f86; }
.upl.ok { color: var(--ok); }
ul.uses { margin: 8px 0 0; padding-left: 18px; color: #ffcf9a; }
.sec-title { font-family: var(--serif); font-size: 17px; margin: 16px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }

/* уведомления */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 16px; transform: translateX(-50%); display: grid; gap: 8px; width: min(520px, 94vw); pointer-events: none; }
.toast { background: #1f1d3a; border: 1px solid var(--line); border-left: 5px solid var(--brass); border-radius: 10px; padding: 10px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: #e0914a; }
#save-status { font-size: 12px; color: var(--muted); padding: 0 8px; }
#save-status[data-s=error], #save-status[data-s=conflict] { color: #ff8f86; }

/* вход */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; width: min(380px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* планшет и телефон */


@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.btn.primary.live { background: var(--ok); border-color: var(--ok); }

.launch-row { display: flex; gap: 8px; flex: 1 1 100%; }
.launch-row .btn.primary { flex: 1; }
#btn-stop { width: 52px; padding: 0; display: flex; align-items: center; justify-content: center; }
.stop-sq { width: 18px; height: 18px; border: 2px solid currentColor; border-radius: 3px; display: flex; align-items: center; justify-content: center; }
.stop-sq::after { content: ""; width: 8px; height: 8px; background: currentColor; border-radius: 1px; }

/* ===== кампании, сцены, кубики (версия 2) ===== */
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--text); }
a.btn.primary { color: #0d0a24; }
a.btn.current { border-color: var(--brass); background: var(--panel2); }
.btn.disabled, .btn:disabled { opacity: .45; pointer-events: none; }
.brand { text-decoration: none; color: inherit; }
.top-nav a.btn { padding: 9px 12px; }
#btn-stop-all { display: inline-flex; align-items: center; gap: 4px; }
#btn-stop-all .stop-sq { width: 16px; height: 16px; }
#btn-stop-all .stop-sq::after { width: 7px; height: 7px; }

/* сетка по экранам */
.layout { grid-template-columns: 230px minmax(0, 1fr) 310px; grid-template-areas: "scenes main mixer"; }
.scenes { grid-area: scenes; } .main { grid-area: main; } .mixer { grid-area: mixer; }
.side { grid-area: side; display: none; }
.layout[data-view=campaigns], .layout[data-view=campaign] { grid-template-columns: minmax(0, 1fr) 310px; grid-template-areas: "main mixer"; }
.layout[data-view=campaigns] .scenes, .layout[data-view=campaign] .scenes, .layout[data-view=scene] .scenes, .layout[data-view=forge] .scenes { display: none; }
.layout[data-view=forge] { grid-template-columns: minmax(0, 1fr) 310px; grid-template-areas: "main mixer"; }
.layout[data-view=forge] .side { display: none; }
.forge-host { display: block; min-width: 0; }
.layout[data-view=scene] { grid-template-columns: minmax(0, 1fr) 360px 300px; grid-template-areas: "main side mixer"; }
.layout[data-view=scene] .side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--top-h, 52px) + 10px); max-height: calc(100vh - var(--top-h, 52px) - 24px); overflow: auto; }
.layout[data-view=presets] .side { display: none; }
.tabs { display: none; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crumbs a { color: var(--brass2); text-decoration: none; } .crumbs a:hover { text-decoration: underline; }
.crumbs .sep { opacity: .5; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 28px; }
.block { margin-top: 22px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }
.block-head h2 { font-size: 20px; } .block-head h3, .block-head h4 { font-size: 15px; }
.empty-box { border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px; text-align: center; }
.error-box { border: 1px solid #6d2a26; background: #2a1715; border-radius: var(--radius); padding: 16px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0; }

/* карточки кампаний */
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.camp-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.camp-card:hover { border-color: var(--brass); }
.camp-open { color: inherit; text-decoration: none; display: block; flex: 1; }
.camp-cover { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--panel2); }
.camp-cover.empty { display: grid; place-items: center; font-size: 44px; color: var(--brass); background: linear-gradient(160deg, #2a2850, #15142a); }
.camp-body { padding: 12px 14px; display: grid; gap: 4px; }
.camp-body h2 { font-size: 19px; }
.camp-actions { display: flex; gap: 6px; padding: 0 12px 12px; }
.camp-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 6px; }
.camp-banner { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.camp-head h1 { font-size: 30px; margin-bottom: 6px; }
.camp-desc { white-space: pre-wrap; color: var(--muted); margin: 0 0 12px; max-width: 70ch; }
.cover-edit, .portrait-edit { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.cover-edit img { width: 200px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.cover-empty { width: 200px; height: 110px; display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 10px; color: var(--muted); }
.col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* список сцен */
.scene-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.scene-row { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.scene-row:hover { border-color: var(--brass); }
.scene-row .num { width: 30px; height: 30px; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; font-weight: 700; color: var(--brass2); flex: none; }
.scene-link { flex: 1; min-width: 0; display: grid; gap: 2px; color: inherit; text-decoration: none; padding: 6px 2px; }
.scene-link b { font-size: 17px; font-family: var(--serif); }
.row-tools { display: flex; gap: 2px; flex: none; }
.row-tools .icon-btn { font-size: 17px; }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.char-card { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.char-info { display: grid; flex: 1; min-width: 0; }
.char-info b { overflow: hidden; text-overflow: ellipsis; }
.portrait { border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, #3a3566, #1f1d3a); border: 1px solid var(--line); display: grid; place-items: center; flex: none; font: 700 20px var(--serif); color: var(--brass2); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }

/* индикатор сохранения */
.save-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 99px; font-size: 13px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); min-height: 30px; }
.save-pill[data-s=saved] { color: var(--ok); border-color: #2c5a37; }
.save-pill[data-s=saving] { color: var(--brass2); border-color: #6a54c4; }
.save-pill[data-s=error] { color: #ff9a92; border-color: #6d2a26; background: #2a1715; }
.link-btn { background: none; border: 0; color: var(--brass2); text-decoration: underline; padding: 0; }

/* экран сцены */
.scene-bar { position: sticky; top: var(--top-h, 52px); z-index: 12; background: rgba(12, 11, 26,.94); backdrop-filter: blur(6px); padding: 6px 0 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.scene-bar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scene-bar-row select { width: auto; max-width: 260px; flex: 1 1 140px; min-height: 36px; padding: 6px 10px; }
.scene-bar-row .save-pill { margin-left: auto; }
#btn-atmosphere.live { background: var(--ok); border-color: var(--ok); color: #08210f; }
.title-input { font: 700 28px var(--serif); background: transparent !important; border: 0 !important; border-bottom: 1px dashed var(--line) !important; border-radius: 0 !important; padding: 6px 2px !important; margin-bottom: 12px; }
.title-input:focus { border-bottom-color: var(--brass) !important; outline: none; }
.scene-main textarea, .state-note textarea { resize: vertical; width: 100%; line-height: 1.5; }
.read-aloud { border-left: 4px solid var(--brass); background: #121128; border-radius: 0 12px 12px 0; padding: 10px 14px 12px; margin-bottom: 12px; }
.read-aloud textarea { font: 17px/1.6 var(--serif); background: transparent; border: 0; padding: 4px 0; min-height: 110px; }
.cap { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: block; margin-bottom: 4px; }
.secrets { border: 1px solid #5a3b4d; background: #15142a; border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; }
.secrets summary { cursor: pointer; padding: 6px 0; font-weight: 600; color: #e7b09f; }
.secrets textarea { background: #121128; margin-top: 6px; }
.images { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.img-card { position: relative; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: grid; }
.img-open { border: 0; padding: 0; background: #000; display: block; }
.img-open img { width: 100%; height: 130px; object-fit: cover; display: block; }
.img-card input { border: 0; border-top: 1px solid var(--line); border-radius: 0; font-size: 13px; min-height: 36px; }
.img-del { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.65); color: #fff; }
.img-big { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; }
.members { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.member { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 8px; align-content: start; }
.member-head { display: flex; align-items: center; gap: 10px; }
.char-more summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.char-more p { white-space: pre-wrap; margin: 6px 0 0; font-size: 14px; }
.state-note textarea { font-size: 14px; background: #121128; min-height: 56px; }
.pick-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; max-height: 40vh; overflow: auto; }
.pick-row { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.pick-row:hover { border-color: var(--brass); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.panel h3 { font-size: 15px; margin-bottom: 10px; }
.panel h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--sans); margin: 14px 0 6px; }

/* кубики */
.die-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 10px; }
.die-btn { min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-weight: 700; }
.die-btn.on { background: var(--brass); color: #0d0a24; border-color: var(--brass2); }
.dice-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.stepper { display: grid; grid-template-columns: 38px 1fr 38px; }
.stepper button { border: 1px solid var(--line); background: var(--panel2); font-size: 20px; min-height: 42px; }
.stepper button:first-child { border-radius: 10px 0 0 10px; } .stepper button:last-child { border-radius: 0 10px 10px 0; }
.stepper input { text-align: center; border-radius: 0; min-height: 42px; padding: 4px; font-variant-numeric: tabular-nums; }
.roll-result { margin: 10px 0; min-height: 56px; padding: 10px 12px; border-radius: 12px; background: #121128; border: 1px solid var(--line); font: 600 19px/1.35 var(--serif); overflow-wrap: anywhere; display: flex; align-items: center; }
.roll-result.pop { animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.96); background: #2a2850; } to { transform: none; } }
.roll-hist { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; display: grid; gap: 4px; }
.roll-item { display: grid; gap: 1px; padding: 5px 8px; border-radius: 8px; background: var(--bg2); font-size: 14px; overflow-wrap: anywhere; }
.roll-item time { font-size: 11px; color: var(--muted); }

/* звук сцены */
.audio-status { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.audio-status[data-here="1"] { color: var(--ok); }
.aud-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; margin-bottom: 8px; }
.aud-row .aud-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.aud-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brass); flex: none; }
.aud-row input[type=range] { grid-column: 1 / -1; }
.aud-row.fx { grid-template-columns: 1fr 1fr; }
.aud-row.fx input[type=range] { grid-column: auto; }
.fx-btn.playing { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.atm-line { font-size: 13px; margin: 0 0 8px; }

/* ход экспорта/импорта */
.job progress { width: 100%; height: 14px; accent-color: var(--brass); }
.job-stage.bad { color: #ff9a92; font-weight: 600; }
.job-out { display: grid; gap: 8px; margin-top: 10px; justify-items: start; }
.uses.scroll { max-height: 30vh; overflow: auto; }




.images .empty-note { grid-column: 1 / -1; }
.master { flex: 0 1 190px; }
@media (max-width: 1500px) { .long { display: none; } .short { display: inline; } .top-nav .lbl { display: none; } #nav-campaigns .lbl, #nav-presets .lbl { display: inline; } }

/* Discord: выход звука, состояние, настройки, статусы бросков */
.dc-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.out-switch { min-width: 214px; }
.out-switch button { padding: 6px 10px; min-height: 38px; white-space: nowrap; }
.dc-bar[data-out=discord] .out-switch button.on { background: #5865f2; color: #fff; }
.dc-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 6px 12px; min-height: 38px; font-size: 13px; max-width: 260px; }
.dc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-chip .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #6b6358; }
.dc-chip.ok .dot { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.dc-chip.warn .dot { background: #e0914a; }
.dc-chip.err { border-color: #6d2a26; }
.dc-chip.err .dot { background: var(--danger); }
.dc-settings h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--sans); margin: 16px 0 8px; }
.dc-settings h3:first-child { margin-top: 0; }
.dc-settings h4 { font-size: 14px; margin: 12px 0 6px; font-family: var(--sans); }
.dc-settings code { background: var(--bg); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.dc-note { padding: 8px 11px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-size: 14px; margin: 6px 0; overflow-wrap: anywhere; }
.dc-note p { margin: 6px 0 0; }
.dc-note.ok { border-color: #2f5a38; }
.dc-note.warn { border-color: #6a54c4; }
.dc-note.err { border-color: #6d2a26; color: #ffb4ad; }
.dc-hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }
.dc-hint:empty { display: none; }
.btn.dc-roll { margin-top: 8px; background: #2c3166; border-color: #4753c9; }
.btn.dc-roll:disabled { background: var(--panel2); border-color: var(--line); }
.roll-item .roll-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.dc-state.sent { color: var(--ok); }
.dc-state.error { color: #ff8f86; }
.dc-state.unknown { color: var(--brass2); }
.dc-state.sending { color: var(--muted); }

.dc-token-row { flex-wrap: nowrap; margin: 6px 0 4px; }
.dc-token-row input { flex: 1; min-width: 0; }

/* подборки пресетов и архивные звуки */
.col-title { font: 600 12px/1.2 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 12px 2px 4px; }
.col-archive { margin-top: 10px; }
.col-archive > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 2px; }
.snd.archived { opacity: .6; }
