:root {
  --bg: #0e1015; --bg2: #141720; --panel: #191d27; --panel2: #1f2430; --line: #2a303d; --line-strong: #3a4252;
  --text: #e8ebf2; --muted: #8e97aa; --accent: #ff5a5f; --accent2: #ffb347; --blue: #4dabf7; --green: #51cf66; --yellow: #fcc419; --red: #ff6b6b;
  --radius: 10px; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.editing { overflow: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.2; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.muted { color: var(--muted); } .small { font-size: 12px; } .pad { padding: 12px; }
.error { color: var(--red); min-height: 1em; margin: 0; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; margin-top: 12px; }
.col { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; }
.loading { display: grid; place-items: center; height: 60vh; color: var(--muted); }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel2); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: #283040; } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent), #ff7b54); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); border-color: #5a2a30; } .btn.danger:hover { background: #3a1d22; }
.btn.small { padding: 4px 10px; font-size: 12px; } .btn.wide { width: 100%; justify-content: center; padding: 10px; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; font: inherit; padding: 0; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; width: 26px; height: 26px; border-radius: 6px; display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--panel2); color: var(--text); }
.mini { background: var(--panel2); border: 1px solid var(--line-strong); color: var(--muted); border-radius: 5px; font-size: 11px; padding: 1px 6px; cursor: pointer; margin-left: 4px; font-weight: 500; }
.mini:hover { color: var(--text); }
.input { width: 100%; background: var(--bg2); border: 1px solid var(--line-strong); color: var(--text); border-radius: 7px; padding: 7px 10px; font: inherit; }
.input:focus { outline: 2px solid #4dabf766; border-color: var(--blue); }
.input.big { font-size: 18px; font-weight: 600; } .input.slim { padding: 3px 7px; }
textarea.input { resize: vertical; min-height: 80px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span, .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; cursor: pointer; font-weight: 600; }
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip.status.draft { cursor: default; } .chip.status.published { background: #1d3b26; color: var(--green); border-color: #2b5a37; cursor: default; }
.chip.status.scheduled { background: #3b331d; color: var(--yellow); border-color: #5a4c2b; cursor: default; }
kbd { background: var(--panel2); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font: 11px ui-monospace, monospace; color: var(--text); }
.progress { height: 6px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .2s; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 13px; } .kv span { color: var(--muted); } .kv b { font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv.big { font-size: 16px; }

/* toasts, modals, menus */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { background: var(--panel2); border: 1px solid var(--line-strong); border-left: 4px solid var(--blue); padding: 10px 14px; border-radius: 8px; max-width: 380px; box-shadow: 0 10px 30px #0008; animation: slidein .2s; }
.toast.success { border-left-color: var(--green); } .toast.error { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateX(20px); transition: .3s; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } }
.modal-wrap { position: fixed; inset: 0; background: #0009; display: grid; place-items: center; z-index: 900; backdrop-filter: blur(2px); }
.modal { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 20px 60px #000a; max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px; overflow: auto; } .modal-body p { margin: 0 0 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.ctx-menu { position: fixed; z-index: 950; background: var(--panel2); border: 1px solid var(--line-strong); border-radius: 9px; padding: 5px; min-width: 220px; box-shadow: 0 12px 40px #000b; }
.ctx-menu button { display: flex; justify-content: space-between; gap: 20px; width: 100%; background: none; border: 0; color: var(--text); padding: 7px 10px; border-radius: 6px; font: inherit; cursor: pointer; text-align: left; }
.ctx-menu button:hover:not(:disabled) { background: var(--blue); color: #fff; } .ctx-menu button:disabled { opacity: .4; cursor: default; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #ff5a5f22, transparent 50%), radial-gradient(circle at 70% 80%, #4dabf722, transparent 50%); }
.auth-card { width: min(380px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 30px; text-align: center; }
.auth-card .field { text-align: left; } .auth-logo { width: 64px; height: 64px; } .auth-card h1 { margin: 10px 0 4px; }

/* shell */
.topnav { display: flex; align-items: center; gap: 4px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--bg2); position: sticky; top: 0; z-index: 10; }
.topnav a, .topnav .link { color: var(--muted); padding: 6px 12px; border-radius: 7px; font-weight: 600; text-decoration: none; }
.topnav a:hover, .topnav .link:hover { color: var(--text); background: var(--panel2); }
.topnav a.on { color: var(--text); background: var(--panel2); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text) !important; margin-right: 14px; font-size: 15px; }
.brand img { width: 26px; height: 26px; }
.banner { background: #3b331d; color: var(--yellow); padding: 8px 20px; font-size: 13px; } .banner a { color: #fff; font-weight: 700; }
.page { max-width: 1200px; margin: 0 auto; padding: 26px 20px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin-top: 4px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); } .empty.big { padding: 80px 20px; } .empty h2 { color: var(--text); margin-bottom: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.card:hover { border-color: var(--line-strong); }
.card-main { color: inherit; padding: 16px; flex: 1; text-decoration: none !important; } .card-main h3 { margin: 12px 0 4px; font-size: 16px; } .card-main p { margin: 0; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px 14px; }
.wave-art { height: 60px; display: flex; align-items: center; gap: 3px; padding: 0 4px; background: linear-gradient(135deg, #ff5a5f18, #4dabf718); border-radius: 8px; }
.wave-art i { flex: 1; background: linear-gradient(var(--accent), var(--accent2)); border-radius: 2px; opacity: .8; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.tpl { border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.tpl input { display: none; } .tpl small { color: var(--muted); } .tpl.on { border-color: var(--accent); background: #ff5a5f14; }

/* episodes */
.ep-table { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ep-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none !important; }
.ep-row:last-child { border-bottom: 0; } .ep-row:hover { background: var(--panel2); }
.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; } .thumb.fallback { display: grid; place-items: center; background: var(--panel2); font-size: 22px; }
.ep-info { flex: 1; display: flex; flex-direction: column; min-width: 0; } .ep-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-edit { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.panel h2 { font-size: 15px; margin: 0 0 14px; } .panel h2:not(:first-child) { margin-top: 18px; } .panel h3 { font-size: 13px; color: var(--muted); margin: 18px 0 10px; text-transform: uppercase; letter-spacing: .06em; }
.audio-box audio { width: 100%; } .current-audio { display: flex; flex-direction: column; gap: 4px; }
.cover-edit { display: flex; gap: 14px; align-items: center; }
.cover-edit img, .cover-edit .cover-fallback { width: 110px; height: 110px; border-radius: 10px; object-fit: cover; flex: none; }
.cover-fallback { display: grid; place-items: center; font-size: 40px; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.cover-edit .col { gap: 8px; align-items: flex-start; }
.chapter-edit { display: flex; flex-direction: column; gap: 6px; } .chapter-row { display: flex; gap: 6px; align-items: center; } .chapter-row .time { width: 90px; flex: none; font-variant-numeric: tabular-nums; }
.copy-row { display: flex; gap: 8px; align-items: center; } .copy-row code { flex: 1; background: var(--bg2); padding: 6px 8px; border-radius: 6px; font-size: 12px; overflow: auto; white-space: nowrap; }
.pub-status .row { gap: 12px; }

/* ================================================================ editor */
.editor { display: flex; flex-direction: column; height: 100vh; }
.ed-top { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--bg2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ed-top-left, .ed-top-right, .transport { display: flex; align-items: center; gap: 6px; }
.ed-top-left { flex: 1; min-width: 200px; } .ed-top-right { flex: 1; justify-content: flex-end; }
.proj-name { background: none; border: 1px solid transparent; color: var(--text); font: 600 15px system-ui; padding: 5px 8px; border-radius: 6px; min-width: 120px; max-width: 280px; }
.proj-name:hover, .proj-name:focus { border-color: var(--line-strong); background: var(--bg); outline: none; }
.save-state { font-size: 11px; color: var(--muted); } .save-state.error { color: var(--red); font-weight: 700; } .save-state.pending, .save-state.saving { color: var(--yellow); }
.tbtn { background: var(--panel2); border: 1px solid var(--line-strong); color: var(--text); border-radius: 8px; height: 34px; min-width: 34px; padding: 0 9px; cursor: pointer; font-size: 14px; display: inline-grid; place-items: center; text-decoration: none !important; }
.tbtn:hover { background: #283040; } .tbtn:disabled { opacity: .35; cursor: default; }
.tbtn.small { height: 30px; min-width: 30px; font-size: 13px; padding: 0 7px; }
.tbtn.on { background: #1f3550; border-color: var(--blue); color: var(--blue); }
.tbtn.play { width: 44px; height: 38px; font-size: 16px; background: var(--text); color: var(--bg); border-color: var(--text); }
.tbtn.rec { width: 40px; height: 38px; } .rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); display: block; }
.tbtn.rec.on { background: var(--red); border-color: var(--red); animation: pulse 1s infinite; } .tbtn.rec.on .rec-dot { background: #fff; border-radius: 3px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px #ff6b6b33; } }
.time-display { font: 600 18px ui-monospace, "SF Mono", Consolas, monospace; background: #07080b; border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; min-width: 150px; text-align: center; color: #9fe6a0; cursor: pointer; font-variant-numeric: tabular-nums; }
.master-meter { display: flex; flex-direction: column; gap: 3px; width: 90px; margin: 0 6px; }
.meter { height: 6px; background: #07080b; border-radius: 3px; overflow: hidden; }
.meter-fill, .tk-meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green) 0 70%, var(--yellow) 85%, var(--red)); background-size: 90px 100%; transition: width .05s linear; }
.meter-fill.clip, .tk-meter-fill.clip { background: var(--red); }
.ed-main { flex: 1; display: flex; min-height: 0; }
.ed-left, .ed-right { width: 270px; flex: none; background: var(--bg2); overflow-y: auto; border-right: 1px solid var(--line); }
.ed-right { border-right: 0; border-left: 1px solid var(--line); padding: 14px; width: 290px; }
.ed-center { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.ed-status { display: flex; gap: 20px; padding: 4px 12px; font-size: 11px; color: var(--muted); background: var(--bg2); border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.ed-status .hint { margin-left: auto; overflow: hidden; text-overflow: ellipsis; }

/* library */
.tabs { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg2); z-index: 2; }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px; font: 600 13px system-ui; cursor: pointer; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.ed-left > .input { margin: 10px; width: calc(100% - 20px); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px 8px; } .chips .chip { font-size: 11px; padding: 2px 8px; }
.lib-list { display: flex; flex-direction: column; }
.lib-item { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 6px; border-bottom: 1px solid #ffffff08; cursor: grab; }
.lib-item:hover { background: var(--panel); } .lib-item:hover .add-btn { color: var(--text); background: var(--blue); }
.lib-name { flex: 1; min-width: 0; display: flex; flex-direction: column; } .lib-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.lib-name small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-btn { font-size: 11px; } .add-btn { font-size: 16px; font-weight: 700; }
.lib-foot { padding: 12px 10px 20px; }

/* timeline */
.tl-scroll { flex: 1; overflow: auto; position: relative; background: var(--bg); }
.tl-inner { position: relative; min-height: 100%; }
.ruler-row { display: flex; position: sticky; top: 0; z-index: 6; background: var(--bg2); border-bottom: 1px solid var(--line); }
.ruler-corner { position: sticky; left: 0; z-index: 7; background: var(--bg2); border-right: 1px solid var(--line); display: flex; align-items: center; padding: 0 6px; flex: none; }
.ruler { position: relative; flex: none; cursor: text; }
.ruler-canvas { position: sticky; left: 236px; display: block; }
.markers-layer { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; top: 0; height: 100%; border-left: 2px solid var(--yellow); pointer-events: auto; cursor: ew-resize; }
.marker span { position: absolute; left: 0; top: 14px; background: var(--yellow); color: #222; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 0 3px 3px 0; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.track-row { display: flex; border-bottom: 1px solid var(--line); }
.track-header { position: sticky; left: 0; z-index: 5; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex: none; cursor: pointer; }
.track-row.selected .track-header { background: #222a38; }
.tk-color { width: 5px; background: var(--c); flex: none; }
.tk-main { flex: 1; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tk-top { display: flex; align-items: center; gap: 3px; }
.tk-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-btn { width: 24px; height: 22px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--bg2); color: var(--muted); font: 700 11px system-ui; cursor: pointer; padding: 0; }
.tk-btn.mute.on { background: var(--yellow); color: #222; border-color: var(--yellow); } .tk-btn.solo.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.tk-btn.arm { color: var(--red); } .tk-btn.arm.on { background: var(--red); color: #fff; border-color: var(--red); }
.tk-row { display: flex; gap: 8px; align-items: center; } .tk-vol { flex: 2; min-width: 0; } .tk-pan { flex: 1; min-width: 0; }
.tk-fx { font-size: 10px; color: var(--muted); } .tk-meter { flex: 1; height: 5px; background: #07080b; border-radius: 3px; overflow: hidden; } .tk-meter-fill { background-size: 120px 100%; }
.tk-fx-list { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
input[type=range] { accent-color: var(--blue); height: 14px; }
.lane { position: relative; flex: none; background: repeating-linear-gradient(90deg, transparent 0 99px, #ffffff05 99px 100px); }
.lane.drop-target, .add-row-lane.drop-target { background-color: #4dabf71a; outline: 2px dashed var(--blue); outline-offset: -2px; }
.lane-canvas { position: sticky; left: 236px; display: block; pointer-events: none; }
.clip { position: absolute; top: 0; height: 100%; border-radius: 5px; cursor: grab; border: 1px solid transparent; z-index: 1; }
.clip:hover { border-color: #ffffff40; }
.clip.selected { border-color: #fff; box-shadow: 0 0 0 1px #fff; z-index: 2; }
.clip.missing { border: 1px dashed var(--red); }
.clip-head { height: 16px; padding: 0 7px; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 16px; text-shadow: 0 1px 2px #0008; pointer-events: none; }
.trim { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 3; } .trim-l { left: -2px; } .trim-r { right: -2px; }
.trim:hover { background: #ffffff30; }
.fade-h { position: absolute; top: 14px; width: 10px; height: 10px; margin: 0 -5px; border-radius: 50%; background: #fff; border: 2px solid var(--c); cursor: ew-resize; z-index: 4; opacity: 0; transition: opacity .1s; }
.clip:hover .fade-h, .clip.selected .fade-h { opacity: 1; }
.fade-out-h { margin: 0 -5px 0 0; }
.add-row { display: flex; height: 70px; }
.add-row-head { position: sticky; left: 0; z-index: 5; background: var(--bg2); display: flex; align-items: center; justify-content: center; flex: none; border-right: 1px solid var(--line); }
.add-row-lane { flex: none; color: #ffffff30; display: flex; align-items: center; padding-left: 20px; font-size: 12px; }
.playhead { position: absolute; top: 0; width: 1px; margin-left: -0.5px; background: var(--red); z-index: 4; pointer-events: none; box-shadow: 0 0 6px var(--red); }
.playhead-cap { position: absolute; top: 0; left: -6px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--red); }
.range-overlay { position: absolute; display: none; background: #4dabf714; border-left: 1px solid var(--blue); border-right: 1px solid var(--blue); z-index: 3; pointer-events: none; }
.rec-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.rec-block { position: absolute; background: #ff6b6b33; border: 1px solid var(--red); border-radius: 5px; overflow: hidden; }
.rec-block span { font: 700 11px system-ui; color: #fff; background: var(--red); padding: 1px 6px; border-radius: 0 0 4px 0; white-space: nowrap; }

/* inspector */
.ed-right h4 { font-size: 15px; margin-bottom: 12px; }
.ed-right h5 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 8px; display: flex; align-items: center; gap: 2px; }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin: 4px 0 10px; align-items: center; }
.slider .lbl { grid-column: 1; } .slider .val { grid-column: 2; grid-row: 1; font: 11px ui-monospace, monospace; color: var(--text); }
.slider input { grid-column: 1 / 3; width: 100%; }
.btn-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.swatches { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; } .swatch.on { border-color: #fff; }
.fx { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; } .fx.on { border-color: #4dabf755; background: #4dabf70a; }
.fx-head { display: flex; gap: 8px; align-items: center; padding: 7px 9px; cursor: pointer; font-weight: 600; font-size: 13px; }
.fx-body { padding: 0 10px 4px; }
.chapters { padding: 0; margin: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.chapters li { display: flex; gap: 4px; align-items: center; } .chapters .link { font: 11px ui-monospace, monospace; width: 52px; text-align: left; flex: none; }
.keys { display: grid; gap: 4px; font-size: 12px; } .keys div { display: flex; justify-content: space-between; gap: 8px; } .keys span { color: var(--muted); }

@media (max-width: 1100px) {
  .ed-right { width: 240px; } .ed-left { width: 220px; }
  .ep-edit { grid-template-columns: 1fr; }
}
@media (max-width: 800px) { .ed-left { display: none; } .master-meter { display: none; } .grid3, .grid2 { grid-template-columns: 1fr; } }

/* ================================================================ live */
:root { --viz-1: #3d8fd6; }
.nav-live i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
body.is-live .nav-live { color: var(--red) !important; } body.is-live .nav-live i { background: var(--red); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.live-cols { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.1fr) minmax(300px, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.on-air-badge { font-weight: 800; font-size: 12px; letter-spacing: .08em; padding: 6px 12px; border-radius: 7px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line-strong); }
.on-air-badge.live { background: var(--red); color: #fff; border-color: var(--red); animation: pulse 1.4s infinite; }
.go-row { display: flex; gap: 14px; align-items: center; margin: 6px 0 4px; }
.go-live { font-size: 16px; padding: 12px 22px; } .go-live.on-air { background: var(--panel2); color: var(--red); border: 1px solid var(--red); }
.go-stats { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.live-timer { font: 700 22px ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }
.warn { color: var(--yellow); } .ok { color: var(--green); }
.meter-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; } .meter-row .lbl { width: 46px; }
.meter.big { flex: 1; height: 10px; } .meter.big .meter-fill { background-size: 100% 100%; }
.mute-btn { width: 100%; justify-content: center; margin: 8px 0 12px; } .mute-btn.muted { background: #3a1d22; border-color: var(--red); color: var(--red); }
.pads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.pad { position: relative; aspect-ratio: 1.25; border-radius: 10px; border: 1px solid var(--line-strong); background: linear-gradient(160deg, #262d3b, #1b202b); color: var(--text);
  font: 600 12px system-ui; cursor: pointer; padding: 8px; display: flex; align-items: flex-end; text-align: left; line-height: 1.2; }
.pad:hover { border-color: var(--blue); } .pad:active { transform: scale(.96); background: #2a4a6b; }
.pad-key { position: absolute; top: 6px; right: 8px; color: var(--muted); font: 11px ui-monospace, monospace; }
.chat-panel { display: flex; flex-direction: column; height: 640px; }
.host-chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; padding-right: 4px; }
.hmsg { background: var(--bg2); border-radius: 8px; padding: 6px 10px; } .hmsg.host { border-left: 3px solid var(--accent); }
.hmsg-top { display: flex; gap: 6px; align-items: center; } .hmsg-top em { font-style: normal; font-size: 10px; background: var(--accent); color: #fff; padding: 0 5px; border-radius: 3px; }
.hmsg p { margin: 2px 0 0; overflow-wrap: anywhere; } .hmsg .icon-btn { width: 22px; height: 22px; font-size: 12px; opacity: 0; } .hmsg:hover .icon-btn { opacity: 1; }
.row.nowrap { flex-wrap: nowrap; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; } .table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.panel + .panel, .grid-2 + .panel, .panel + .grid-2, .kpis + .panel { margin-top: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; } .panel-head h2 { margin: 0; }

/* ================================================================ audience */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--panel2); border: 0; color: var(--muted); padding: 7px 14px; font: 600 13px system-ui; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); } .seg button.on { background: var(--blue); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 600; } .kpi-value { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.chart-wrap { position: relative; }
.bar-chart { width: 100%; height: auto; display: block; overflow: visible; }
.bar-chart .grid { stroke: var(--line); stroke-width: 1; } .bar-chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.bar-chart .tick { fill: var(--muted); font: 11px system-ui; }
.bar-chart .hit { fill: transparent; cursor: default; outline: none; } .bar-chart .hit.hover { fill: #ffffff0d; }
.chart-tip { position: absolute; transform: translate(var(--tx, -50%), calc(-100% - 10px)); background: var(--panel2); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px;
  font-size: 12px; pointer-events: none; opacity: 0; white-space: nowrap; display: flex; flex-direction: column; box-shadow: 0 8px 20px #0008; }
.chart-tip.on { opacity: 1; } .chart-tip span { color: var(--muted); }
.rank { display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 120px 1fr 52px; gap: 10px; align-items: center; font-size: 13px; }
.rank-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rank-val { text-align: right; font-variant-numeric: tabular-nums; }
.rank-track { height: 10px; } .rank-bar { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
@media (max-width: 1200px) { .live-cols { grid-template-columns: 1fr 1fr; } .chat-panel { grid-column: 1 / -1; height: 480px; } }
@media (max-width: 900px) { .live-cols, .grid-2 { grid-template-columns: 1fr; } }
