/* AI GEN — a decoder-led console, not another recolor.
   Opt-in and station-only. Grid places the existing live nodes; switching looks
   removes these rules without moving controls, resetting data or opening devices. */
html[data-appearance=ai-gen] body.station-page {
 --appearance-line:#78b7bf29;
 --appearance-control-line:#8abcc13d;
 --ai-teal:#89d2cd;
 --ai-radius:16px;
 background:radial-gradient(ellipse at 14% 0%,#143a474a,transparent 55%),#08131c!important;
}

/* Compact masthead; navigation and preference controls keep their native order. */
html[data-appearance=ai-gen] body.station-page>header {
 max-width:1800px;margin:0 auto 10px;padding:9px 20px;
 border-bottom:1px solid var(--appearance-line);
 box-shadow:0 10px 40px #00000016;
}
html[data-appearance=ai-gen] body.station-page>header .wordmark {letter-spacing:4px;font-size:12px}
html[data-appearance=ai-gen] body.station-page>header #radiance-globe {opacity:.85}
html[data-appearance=ai-gen] body.station-page>header :is(nav button[aria-current],#radiance-appearance-button) {
 color:var(--appearance-accent)!important;
 text-decoration:underline;text-decoration-color:#e1bb7c88;text-underline-offset:6px;
}

/* Two matched monitor channels. LEDs keep their real connection-state colors. */
html[data-appearance=ai-gen] body.station-page>:is(#dmr-dashboard,#mesh-bar) {
 max-width:1760px;margin:0 20px 7px;padding:6px 12px;min-height:42px;
 border:1px solid var(--appearance-line);border-radius:8px;
 box-shadow:inset 3px 0 0 #89d2cd66;
}
html[data-appearance=ai-gen] body.station-page>:is(#dmr-dashboard,#mesh-bar) .radio-feature-title {
 flex-basis:112px;letter-spacing:.3px;
}

/* One large receive workspace and a quieter utility rail. Height is a minimum,
   never a clip: expanded contact review, saved notes and RTL controls can grow. */
html[data-appearance=ai-gen] body.station-page .workspace {
 grid-template-columns:minmax(0,1fr) minmax(290px,330px);
 grid-template-rows:auto minmax(250px,1fr);
 grid-template-areas:"decoder station" "decoder communicator";
 align-items:stretch;gap:14px;padding:7px 20px 20px;max-width:1800px;
}
html[data-appearance=ai-gen] body.station-page .workspace>.decoder-panel {
 grid-area:decoder;display:block;align-self:stretch;border-radius:var(--ai-radius);
 border:1px solid var(--appearance-line);box-shadow:0 14px 42px #00000026,inset 0 1px 0 #a0d7d920;
}
html[data-appearance=ai-gen] body.station-page .decoder-content {
 height:auto;min-height:var(--console-height,620px);border-radius:inherit;
 background:linear-gradient(145deg,#12313e66,#08131c22 65%);
}
html[data-appearance=ai-gen] body.station-page .decoder-commandbar {
 padding:17px 18px 12px;border-top:2px solid #89d2cd99;border-radius:var(--ai-radius) var(--ai-radius) 0 0;
}
html[data-appearance=ai-gen] body.station-page .decoder-heading {margin-bottom:14px}
html[data-appearance=ai-gen] body.station-page #decoder-title {font-size:21px;letter-spacing:-.3px}
html[data-appearance=ai-gen] body.station-page #decoder-mode-badge {
 padding:4px 7px;border-color:#89d2cd66;color:var(--ai-teal);font-size:10px;letter-spacing:.8px;
}
html[data-appearance=ai-gen] body.station-page .decoder-panel :is(button,.compact-config>summary) {
 min-height:34px;padding:7px 10px;border-radius:6px;font-size:12px;
}
html[data-appearance=ai-gen] body.station-page .decoder-panel #cw-test {
 width:auto;min-width:76px;height:auto;min-height:34px;color:var(--appearance-bg)!important;
 background:var(--appearance-accent)!important;border-color:var(--appearance-accent)!important;font-weight:650;
}
html[data-appearance=ai-gen] body.station-page .decoder-panel #mode-picker {width:auto;min-width:70px;height:auto;min-height:34px}
html[data-appearance=ai-gen] body.station-page .decoder-toolbar {gap:7px}
html[data-appearance=ai-gen] body.station-page .decoder-toolbar .compact-file {flex:1 1 190px;max-width:none}
html[data-appearance=ai-gen] body.station-page .decoder-panel input[type=file]::file-selector-button {
 min-height:32px;padding:6px 10px;color:var(--appearance-ink);background:#17303c;border-color:var(--appearance-control-line);
}
html[data-appearance=ai-gen] body.station-page .decoder-panel #transcript {
 flex:1 1 180px;height:auto;min-height:150px;max-height:55dvh;margin:0 18px;padding:18px;
 resize:vertical;border:1px solid var(--appearance-line);border-radius:9px;
 box-shadow:inset 0 1px 12px #00000020;
}
html[data-appearance=ai-gen] body.station-page .decoder-panel #transcript .empty {min-height:110px;max-width:100%}
html[data-appearance=ai-gen] body.station-page .decoder-panel .decode-live {font-size:15px;line-height:1.8}
html[data-appearance=ai-gen] body.station-page .decoder-panel #source-status {margin:6px 18px;font-size:10px}
html[data-appearance=ai-gen] body.station-page .decoder-panel .waterfall-section {
 flex:none;padding:12px 18px 8px;border-top:0;
}
html[data-appearance=ai-gen] body.station-page .waterfall-section>.heading {margin-bottom:7px}
html[data-appearance=ai-gen] body.station-page .instrument-section :is(h3,.section-label) {font-size:13px;letter-spacing:.3px}
html[data-appearance=ai-gen] body.station-page .decoder-panel #waterfall[data-design] {
 height:clamp(130px,21dvh,210px);min-height:130px;max-height:55dvh;margin-top:0;
 resize:vertical;border-radius:7px;border-color:#89d2cd40;
}
html[data-appearance=ai-gen] body.station-page .decoder-panel .scale {font-size:9px;margin-top:6px}
html[data-appearance=ai-gen] body.station-page .decoder-panel .notearea {
 flex:none;margin:5px 18px 18px;padding:12px 14px;border-radius:9px;
 border:1px solid var(--appearance-line);box-shadow:inset 3px 0 0 #e1bb7c77;
}
html[data-appearance=ai-gen] body.station-page .decoder-panel .notearea .heading {margin-bottom:7px}
html[data-appearance=ai-gen] body.station-page .decoder-panel #savedcount {padding:5px 0;font-size:11px}
html[data-appearance=ai-gen] body.station-page .decoder-panel #note {min-height:36px;padding:7px 10px}
html[data-appearance=ai-gen] body.station-page #operate-voice {margin:0 18px 8px;min-height:240px;flex:1 1 240px;height:auto}

/* Station settings remain first in DOM/keyboard order. The compact rail makes
   their relationship to the adjacent receiver explicit without duplicating UI. */
html[data-appearance=ai-gen] body.station-page .workspace>.station-column {
 grid-area:station;display:flex;flex-direction:column;gap:0;max-height:none;overflow:visible;
 border:1px solid var(--appearance-line);border-radius:var(--ai-radius);
 background:linear-gradient(145deg,#12313e88,#08131c66);box-shadow:0 8px 28px #0000001f;
}
html[data-appearance=ai-gen] body.station-page .station-column>.panel {
 border:0!important;border-radius:var(--ai-radius);box-shadow:none;padding:12px 14px;
}
html[data-appearance=ai-gen] body.station-page .station-column>.panel:has(>#station-title) {
 display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;
 border-bottom:1px solid var(--appearance-line)!important;border-radius:var(--ai-radius) var(--ai-radius) 0 0;
}
html[data-appearance=ai-gen] body.station-page .station-column #station-title {font-size:15px}
html[data-appearance=ai-gen] body.station-page .station-column>.panel>.station-setup-launcher {margin:0;min-height:34px;padding:5px 8px}
html[data-appearance=ai-gen] body.station-page .radio-health {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 12px}
html[data-appearance=ai-gen] body.station-page .radio-health h2 {grid-column:1;font-size:11px;font-weight:600;letter-spacing:.7px;text-transform:uppercase;margin:0}
html[data-appearance=ai-gen] body.station-page .radio-health>p {grid-column:2;margin:0;font-size:11px;text-align:right}
html[data-appearance=ai-gen] body.station-page .radio-health .freq {font-size:20px;letter-spacing:-.7px;margin:6px 0;align-self:center;overflow-wrap:anywhere}
html[data-appearance=ai-gen] body.station-page .radio-health .health {grid-column:1/-1;grid-template-columns:minmax(0,1fr);font-size:11px;gap:4px;margin:4px 0;padding:6px 0}
html[data-appearance=ai-gen] body.station-page .radio-health .health>div {display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;gap:8px;min-width:0}
html[data-appearance=ai-gen] body.station-page .radio-health .health>div:has(#station-source-health) {grid-column:1/-1}
html[data-appearance=ai-gen] body.station-page .radio-health .health :is(b,#station-source-health) {max-width:65%;text-align:right}
html[data-appearance=ai-gen] body.station-page .radio-health>small {grid-column:1/-1;display:block;font-size:10px;line-height:1.5}
html[data-appearance=ai-gen] body.station-page .radio-health .sdr-meter {border-radius:6px;margin:0;align-self:center;padding:6px 0}
html[data-appearance=ai-gen] body.station-page .radio-health .rtl-controls {grid-column:1/-1}

html[data-appearance=ai-gen] body.station-page .workspace>.chat {
 grid-area:communicator;align-self:stretch;height:auto;min-height:250px;border-radius:var(--ai-radius);
 border:1px solid var(--appearance-line);box-shadow:0 8px 28px #0000001f;
}
html[data-appearance=ai-gen] body.station-page .chat>.chat-heading {padding:12px 16px;flex:none}
html[data-appearance=ai-gen] body.station-page .chat>.chat-heading h2 {font-size:15px}
html[data-appearance=ai-gen] body.station-page .chatspace {
 flex:1 1 100px;height:100px;min-height:90px;max-height:360px;margin:0 12px 8px;padding:12px;
 border-radius:8px;border-color:var(--appearance-line);scrollbar-color:#4c727c #08131c;
}
html[data-appearance=ai-gen] body.station-page .chat-compose {padding:0 12px 12px;flex:none}
html[data-appearance=ai-gen] body.station-page .chat #draft {height:52px;min-height:44px;font-size:12px;padding:8px 10px;border-radius:6px}
html[data-appearance=ai-gen] body.station-page .chat #send {min-height:34px;font-size:12px;border-radius:6px}
html[data-appearance=ai-gen] body.station-page .chat #chatstatus {min-height:0;font-size:11px}

/* Existing Focus/Motion controls continue to own scenery and animation. */
html[data-appearance=ai-gen] body.station-page:not(.focus-mode) :is(.ambient,#surface-scene) {filter:brightness(.35) saturate(.6)}
html[data-appearance=ai-gen] body.station-page.focus-mode .decoder-content {background:transparent}
html[data-appearance=ai-gen] body.station-page :is(.config-window,.chat-actions>div) {box-shadow:0 16px 42px #0008;border-radius:9px}

/* Let short windows and tablet widths use natural page flow, not nested clips. */
@media(min-width:901px) and (max-height:900px) {
 html[data-appearance=ai-gen] body.station-page .decoder-commandbar {padding:12px 16px 8px}
 html[data-appearance=ai-gen] body.station-page .decoder-heading {margin-bottom:10px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel .waterfall-section {padding:8px 18px 6px}
 html[data-appearance=ai-gen] body.station-page .waterfall-section>.heading {margin-bottom:4px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel #waterfall[data-design] {height:clamp(110px,18dvh,160px);min-height:110px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel .notearea {margin-block:4px 11px;padding-block:8px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel .notearea .heading {margin-bottom:4px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel #savedcount {padding:3px 0}
}
@media(min-width:1101px) and (min-height:651px) and (max-height:850px) {
 /* Typical laptop: the receive transcript yields space before logging does. */
 html[data-appearance=ai-gen] body.station-page .decoder-panel #transcript {flex-basis:110px;min-height:110px;padding-block:10px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel #transcript .empty {min-height:88px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel #waterfall[data-design] {height:clamp(105px,16dvh,136px);min-height:105px}
}
@media(max-width:1100px),(max-height:650px) {
 html[data-appearance=ai-gen] body.station-page .decoder-content {min-height:0}
 html[data-appearance=ai-gen] body.station-page .decoder-panel #transcript {flex:1 1 200px;min-height:180px}
}
@media(max-width:900px) {
 html[data-appearance=ai-gen] body.station-page .workspace {
  grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;
  grid-template-areas:"decoder" "station" "communicator";padding:8px 12px 20px;gap:12px;
 }
 html[data-appearance=ai-gen] body.station-page .decoder-content {min-height:0}
 html[data-appearance=ai-gen] body.station-page .chatspace {flex:1 1 200px;height:200px;max-height:420px}
 html[data-appearance=ai-gen] body.station-page>:is(#dmr-dashboard,#mesh-bar) {margin-inline:12px}
 html[data-appearance=ai-gen] body.station-page>header {padding:8px 12px}
}
@media(max-width:600px) {
 html[data-appearance=ai-gen] body.station-page .decoder-commandbar {padding:13px 12px 10px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel :is(button,.compact-config>summary) {min-height:44px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel :is(#cw-test,#mode-picker) {min-height:44px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel #transcript {margin-inline:12px;padding:12px;min-height:180px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel .waterfall-section {padding:10px 12px 8px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel #waterfall[data-design] {height:180px;min-height:140px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel .notearea {margin:4px 12px 12px;padding:10px}
 html[data-appearance=ai-gen] body.station-page .decoder-panel #note {min-height:44px}
 html[data-appearance=ai-gen] body.station-page #operate-voice {margin-inline:12px;min-height:360px}
 html[data-appearance=ai-gen] body.station-page .station-column>.panel>.station-setup-launcher {min-height:44px}
 html[data-appearance=ai-gen] body.station-page .chat #send {min-height:44px}
 html[data-appearance=ai-gen] body.station-page .chat #draft {min-height:66px}
}
@media(min-width:1800px) {
 html[data-appearance=ai-gen] body.station-page>:is(#dmr-dashboard,#mesh-bar) {margin-inline:auto}
}
