:root {
  --night: #171210;
  --wood-dark: #3b2117;
  --wood: #6f4329;
  --wood-light: #99643b;
  --plastic: #201b18;
  --metal: #b7a88f;
  --screen: #d9e0c1;
  --screen-deep: #b9c4a8;
  --ink: #26342c;
  --faint: #48574b;
  --signal: #e56a43;
  --cream: #f5ecd8;
  --sans: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --mono: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% -20%, #4a3429 0, transparent 45%),
    repeating-linear-gradient(91deg, rgba(255,255,255,.018) 0 1px, transparent 1px 7px),
    var(--night);
  font-family: var(--sans);
  line-height: 1.55;
}
.channel-01 { --signal: #ef774e; }
.channel-02 { --signal: #18a6a0; }
.channel-03 { --signal: #e0ad35; }
.channel-04 { --signal: #be6ca7; }
.channel-05 { --signal: #df544a; }
.channel-06 { --signal: #6d93c4; }
.channel-07 { --signal: #e5cf5d; }
a { color: inherit; text-underline-offset: .18em; text-decoration-color: var(--signal); }

.station-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 3rem);
  color: #c8bda8;
  background: #0b0908;
  border-bottom: 1px solid #4d4037;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
}
.station-bar a { color: #fff5dc; font-weight: 700; text-decoration: none; }
.station-bar time { justify-self: end; }

.broadcast-set { width: min(1480px, 96vw); margin: clamp(1.5rem, 4vw, 4rem) auto 0; }
.cabinet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  gap: 24px;
  padding: clamp(18px, 3vw, 38px);
  background:
    linear-gradient(100deg, rgba(255,255,255,.07), transparent 24% 72%, rgba(0,0,0,.18)),
    repeating-linear-gradient(2deg, transparent 0 9px, rgba(35,15,5,.12) 10px 11px),
    var(--wood);
  border: 3px solid #2d180f;
  border-radius: 38px 38px 24px 24px;
  box-shadow: 0 32px 70px #000b, inset 0 2px #bd865c, inset 0 -7px #3a1e12;
}
.screen-bezel {
  min-width: 0;
  padding: clamp(12px, 2vw, 24px);
  background: linear-gradient(145deg, #302925, #12100f 60%, #332922);
  border: 2px solid #0c0a09;
  border-radius: 46px;
  box-shadow: inset 0 0 0 4px #4b4038, 0 4px 10px #0008;
}
.crt-screen {
  position: relative;
  min-height: 660px;
  overflow: hidden;
  color: var(--ink);
  background: var(--screen);
  border: 3px solid #050706;
  border-radius: 58px / 42px;
  box-shadow: inset 0 0 80px #1a281d66, inset 0 0 16px #0008, 0 0 8px #c9d8a7aa;
}
.screen-content { position: relative; z-index: 2; padding: clamp(2rem, 5vw, 5rem); }
.scanlines, .screen-vignette { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.scanlines { opacity: .13; background: repeating-linear-gradient(0deg, rgba(20,35,23,.34) 0 1px, transparent 1px 4px); }
.screen-vignette { box-shadow: inset 0 0 110px #1021168a; border-radius: inherit; }

.tv-controls {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.1rem;
  color: #d5cab5;
  background: linear-gradient(145deg, #2a2420, #151210);
  border: 2px solid #100d0b;
  border-radius: 24px;
  box-shadow: inset 0 2px #534942, inset 0 -4px #0c0a09;
}
.set-brand { padding: .7rem .4rem 1.2rem; text-align: center; }
.set-brand b { display: block; color: #eee2ca; font-size: .9rem; letter-spacing: .18em; }
.set-brand span { color: #8e8475; font-family: var(--mono); font-size: .58rem; letter-spacing: .15em; }
.dial-row { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: .7rem; }
.dial {
  display: grid;
  width: 56px;
  aspect-ratio: 1;
  place-items: center;
  color: #dcd0b8;
  background: radial-gradient(circle at 38% 32%, #645d54, #211e1b 54%, #090807 57% 100%);
  border: 2px solid #777064;
  border-radius: 50%;
  box-shadow: 0 4px 5px #000, inset 0 0 0 4px #181512;
  font-family: var(--mono);
  font-size: .63rem;
  text-decoration: none;
  transition: transform .12s ease;
}
.dial:active { transform: rotate(18deg) scale(.95); }
.channel-display { padding: .35rem; color: #ff6d49; text-align: center; background: #100d0b; border: 1px solid #4d3d35; border-radius: 7px; box-shadow: inset 0 0 12px #000; }
.channel-display small { display: block; color: #866e60; font-family: var(--mono); font-size: .55rem; }
.channel-display strong { font-family: var(--mono); font-size: 1.6rem; text-shadow: 0 0 8px #ff5b38; }
.channel-grid { display: grid; gap: .45rem; margin: 1.3rem 0; }
.channel-button { display: grid; grid-template-columns: 32px 1fr; align-items: center; padding: .52rem .62rem; color: #bcb19d; background: #29231f; border: 1px solid #4b423a; border-radius: 6px; font-size: .68rem; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; box-shadow: 0 2px #090807; }
.channel-button span { color: #82766a; font-family: var(--mono); }
.channel-button:hover, .channel-button.active { color: #17110e; background: var(--signal); border-color: #f7ddba; }
.channel-button.active span { color: #3f2a20; }
.speaker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: auto .5rem 1.3rem; padding: .8rem; background: #0e0c0b; border-radius: 10px; box-shadow: inset 0 0 10px #000; }
.speaker i { aspect-ratio: 1; background: #050404; border-radius: 50%; box-shadow: inset 0 1px #392f29; }
.power { display: flex; justify-content: center; align-items: center; gap: .6rem; color: #8f8576; font-family: var(--mono); font-size: .58rem; letter-spacing: .1em; }
.power i { width: 8px; height: 8px; background: #ec4f37; border-radius: 50%; box-shadow: 0 0 8px #ff4d31; animation: power-pulse 3s ease-in-out infinite; }
.tv-feet { display: flex; justify-content: space-between; width: 82%; height: 32px; margin: 0 auto; }
.tv-feet i { width: 90px; background: #3b2418; clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%); }

.channel-ident { position: relative; min-height: 390px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; text-align: center; border: 1px solid #8e9c82; }
.channel-ident::before, .channel-ident::after { content: ""; position: absolute; width: 84px; height: 84px; border-color: var(--signal); opacity: .65; }
.channel-ident::before { top: 18px; left: 18px; border-top: 4px solid; border-left: 4px solid; }
.channel-ident::after { right: 18px; bottom: 18px; border-right: 4px solid; border-bottom: 4px solid; }
.channel-bug { position: absolute; top: 22px; right: 28px; padding: .25rem .45rem; color: var(--screen); background: var(--ink); font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; }
.channel-ident > p:first-of-type { margin: 0 0 1.2rem; color: var(--faint); font-family: var(--mono); font-size: .75rem; letter-spacing: .16em; }
.channel-ident h1 { margin: 0; color: var(--ink); font-family: var(--sans); font-size: clamp(3rem, 7.2vw, 7.5rem); font-weight: 900; line-height: .83; letter-spacing: -.055em; text-transform: uppercase; text-shadow: 2px 2px 0 #f7f5d9, 5px 5px 0 #9da88f; }
.signal-rule { width: min(320px, 65%); height: 8px; margin: 2rem auto; background: repeating-linear-gradient(90deg, var(--signal) 0 26px, transparent 26px 35px); }
.standfirst { max-width: 720px; margin: 0; color: #3d4c41; font-family: var(--mono); font-size: clamp(.88rem, 1.4vw, 1.05rem); }
.ident-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 2rem 0; background: #899583; border: 1px solid #899583; }
.ident-stats span { display: flex; flex-direction: column; padding: 1.2rem; background: #ced7b9; font-family: var(--mono); font-size: .7rem; text-align: center; text-transform: uppercase; }
.ident-stats b { color: var(--signal); font-size: 1.45rem; }
.programme-guide { margin-top: 3.5rem; }
.programme-guide h2, .segment h2, .two-up h2, .manual h2 { font-size: .78rem; letter-spacing: .17em; text-transform: uppercase; }
.programme { display: grid; grid-template-columns: 72px 150px 1fr; align-items: baseline; gap: 1rem; padding: 1rem .4rem; color: var(--ink); border-bottom: 1px solid #98a38e; text-decoration: none; }
.programme b { color: var(--signal); font-family: var(--mono); }
.programme span { font-weight: 900; text-transform: uppercase; }
.programme small { color: var(--faint); }
.programme:hover { padding-left: 1rem; color: #fff; background: var(--ink); }
.programme:hover small { color: #bdc9b5; }
.transmission-time, .caption, .download-line { color: var(--faint); font-family: var(--mono); font-size: .72rem; }
.table-wrap caption { padding: 0 0 .7rem; color: var(--ink); font-family: var(--mono); font-size: .72rem; font-weight: 700; text-align: left; }

.segment { margin-top: 3rem; padding-top: 2rem; border-top: 4px double #899583; }
.chart { padding: clamp(.3rem, 1.5vw, 1.2rem); background: #dfe5cd; border: 1px solid #929e88; box-shadow: inset 0 0 25px #6f806a33; }
.chart svg { display: block; width: 100%; height: auto; }
.chart svg > rect { fill: #dfe5cd; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3rem; }
.two-up > article { padding: 1.4rem; border: 1px solid #94a08c; }
.download-card { color: #e5ead5; background: var(--ink); }
.download-card span { color: var(--signal); font-family: var(--mono); font-size: .7rem; letter-spacing: .13em; }
.download-card h2 { font-size: 1.3rem; }
.signal-warning { display: flex; gap: 1rem; align-items: center; margin: 2rem 0; padding: .8rem 1rem; color: #fff9df; background: #35463a; font-family: var(--mono); font-size: .72rem; }
.signal-warning b { color: #ffd76a; }
.counter-bank { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 3rem 0; background: #82907c; }
.counter-bank article { display: flex; flex-direction: column; padding: 1.3rem; background: #cfd8bc; }
.counter-bank b { color: var(--signal); font-family: var(--mono); font-size: 1.9rem; }
.counter-bank span { font-size: .7rem; text-transform: uppercase; }
.meter-explainer { display: grid; grid-template-columns: 190px 1fr; gap: 2rem; align-items: center; margin: 3rem 0; }
.meter { position: relative; width: 180px; height: 100px; overflow: hidden; border: 5px solid #354239; border-bottom: 0; border-radius: 180px 180px 0 0; background: repeating-conic-gradient(from 270deg at 50% 100%, #38473d 0 2deg, transparent 2deg 15deg); }
.meter i { position: absolute; left: 50%; bottom: 0; width: 4px; height: 78px; background: #d94e3a; transform-origin: 50% 100%; transform: rotate(var(--needle)); box-shadow: 0 0 5px #d94e3a; }
.meter span { position: absolute; right: 0; bottom: 8px; left: 0; font-family: var(--mono); font-size: .65rem; text-align: center; }
.test-pattern { display: grid; grid-template-columns: repeat(6, 1fr); height: 84px; margin: 2rem 0; border: 5px solid #2c3931; }
.test-pattern i:nth-child(1) { background: #e2d95b; }.test-pattern i:nth-child(2) { background: #3aa6a1; }.test-pattern i:nth-child(3) { background: #74b95b; }.test-pattern i:nth-child(4) { background: #bf5a9a; }.test-pattern i:nth-child(5) { background: #da554b; }.test-pattern i:nth-child(6) { background: #546db4; }
.manual { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: #8d9986; }
.manual article { padding: 1.3rem; background: #d6dec3; }
pre { overflow-x: auto; padding: .8rem; background: #bdc8ad; border: 1px solid #8e9a85; font-family: var(--mono); font-size: .72rem; }

.table-wrap { overflow-x: auto; border-top: 2px solid var(--signal); }
table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .72rem; }
th, td { padding: .72rem .6rem; text-align: right; border-bottom: 1px solid #98a48e; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: #536255; font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; }

footer { display: flex; justify-content: space-between; gap: 2rem; width: min(1320px, 92vw); margin: 1rem auto 3rem; color: #948778; font-family: var(--mono); font-size: .66rem; }
footer a { color: #d7c9ae; }

@keyframes power-pulse { 50% { opacity: .55; box-shadow: 0 0 3px #ff4d31; } }
@media (max-width: 980px) {
  .cabinet { grid-template-columns: 1fr; }
  .tv-controls { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; }
  .set-brand, .speaker, .power { display: none; }
  .dial-row { width: 220px; }
  .channel-grid { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); margin: 0; }
}
@media (max-width: 700px) {
  .station-bar { grid-template-columns: 1fr auto; }
  .station-bar span { display: none; }
  .cabinet { padding: 10px; gap: 10px; border-radius: 20px; }
  .screen-bezel { padding: 8px; border-radius: 28px; }
  .crt-screen { min-height: 560px; border-radius: 30px / 22px; }
  .screen-content { padding: 2.2rem 1.1rem; }
  .tv-controls { display: block; }
  .dial-row { margin: 0 auto 1rem; }
  .channel-grid { grid-template-columns: repeat(2, 1fr); }
  .two-up, .manual, .counter-bank, .ident-stats { grid-template-columns: 1fr; }
  .programme { grid-template-columns: 58px 1fr; }
  .programme small { grid-column: 2; }
  .meter-explainer { grid-template-columns: 1fr; }
  footer { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .power i { animation: none; }
  .dial { transition: none; }
}
