/* The tuner home page's own parts, ported from the prototype
   (docs/superpowers/prototypes/phase-5/tuner.html). The cabinet, plates,
   keys, slots and lamp come from receiver.css. */
:root {
  --glass-hot: #ffe2a0; --glass-edge: #c78a2f; --glass-ink: #3a2410;
  --window: #0b0b0c; --window-ink: #f4f1ea;
}

/* ---- Module headings ---- */
.step { margin: 0; font-family: var(--cond); font-weight: 700; font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--engrave); text-shadow: 0 1px 0 rgba(255,255,255,.7); display: flex; align-items: center; gap: 8px; }
.step .num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--engrave); color: var(--alu-1); font-size: 13px; letter-spacing: 0; text-shadow: none; box-shadow: 0 1px 0 rgba(255,255,255,.7); }
.face.module > .step, .face.module > .band-step > .step { font-size: 19px; padding: 0 0 12px 0; margin: 0 4px 2px; border-bottom: 2px solid transparent;
  border-image: linear-gradient(180deg, rgba(0,0,0,.22) 50%, rgba(255,255,255,.75) 50%) 1; }
.face.module .step .num { width: 30px; height: 30px; font-size: 17px; }
.engraved { color: var(--engrave); text-shadow: 0 1px 0 rgba(255,255,255,.65); }
.tiny { font-family: var(--cond); font-weight: 600; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--engrave-soft); text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.key.save-key { padding: 12px 18px; font-size: 15px; min-width: 104px; }
.key.save-key.saved { color: #9c1f14; }
.key.red[aria-disabled=true] { background: linear-gradient(180deg, #d9dadc, #c3c5c9); color: #8b8e94; text-shadow: 0 1px 0 #fff; border-color: #9a9da3; box-shadow: 0 3px 0 #8d9095, inset 0 1px 0 #fff; cursor: not-allowed; }

/* ---- ① Your bands ---- */
.band-step { display: flex; flex-direction: column; gap: 10px; }
/* Search results: a plain, fast list with a small cover per band. */
.results { list-style: none; margin: -2px 0 0; padding: 4px; max-height: 312px; overflow-y: auto; border-radius: 4px; background: var(--window);
  box-shadow: inset 0 3px 10px rgba(0,0,0,.95), 0 1px 0 rgba(255,255,255,.7); scrollbar-width: thin; }
.results[hidden] { display: none; }
.result { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 7px 8px; border: 0; border-radius: 3px;
  background: none; color: var(--window-ink); text-align: left; cursor: pointer; }
.result:hover, .result:focus-visible { background: rgba(255,177,74,.1); }
.result:focus-visible { outline: 2px solid #1f6feb; outline-offset: -2px; }
.results li + li .result { border-top: 1px solid #1d1d20; border-radius: 0 0 3px 3px; }
.r-art { display: block; width: 52px; height: 52px; border-radius: 2px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,.6); }
.r-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.r-art .cover .initial { font-size: 26px; right: 4px; bottom: 2px; }
.r-name { display: block; font: 700 19px/1.05 var(--cond); letter-spacing: .03em; text-transform: uppercase; }
.r-meta { display: block; margin-top: 3px; font: 400 12px/1.2 var(--body); color: #9c978f; }
.r-add { font: 700 12px/1 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: var(--amber); white-space: nowrap; }
.r-add.on { color: #8f8a82; }
.flying { position: fixed; z-index: 50; pointer-events: none; border-radius: 2px; overflow: hidden; box-shadow: 0 12px 24px rgba(0,0,0,.5); }
.flying img { display: block; width: 100%; height: 100%; object-fit: cover; }
@keyframes land { 0% { transform: translateY(-8px) rotate(0); } 60% { transform: translateY(2px) rotate(-1deg); } 100% { transform: translateY(-10px) rotate(0); } }
.shelf-rec.landed { animation: land .35s ease-out; }
.cover { display: block; position: relative; width: 100%; height: 100%; background: var(--c1); }
.cover.p0 { background: radial-gradient(circle at 70% 60%, var(--c2) 0 18%, transparent 19% 30%, var(--c2) 31% 33%, transparent 34%), var(--c1); }
.cover.p1 { background: repeating-linear-gradient(135deg, var(--c1) 0 12px, var(--c2) 12px 18px); }
.cover.p2 { background: linear-gradient(180deg, var(--c1) 0 54%, var(--c2) 54%); }
.cover.p3 { background: radial-gradient(circle at 50% 120%, var(--c2) 0 45%, transparent 46%), var(--c1); }
.cover .initial { position: absolute; right: 10px; bottom: 6px; font: 700 64px/1 var(--wide); color: rgba(255,255,255,.2); }
/* Your bands: full covers leaning on a shelf, overlapping like LPs in a row */
.shelf-wrap { display: flex; flex-direction: column; gap: 6px; }
.shelf { position: relative; display: flex; align-items: flex-end; min-height: 150px; padding: 28px 14px 0 10px; overflow-x: auto; overflow-y: hidden;
  border-bottom: 12px solid #4a2c18; border-radius: 0 0 3px 3px; box-shadow: 0 7px 0 -2px #1d1009, inset 0 -6px 10px -6px rgba(0,0,0,.35); }
.shelf-rec { position: relative; flex: 0 0 auto; width: 112px; height: 112px; padding: 0; border: 0; border-radius: 2px; overflow: hidden; cursor: pointer;
  box-shadow: -4px 0 10px rgba(0,0,0,.45), 0 4px 6px rgba(0,0,0,.35); transform: rotate(-2deg); transform-origin: 50% 100%; transition: transform .2s ease; }
.shelf-rec img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shelf-item { position: relative; flex: 0 0 auto; margin-left: -64px; }
.shelf-item:first-child { margin-left: 0; }
.shelf-item.active { z-index: 5; }
.eject.shelf-x { right: -8px; top: -18px; bottom: auto; z-index: 6; width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.7); }
.shelf-rec.active { transform: translateY(-10px) rotate(0); box-shadow: 0 0 0 2px var(--amber), 0 10px 18px rgba(0,0,0,.5); }
.shelf-rec:focus-visible { outline: 2px solid #1f6feb; outline-offset: 2px; }
.shelf-rec .cover .initial { font-size: 40px; }
.shelf-rec .name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff;
  font: 700 13px/1.05 var(--cond); letter-spacing: .04em; text-transform: uppercase; text-align: left; }
.shelf-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 26px; }
.shelf-bar .now { font: 500 14px/1.3 var(--body); color: var(--engrave-soft); }
.shelf-bar .now strong { font: 700 16px/1 var(--cond); letter-spacing: .04em; text-transform: uppercase; color: var(--engrave); }
.shelf-empty { align-self: center; margin: 0 auto 26px; font: 500 14px/1.4 var(--body); color: var(--engrave-soft); }
@media (prefers-reduced-motion: reduce) { .shelf-rec, .shelf-rec.landed { transition: none; animation: none; } }

/* ---- ③ Push notifications: a checkbox, or an iPhone tip ---- */
.push-row { display: flex; align-items: center; gap: 10px; cursor: pointer; font: 600 15px/1.3 var(--body); color: var(--engrave); text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.push-row input { width: 22px; height: 22px; margin: 0; accent-color: #b9271a; flex: 0 0 auto; }
/* The prototype's account line sat on its own row under the badge; here it
   sits inline on the plate, so it has no top margin. */
.account { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; font: 500 14px/1.3 var(--body); color: var(--engrave-soft); }
.account strong { color: var(--engrave); font-weight: 600; }
.member-to { margin: 0; font: 500 15px/1.4 var(--body); color: var(--engrave-soft); }
.member-to strong { color: var(--engrave); font-weight: 600; }
.tip-head { display: flex; gap: 10px; align-items: flex-start; }
.howto { margin-top: 8px; }
.howto summary { cursor: pointer; font: 700 13px/1.2 var(--cond); letter-spacing: .14em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; margin-left: 30px; list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary:focus-visible { outline: 2px solid #1f6feb; outline-offset: 2px; }
.steps { margin: 10px 0 2px; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: grid; grid-template-columns: 22px 40px 1fr; gap: 10px; align-items: center; counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--engrave); color: var(--alu-1); font: 700 13px/1 var(--cond); }
.steps .pic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); overflow: hidden; }
.steps .pic svg { width: 24px; height: 24px; stroke: #1f6feb; }
.steps .pic.app { background: linear-gradient(180deg, #3a2414, #1e120a); color: var(--amber); font: 700 14px/1 var(--wide); letter-spacing: .02em; }
.steps .pic.app img { display: block; width: 100%; height: 100%; }
.push-tip { display: block; margin: 0; padding: 10px 12px; border-radius: 4px; background: rgba(255,255,255,.35);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.2); font: 500 14px/1.4 var(--body); color: var(--engrave); }
.push-tip svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; stroke: var(--engrave); }

/* ---- ② Search slot and push keys ---- */
.find { display: flex; gap: 8px; }
.find .slot-wrap { flex: 1; min-width: 0; }
.scroller:focus-visible { outline: 2px solid #1f6feb; outline-offset: 2px; }
.hint .textlink:disabled { text-decoration: none; cursor: default; color: var(--engrave-soft); }
.hint { margin: -8px 2px 0; min-height: 1.3em; font: 500 13px/1.3 var(--body); color: var(--engrave-soft); }

/* Backlit dial glass */
.dial { position: relative; height: 74px; border-radius: 4px; overflow: hidden;
  background: radial-gradient(120% 140% at 50% 55%, var(--glass-hot) 0%, #f2c46e 45%, var(--glass-edge) 100%);
  box-shadow: inset 0 2px 7px rgba(0,0,0,.5), inset 0 0 0 1px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.7); }
.dial::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,.3), transparent 38%, transparent 70%, rgba(0,0,0,.12)); }
.scale { position: absolute; left: 16px; right: 16px; top: 0; bottom: 0; }
.scale .mhz { position: absolute; top: 31px; transform: translateX(-50%); font-family: var(--cond); font-weight: 700; font-size: 17px; color: var(--glass-ink); }
.scale .tick { position: absolute; bottom: 13px; width: 1px; height: 7px; background: var(--glass-ink); opacity: .6; }
.scale .tick.major { height: 13px; width: 2px; opacity: .85; }
.scale .dot { position: absolute; top: 14px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--glass-ink); opacity: .5; }
.scale .dot.picked { background: var(--needle); opacity: 1; box-shadow: 0 0 5px var(--needle); }
.scale .fm { position: absolute; left: -8px; top: 8px; font-family: var(--cond); font-weight: 700; font-size: 11px; letter-spacing: .12em; color: var(--glass-ink); opacity: .75; }
.needle { position: absolute; top: 6px; bottom: 6px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--needle); box-shadow: 0 0 6px rgba(229,40,28,.85), 0 0 14px rgba(229,40,28,.45); }

/* Plays-per-week meter */
.meter-box { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 5px; align-items: end; }
.meter-box .tiny { grid-column: 1; }
.meter { grid-column: 1; display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; height: 11px; }
.meter i { border-radius: 1px; background: #94979d; box-shadow: inset 0 1px 1px rgba(0,0,0,.35); }
.meter i.on { background: #2f9a4a; box-shadow: 0 0 4px rgba(47,154,74,.8); }
.meter i.on.hot { background: #e0a020; box-shadow: 0 0 4px rgba(224,160,32,.8); }
.meter-val { grid-column: 2; grid-row: 1 / span 2; font-family: var(--cond); font-weight: 700; font-size: 30px; line-height: .9; font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }

/* The wheel: stations fan out from the knob like clock hands */
.wheel { --pivot-x: 58px; position: relative; height: 300px; border-radius: 4px; overflow: hidden;
  background: radial-gradient(circle at var(--pivot-x) 50%, #1b1b1e 0, var(--window) 60%);
  box-shadow: inset 0 3px 10px rgba(0,0,0,.95), 0 1px 0 rgba(255,255,255,.7); }
.spokes { position: absolute; left: var(--pivot-x); top: 50%; width: 0; height: 0; }
.spoke { position: absolute; left: 0; top: 0; transform-origin: 0 0; white-space: nowrap; display: grid; grid-template-columns: auto auto auto; column-gap: 8px; row-gap: 2px; align-items: baseline; color: var(--window-ink); font-family: var(--cond); line-height: 1; }
.spoke .f { grid-row: 1 / span 2; align-self: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.spoke .n { grid-column: 2; grid-row: 1; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.spoke .c { grid-column: 2; grid-row: 2; font-family: var(--body); font-size: 10px; letter-spacing: .02em; color: #8f8a82; }
.spoke.selected .c { font-size: 12px; color: #b3ada3; }
.spoke:not(.selected) .n { font-weight: 500; color: #cfc9be; }
.spoke .pick { grid-column: 3; grid-row: 1; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 8px var(--lamp); }
.spoke.match .n { color: var(--glass-hot); }
.hand { position: absolute; left: calc(var(--pivot-x) + 50px); right: 0; top: 50%; height: 52px; margin-top: -26px; pointer-events: none;
  border-top: 2px solid var(--needle); border-bottom: 2px solid var(--needle);
  background: linear-gradient(90deg, rgba(255,226,160,.12), rgba(255,226,160,.02)); box-shadow: 0 0 12px rgba(229,40,28,.25); }
.knob { position: absolute; left: calc(var(--pivot-x) - 46px); top: 50%; width: 92px; height: 92px; margin-top: -46px;
  border-radius: 50%; touch-action: none; cursor: grab; z-index: 3;
  background: radial-gradient(circle, #2b2f38 0 34%, transparent 35%), repeating-conic-gradient(#1c1f26 0 4deg, #3b404b 4deg 6deg, #1c1f26 6deg 10deg);
  box-shadow: 0 8px 20px rgba(0,0,0,.7), inset 0 2px 2px rgba(255,255,255,.08), 0 0 0 1px #000; }
.knob::after { content: ''; position: absolute; right: 7px; top: 50%; width: 18px; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--glass-hot); box-shadow: 0 0 10px rgba(255,226,160,.9); }
.scroller { position: absolute; inset: 0; z-index: 2; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; cursor: grab; -webkit-tap-highlight-color: transparent; }
.scroller::-webkit-scrollbar { display: none; }
.scroller .stop { height: 40px; scroll-snap-align: start; }
.rail { position: absolute; top: 10px; bottom: 10px; right: 5px; width: 6px; z-index: 4; border-radius: 3px; background: rgba(255,255,255,.07); touch-action: none; cursor: pointer; }
.rail::before { content: ''; position: absolute; inset: 0 -8px; } /* bigger grab area */
.thumb { position: absolute; left: 0; right: 0; height: 36px; border-radius: 3px; background: rgba(255,226,160,.45); box-shadow: 0 0 6px rgba(255,226,160,.25); cursor: grab; }
.rail:hover .thumb, .rail.dragging .thumb { background: rgba(255,226,160,.75); }

.readout { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: -4px; font: 500 14px/1.3 var(--body); color: var(--engrave-soft); }
.readout strong { font-family: var(--cond); font-size: 18px; font-weight: 700; color: var(--engrave); letter-spacing: .02em; }

/* Memory presets: your stations, as push keys */
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
.preset { position: relative; text-align: left; padding: 9px 10px 8px; display: flex; flex-direction: column; gap: 1px; }
.preset .pf { font: 700 19px/1 var(--cond); letter-spacing: .02em; }
.preset .pn { font: 600 12px/1.1 var(--cond); letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset .led { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: #6b3a35; box-shadow: inset 0 1px 1px rgba(0,0,0,.5); }
.preset.on .led { background: var(--lamp); box-shadow: 0 0 7px var(--lamp); }
.preset-unit { position: relative; display: flex; }
.preset-unit .preset { flex: 1; min-width: 0; padding-right: 30px; }
.eject { position: absolute; right: 5px; bottom: 7px; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border-radius: 3px; cursor: pointer;
  background: linear-gradient(180deg, #caccd0, #aeb1b6); border: 1px solid #85888e; color: var(--engrave); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 1px 0 rgba(0,0,0,.25); }
.eject svg { width: 12px; height: 12px; }
.eject:hover { color: #9c1f14; }
.eject:active { transform: translateY(1px); }
.eject:focus-visible { outline: 2px solid #1f6feb; outline-offset: 2px; }
.empty-note { grid-column: 1 / -1; margin: 0; font: 500 14px/1.4 var(--body); color: var(--engrave-soft); }

.list { list-style: none; margin: 0; padding: 0; border-radius: 4px; max-height: 360px; overflow: auto; background: var(--window); box-shadow: inset 0 3px 10px rgba(0,0,0,.95); }
.list label { display: grid; grid-template-columns: auto 56px 1fr; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #222; cursor: pointer; color: var(--window-ink); }
.list input { width: 18px; height: 18px; accent-color: var(--lamp); }
.list input:focus-visible { outline: 2px solid #1f6feb; outline-offset: 2px; }
.list .f { font: 700 20px/1 var(--cond); }
.list .n { font: 600 18px/1.1 var(--cond); text-transform: uppercase; }
.list small { display: block; font: 400 12px/1.3 var(--body); color: #9c978f; text-transform: none; }
.view-switch { display: flex; justify-content: flex-end; }

.tuner-view { display: flex; flex-direction: column; gap: 16px; }
/* Step 3's fields sit inside a form (receiver.css lays it out as a column),
   so the form, not its wrapper, carries the wide-screen grid below. */
.member-3, .member-3 > form { display: flex; flex-direction: column; gap: 14px; }
.guest-3, .guest-3 > form { display: flex; flex-direction: column; gap: 16px; }

/* Wide screens: the same three units, stacked in order, each full width
   and using the space inside itself. */
@media (min-width: 1000px) {
  .band-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-areas: "head head" "search shelf" "results shelf" "hint shelf"; column-gap: 28px; row-gap: 10px; align-items: start; }
  .band-step > .step { grid-area: head; }
  .band-step > .slot-wrap { grid-area: search; }
  .band-step > .results { grid-area: results; }
  .band-step > .hint { grid-area: hint; }
  .band-step > .shelf-wrap { grid-area: shelf; }
  .tuner-view:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "wheel dial" "wheel meter" "wheel readout" "wheel presets"; column-gap: 28px; row-gap: 16px; align-items: start; }
  .tuner-view .dial { grid-area: dial; }
  .tuner-view .meter-box { grid-area: meter; }
  .tuner-view .readout { grid-area: readout; margin-top: 0; }
  .tuner-view .presets-box { grid-area: presets; }
  .tuner-view .wheel { grid-area: wheel; height: 400px; --pivot-x: 66px; }
  .knob { width: 104px; height: 104px; left: calc(var(--pivot-x) - 52px); margin-top: -52px; }
  .guest-3 > form { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "email send" "push push" "tip tip" "hint hint"; column-gap: 16px; row-gap: 14px; align-items: center; }
  .guest-3 > form > .slot-wrap { grid-area: email; }
  .guest-3 > form > #send-btn { grid-area: send; }
  .guest-3 > form > .push-row { grid-area: push; }
  .guest-3 > form > .push-tip { grid-area: tip; }
  .guest-3 > form > #send-hint { grid-area: hint; margin-top: 0 !important; }
  .guest-3 > form > #send-hint:empty { display: none; }
  .member-3 > form { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 16px; align-items: center; }
  .member-3 > form > #member-hint { grid-column: 1 / -1; margin-top: 0 !important; }
}
@media (max-width: 380px) {
  .cabinet { padding: 8px; }
  .badge { font-size: 13px; }
  .wheel { --pivot-x: 50px; }
}
