/* GroomsTV workstation. Adjust these proportions and gaps to tune your screens. */
:root {
  --gap: clamp(10px, .8vw, 22px);
  --left: minmax(230px, 18fr);
  --right: minmax(240px, 19fr);
  --bottom: clamp(210px, 25vh, 320px);
  --panel: #0b111cec;
  --line: #354256;
  --muted: #97a9bf;
  --text: #e1e9f2;
  --cyan: #9be5de;
  --amber: #e4ba7e;
}
* { box-sizing: border-box; }
html { background: #050711; }
body { margin: 0; color: var(--text); font: clamp(12px, .78vw, 18px)/1.45 system-ui, sans-serif; isolation: isolate; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 42% 90%, #62448685, transparent 53%), radial-gradient(ellipse at 90% 20%, #23576e8a, transparent 48%),
  radial-gradient(circle at 22px 32px, #e0d6ffbd .8px, transparent 1.4px), radial-gradient(circle at 72px 91px, #d0f1ff80 .8px, transparent 1.4px), #050711;
  background-size: auto, auto, 137px 163px, 211px 239px, auto;
}
button, input, textarea { font: inherit; }
button, .link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 11px; border: 1px solid #3a4a5e; border-radius: 3px; color: var(--text); background: #172333; text-decoration: none; cursor: pointer; }
button:hover, .link:hover { background: #23384a; border-color: var(--cyan); }
:where(button, a, input, textarea):focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
button:disabled { opacity: .5; cursor: wait; }
input, textarea { width: 100%; min-width: 0; padding: 9px 10px; color: var(--text); background: #070d17; border: 1px solid var(--line); border-radius: 3px; }
input[type=range] { padding: 0; accent-color: var(--cyan); }
a { color: var(--cyan); }
h1, h2, h3, p { margin: 0; }
h2 { font-size: inherit; font-weight: 600; letter-spacing: .065em; text-transform: uppercase; }
h3 { font-size: inherit; font-weight: 500; }
.mono, .eyebrow, time, .id { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.eyebrow, .id { font-size: .78em; color: var(--muted); letter-spacing: .06em; }
.eyebrow { text-transform: uppercase; }
.small { font-size: .88em; }
.muted { color: var(--muted); }
.accent { color: var(--cyan); }
.primary { border-color: #648c9b; color: var(--cyan); }
.wide { width: 100%; }
[hidden] { display: none !important; }

/* Edge-to-edge viewport. Each window scrolls independently when content is long. */
.shell { width: 100%; height: 100vh; height: 100dvh; padding: 0 var(--gap) 5px; display: grid; grid-template-rows: 48px minmax(0, 1fr) 21px; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.identity, .mast-right, .row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.identity > div:last-child { display: flex; align-items: baseline; gap: 18px; }
h1 { font-size: 17px; letter-spacing: .14em; }
.sigil { display: grid; place-items: center; width: 23px; height: 23px; color: var(--cyan); border: 1px solid #80a6b2; }
.mast-right { gap: 18px; }
.clock { font-size: 16px; letter-spacing: .06em; }
.workspace { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) var(--bottom); gap: var(--gap); }
.bridge { display: grid; grid-template-columns: var(--left) minmax(0, 63fr) var(--right); gap: var(--gap); min-height: 0; }
.column { min-width: 0; min-height: 0; display: grid; gap: var(--gap); }
.left-column { grid-template-rows: minmax(160px, .8fr) minmax(0, 1.6fr); }
.right-column { grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr); }
.monitor { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 6px 16px #0008, inset 0 0 0 2px #131d2c; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 0 0 auto; min-height: 34px; padding: 7px 11px; border-bottom: 1px solid var(--line); background: linear-gradient(#202c3c, #141e2d); }
.bar h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar button { padding: 4px 8px; }
.bar .id { flex: 0 0 auto; }
.body { padding: 12px; min-height: 0; overflow: auto; flex: 1; scrollbar-color: #445773 #0a111c; scrollbar-width: thin; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.rule { border-top: 1px solid var(--line); padding-top: 10px; }
.row > * { min-width: 0; }
.spread { justify-content: space-between; }
.notes { display: flex; flex-direction: column; gap: 9px; }
.notes textarea { flex: 1; min-height: 70px; resize: none; line-height: 1.9; background: repeating-linear-gradient(#090f19 0, #090f19 24px, #192437 25px); }
.notes .row { flex-wrap: wrap; }

/* Main monitor: all available upper-center space belongs to the player. */
.center { border-color: #637d93; box-shadow: 0 0 0 1px #627e9329, 0 8px 24px #0009; }
.screen { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #02040a; }
video { position: absolute; width: 100%; height: 100%; object-fit: contain; }
.standby { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; text-align: center; pointer-events: none;
  background: radial-gradient(ellipse at 50% 115%, #49647770, transparent 55%), linear-gradient(135deg, #0b1628, #03050c 70%); }
.standby::before { content: ''; position: absolute; width: min(46%, 400px); aspect-ratio: 1; border: 1px solid #87bdda22; border-radius: 50%; box-shadow: 0 0 0 35px #87bdda06, 0 0 0 70px #87bdda04; }
.standby > * { z-index: 1; }
.standby h3 { font-size: clamp(22px, 2.5vw, 58px); font-weight: 300; }
.standby p { max-width: 90%; }
.orbit { font-size: 45px; color: #93cad995; line-height: 1; }
.channel { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); background: #0c1421; }
.channel > div { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
#now-playing { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.signal { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--amber); }
.search { display: flex; gap: 6px; margin-top: 8px; }
.tool-links { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tool-links .link { justify-content: flex-start; font-size: .88em; }
.status-message { color: var(--muted); font-size: .88em; overflow-wrap: anywhere; }

/* Four lower console windows; source assignment lives beside the transport. */
.lower { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, .8fr); gap: var(--gap); min-height: 0; }
.guide-row { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; gap: 8px; padding: 10px 0; border-bottom: 1px solid #263447; font-size: .9em; }
.guide-row:last-child { border: 0; }
.guide-row strong { font-weight: 500; }
.transport { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.transport button { padding: 7px 9px; }
.volume { display: flex; align-items: center; gap: 10px; font-size: .8em; color: var(--muted); margin-top: 10px; }
.volume input { flex: 1; }
.source-form { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.source-form .row { gap: 6px; margin-top: 5px !important; }
.source-form button, .local-label { padding: 7px 9px; font-size: .86em; white-space: nowrap; }
.source-form input { padding: 7px 9px; }
.local-label { position: relative; overflow: hidden; }
.local-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.local-label:focus-within { outline: 2px solid var(--cyan); }
#media-message { margin-top: 5px !important; font-size: .8em; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 8px; margin: 0; font-size: .87em; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.utilities .body { display: flex; flex-direction: column; gap: 8px; }
.footer { display: flex; justify-content: space-between; align-items: end; font: 9px ui-monospace, monospace; letter-spacing: .12em; color: #bdc5dc; }
.focus .bridge { grid-template-columns: minmax(0, 1fr); }
.focus .column { display: none; }

/* Larger screens increase readability without adding an outer content limit. */
@media (min-width: 1900px) { .shell { grid-template-rows: 58px minmax(0, 1fr) 24px; } .bar { min-height: 40px; } .body { padding: 15px; } h1 { font-size: 21px; } .clock { font-size: 20px; } .footer { font-size: 11px; } }
/* Smaller laptops and zoomed views scroll naturally, preserving all tools. */
@media (max-width: 1100px), (max-height: 660px) {
  .shell { height: auto; min-height: 100svh; grid-template-rows: 48px auto 24px; }
  .workspace { grid-template-rows: auto auto; }
  .bridge { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .center { grid-row: 1; grid-column: 1 / -1; min-height: 420px; }
  .column { min-height: 430px; }
  .lower { grid-template-columns: 1fr 1fr; }
  .lower .monitor { min-height: 230px; }
  .identity .eyebrow { display: none; }
  .focus .center { min-height: 75svh; }
}
@media (max-width: 600px) {
  .shell { padding-inline: 8px; }
  .bridge, .lower { grid-template-columns: minmax(0, 1fr); }
  .center { grid-column: auto; min-height: 310px; }
  .mast-right .eyebrow { display: none; }
  .column { min-height: 460px; }
  .channel > div { display: block; }
  .source-form .row { flex-wrap: wrap; }
  #media-url { flex-basis: 100%; }
  .footer { font-size: 8px; letter-spacing: 0; }
  .standby { gap: 10px; }
}
