/* The view-source look, shared by the station page (/) and the share receiver
   (/tune) so the two stay one station. Page-specific rules (the dial, the dev
   panel) stay inline in their templates. */
:root{
  --bg:#f3f2ee; --ink:#1b1b1a; --gutter:#c8c6bd; --rule:#e4e2da;
  --tag:#2f6f6a;       /* element names      */
  --attr:#8a6d3b;      /* attribute names    */
  --str:#9c4f2c;       /* string values      */
  --comment:#9a988f;   /* comments           */
  --punct:#b7b5ac;     /* brackets/slashes   */
  --live:#16527a;      /* the real signal    */
}
*{box-sizing:border-box}
html{ -webkit-text-size-adjust:100%; text-size-adjust:100% }
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--ink)}
body{
  font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size:clamp(11px,3.1vw,12.5px); line-height:1.75;
  -webkit-font-smoothing:none; letter-spacing:.01em;
  overflow-x:hidden; touch-action:manipulation;
  padding:calc(1.4rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right))
          calc(4rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left));
}
.src{ counter-reset:ln; max-width:64rem; white-space:pre; overflow-x:auto;
      -webkit-overflow-scrolling:touch; }
.ln{ display:block; }
.ln::before{
  counter-increment:ln; content:counter(ln);
  display:inline-block; width:2.6em; margin-right:1.2em;
  text-align:right; color:var(--gutter); border-right:1px solid var(--rule);
  padding-right:.7em; user-select:none;
}
.t{color:var(--tag)} .a{color:var(--attr)} .s{color:var(--str)}
.c{color:var(--comment);font-style:italic} .p{color:var(--punct)}
.live{ color:var(--live); }
.clickable{ cursor:pointer; }
.clickable:hover .live{ text-decoration:underline; }
.control,.control-line{ -webkit-tap-highlight-color:transparent }
.control-line{ cursor:pointer }
/* keyboard users need to see where they are; the page is otherwise flat */
.control:focus-visible,#dial:focus-visible{
  outline:1px solid var(--live); outline-offset:2px;
}
.cur{ animation:blink 1.1s steps(1) infinite }
@keyframes blink{50%{opacity:0}}
a{color:inherit}
.traffic{
  margin-top:1.4rem; max-width:64rem; padding-top:.7rem;
  border-top:1px solid var(--rule); white-space:normal;
}
.receiver-lights{letter-spacing:.18em;color:var(--live)}

/* floating ASCII 3D logo (logo.js) — overlays the code, never touches it */
#nut{
  position:fixed; top:46%; left:50%; transform:translate(-50%,-50%);
  margin:0; z-index:5; opacity:.42; pointer-events:none; user-select:none;
  font:14px/1.0 ui-monospace,Menlo,Consolas,monospace; white-space:pre;
  color:var(--live); text-shadow:0 0 1px var(--bg);
  transition:opacity .18s linear;
}

/* phones (iPhone, Pixel, small Android): wrap instead of side-scroll,
   hang-indent wrapped lines under the code so numbers stay aligned */
@media (max-width:560px){
  #nut{ font-size:11px; opacity:.4 }
  .src{ white-space:pre-wrap; word-break:break-word; overflow-x:visible }
  .ln{ padding-left:3.2em; text-indent:-3.2em }
  .ln::before{ width:1.9em; margin-right:.5em; padding-right:.4em; border-right:none }
  /* the one control on the page can be far down on a phone: it rides at the
     foot of the screen until you scroll to where it lives in the source */
  .control-line{ position:sticky; bottom:0; z-index:6; background:var(--bg);
                 border-top:1px solid var(--rule);
                 padding:.7em 0 calc(.7em + env(safe-area-inset-bottom)) 3.2em }
}
