:root {
  --bg: #070708;
  --bg-soft: #0b0b0d;
  --panel: #101013;
  --panel-2: #141417;
  --panel-3: #19191d;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);
  --text: #f3f0eb;
  --muted: #98989f;
  --dim: #626269;
  --red: #df2537;
  --red-bright: #ff4053;
  --red-soft: rgba(223,37,55,.13);
  --green: #62d895;
  --amber: #e6b65a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px rgba(0,0,0,.34);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.control-noise { position: fixed; inset: 0; pointer-events: none; opacity: .035; z-index: 100; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E"); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.eyebrow { color: #85858d; font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.console-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0,1fr); }
.console-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; border-right: 1px solid var(--line); background: rgba(9,9,11,.96); z-index: 40; }
.console-brand { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 10px 20px; border-bottom: 1px solid var(--line); }
.console-brand-mark { width: 38px; height: 38px; border-radius: 11px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); background: #050506; box-shadow: 0 0 24px rgba(223,37,55,.16); }
.console-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.console-brand > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.console-brand strong { font-size: 14px; letter-spacing: .01em; }
.console-brand small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.console-nav { display: grid; gap: 6px; margin-top: 22px; }
.rail-link { position: relative; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; width: 100%; gap: 9px; padding: 10px 11px; border: 1px solid transparent; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; transition: .18s ease; }
.rail-link > svg { width: 18px; height: 18px; color: #777780; }
.rail-link > span { display: flex; flex-direction: column; min-width: 0; }
.rail-link b { font-size: 12px; font-weight: 700; }
.rail-link small { margin-top: 2px; color: #686870; font-size: 10px; }
.rail-link em { color: #797982; font-size: 9px; font-style: normal; text-transform: uppercase; }
.rail-link:hover { background: rgba(255,255,255,.035); border-color: rgba(255,255,255,.06); }
.rail-link.active { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.1); }
.rail-link.active::before { content: ""; position: absolute; left: -17px; width: 3px; height: 24px; border-radius: 4px; background: var(--red); box-shadow: 0 0 16px rgba(223,37,55,.5); }
.rail-link.active > svg { color: #f1eff0; }
.rail-status-dot { width: 7px !important; height: 7px !important; border-radius: 99px; background: #48484f; color: transparent !important; }
.rail-status-dot.online { background: var(--green); box-shadow: 0 0 9px rgba(98,216,149,.55); }
.sidebar-status { margin-top: auto; padding: 16px 10px 5px; border-top: 1px solid var(--line); }
.sidebar-status small { display: block; margin-top: 7px; color: #616168; font-size: 9px; }
.gateway-pill { display: flex; align-items: center; gap: 8px; color: #a0a0a7; font-size: 10px; }
.gateway-pill > span { width: 7px; height: 7px; border-radius: 50%; background: #55555b; }
.gateway-pill.online > span { background: var(--green); box-shadow: 0 0 10px rgba(98,216,149,.5); }

.console-main { min-width: 0; }
.console-header { position: sticky; top: 0; z-index: 30; min-height: 86px; display: flex; align-items: center; gap: 18px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: rgba(7,7,8,.9); backdrop-filter: blur(18px); }
.header-copy { min-width: 0; }
.header-copy h1 { margin: 3px 0 2px; font-size: 22px; letter-spacing: -.03em; }
.header-copy p { margin: 0; color: var(--muted); font-size: 11px; }
.header-live-state { margin-left: auto; display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.header-live-state > span { width: 8px; height: 8px; border-radius: 99px; background: #55555b; }
.header-live-state > span.live { background: var(--red-bright); box-shadow: 0 0 12px rgba(255,64,83,.6); }
.header-live-state div { display: flex; flex-direction: column; }
.header-live-state small { color: var(--dim); font-size: 8px; text-transform: uppercase; letter-spacing: .12em; }
.header-live-state strong { margin-top: 2px; font-size: 10px; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.header-actions form { margin: 0; }
.mobile-menu { display: none !important; }

.console-content { padding: 26px 28px 42px; }
.control-view { display: none; }
.control-view.active { display: block; animation: viewIn .22s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.icon-button { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); cursor: pointer; transition: .16s ease; }
.icon-button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.06); }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button.small { width: 32px; height: 32px; border-radius: 9px; }
.danger-icon { color: #ff6675; }
.control-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.035); font-size: 11px; font-weight: 750; cursor: pointer; transition: .16s ease; }
.control-button svg { width: 16px; height: 16px; }
.control-button:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.06); }
.control-button:disabled { opacity: .32; cursor: not-allowed; transform: none; }
.control-button.primary { border-color: #a92435; background: linear-gradient(180deg,#e53247,#c91e33); box-shadow: inset 0 1px rgba(255,255,255,.12), 0 10px 24px rgba(223,37,55,.12); color: #fff; }
.control-button.primary:hover { background: linear-gradient(180deg,#ef3b50,#d42339); }
.control-button.secondary { background: #151518; }
.control-button.danger { border-color: rgba(255,72,90,.28); color: #ff7b88; background: rgba(223,37,55,.08); }
.control-button.ghost { background: transparent; }
.control-button.compact { min-height: 38px; }
.wide-button { width: 100%; }
.loading { pointer-events: none; opacity: .62; }

.control-panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg,rgba(255,255,255,.026),rgba(255,255,255,.012)); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.02em; }
.panel-heading p { margin: 6px 0 0; max-width: 620px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.panel-heading > svg { width: 20px; height: 20px; color: #74747d; }
.state-badge, .count-chip, .live-chip { min-height: 25px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); color: #9f9fa6; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.state-badge.waiting, .state-badge.countdown, .state-badge.spinning { color: #ffd0d5; border-color: rgba(223,37,55,.25); background: rgba(223,37,55,.08); }
.state-badge.result { color: #a8edc6; border-color: rgba(98,216,149,.25); background: rgba(98,216,149,.07); }
.live-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--red-bright); box-shadow: 0 0 8px rgba(255,64,83,.6); }

/* Live control */
.live-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(290px,.65fr); gap: 18px; }
.preview-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #030304; box-shadow: 0 26px 80px rgba(0,0,0,.42); }
.preview-toolbar { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px 0 16px; border-bottom: 1px solid var(--line); background: #0d0d0f; }
.preview-toolbar > div { display: flex; align-items: center; gap: 9px; }
.preview-toolbar strong { font-size: 11px; }
.preview-toolbar small { color: var(--dim); font-size: 9px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red-bright); box-shadow: 0 0 10px rgba(255,64,83,.55); }
.preview-frame-wrap { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #050506; }
.preview-frame-wrap iframe { width: 100%; height: 100%; border: 0; background: #050506; }
.preview-glass { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.025); }
.live-command-column { display: flex; flex-direction: column; gap: 14px; }
.live-status-card, .operator-actions { border: 1px solid var(--line); border-radius: 18px; background: #0f0f12; padding: 18px; }
.live-status-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.live-status-heading > div { display: flex; flex-direction: column; }
.live-status-heading strong { margin-top: 2px; font-size: 27px; line-height: 1; letter-spacing: -.04em; }
.live-status-card h2 { min-height: 60px; margin: 20px 0 18px; font-size: 17px; line-height: 1.35; letter-spacing: -.02em; }
.compact-track { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; }
.compact-track > div { min-width: 0; padding: 8px 6px; border: 1px solid var(--line); border-radius: 9px; color: #65656c; text-align: center; }
.compact-track i { display: block; font-size: 8px; font-style: normal; }
.compact-track span { display: block; margin-top: 3px; font-size: 8px; font-weight: 800; }
.compact-track > div.complete { color: #b3b3b8; border-color: rgba(255,255,255,.14); }
.compact-track > div.active { color: #fff; border-color: rgba(223,37,55,.45); background: rgba(223,37,55,.1); }
.event-progress { height: 3px; margin-top: 10px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.06); }
.event-progress > span { display: block; width: 0; height: 100%; background: var(--red); transition: width .16s linear; }
.live-time { margin-top: 15px; display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 9px; }
.live-time span { color: var(--dim); font-size: 9px; text-transform: uppercase; }
.live-time strong { font-size: 11px; }
.live-time b { font-size: 24px; font-variant-numeric: tabular-nums; }
.operator-actions { display: grid; gap: 9px; }
.command-primary { width: 100%; min-height: 56px; justify-content: flex-start; padding: 0 16px; }
.command-primary > span { display: flex; flex-direction: column; align-items: flex-start; }
.command-primary b { font-size: 11px; }
.command-primary small { margin-top: 2px; font-size: 9px; font-weight: 500; opacity: .68; }
.danger-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.live-bottom-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0,1.3fr) minmax(360px,.7fr); gap: 18px; }
.telemetry-strip { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); border-radius: 17px; overflow: hidden; background: #0e0e10; }
.telemetry-strip article { min-width: 0; padding: 16px; border-right: 1px solid var(--line); }
.telemetry-strip article:last-child { border: 0; }
.telemetry-strip span, .telemetry-strip small { display: block; color: var(--dim); font-size: 8px; }
.telemetry-strip span { text-transform: uppercase; letter-spacing: .1em; }
.telemetry-strip strong { display: block; margin: 6px 0 3px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-panel { padding: 16px; }
.activity-stream { margin-top: 13px; display: grid; gap: 8px; }
.activity-stream.horizontal { max-height: 118px; overflow: auto; }
.activity-entry { display: grid; grid-template-columns: 62px 70px minmax(0,1fr); gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.activity-entry:last-child { border: 0; }
.activity-entry time { color: #626268; font-size: 9px; }
.activity-kind { color: #8d8d94; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.activity-entry p { margin: 0; color: #c4c4c8; font-size: 10px; }
.empty-state { margin: 0; color: #626269; font-size: 10px; }

/* Builder */
.builder-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); gap: 18px; align-items: start; }
.builder-panel { padding: 22px; }
.builder-list { margin-top: 20px; display: grid; gap: 8px; }
.builder-entry { display: grid; grid-template-columns: 34px 36px minmax(0,1fr) 36px; align-items: center; min-height: 51px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); transition: .15s ease; }
.builder-entry:hover { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.03); }
.builder-entry.dragging { opacity: .46; transform: scale(.99); }
.builder-handle { color: #5f5f66; text-align: center; cursor: grab; user-select: none; letter-spacing: -2px; }
.builder-index { color: #696970; font-size: 9px; font-weight: 800; }
.builder-entry input { width: 100%; height: 49px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.builder-entry input::placeholder { color: #4c4c52; }
.builder-remove { width: 32px; height: 32px; border: 0; background: transparent; color: #68686f; cursor: pointer; font-size: 19px; }
.builder-remove:hover { color: #ff6d7b; }
.add-entry-button { width: 100%; min-height: 45px; margin-top: 9px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed rgba(255,255,255,.13); border-radius: 12px; color: #888890; background: transparent; cursor: pointer; font-size: 10px; }
.add-entry-button:hover { border-color: rgba(255,255,255,.25); color: #d1d1d5; }
.add-entry-button span { font-size: 18px; font-weight: 300; }
.builder-footer { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.builder-footer small { display: flex; align-items: center; gap: 7px; color: #73737a; font-size: 9px; }
.builder-footer svg { width: 14px; height: 14px; }
.builder-settings { display: grid; gap: 14px; }
.builder-settings .control-panel { padding: 19px; }
.field-label { display: block; margin: 16px 0 7px; color: #85858c; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
select, textarea, .password-field input { width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #0b0b0d; color: var(--text); }
select { height: 42px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; line-height: 1.5; }
select:focus, textarea:focus, .password-field:focus-within { border-color: rgba(223,37,55,.5); box-shadow: 0 0 0 3px rgba(223,37,55,.07); }
.field-help { display: flex; gap: 7px; color: #73737a; font-size: 9px; line-height: 1.5; }
.field-help svg { flex: 0 0 auto; width: 14px; height: 14px; }
.selection-summary { margin-top: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.selection-summary div { padding: 12px; background: #0d0d0f; }
.selection-summary span, .selection-summary b { display: block; }
.selection-summary span { color: var(--dim); font-size: 8px; text-transform: uppercase; }
.selection-summary b { margin-top: 4px; font-size: 11px; }
.manual-controls { margin: 15px 0; }
.manual-controls > span { display: block; margin-bottom: 7px; color: var(--dim); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.manual-controls > div { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.manual-controls .control-button { padding: 0 8px; }
.vertical-track { margin-top: 16px; display: grid; gap: 7px; }
.vertical-track > div { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; color: #63636a; }
.vertical-track i { font-size: 8px; font-style: normal; }
.vertical-track b, .vertical-track small { display: block; }
.vertical-track b { font-size: 10px; }
.vertical-track small { margin-top: 2px; color: #5d5d64; font-size: 8px; }
.vertical-track > div.complete { color: #a7a7ac; }
.vertical-track > div.active { border-color: rgba(223,37,55,.35); background: rgba(223,37,55,.08); color: #fff; }
.vertical-track > div.active small { color: #a9a9ae; }

/* Voice and audio */
.audio-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; align-items: start; }
.audio-layout .control-panel { padding: 21px; }
.voice-destination { grid-column: span 1; }
.audio-master { grid-row: span 2; }
.voice-signal { display: flex; align-items: center; gap: 7px; min-height: 29px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; color: #77777e; font-size: 9px; }
.voice-signal > span { width: 7px; height: 7px; border-radius: 50%; background: #55555b; }
.voice-signal.online { color: #b7eccd; border-color: rgba(98,216,149,.22); }
.voice-signal.online > span { background: var(--green); box-shadow: 0 0 10px rgba(98,216,149,.55); }
.command-row { display: flex; gap: 7px; margin-top: 13px; }
.command-row.split > * { flex: 1; }
.meter-bank { display: grid; gap: 14px; margin: 20px 0; }
.channel-meter { display: grid; grid-template-columns: 50px minmax(0,1fr) 66px; align-items: center; gap: 10px; }
.channel-meter > span { color: #85858c; font-size: 9px; font-weight: 700; }
.channel-meter > b { color: #77777d; font-size: 9px; text-align: right; }
.channel-meter > div { height: 14px; display: grid; grid-template-columns: repeat(12,1fr); gap: 3px; }
.channel-meter i { border-radius: 2px; background: #242428; transition: background .12s ease, box-shadow .12s ease; }
.channel-meter.active i:nth-child(-n+7) { background: #d8d8dc; }
.channel-meter.hot i:nth-child(-n+10) { background: var(--red); box-shadow: 0 0 7px rgba(223,37,55,.25); }
.range-control { margin: 18px 0; }
.range-control > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.range-control label, .range-control output { color: #85858c; font-size: 9px; }
.range-control input { width: 100%; accent-color: var(--red); }
.composer-meta { display: flex; justify-content: space-between; margin: 7px 2px 12px; color: #67676e; font-size: 8px; }
.programme-panel p, .panel-note { color: var(--muted); font-size: 10px; line-height: 1.55; }
.music-controls { display: flex; align-items: center; gap: 7px; margin-top: 15px; }
.music-controls .state-badge { margin-left: auto; }
.diagnostic-grid { margin: 15px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.diagnostic-grid div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); }
.diagnostic-grid dt { color: var(--dim); font-size: 8px; text-transform: uppercase; }
.diagnostic-grid dd { margin: 5px 0 0; font-size: 10px; }
.inline-alert { margin-top: 12px; padding: 11px 12px; border: 1px solid rgba(223,37,55,.28); border-radius: 10px; background: rgba(223,37,55,.07); color: #ff9ba5; font-size: 10px; }

/* System */
.system-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.system-health { grid-column: 1 / -1; }
.health-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.health-grid article { min-height: 92px; display: flex; gap: 11px; align-items: flex-start; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #0e0e10; }
.check-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 3px; border-radius: 50%; background: #505057; }
.check-dot.ready { background: var(--green); box-shadow: 0 0 9px rgba(98,216,149,.45); }
.check-dot.warning { background: var(--amber); box-shadow: 0 0 9px rgba(230,182,90,.35); }
.health-grid small, .health-grid strong { display: block; }
.health-grid small { color: var(--dim); font-size: 8px; text-transform: uppercase; }
.health-grid strong { margin-top: 7px; font-size: 10px; line-height: 1.4; }
.archive-panel, .event-log-panel { padding: 20px; }
.archive-list { margin-top: 16px; display: grid; gap: 8px; }
.archive-entry { display: grid; grid-template-columns: 65px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.018); }
.archive-entry > strong { font-size: 11px; }
.archive-entry > div { min-width: 0; }
.archive-entry b, .archive-entry small { display: block; }
.archive-entry b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.archive-entry small { margin-top: 3px; color: var(--dim); font-size: 8px; }
.archive-entry time { color: #68686f; font-size: 8px; }
.activity-stream.tall { max-height: 430px; overflow: auto; }

/* Toasts */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 120; width: min(360px,calc(100vw - 30px)); display: grid; gap: 8px; }
.toast { display: grid; grid-template-columns: 20px minmax(0,1fr) 26px; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(17,17,20,.96); box-shadow: 0 18px 45px rgba(0,0,0,.38); backdrop-filter: blur(16px); }
.toast > svg { width: 17px; height: 17px; }
.toast span { font-size: 10px; line-height: 1.4; }
.toast button { width: 26px; height: 26px; border: 0; background: transparent; color: #77777e; cursor: pointer; }
.toast button svg { width: 14px; height: 14px; }
.toast.error { border-color: rgba(223,37,55,.28); }
.toast.error > svg { color: #ff6574; }
.toast.success > svg { color: var(--green); }

.rail-scrim { display: none; }
.mobile-console-nav { display: none; }

/* Login */
.login-body { overflow: hidden; background: #060607; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.login-identity { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(35px,7vw,100px); overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(circle at 40% 44%,rgba(223,37,55,.09),transparent 36%), linear-gradient(145deg,#09090b,#050506); }
.login-identity::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg,transparent 49.8%,rgba(255,255,255,.025) 50%,transparent 50.2%); background-size: 44px 44px; opacity: .35; }
.login-node { position: absolute; top: 28px; left: 34px; display: flex; align-items: center; gap: 8px; color: #6e6e75; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-node span { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px rgba(223,37,55,.5); }
.login-lockup { position: relative; z-index: 1; max-width: 560px; }
.login-face-frame { width: 72px; height: 72px; margin-bottom: 28px; overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 18px; box-shadow: 0 20px 55px rgba(0,0,0,.45),0 0 40px rgba(223,37,55,.08); }
.login-face-frame img { width: 100%; height: 100%; object-fit: cover; }
.login-lockup h1 { margin: 10px 0 18px; font-size: clamp(56px,8vw,112px); line-height: .84; letter-spacing: -.07em; }
.login-lockup p { max-width: 470px; color: #8c8c93; font-size: 13px; line-height: 1.6; }
.login-telemetry { position: absolute; z-index: 1; left: clamp(35px,7vw,100px); bottom: 32px; display: flex; gap: 18px; color: #55555d; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.login-access { display: flex; align-items: center; justify-content: center; padding: 34px; background: #09090b; }
.login-form { width: min(390px,100%); }
.access-icon { width: 44px; height: 44px; margin-bottom: 22px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 13px; background: #101012; }
.access-icon svg { width: 20px; height: 20px; color: #b7b7bc; }
.login-form h2 { margin: 7px 0; font-size: 25px; letter-spacing: -.04em; }
.login-form > p { margin: 0 0 24px; color: #77777f; font-size: 11px; line-height: 1.55; }
.password-field { height: 46px; display: grid; grid-template-columns: 38px minmax(0,1fr) 38px; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: #0c0c0e; }
.password-field > svg { width: 15px; height: 15px; margin: auto; color: #68686f; }
.password-field input { height: 44px; padding: 0; border: 0; background: transparent; }
.password-field button { width: 38px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #77777f; cursor: pointer; }
.password-field button svg { width: 15px; height: 15px; }
.login-submit { width: 100%; margin-top: 13px; }
.login-warning { margin-top: 13px; display: flex; gap: 7px; align-items: center; color: #5f5f66; font-size: 8px; }
.login-warning svg { width: 13px; height: 13px; }

@media (max-width: 1180px) {
  .console-shell { grid-template-columns: 220px minmax(0,1fr); }
  .live-layout { grid-template-columns: 1fr; }
  .live-command-column { display: grid; grid-template-columns: 1fr 1fr; }
  .live-bottom-grid { grid-template-columns: 1fr; }
  .builder-layout { grid-template-columns: 1fr; }
  .builder-settings { grid-template-columns: repeat(3,1fr); }
  .health-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .console-shell { display: block; }
  .console-sidebar { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 30px 0 80px rgba(0,0,0,.45); }
  .console-sidebar.open { transform: none; }
  .rail-scrim { position: fixed; inset: 0; z-index: 35; display: block; pointer-events: none; opacity: 0; background: rgba(0,0,0,.55); transition: opacity .2s ease; }
  .rail-scrim.open { pointer-events: auto; opacity: 1; }
  .mobile-menu { display: inline-flex !important; }
  .console-header { padding: 12px 16px; }
  .header-live-state { display: none; }
  .header-actions .compact { display: none; }
  .console-content { padding: 18px 16px 90px; }
  .builder-settings { grid-template-columns: 1fr; }
  .audio-layout, .system-layout { grid-template-columns: 1fr; }
  .system-health { grid-column: auto; }
  .telemetry-strip { grid-template-columns: 1fr 1fr; }
  .telemetry-strip article:nth-child(2) { border-right: 0; }
  .telemetry-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .mobile-console-nav { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 60; display: grid; grid-template-columns: repeat(4,1fr); min-height: 62px; padding: 5px; border: 1px solid var(--line); border-radius: 17px; background: rgba(13,13,15,.94); box-shadow: 0 18px 60px rgba(0,0,0,.45); backdrop-filter: blur(18px); }
  .mobile-nav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 12px; background: transparent; color: #6c6c73; font-size: 8px; cursor: pointer; }
  .mobile-nav-link svg { width: 17px; height: 17px; }
  .mobile-nav-link.active { color: #fff; background: rgba(255,255,255,.055); }
  .login-shell { grid-template-columns: 1fr; overflow: auto; }
  .login-identity { min-height: 42vh; padding: 70px 28px 40px; border: 0; border-bottom: 1px solid var(--line); }
  .login-lockup h1 { font-size: 66px; }
  .login-face-frame { width: 55px; height: 55px; margin-bottom: 20px; }
  .login-telemetry { display: none; }
  .login-node { left: 28px; top: 24px; }
  .login-access { padding: 38px 24px 55px; }
  .login-body { overflow: auto; }
}

@media (max-width: 620px) {
  .console-header { min-height: 74px; gap: 10px; }
  .header-copy .eyebrow, .header-copy p { display: none; }
  .header-copy h1 { margin: 0; font-size: 18px; }
  .header-actions { margin-left: auto; }
  .live-command-column { grid-template-columns: 1fr; }
  .preview-frame-wrap { aspect-ratio: 4 / 3; }
  .telemetry-strip { grid-template-columns: 1fr; }
  .telemetry-strip article { border-right: 0; border-bottom: 1px solid var(--line); }
  .telemetry-strip article:last-child { border-bottom: 0; }
  .health-grid { grid-template-columns: 1fr; }
  .builder-entry { grid-template-columns: 28px 30px minmax(0,1fr) 34px; }
  .builder-footer { align-items: stretch; flex-direction: column; }
  .builder-footer .control-button { width: 100%; }
  .audio-layout .control-panel, .builder-panel, .builder-settings .control-panel, .archive-panel, .event-log-panel { padding: 16px; }
  .command-row { flex-wrap: wrap; }
  .command-row > .control-button { flex: 1 1 120px; }
  .channel-meter { grid-template-columns: 42px minmax(0,1fr); }
  .channel-meter > b { grid-column: 2; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
