/* ════════════════════════════════════════════════════════════════════════
   ilan_woodward — sound_library
   Early-90s browser restyle, taken directly from the two reference
   screenshots (NCSA-Mosaic-era Smithsonian page):
   · flat #c0c0c0 grey page, black text, classic #0000ee hyperlink blue
   · chunky Win3.x bevel borders (white/dark-grey, hard black offsets)
   · bitmap pixel type (VT323) — pixels visible, nothing antialiased-smooth
   · photos rendered the period way: small GIFs, 216-colour web-safe
     palette, Floyd–Steinberg dithered (JPEG support only arrived ~1995)
   · Windows-9x arrow + hand cursors
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --grey: #c0c0c0;      /* control grey from images-1 */
  --grey-bg: #e0e0e0;   /* page background — 50% lighter than #c0c0c0 */
  --hi: #ffffff;        /* bevel highlight */
  --lo: #808080;        /* bevel shade */
  --black: #000000;
  --navy: #000080;      /* selection */
  --bar: #39397c;       /* top-bar indigo, sampled from the Mosaic titlebar */
  --rail-a: #41606f;    /* argyle desktop pattern behind the window, sampled */
  --rail-b: #35364f;
  --rail: 64px;         /* side borders boxing the page in (wide = torch pillars) */
  --link: #0000ee;      /* classic hyperlink blue */
  --red: #990000;       /* errors / destructive */
  --pink: #d63384;      /* secondary text (was light grey) */
  --boxshadow: 4px 4px 0 var(--black); /* the SIA2012-0382 text-box shadow */

  --mono: "VT323", ui-monospace, "JetBrains Mono", "IBM Plex Mono",
    Menlo, Consolas, "Liberation Mono", monospace;

  /* photo slots — period rendering: dithered 216-colour GIFs.
     Any photo can be swapped into any slot. */
  --photo-hero: url("/assets/photos/snow.gif");  /* R1-04790-0003 copy 2 */
  --photo-login: url("/assets/photos/moon-night.gif");
  --photo-frame-a: url("/assets/photos/observatory.gif");
  --photo-frame-b: url("/assets/photos/meadow.gif");

  --player-h: 92px;
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--grey-bg);         /* flat — no gradient, no texture */
  color: var(--black);
  font-family: var(--mono);
  font-size: 19px;
  line-height: 1.35;
  padding: 0 var(--rail) calc(var(--player-h) + 24px);
  cursor: url("/assets/cursors/arrow.png") 0 0, auto;
}

/* side borders boxing the page in — the argyle desktop pattern that frames
   the Mosaic window in the smithsonian 470x251 screenshot */
body::before, body::after {
  content: ""; position: fixed; top: 0; bottom: 0; width: var(--rail); z-index: 90;
  background: conic-gradient(from 45deg, var(--rail-a) 0 25%, var(--rail-b) 0 50%,
    var(--rail-a) 0 75%, var(--rail-b) 0) 0 0 / 22px 22px;
}
body::before { left: 0; border-right: 2px solid var(--black); }
body::after { right: 0; border-left: 2px solid var(--black); }

/* wall torches on the side rails (OSRS-style pixel fire, injected by fx.js) */
.torch {
  position: fixed; width: 48px; height: 96px; z-index: 91;
  pointer-events: none;
  background: url("/assets/flame-a.gif") center bottom / contain no-repeat;
  image-rendering: pixelated;
}
.torch-b { background-image: url("/assets/flame-b.gif"); }
.torch-l { left: 8px; }
.torch-r { right: 8px; }
.torch-1 { top: 14%; }
.torch-2 { top: 58%; }
@media (max-width: 1239px) {
  :root { --rail: 26px; }   /* rails slim down; no room for torches */
  .torch { display: none; }
}
@media (prefers-reduced-motion: reduce) { .torch { display: none; } }

::selection { background: var(--navy); color: var(--hi); }

a { color: var(--link); text-decoration: underline; }
a:hover { color: var(--red); }
a, button, .btn, .abtn, .row-play, .pbtn, .dropzone, label,
input[type="radio"], input[type="checkbox"] {
  cursor: url("/assets/cursors/hand.png") 10 0, pointer;
}
:focus-visible { outline: 1px dotted var(--black); outline-offset: 1px; }

/* Dithered images keep pixel-crisp rendering ONLY where they are shown at or
   above their file size (upscaling is safe). NEVER add `pixelated` to an
   image that gets shown SMALLER than its file: nearest-neighbour downscaling
   magnifies the dither dots into speckle that reads as grey haze.
   (This is the bug that kept washing out the framed aside photos.) */
.hero, .dl-page, .detail-art, .p-art img { image-rendering: pixelated; }

/* ── boot type-in effect (fx.js) ────────────────────────────────────── */

.fx-blink { opacity: 0; animation: fxblink .16s steps(2) forwards; }
@keyframes fxblink { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .fx-blink { animation: none; opacity: 1; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.stars { display: none; }

/* ── bevel language (the blocky borders from the screenshots) ───────── */

.panel {
  position: relative;
  background: var(--grey);
  border: 2px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  box-shadow: 3px 3px 0 var(--black);
}

.titlebar {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px;
  font-size: 16px; letter-spacing: .04em; text-transform: lowercase;
  color: var(--hi);
  background: var(--bar);              /* matches the Mosaic titlebar */
  border-bottom: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
}
.titlebar::after { content: "▪ ▪"; margin-left: auto; opacity: .8; }

.btn {
  display: inline-block;
  font-family: var(--mono); font-size: 17px;
  color: var(--black);
  background: var(--grey);
  border: 2px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  padding: 6px 14px;
  user-select: none;
  text-decoration: none;
}
.btn:hover { color: var(--navy); }
.btn:active {
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  transform: translate(1px, 1px);
}
.btn-amber { font-weight: 700; box-shadow: 0 0 0 1px var(--black); } /* "default button" ring */
.btn-danger:hover { color: var(--red); }
.btn[disabled] { color: var(--lo); text-shadow: 1px 1px 0 var(--hi); cursor: url("/assets/cursors/arrow.png") 0 0, auto; }

.cursor {
  display: inline-block; margin-left: 4px;
  color: var(--navy);
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 18px; position: relative; z-index: 2; }
.wrap.wide { max-width: 1470px; } /* the library spreads out for the big frames */

/* ── header chrome ──────────────────────────────────────────────────── */

.chrome {
  position: relative; z-index: 5;
  background: var(--bar);              /* the Mosaic titlebar indigo */
  color: var(--hi);
  border-bottom: 2px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
}
.chrome-bar {
  max-width: 1060px; margin: 0 auto; padding: 8px 18px;
  display: flex; align-items: center; gap: 14px;
  font-size: 16px;
}
.chrome-dots { font-size: 11px; letter-spacing: .3em; }
.chrome-dots b:nth-child(1) { color: var(--hi); }
.chrome-dots b:nth-child(2) { color: var(--grey); }
.chrome-dots b:nth-child(3) { color: var(--black); }
.chrome-title { flex: 1; color: var(--hi); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chrome-link { color: var(--hi); }
.chrome-link:hover { color: var(--grey); }

/* menubar — the File/Edit/Options strip under the titlebar */
.menubar {
  position: relative; z-index: 4;
  background: var(--hi);
  border-bottom: 2px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
}
.menubar-inner {
  max-width: 1060px; margin: 0 auto; padding: 5px 18px;
  display: flex; gap: 22px; flex-wrap: wrap;
  font-size: 17px;
}
.menubar a { color: var(--black); text-decoration: none; }
.menubar a:hover { color: var(--navy); text-decoration: underline; }
.menubar a.active { color: var(--navy); text-decoration: underline; }

/* ── hero — an inline image in a sunken well, labels as grey chips ──── */

.hero {
  position: relative; z-index: 1;
  height: clamp(260px, 40vh, 440px);
  margin: 14px auto 0; max-width: 1024px;
  border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo); /* sunken image well */
  background-image:
    var(--photo-hero),
    linear-gradient(180deg, var(--navy) 0 55%, var(--lo) 55% 85%, var(--black) 85%);
  background-size: cover, cover;
  background-position: center 40%, center;
}
/* the title block sits BELOW the main photo */
.masthead { max-width: 1024px; margin: 18px auto 0; }
.hero-path, .hero-tagline {
  margin: 0 0 4px; font-size: 16px; color: var(--black);
  display: inline-block; background: var(--grey);
  border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  padding: 1px 8px;
  box-shadow: var(--boxshadow);
}
.hero-title {
  margin: 0 0 4px; display: block; width: fit-content;
  font-size: clamp(34px, 6vw, 58px); line-height: 1.05;
  font-weight: 400; /* VT323 has one weight; bold would blur the pixels */
  color: var(--black);
  background: var(--grey);
  border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  padding: 2px 12px;
  box-shadow: var(--boxshadow);
}
.hero-tagline { margin: 0; }

/* ── library ────────────────────────────────────────────────────────── */

/* aside frames at 2.79x (240px -> 670px); assets are dithered at 2x the
   rendered width, and fx detaches after animating, so no grey-out */
.lib-layout { display: grid; grid-template-columns: minmax(0, 1fr) 670px; gap: 28px; margin-top: 26px; }
@media (max-width: 1300px) {
  .lib-layout { grid-template-columns: minmax(0, 1fr) 440px; }
}
.lib-section { margin-bottom: 28px; }
.row-none { padding: 10px 12px; color: var(--pink); font-size: 15px; list-style: none; }

.lib-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.lib-head h2 { margin: 0; font-size: 22px; color: var(--black); font-weight: 400; }
.lib-head .comment { color: var(--pink); font-size: 15px; }

.tracklist {
  list-style: none; margin: 0; padding: 0;
  background: var(--hi);
  border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo); /* sunken list box */
  box-shadow: var(--boxshadow);
}

.row {
  display: grid;
  grid-template-columns: 44px 64px minmax(0, 1fr) 64px 120px;
  align-items: center; gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--grey);
}
.row:hover { background: var(--navy); }
.row:hover .row-title, .row:hover .row-artist, .row:hover .row-num,
.row:hover .row-dur, .row:hover .row-dl { color: var(--hi); }
.row-num { color: var(--pink); font-size: 15px; }
.row-play {
  font-family: var(--mono); font-size: 15px;
  background: var(--grey); border: 2px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  color: var(--black);
  padding: 3px 0; width: 62px;
}
.row-play:active { border-color: var(--lo) var(--hi) var(--hi) var(--lo); transform: translate(1px, 1px); }
.row-main { min-width: 0; }
.row-title { display: block; color: var(--link); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: underline; }
.row-artist { display: block; color: var(--pink); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-dur { color: var(--black); font-size: 15px; text-align: right; }
.row-dl { font-size: 15px; color: var(--link); text-align: right; white-space: nowrap; }
.dl-icon { display: none; } /* compact phone form of the download/open links */

/* currently playing = classic selection bar with marching-ants border */
.row.active { background: var(--navy); }
.row.active .row-title, .row.active .row-num, .row.active .row-artist,
.row.active .row-dur, .row.active .row-dl { color: var(--hi); }
.row.active .row-play { animation: ants 1s steps(2) infinite; }
@keyframes ants {
  0%, 100% { outline: 1px dotted var(--hi); outline-offset: 1px; }
  50% { outline: 1px dotted var(--navy); outline-offset: 1px; }
}

.status-line { color: var(--black); font-size: 17px; padding: 22px 4px; }
.status-line .err { color: var(--red); }

/* works pages — same listbox, simpler rows */
.works-list { margin-top: 24px; }
.wrow { grid-template-columns: 44px minmax(0, 1fr) 44px; }

/* release rows — an EP/album as one entry with its artwork as the "number" */
.rel-thumb {
  width: 44px; height: 44px; object-fit: cover; display: block;
  border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  image-rendering: pixelated;
  background: var(--hi);
}
.rel-tracks { margin-top: 18px; }

/* framed photos — straight, raised grey frames */
.aside { display: flex; flex-direction: column; gap: 28px; }
.polaroid {
  padding: 12px 12px 32px;
  background: var(--grey);
  border: 2px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  box-shadow: 4px 4px 0 var(--black);
}
.polaroid img {
  display: block; width: 100%; height: auto;
  border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
}
.polaroid figcaption { margin-top: 9px; font-size: 15px; color: var(--black); text-align: center; }

/* upcoming gigs box (library sidebar) */
.gigs-box .gigs-list {
  list-style: none; margin: 12px; padding: 6px 12px;
  background: var(--hi);
  border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
}
.gig { padding: 9px 2px; border-bottom: 1px solid var(--grey); display: flex; flex-direction: column; gap: 1px; }
.gig:last-child { border-bottom: none; }
.gig-when { color: var(--navy); font-size: 15px; }
.gig-what { color: var(--black); font-size: 18px; }
.gig-where { color: var(--pink); font-size: 15px; }
.gig-link { color: var(--link); text-decoration: underline; }
.gig-link:hover { color: var(--red); }

/* ── track detail ───────────────────────────────────────────────────── */

.detail { margin-top: 26px; }
.detail-back { display: inline-block; margin-bottom: 16px; font-size: 17px; }
.detail-grid { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; gap: 28px; align-items: start; }
.detail-art {
  aspect-ratio: 1; width: 100%;
  background: var(--hi) var(--photo-frame-b) center/cover;
  border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  object-fit: cover;
}
.detail-meta h2 { margin: 0 0 2px; font-size: clamp(28px, 4vw, 40px); color: var(--black); font-weight: 400; }
.detail-meta .detail-artist { color: var(--navy); margin: 0 0 16px; font-size: 17px; }
.detail-desc {
  color: var(--black);
  background: var(--hi);
  border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  padding: 10px 14px; margin: 0 0 20px;
  font-size: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: var(--boxshadow);
}
.detail-desc::before { content: "/* "; color: var(--pink); }
.detail-desc::after { content: " */"; color: var(--pink); }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.detail-file { margin-top: 16px; font-size: 15px; color: var(--pink); overflow-wrap: anywhere; }
.detail-file b { color: var(--black); font-weight: 400; }

/* ── player bar — a raised grey strip ───────────────────────────────── */

.player {
  position: fixed; left: var(--rail); right: var(--rail); bottom: 0; z-index: 100;
  background: var(--grey);
  border-top: 2px solid var(--hi);
  box-shadow: 0 -2px 0 var(--lo), 0 -3px 0 var(--black);
}
.player.hidden { display: none; }
.player-inner {
  max-width: 1060px; margin: 0 auto; padding: 8px 14px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  grid-template-areas: "art meta controls" "seek seek seek";
  gap: 6px 14px; align-items: center;
}
.p-art {
  grid-area: art; width: 52px; height: 52px;
  border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  background: var(--hi); overflow: hidden;
}
.p-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-meta { grid-area: meta; min-width: 0; }
.p-label { font-size: 14px; color: var(--navy); }
.p-title { font-size: 17px; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-title i { color: var(--pink); font-style: normal; }
.p-controls { grid-area: controls; display: flex; gap: 8px; }
.pbtn {
  font-family: var(--mono); font-size: 17px;
  width: 48px; height: 42px;
  background: var(--grey); color: var(--black);
  border: 2px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
}
.pbtn:active { border-color: var(--lo) var(--hi) var(--hi) var(--lo); transform: translate(1px, 1px); }
.pbtn-main { font-weight: 400; box-shadow: 0 0 0 1px var(--black); }
.p-seek { grid-area: seek; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--black); }
.p-seek input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 14px;
  background: linear-gradient(90deg, var(--navy) var(--fill, 0%), var(--hi) var(--fill, 0%));
  border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  outline-offset: 3px; border-radius: 0;
  cursor: url("/assets/cursors/hand.png") 10 0, pointer;
}
.p-seek input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 22px; border-radius: 0;
  background: var(--grey);
  border: 2px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  box-shadow: 1px 1px 0 var(--black);
}
.p-seek input[type="range"]::-moz-range-thumb {
  width: 14px; height: 20px; border-radius: 0;
  background: var(--grey);
  border: 2px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  box-shadow: 1px 1px 0 var(--black);
}
.p-seek input[type="range"]::-moz-range-track { height: 12px; background: var(--hi); border: 1px solid var(--lo); }
.p-seek input[type="range"]::-moz-range-progress { height: 12px; background: var(--navy); }

/* ── footer ─────────────────────────────────────────────────────────── */

.foot {
  max-width: 1060px; margin: 54px auto 0; padding: 14px 18px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  color: var(--black); font-size: 15px;
  border-top: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
}
.foot a { color: var(--link); }
.foot-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.foot-badges span {
  padding: 1px 8px; background: var(--grey);
  border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi);
}

/* ── QR download landing / expired pages ────────────────────────────── */

.dl-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: var(--grey-bg);
}
.dl-card { max-width: 480px; width: 100%; padding: 26px 24px; text-align: left; }
.dl-label { margin: 0; font-size: 15px; color: var(--navy); }
.dl-title { margin: 2px 0 10px; font-size: 34px; color: var(--black); font-weight: 400; overflow-wrap: anywhere; }
.dl-desc { color: var(--black); font-size: 17px; margin: 0 0 20px; }
.dl-fine { color: var(--pink); font-size: 14px; margin: 16px 0 0; }

/* ── admin ──────────────────────────────────────────────────────────── */

.admin-body { background: var(--grey-bg); padding-bottom: 40px; }
.login-wrap { display: flex; justify-content: center; padding: 10vh 18px 0; }
.login-card { width: 100%; max-width: 420px; }
.login-card .inner { padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 15px; color: var(--black); }
.field label::before { content: "const "; color: var(--pink); }
.field label::after { content: " ="; color: var(--pink); }
.field select {
  font-family: var(--mono); font-size: 18px;
  color: var(--black); background: var(--hi);
  border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  padding: 6px 10px;
  box-shadow: var(--boxshadow);
  border-radius: 0;
  cursor: url("/assets/cursors/hand.png") 10 0, pointer;
}
.field input[type="text"], .field input[type="password"], .field input[type="number"],
.field input[type="date"], .field input[type="time"], .field textarea {
  font-family: var(--mono); font-size: 18px;
  color: var(--black); background: var(--hi);
  border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  padding: 6px 10px;
  box-shadow: var(--boxshadow);
}
.field input:focus, .field textarea:focus { outline: 1px dotted var(--black); outline-offset: -4px; }
.field textarea { resize: vertical; min-height: 74px; }
.qr-uses input[type="number"] {
  font-family: var(--mono); font-size: 18px;
  background: var(--hi); border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  padding: 4px 8px;
  box-shadow: var(--boxshadow);
}

.admin-main { max-width: 1060px; margin: 24px auto 0; padding: 0 18px; display: grid; gap: 26px; }
.admin-grid { display: grid; grid-template-columns: 400px 1fr; gap: 26px; align-items: stretch; }
/* tracks_on_disk matches the upload panel's height and scrolls internally:
   height:0 keeps it from influencing the row height (the upload box decides),
   min-height:100% stretches it back to that height */
#tracks-panel { display: flex; flex-direction: column; height: 0; min-height: 100%; }
#tracks-panel > .inner { flex: 1; min-height: 0; overflow-y: auto; }
.works-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; align-items: end;
}
.admin-panel .inner { padding: 16px; display: flex; flex-direction: column; gap: 14px; }

.dropzone {
  background: var(--hi);
  border: 2px solid;
  border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  padding: 18px 12px; text-align: center;
  color: var(--black); font-size: 16px;
  overflow-wrap: anywhere;
  box-shadow: var(--boxshadow);
}
.dropzone:hover, .dropzone.drag { color: var(--navy); }
.dropzone.has-file { color: var(--navy); font-weight: 400; }
.dropzone .admin-note { color: var(--pink); }

.upload-progress {
  height: 16px; background: var(--hi);
  border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  position: relative; display: none;
}
.upload-progress b { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--navy); transition: width .2s; }

.atable { width: 100%; border-collapse: collapse; font-size: 16px; background: var(--hi);
  border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  box-shadow: var(--boxshadow); }
.atable th {
  text-align: left; font-size: 14px; text-transform: uppercase;
  color: var(--hi); background: var(--bar); font-weight: 400;
  padding: 5px 10px;
}
.atable td { padding: 7px 10px; border-bottom: 1px solid var(--grey); vertical-align: middle; }
.atable td.t-title { color: var(--black); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atable td.t-artist { color: var(--pink); }
.atable td.t-num { color: var(--pink); font-size: 14px; }
.atable .rowbtns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.abtn {
  font-family: var(--mono); font-size: 14px;
  background: var(--grey); color: var(--black);
  border: 2px solid;
  border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  padding: 3px 8px; white-space: nowrap;
}
.abtn:active { border-color: var(--lo) var(--hi) var(--hi) var(--lo); transform: translate(1px, 1px); }
.abtn:hover { color: var(--navy); }
.abtn.warn:hover { color: var(--red); }
.abtn.confirm { color: var(--red); animation: blink 0.6s steps(2) infinite; }

.toast {
  position: fixed; left: calc(var(--rail) + 14px); bottom: 18px; z-index: 300;
  font-size: 16px; padding: 8px 14px;
  background: var(--grey); color: var(--black);
  border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi);
  box-shadow: 3px 3px 0 var(--black);
  max-width: min(480px, calc(100vw - 36px));
  overflow-wrap: anywhere;
}
.toast.err { color: var(--red); }
.toast.hidden { display: none; }

/* modal */
.modal-veil {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.modal-veil.hidden { display: none; }
.modal { width: 100%; max-width: 540px; max-height: 88vh; overflow: auto; }
.modal .inner { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.qr-uses { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 16px; color: var(--black); }
.qr-uses label { display: flex; gap: 6px; align-items: center; }
.qr-uses input[type="number"] { width: 90px; }
.qr-result { text-align: center; display: none; flex-direction: column; gap: 10px; align-items: center; }
.qr-result img {
  width: 220px; height: 220px; image-rendering: pixelated;
  background: var(--hi); padding: 8px;
  border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo);
}
.qr-url { font-size: 14px; color: var(--navy); overflow-wrap: anywhere; }
.qr-list { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.qr-list .qrow {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  background: var(--hi);
  border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo);
  padding: 6px 10px; flex-wrap: wrap;
  box-shadow: var(--boxshadow);
}
.qr-list .qrow code { color: var(--black); overflow-wrap: anywhere; }
.qr-list .uses { color: var(--navy); white-space: nowrap; }

.admin-note { font-size: 14px; color: var(--pink); }
.admin-note b { color: var(--black); font-weight: 400; }

/* ── responsive ─────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .lib-layout { grid-template-columns: 1fr; }
  /* phones: the photo frame hides, but upcoming gigs are content — keep them */
  .aside .polaroid { display: none; }
  .admin-grid { grid-template-columns: 1fr; }
  #tracks-panel { height: auto; min-height: 0; }
  #tracks-panel > .inner { overflow-y: visible; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-art { max-width: 420px; }
  .hero { margin: 14px 12px 0; }
  .masthead { margin: 18px 12px 0; }
}

@media (max-width: 620px) {
  :root { --rail: 14px; }
  body { font-size: 17px; padding-bottom: calc(var(--player-h) + 34px); }
  .hero { height: clamp(200px, 34vh, 320px); }
  .hero-title { font-size: clamp(28px, 8vw, 40px); }
  /* compact phone rows: [ play | title+artist | length | ↓ ] */
  .row { grid-template-columns: 50px minmax(0, 1fr) auto 30px; gap: 8px; padding: 9px 6px; }
  .row-num, .rel-thumb { display: none; }
  .row-dur { display: block; font-size: 13px; }
  .row-dl { font-size: 19px; }
  .dl-word { display: none; }
  .dl-icon { display: inline; }
  .row-play { width: 48px; padding: 6px 0; font-size: 14px; }
  body { overflow-x: hidden; }
  .p-seek { gap: 8px; }
  .pbtn { width: 52px; height: 46px; }
  .chrome-bar { padding: 8px 12px; gap: 8px; }
  .chrome-dots { display: none; }
  .menubar-inner { gap: 13px; font-size: 15px; padding: 5px 12px; }
  .foot { flex-direction: column; }
  .atable th:nth-child(1), .atable td.t-num { display: none; }
  .atable td.t-title { max-width: 130px; }
}
