/* OrlaCast — a 1950s valve radio: cream bakelite, walnut cabinet, brass trim, a warm lit dial. */
:root {
  --bg: #EFE4CC;          /* cream bakelite */
  --bg2: #F8F1E1;         /* card */
  --bg3: #E3D5B8;         /* muted surface */
  --fg: #2B1A10;          /* walnut ink */
  --fg2: #6A5240;
  --fg3: #93806A;
  --line: #D9C8A7;
  --walnut: #4A2A16; --walnut2: #6B3F22; --walnut3: #2B170C; --on-walnut: #F3E7CF; --on-walnut2: #C9B394;
  --brass: #C9A24D; --brass2: #E9CB7A; --brass3: #8E6E25; --brass-text: #86651A; --on-brass: #2B1A10;
  --dial: #F4DE98; --dial2: #E6C25E; --dial-ink: #3A2A12; --dial-ink2: #6E5526; --needle: #C0392B;
  --moss: #5F7D47; --moss-soft: #E4EBD6;
  --danger: #B23A3A; --danger-soft: #F4E0DD;
  --radius: 16px; --radius-sm: 10px; --nav-h: 60px; --mini-h: 68px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --shadow: 0 1px 2px rgba(43,26,16,.07), 0 6px 18px rgba(43,26,16,.09);
  --shadow-lg: 0 12px 32px rgba(43,26,16,.32);
  --font-display: "Bodoni Moda", "Didot", Georgia, serif;
  --font-body: "Jost", "Futura", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --t: 200ms cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E130C; --bg2: #2A1B12; --bg3: #3A2718; --fg: #F1E6D2; --fg2: #CDB89C; --fg3: #937F68; --line: #43301F;
    --brass-text: #E9CB7A; --moss-soft: #2C3A24; --danger-soft: #4A2424;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E130C; --bg2: #2A1B12; --bg3: #3A2718; --fg: #F1E6D2; --fg2: #CDB89C; --fg3: #937F68; --line: #43301F;
  --brass-text: #E9CB7A; --moss-soft: #2C3A24; --danger-soft: #4A2424;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.35); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font: 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; overscroll-behavior-y: contain; touch-action: manipulation;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
input, select, textarea {
  font: inherit; color: var(--fg); background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; width: 100%; min-height: 46px; transition: border-color var(--t), box-shadow var(--t);
}
input:focus, select:focus { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(201,162,77,.22); outline: none; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--walnut2); }
h1, h2, h3 { font-weight: 600; letter-spacing: .01em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
[hidden] { display: none !important; }
.ico { display: inline-block; vertical-align: middle; flex: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ----- brass plate (wordmark) ----- */
.plate, #topbar h1.brand {
  display: inline-block; font-family: var(--font-display); font-style: italic; font-weight: 600; letter-spacing: .04em; color: var(--on-brass);
  background: linear-gradient(180deg, var(--brass2), var(--brass) 55%, var(--brass3)); border-radius: 6px; padding: 1px 14px; line-height: 1.45;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 2px rgba(0,0,0,.35); text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

/* ----- top bar ----- */
#topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px;
  padding: calc(8px + var(--sat)) 12px 8px; min-height: 56px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
#topbar h1 { font-size: 20px; margin: 0 0 0 4px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; letter-spacing: .02em; }
#topbar h1.brand { flex: 0 0 auto; font-size: 22px; margin-right: auto; }
#topbar-actions { display: flex; gap: 2px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg2); transition: background var(--t), color var(--t), transform var(--t);
}
.icon-btn:active { background: var(--bg3); color: var(--fg); transform: scale(.94); }
.icon-btn.spin .ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#view { padding: 14px 16px calc(var(--nav-h) + var(--mini-h) + var(--sab) + 28px); max-width: 760px; margin: 0 auto; }
@media (min-width: 768px) { #view { padding-left: 24px; padding-right: 24px; } }

/* ----- bottom nav: the cabinet base ----- */
#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex;
  height: calc(var(--nav-h) + var(--sab)); padding-bottom: var(--sab);
  background: linear-gradient(180deg, var(--walnut), var(--walnut3)); color: var(--on-walnut2);
  box-shadow: 0 -2px 0 var(--brass3), 0 -3px 0 var(--brass2);
}
#nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; gap: 3px; letter-spacing: .04em; text-transform: uppercase; transition: color var(--t); position: relative; }
#nav a.active { color: var(--brass2); }
#nav a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; background: var(--brass2); border-radius: 0 0 3px 3px; }

/* ----- mini player: a small set on the shelf ----- */
#mini {
  position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav-h) + var(--sab) + 8px); z-index: 6;
  height: var(--mini-h); background: linear-gradient(180deg, var(--walnut2), var(--walnut) 60%, var(--walnut3)); color: var(--on-walnut);
  border-radius: 14px; display: flex; align-items: center; gap: 8px; padding: 0 8px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.12); border: 1px solid var(--brass3); max-width: 740px; margin: 0 auto;
}
#mini .art { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--walnut3); flex: none; border: 2px solid var(--brass); cursor: pointer; }
#mini .mdisplay {
  flex: 1; min-width: 0; cursor: pointer; height: 50px; border-radius: 6px; padding: 5px 10px 0; position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--dial), var(--dial2)); color: var(--dial-ink);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.35), 0 0 16px rgba(244,222,152,.25);
}
#mini .t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
#mini .s { font-size: 10px; color: var(--dial-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: .1em; }
#mini .bar { position: absolute; left: 10px; right: 10px; bottom: 6px; height: 4px; background: repeating-linear-gradient(90deg, var(--dial-ink2) 0 1px, transparent 1px 8px); opacity: .9; }
#mini .bar i { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--needle); left: 0; box-shadow: 0 0 3px rgba(192,57,43,.6); }
#mini .mbtn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--on-brass);
  background: radial-gradient(circle at 35% 30%, var(--brass2), var(--brass) 55%, var(--brass3)); box-shadow: inset 0 -2px 3px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.45); transition: transform var(--t); }
#mini .mbtn:active { transform: scale(.92); }
#mini .mbtn.main { width: 46px; height: 46px; }

/* ----- lists & cards ----- */
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--fg3); margin: 22px 0 10px; font-weight: 600; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); min-height: 60px; transition: background var(--t); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; font-size: 17px; }
.row .sub { font-size: 13px; color: var(--fg2); }
.row .count { font-size: 12px; font-weight: 700; color: var(--on-brass); background: linear-gradient(180deg, var(--brass2), var(--brass)); border-radius: 999px; padding: 3px 10px; min-width: 32px; text-align: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.row .count.zero { background: var(--bg3); color: var(--fg3); box-shadow: none; }
.row .chev { color: var(--fg3); }
.row .dot { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--brass2), var(--brass3)); box-shadow: 0 1px 2px rgba(0,0,0,.4); flex: none; }
a.row:active { background: var(--bg3); }

.ep { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.ep:last-child { border-bottom: 0; }
.ep .art { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--bg3); border: 2px solid var(--brass); }
.ep .main { min-width: 0; cursor: pointer; }
.ep .show { font-size: 11px; color: var(--brass-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.ep .t { font-weight: 500; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 1px; }
.ep .meta { font-size: 12px; color: var(--fg2); margin-top: 3px; font-variant-numeric: tabular-nums; }
.ep.played .t, .ep.played .meta, .ep.played .show { color: var(--fg3); }
.ep .btns { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.ep .prog { height: 3px; background: var(--line); border-radius: 2px; margin-top: 7px; overflow: hidden; max-width: 180px; }
.ep .prog i { display: block; height: 100%; background: var(--needle); }
.play-btn {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--on-brass);
  background: radial-gradient(circle at 35% 30%, var(--brass2), var(--brass) 55%, var(--brass3));
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.3), 0 2px 5px rgba(0,0,0,.35); transition: transform var(--t), filter var(--t);
}
.play-btn:active { transform: scale(.94); filter: brightness(.95); }
.play-btn.now { background: var(--walnut); color: var(--brass2); box-shadow: inset 0 2px 4px rgba(0,0,0,.5); }
.small-btn { width: 40px; height: 36px; border-radius: 8px; color: var(--fg3); display: inline-flex; align-items: center; justify-content: center; transition: background var(--t); }
.small-btn:active { background: var(--bg3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; min-height: 44px;
  border-radius: 999px; background: var(--bg3); color: var(--fg); font-weight: 500; border: 1px solid var(--line);
  transition: transform var(--t), filter var(--t), background var(--t);
}
.btn.primary { background: linear-gradient(180deg, var(--walnut2), var(--walnut)); border-color: var(--walnut3); color: var(--on-walnut); }
.btn.gold { background: linear-gradient(180deg, var(--brass2), var(--brass) 60%, var(--brass3)); border-color: transparent; color: var(--on-brass); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.btn.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.btn.sm { padding: 7px 14px; font-size: 13px; min-height: 38px; }
.btn:active { transform: scale(.97); filter: brightness(.96); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; align-items: center; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px; }
.tile { display: block; position: relative; transition: transform var(--t); }
.tile:active { transform: scale(.97); }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; background: var(--bg3); display: block; border: 3px solid var(--brass); box-shadow: var(--shadow); }
.tile .t { font-size: 12px; margin-top: 7px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; text-align: center; }
.tile .n { position: absolute; top: 2px; right: 4px; background: var(--needle); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 7px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

.show-head { display: flex; gap: 16px; align-items: flex-start; }
.show-head img { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; background: var(--bg3); flex: none; border: 3px solid var(--brass); box-shadow: var(--shadow); }
.show-head h2 { margin: 0 0 4px; font-size: 21px; line-height: 1.2; }
.show-head .sub { color: var(--fg2); font-size: 14px; }
.desc { color: var(--fg2); font-size: 14px; white-space: pre-line; line-height: 1.55; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.desc a { color: var(--brass-text); text-decoration: underline; }
.seg { display: inline-flex; background: var(--bg3); border-radius: 999px; padding: 3px; }
.seg button { padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--fg2); font-weight: 500; min-height: 36px; transition: background var(--t), color var(--t); }
.seg button.on { background: var(--walnut); color: var(--on-walnut); }
.field { margin: 16px 0; }
.field label { display: block; font-size: 13px; color: var(--fg2); margin-bottom: 6px; font-weight: 500; }
.field .help { font-size: 12px; color: var(--fg3); margin-top: 6px; }
.check { display: flex; align-items: center; gap: 12px; padding: 10px 0; min-height: 44px; cursor: pointer; }
.empty { text-align: center; color: var(--fg3); padding: 48px 20px; }
.empty .ico { color: var(--brass); margin-bottom: 10px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 3px 9px; background: var(--bg3); color: var(--fg2); text-transform: uppercase; letter-spacing: .06em; }
.pill.follow { background: var(--moss-soft); color: var(--moss); }
.search { margin: 10px 0; }
.err { color: var(--danger); font-size: 13px; }
.muted { color: var(--fg3); font-size: 13px; }
.searchbox { position: relative; }
.searchbox .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--fg3); }
.searchbox input { padding-left: 44px; }
.result { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.result:last-child { border-bottom: 0; }
.result img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--bg3); border: 2px solid var(--brass); }
.result .t { font-weight: 600; font-size: 15px; line-height: 1.3; }
.result .sub { font-size: 12px; color: var(--fg2); margin: 2px 0 8px; }
.result .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== the radio (full player) ===== */
#sheet {
  position: fixed; inset: 0; z-index: 20; overflow-y: auto; padding: calc(10px + var(--sat)) 12px calc(20px + var(--sab));
  background: radial-gradient(130% 80% at 50% 0, #6B3F22 0%, #3A2010 55%, #24140A 100%); color: var(--on-walnut);
}
#sheet::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .18;
  background: repeating-linear-gradient(100deg, rgba(0,0,0,0) 0 7px, rgba(0,0,0,.35) 7px 9px, rgba(255,255,255,.04) 9px 13px); }
.radio {
  position: relative; max-width: 560px; margin: 0 auto; border-radius: 28px; padding: 14px 16px 20px;
  background: linear-gradient(180deg, #F7EDD5, #E9D9B7 70%, #DFCCA6); color: #2B1A10;
  border: 3px solid var(--brass); box-shadow: inset 0 2px 0 rgba(255,255,255,.7), inset 0 -6px 12px rgba(90,60,20,.18), 0 24px 50px rgba(0,0,0,.55);
}
.radio .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.radio .head .icon-btn { color: #6A5240; }
.radio .head .icon-btn:active { background: rgba(0,0,0,.08); }
.radio .plate { font-size: 17px; }

.dial {
  border-radius: 12px; padding: 12px 14px 10px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--dial) 0%, var(--dial2) 100%); color: var(--dial-ink);
  box-shadow: inset 0 3px 10px rgba(60,40,10,.45), inset 0 0 0 2px rgba(255,250,220,.35), 0 0 22px rgba(244,222,152,.35);
  border: 2px solid var(--brass3);
}
.dial::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 35%); }
.dial .station { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--dial-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dial .freq { font-size: 16px; font-weight: 600; line-height: 1.3; margin: 3px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.scale { position: relative; height: 44px; padding-top: 4px; }
.scale .ticks { position: absolute; left: 0; right: 0; top: 4px; height: 18px;
  background: repeating-linear-gradient(90deg, var(--dial-ink2) 0 1px, transparent 1px 10%), repeating-linear-gradient(90deg, var(--dial-ink2) 0 1px, transparent 1px 2.5%);
  background-size: 100% 18px, 100% 9px; background-repeat: no-repeat; background-position: 0 0, 0 9px; opacity: .8; }
.scale .marks { position: absolute; left: 0; right: 0; top: 24px; display: flex; justify-content: space-between; font-size: 10px; font-weight: 600; color: var(--dial-ink2); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.scale .marks span { width: 0; display: flex; justify-content: center; white-space: nowrap; }
.scale .marks span:first-child { justify-content: flex-start; } .scale .marks span:last-child { justify-content: flex-end; }
.scale input[type="range"] { -webkit-appearance: none; appearance: none; position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 44px; background: transparent; padding: 0; border: 0; min-height: 0; margin: 0; cursor: pointer; }
.scale input[type="range"]::-webkit-slider-runnable-track { height: 44px; background: transparent; }
.scale input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 4px; height: 36px; margin-top: 2px; border-radius: 2px; background: var(--needle); box-shadow: 0 0 0 1px rgba(255,255,255,.4), 0 0 6px rgba(192,57,43,.6); }
.scale input[type="range"]::-moz-range-track { height: 44px; background: transparent; }
.scale input[type="range"]::-moz-range-thumb { width: 4px; height: 36px; border: 0; border-radius: 2px; background: var(--needle); box-shadow: 0 0 6px rgba(192,57,43,.6); }
.dial .readout { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--dial-ink); margin-top: 2px; }
.dial .readout .mode { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dial-ink2); }

.midrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 6px; }
.grille { position: relative; width: 132px; height: 132px; border-radius: 50%; flex: none; overflow: hidden; border: 4px solid var(--brass); background: var(--walnut3);
  box-shadow: inset 0 0 18px rgba(0,0,0,.7), 0 3px 8px rgba(0,0,0,.35); }
.grille img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; }
.grille::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, transparent 1.2px, rgba(30,18,8,.5) 1.8px); background-size: 6px 6px; }
.knobs { display: flex; gap: 18px; justify-content: flex-end; flex: 1; }
.knobwrap, .keys, .extras { user-select: none; -webkit-user-select: none; }
.knobwrap { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 76px; }
.knob {
  --rot: 0deg; width: 72px; height: 72px; border-radius: 50%; position: relative; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  background: repeating-conic-gradient(from 0deg, #A98A58 0 5deg, #E3C98E 5deg 10deg);
  box-shadow: 0 5px 10px rgba(0,0,0,.45), inset 0 -3px 5px rgba(0,0,0,.35); transform: rotate(var(--rot)); transition: box-shadow var(--t);
}
.knob::before { content: ""; position: absolute; inset: 9px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #FBF0D4, #D8B978 55%, #9D7A3E); box-shadow: inset 0 -3px 6px rgba(0,0,0,.35), inset 0 2px 2px rgba(255,255,255,.6); }
.knob::after { content: ""; position: absolute; top: 12px; left: 50%; width: 5px; height: 18px; margin-left: -2.5px; border-radius: 3px; background: var(--walnut3); box-shadow: 0 1px 1px rgba(255,255,255,.4); }
.knob.grab, .knob:active { cursor: grabbing; box-shadow: 0 3px 6px rgba(0,0,0,.45), inset 0 -3px 5px rgba(0,0,0,.35); }
.knob:focus-visible { outline: 3px solid var(--brass3); outline-offset: 3px; }
.klabel { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #6A5240; }
.kval { font-size: 12px; color: #93806A; font-variant-numeric: tabular-nums; }

.keys { display: flex; justify-content: center; gap: 6px; margin: 14px 0 4px; }
.keywrap { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; max-width: 72px; }
.keywrap span { font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6A5240; white-space: nowrap; }
.key {
  position: relative; width: 100%; height: 56px; min-width: 44px; border-radius: 7px 7px 9px 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--walnut3);
  background: linear-gradient(180deg, #FCF5E6, #E8D9BA); border: 1px solid #C9B88F;
  box-shadow: 0 4px 0 #A58A5E, 0 6px 8px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.8); transition: transform 80ms ease-out, box-shadow 80ms ease-out;
}
.key:active, .key.down { transform: translateY(3px); box-shadow: 0 1px 0 #A58A5E, 0 2px 3px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.8); }
.key.main { background: linear-gradient(180deg, var(--brass2), var(--brass) 60%, var(--brass3)); border-color: var(--brass3); box-shadow: 0 4px 0 #6E5420, 0 6px 8px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.6); }
.key.main:active, .key.main.down { box-shadow: 0 1px 0 #6E5420, 0 2px 3px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.6); }
.key.red { color: var(--needle); }
.key .n { position: absolute; font-size: 10px; font-weight: 800; margin-top: 1px; }
.extras { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.extras .btn { background: #E3D5B8; color: #2B1A10; border-color: #CBB88E; }
.extras .btn.on { background: var(--walnut); color: var(--on-walnut); border-color: transparent; }
.radio .idx { text-align: center; font-size: 11px; color: #93806A; letter-spacing: .1em; text-transform: uppercase; margin-top: 10px; }
.radio .notes { margin-top: 20px; }
.radio .notes h3 { font-size: 11px; color: #93806A; text-transform: uppercase; letter-spacing: .16em; margin: 0 0 6px; }
.radio .notes .desc { color: #6A5240; }
@media (max-width: 380px) { .grille { width: 108px; height: 108px; } .knob { width: 64px; height: 64px; } .knobs { gap: 10px; } .keys { gap: 4px; } }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--mini-h) + var(--sab) + 22px); z-index: 30;
  background: var(--walnut3); color: var(--on-walnut); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); max-width: 90vw; border: 1px solid var(--brass3); }

.progress-import { padding: 28px 20px; text-align: center; }
.progress-import .ico { color: var(--brass); }
.progress-import .bar { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; margin: 16px 0; }
.progress-import .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass2), var(--brass)); transition: width .3s; }

.menu { position: fixed; inset: 0; z-index: 25; background: rgba(21,12,8,.55); display: flex; align-items: flex-end; justify-content: center; }
.menu .panel { background: var(--bg2); border-radius: 20px 20px 0 0; width: 100%; max-width: 760px; padding: 8px 8px calc(16px + var(--sab)); box-shadow: var(--shadow-lg); border-top: 3px solid var(--brass); animation: up 220ms cubic-bezier(.2,.7,.2,1); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu .panel button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; min-height: 48px; font-size: 16px; border-radius: 12px; transition: background var(--t); }
.menu .panel button:active { background: var(--bg3); }
.menu .panel .hd { padding: 10px 16px 6px; font-size: 13px; color: var(--fg3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu .panel .cancel { justify-content: center; color: var(--fg3); }

/* ----- tags & toast action ----- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 6px 4px 10px; background: var(--moss-soft); color: var(--moss); text-transform: capitalize; }
.chip button { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: inherit; }
.chip button:active { background: rgba(0,0,0,.1); }
.tagform { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 200px; }
.tagform input { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.toast-act { margin-left: 14px; color: var(--brass2); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; padding: 4px 2px; }
.keys.presets .keywrap { max-width: 96px; }
.keys.presets .keywrap span { white-space: normal; text-align: center; line-height: 1.2; }
.dlprog { display: inline-flex; align-items: center; gap: 10px; min-width: 160px; height: 38px; position: relative; padding: 0 12px; border-radius: 999px; background: var(--bg3); overflow: hidden; font-size: 13px; font-variant-numeric: tabular-nums; }
.dlprog i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--brass2), var(--brass)); opacity: .55; transition: width .25s; }
.dlprog span { position: relative; }

/* ----- Patreon list ----- */
.steps { margin: 6px 0 4px; padding-left: 20px; color: var(--fg2); font-size: 14px; line-height: 1.5; }
.steps li { margin: 6px 0; }
.steps b { color: var(--fg); font-weight: 600; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; margin: 4px 0 10px; }
.pgrid .tile .t { font-size: 11px; }
.tile .addart { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; border-radius: 50%; border: 3px dashed var(--brass); color: var(--brass-text); background: var(--bg2); }
.pill.patreon { background: var(--danger-soft); color: var(--danger); vertical-align: middle; }

/* ===== textures: paper grain, grille cloth, brass label plates ===== */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] body::before { opacity: .7; mix-blend-mode: screen; filter: invert(1) sepia(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { opacity: .7; mix-blend-mode: screen; filter: invert(1) sepia(1); } }
#view { position: relative; z-index: 1; }
#mini { background:
  repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, rgba(0,0,0,0) 1px 3px),
  repeating-linear-gradient(90deg, rgba(255,226,170,.08) 0 1px, rgba(0,0,0,0) 1px 3px),
  linear-gradient(180deg, var(--walnut2), var(--walnut) 60%, var(--walnut3)); }
.section-title { display: flex; width: fit-content; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .16em; color: var(--on-brass);
  padding: 3px 10px; border-radius: 4px; background: linear-gradient(180deg, var(--brass2), var(--brass) 55%, var(--brass3));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(0,0,0,.18), 0 1px 2px rgba(0,0,0,.3); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.section-title::before, .section-title::after { content: ""; width: 5px; height: 5px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.75) 0 25%, var(--brass3) 70%); box-shadow: inset 0 0 0 .6px rgba(0,0,0,.45); }

/* ===== illustrated empty pages ===== */
.empty.illustrated { padding: 34px 20px 40px; color: var(--fg2); }
.illo { color: var(--brass-text); display: block; margin: 0 auto 12px; overflow: visible; }
.illo .fill { fill: var(--bg2); }
.illo .glow { fill: var(--dial); }
.empty.illustrated .say { max-width: 300px; margin: 0 auto; font-size: 15px; line-height: 1.45; }
.empty.illustrated .err-detail { margin-top: 10px; font-size: 12px; }

/* ===== the Inbox as a programme listing ===== */
.listing { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2px 14px 8px; }
.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-bottom: 3px double var(--fg2); padding: 12px 0 8px;
  font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--fg3); }
.masthead b { font-family: var(--font-display); font-style: italic; font-size: 21px; letter-spacing: .01em; text-transform: none; color: var(--fg); font-weight: 600; white-space: nowrap; }
.lday { font-family: var(--font-display); font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin: 18px 0 2px; padding-bottom: 4px; border-bottom: 1px solid var(--fg3); color: var(--fg); }
.lrow { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; padding: 11px 0; border-bottom: 1px dotted var(--line); align-items: start; }
.lgroup .lrow:last-child { border-bottom: 0; }
.ltime { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.lmain { cursor: pointer; min-width: 0; }
.lshow { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltitle { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.25; margin: 2px 0 3px; }
.ldesc { font-size: 13px; color: var(--fg2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lmeta { font-size: 11px; color: var(--fg3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.lrow.played .ltime, .lrow.played .ltitle, .lrow.played .ldesc, .lrow.played .lshow { color: var(--fg3); }
.lrow .btns { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.lday + .card { margin-bottom: 4px; }

/* ===== stations on the dial ===== */
.stations { position: relative; height: 19px; margin: 0 0 1px; }
.stations span { position: absolute; top: 0; transform: translateX(-50%); max-width: calc(100% / var(--n, 5) - 6px); font-size: 9px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--dial-ink2); opacity: .62; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .8s, color .8s; }
.stations span.on { opacity: 1; color: var(--dial-ink); text-shadow: 0 0 6px rgba(255,244,200,.95); }
.stations .pointer { position: absolute; top: 13px; width: 0; height: 0; margin-left: -5px; border: 5px solid transparent; border-top: 6px solid var(--needle); border-bottom: 0;
  filter: drop-shadow(0 0 2px rgba(192,57,43,.5)); transition: left 1.5s cubic-bezier(.45,.05,.2,1); }

/* ===== the magic eye (a green tuning valve) ===== */
@property --open { syntax: '<angle>'; inherits: false; initial-value: 130deg; }
.radio .head .hmid { display: inline-flex; align-items: center; gap: 10px; }
.eye { --open: 130deg; width: 26px; height: 26px; border-radius: 50%; flex: none; border: 2px solid var(--brass3);
  background: radial-gradient(circle, #0E1F11 0 19%, transparent 20%),
    conic-gradient(from calc(var(--open) / -2), rgba(6,16,8,.96) 0 var(--open), transparent var(--open)),
    radial-gradient(circle, #CCFFD5 0 22%, #5BE07F 52%, #1D7A38 100%);
  box-shadow: inset 0 0 5px rgba(0,0,0,.7); filter: brightness(.3) saturate(.35); transition: --open 1.2s ease, filter 1.2s ease, box-shadow 1.2s ease; }
.eye[data-state="paused"] { --open: 72deg; filter: brightness(.7) saturate(.75); }
.eye[data-state="on"] { --open: 8deg; filter: none; box-shadow: inset 0 0 5px rgba(0,0,0,.6), 0 0 12px rgba(91,224,127,.6); }
.eye[data-state="tuning"] { filter: none; animation: eyeflick .8s ease-in-out infinite alternate; }
@keyframes eyeflick { 0% { --open: 110deg; filter: brightness(.75); } 35% { --open: 42deg; } 65% { --open: 84deg; filter: brightness(1.1); } 100% { --open: 28deg; filter: brightness(.95); } }

/* ===== valves warming: the dial lamps fade up ===== */
.warming { animation: warmup 2.6s cubic-bezier(.3,.1,.3,1) both; }
@keyframes warmup { 0% { filter: brightness(.3) saturate(.3) sepia(.5); } 45% { filter: brightness(.72) saturate(.8) sepia(.15); } 100% { filter: none; } }

/* ===== start-up splash: the dial glowing in the cabinet ===== */
#boot { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 80% at 50% 35%, #6B3F22, #3A2010 55%, #1E110A); transition: opacity .5s ease; animation: bootout .5s 6s forwards; }
#boot.gone { opacity: 0; pointer-events: none; }
@keyframes bootout { to { opacity: 0; visibility: hidden; } }
#boot .bdial { width: min(72vw, 300px); padding: 20px 18px 14px; border-radius: 14px; border: 2px solid var(--brass3); text-align: center;
  background: linear-gradient(180deg, var(--dial), var(--dial2)); box-shadow: inset 0 3px 10px rgba(60,40,10,.45), 0 0 46px rgba(244,222,152,.5); animation: warmup 1.4s cubic-bezier(.3,.1,.3,1) both; }
#boot .plate { font-size: 26px; }
#boot .btick { position: relative; height: 16px; margin-top: 16px; opacity: .75;
  background: repeating-linear-gradient(90deg, var(--dial-ink2) 0 1px, transparent 1px 10%), repeating-linear-gradient(90deg, var(--dial-ink2) 0 1px, transparent 1px 2.5%);
  background-size: 100% 16px, 100% 8px; background-repeat: no-repeat; background-position: 0 0, 0 8px; }
#boot .btick::after { content: ""; position: absolute; left: 38%; top: -6px; bottom: -4px; width: 3px; border-radius: 2px; background: var(--needle); box-shadow: 0 0 6px rgba(192,57,43,.6); }
@media (max-width: 440px) { .stations span { font-size: 8.5px; letter-spacing: .05em; } }

/* ===== Playlists page: a greeting, station cards with lit count windows, luggage-label tags ===== */
.greet { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px 0 4px; }
.greet span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg3); }
.greet b { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 26px; line-height: 1.15; color: var(--fg); }
.pgrid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 620px) { .pgrid2 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pcard { position: relative; display: flex; flex-direction: column; min-height: 168px; padding: 10px 12px 12px; border-radius: 18px;
  background: linear-gradient(180deg, #FBF3DF, #EFE0BF 75%, #E4D0A6); color: #2B1A10; border: 2px solid var(--brass);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.75), inset 0 -4px 8px rgba(90,60,20,.14), var(--shadow); transition: transform var(--t); }
.pcard:active { transform: scale(.98); }
.pwin { display: flex; align-items: baseline; justify-content: center; gap: 6px; height: 50px; border-radius: 9px; padding-top: 6px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--dial), var(--dial2)); color: var(--dial-ink); border: 2px solid var(--brass3);
  box-shadow: inset 0 2px 7px rgba(60,40,10,.45), 0 0 14px rgba(244,222,152,.35); }
.pwin::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 4px; height: 8px; opacity: .55;
  background: repeating-linear-gradient(90deg, var(--dial-ink2) 0 1px, transparent 1px 12.5%), repeating-linear-gradient(90deg, var(--dial-ink2) 0 1px, transparent 1px 4.166%);
  background-size: 100% 8px, 100% 4px; background-repeat: no-repeat; background-position: 0 0, 0 4px; }
.pwin b { font-family: var(--font-display); font-size: 26px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.pwin span { font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dial-ink2); }
.pwin.off { filter: brightness(.8) saturate(.35); box-shadow: inset 0 2px 7px rgba(60,40,10,.5); }
.pname { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.15; margin: 10px 44px 3px 0; }
.psub { font-size: 12px; color: #6A5240; line-height: 1.35; margin-right: 40px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .pplay { position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; }
.pcard.new { align-items: center; justify-content: center; text-align: center; border-style: dashed; background: var(--bg2); color: var(--fg); }
.pcard.new .addart { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--brass); color: var(--brass-text); }
.pcard.new .pname { margin: 8px 0 2px; } .pcard.new .psub { margin: 0; color: var(--fg3); }
.ltags { display: flex; flex-wrap: wrap; gap: 12px 10px; padding: 4px 0 2px 10px; }
.ltag { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px 6px 30px; color: #3A2410;
  background: linear-gradient(180deg, #F0DDAE, #E2C688); clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); transform: rotate(-1.5deg); transition: transform var(--t); filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.ltag:nth-child(2n) { transform: rotate(1.2deg); }
.ltag:active { transform: scale(.97); }
.ltag .hole { position: absolute; left: 14px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0,0,0,.45), 0 0 0 2px #C9A24D; }
.ltag .tn { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 16px; text-transform: capitalize; }
.ltag .tc { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: rgba(58,36,16,.12); font-variant-numeric: tabular-nums; }

/* ===== small additions ===== */
#mini .mbtn.full { width: 36px; height: 36px; }
.btn.sm.on { background: var(--walnut); color: var(--on-walnut); border-color: transparent; }
#topbar h1.brand { cursor: pointer; }
a.plate { color: var(--on-brass); }
#nav a { text-align: center; line-height: 1.1; padding: 0 2px; }
@media (max-width: 440px) { #nav a { font-size: 10px; letter-spacing: .02em; } }
