/* CityHill Radio — v6 «Приёмник». Один предмет в комнате. Свет комнаты следует часу в Сиэтле,
   корпус не меняет цвет, а только темнеет вместе с комнатой; дисплей и шкала светятся сами. */
:root {
  --ink: #0A0A0A; --lime: #d9f99d; --orange: #FF6B35; --blue: #4A90E2;
  --display: Unbounded, Inter, sans-serif;
  --text: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --px-min: 5px;
}
/* комната: фон, текст на полке, затемнение корпуса, оттенок подсветки шкалы и дисплея, свет на фото */
body                { --room: #E9E9E6; --room-fg: #1A1A1A; --room-2: #6B6B66; --shade: 0%;  --tint: #1A1A18;    --tint-k: 0%;  --pl-b: 1.06; --pl-s: 1; }
body.part-morning   { --room: #EEF2E2; --room-fg: #1A1A1A; --room-2: #5E6456; --shade: 0%;  --tint: var(--lime);   --tint-k: 12%; --pl-b: 1.12; --pl-s: 1.05; }
body.part-day       { --room: #E9E9E6; --room-fg: #1A1A1A; --room-2: #6B6B66; --shade: 0%;  --tint: #1A1A18;    --tint-k: 0%;  --pl-b: 1.06; --pl-s: 1; }
body.part-home      { --room: #EFE2D8; --room-fg: #1A1A1A; --room-2: #7A5A4A; --shade: 4%;  --tint: var(--orange); --tint-k: 12%; --pl-b: .98;  --pl-s: 1.1; }
body.part-evening   { --room: #1F2833; --room-fg: #E8E8E4; --room-2: #93A3B5; --shade: 22%; --tint: var(--blue);   --tint-k: 14%; --pl-b: .62;  --pl-s: .85; }
body.part-late      { --room: #13161D; --room-fg: #E8E8E4; --room-2: #8B93A5; --shade: 30%; --tint: var(--lime);   --tint-k: 6%;  --pl-b: .46;  --pl-s: .75; }
body.part-night     { --room: #0A0A0A; --room-fg: #E8E8E4; --room-2: #8A8A84; --shade: 36%; --tint: var(--lime);   --tint-k: 7%;  --pl-b: .38;  --pl-s: .7; }
/* предмет: считается на body, чтобы видеть переменные комнаты */
body {
  --case: color-mix(in srgb, #E3E1DB, black var(--shade));
  --case-2: color-mix(in srgb, #D2D0CA, black var(--shade));
  --case-fg: color-mix(in srgb, #1C1C1A, white calc(var(--shade) * 1.5)); /* гравировка светлеет в тёмной комнате, чтобы читаться на затемнённом корпусе */
  --case-fg-2: color-mix(in srgb, #1C1C1A 62%, var(--case));
  --key: color-mix(in srgb, #F3F2EE, black var(--shade));
  --key-line: rgba(0,0,0,.2);
  --disp: color-mix(in srgb, #141412, var(--tint) var(--tint-k));
  --dial: color-mix(in srgb, #1B1B19, var(--tint) var(--tint-k));
  --disp-fg: #F2F2EE; --disp-2: #9C9C95; --disp-line: rgba(255,255,255,.14);
}

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 28px 16px 26px; background: var(--room); color: var(--room-fg);
  font-family: var(--text); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  transition: background 1.2s ease, color 1.2s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--room-fg); outline-offset: 3px; border-radius: 6px; }
.display :focus-visible, .dial :focus-visible { outline-color: var(--disp-fg); }

/* корпус */
.set {
  width: min(100%, 1120px); background: var(--case); border-radius: 28px; padding: 22px;
  display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 16px 22px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: background 1.2s ease;
}

/* решётка динамика: круг отверстий прямо в панели корпуса, без отдельной рамки */
.grille { grid-column: 1; grid-row: 1; position: relative; align-self: center; justify-self: center; width: min(100%, 300px); aspect-ratio: 1; border-radius: 50%; --dot: 1.9px; --pitch: 10px; }
.grille::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background-size: var(--pitch) var(--pitch); background-position: 0 0; background-image: radial-gradient(circle at center, color-mix(in srgb, #121210, var(--case) 8%) var(--dot), transparent calc(var(--dot) + .7px)); -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 66%, transparent 71%); mask-image: radial-gradient(circle at 50% 50%, #000 66%, transparent 71%); }

/* табличка и лампочка-индикатор: зелёная — станция в эфире, красная — эфир не идёт или поток оборвался */
.plate { grid-column: 1; grid-row: 2; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; color: var(--case-fg); font-size: 12px; letter-spacing: .02em; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.brand .mark { width: 34px; height: 19px; }
.lamp { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.16); box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); transition: background .4s; }
.lamp.live { background: #34C759; }
.lamp.down { background: #FF3B30; }

/* дисплей */
.display {
  grid-column: 2; grid-row: 1; position: relative; min-height: 320px; border-radius: 18px; padding: 18px 22px 18px; background: var(--disp); color: var(--disp-fg);
  display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; gap: 16px 20px; padding-bottom: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); transition: background 1.2s ease;
}
.state { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--disp-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--disp-2); flex: none; transition: background .4s; }
.live .dot { background: var(--live, var(--lime)); }
.state .when { font-weight: 400; }
.clock { margin-left: auto; display: flex; align-items: baseline; gap: 8px; font-family: var(--display); font-weight: 300; font-size: 14px; letter-spacing: .04em; color: var(--disp-fg); font-variant-numeric: tabular-nums; }
.clock, .hours span { white-space: nowrap; }
.clock .tz { font-family: var(--text); font-size: 12px; color: var(--disp-2); letter-spacing: 0; }
.portrait { grid-column: 1; grid-row: 2; margin: 0; width: 96px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.06); align-self: start; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; filter: var(--photo-filter, none); }
.card-text { grid-column: 2; grid-row: 2; min-width: 0; }
.rubric { margin: 0 0 6px; font-size: 13px; color: var(--disp-2); }
.rubric:empty { display: none; }
.voice { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2.3vw, 32px); line-height: 1.15; letter-spacing: -.01em; max-width: 22ch; text-wrap: balance; }
.role { margin: 6px 0 0; font-size: 13px; color: var(--disp-2); max-width: 52ch; }
.role:empty { display: none; }
.piece { margin: 10px 0 0; font-size: 16px; max-width: 46ch; }
.piece:empty { display: none; }
.meta { grid-column: 1 / -1; grid-row: 3; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin: 0; font-size: 13px; color: var(--disp-2); font-variant-numeric: tabular-nums; min-height: 20px; }
.meta .left { color: var(--disp-fg); }
.meta .left:empty, .meta .next:empty, .meta .status:empty { display: none; }
.meta .status { color: var(--disp-fg); }

/* шкала дня: нижняя полоса того же окна, под портретом и названием */
.dial { grid-column: 1 / -1; grid-row: 4; position: relative; height: 104px; margin: 2px -22px 0; border-radius: 0 0 18px 18px; border-top: 1px solid var(--disp-line); background: var(--dial); color: var(--disp-fg); overflow: hidden; user-select: none; -webkit-user-select: none; transition: background 1.2s ease; }
.dial::before, .dial::after { content: ""; position: absolute; top: 0; bottom: 0; width: 10%; z-index: 3; pointer-events: none; }
.dial::before { left: 0; background: linear-gradient(90deg, var(--dial-fade, var(--dial)), transparent); }
.dial::after { right: 0; background: linear-gradient(270deg, var(--dial-fade, var(--dial)), transparent); }
.parts, .hours { position: relative; left: 50%; will-change: transform; }
.parts { height: 15px; margin-top: 7px; }
.parts span { position: absolute; top: 0; font-size: 10.5px; line-height: 15px; color: var(--disp-2); white-space: nowrap; letter-spacing: .02em; padding-left: 5px; border-left: 1px solid var(--disp-line); }
.hours { height: 17px; margin-top: 2px; }
.hours span { position: absolute; top: 0; transform: translateX(-50%); font-family: var(--display); font-weight: 300; font-size: 11px; letter-spacing: .06em; color: var(--disp-2); font-variant-numeric: tabular-nums; }
.hours span::after { content: ""; position: absolute; left: 50%; top: 16px; width: 1px; height: 5px; background: var(--disp-line); }
.hours span.tick::after { top: 18px; height: 3px; }
.track { position: relative; height: 60px; margin-top: 2px; cursor: grab; touch-action: pan-y; outline-offset: -2px; }
.track.dragging { cursor: grabbing; }
.items { position: absolute; left: 50%; top: 0; height: 100%; will-change: transform; }
.item { position: absolute; top: 6px; height: 46px; border-radius: 7px; background: var(--item-bg, rgba(255,255,255,.09)); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 5px 8px; min-width: 4px; transition: background .3s; color: var(--disp-fg); }
.item.past { opacity: .55; }
.item.now { background: var(--now-bg, var(--lime)); color: var(--now-fg, #0A0A0A); }
.item.future { background: transparent; box-shadow: inset 0 0 0 1px var(--item-line, rgba(255,255,255,.26)); }
.item.focus { box-shadow: inset 0 0 0 2px var(--disp-fg); }
.item b, .item i { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: normal; }
.item b { font-weight: 500; font-size: 12px; }
.item i { font-size: 11px; opacity: .8; }
.item.tight b, .item.tight i { display: none; }
.item.tight::before { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 14px; margin: -7px 0 0 -1px; border-radius: 1px; background: currentColor; opacity: .5; }
.needle { position: absolute; left: 50%; top: -28px; bottom: 0; width: 2px; margin-left: -1px; background: var(--disp-fg); z-index: 2; pointer-events: none; }
.needle span { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font-size: 10.5px; letter-spacing: .04em; color: var(--needle-fg, #0A0A0A); background: var(--disp-fg); padding: 1px 6px; border-radius: 8px; white-space: nowrap; line-height: 15px; }

/* органы управления: клавиши на корпусе */
.controls { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; }
.key { display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--key); color: var(--case-fg); font-size: 13px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--key-line); transition: background .4s, color .4s; }
.key svg { width: 18px; height: 18px; }
.key:hover { background: color-mix(in srgb, var(--key), white 40%); }
.key:active { background: var(--case-2); }
.key.icon { width: 44px; padding: 0; justify-content: center; }
.key.play { height: 52px; min-width: 200px; justify-content: center; padding: 0 22px 0 18px; border-radius: 26px; background: #1C1C1A; color: #F2F2EE; box-shadow: none; font-size: 14px; }
.key.play svg { width: 22px; height: 22px; }
.key.play:hover { background: #2A2A27; }
.key.play:disabled { opacity: .45; cursor: default; }
.key.on { box-shadow: inset 0 0 0 1.5px var(--case-fg); }
.vol { display: flex; align-items: center; gap: 6px; }
.vol input { width: 110px; height: 44px; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
.vol input::-webkit-slider-runnable-track { height: 2px; background: var(--case-fg-2); border-radius: 1px; }
.vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 22px; margin-top: -10px; border-radius: 4px; background: var(--key); box-shadow: inset 0 0 0 1px var(--key-line); }
.vol input::-moz-range-track { height: 2px; background: var(--case-fg-2); border-radius: 1px; }
.vol input::-moz-range-thumb { width: 12px; height: 22px; border: 0; border-radius: 4px; background: var(--key); box-shadow: inset 0 0 0 1px var(--key-line); }
.hint { margin-left: auto; font-size: 12px; color: var(--case-fg-2); text-align: right; max-width: 34ch; }

/* полка: встреча, фото церкви, ссылки */
.shelf { width: min(100%, 1120px); display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; align-items: center; color: var(--room-2); font-size: 13px; line-height: 1.5; transition: color 1.2s ease; }
.shelf-photo { margin: 0; width: 96px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: rgba(0,0,0,.08); }
.shelf-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; filter: brightness(var(--pl-b)) saturate(var(--pl-s)); transition: filter 1.2s ease; }
.shelf-text p { margin: 0; }
.shelf-text p + p { margin-top: 6px; }
.meet { color: var(--room-fg); font-size: 14px; }
.meet b { font-weight: 500; }
.link { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; color: var(--room-fg); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--room-fg) 30%, transparent); white-space: nowrap; }
.link:hover { text-decoration-color: var(--room-fg); }
.link svg { width: 15px; height: 15px; }
.links a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.links a + a { margin-left: 18px; }
.links a:hover { color: var(--room-fg); }

/* тихий экран: слушаешь и минуту ничего не трогаешь — остаются дисплей и шкала */
.controls, .plate, .shelf { transition: opacity .8s ease; }
body.quiet .controls, body.quiet .plate, body.quiet .shelf { opacity: 0; pointer-events: none; }
body.quiet .set { background: color-mix(in srgb, var(--case), black 10%); }

@media (prefers-reduced-motion: reduce) {
  body, .set, .grille, .display, .dial, .controls, .plate, .shelf, .shelf-photo img, .dot, .lamp, .key { transition: none; }
}
@media (max-width: 900px) {
  .set { grid-template-columns: 220px minmax(0, 1fr); gap: 14px 16px; padding: 18px; }
  .grille { width: min(100%, 220px); }
  .display { min-height: 280px; padding: 16px 18px 0; grid-template-columns: 80px minmax(0, 1fr); gap: 14px 16px; }
  .dial { margin: 2px -18px 0; }
  .portrait { width: 80px; }
  .hint { display: none; }
}
@media (max-width: 680px) {
  :root { --px-min: 4px; }
  /* телефон: тот же приёмник, поставленный вертикально — окно, клавиши, круглый динамик, табличка; корпус на первый экран */
  body { padding: 12px 10px 20px; gap: 16px; justify-content: flex-start; }
  .set { --g: min(72vw, 300px); grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(var(--g), 1fr) auto; gap: 14px; padding: 14px; border-radius: 28px; min-height: calc(100dvh - 32px); }
  .grille { grid-column: 1; grid-row: 3; width: var(--g); justify-self: center; align-self: center; }
  .display { grid-column: 1; grid-row: 1; min-height: 0; padding: 14px 16px 0; grid-template-columns: 72px minmax(0, 1fr); gap: 12px 14px; border-radius: 16px; }
  .portrait { width: 72px; border-radius: 6px; }
  .voice { font-size: 22px; }
  .piece { font-size: 15px; margin-top: 8px; }
  .meta { gap: 12px; }
  .dial { height: 96px; margin: 0 -16px 0; border-radius: 0 0 16px 16px; }
  .track { height: 54px; }
  .item { height: 42px; padding: 4px 7px; }
  .controls { grid-column: 1; grid-row: 2; min-height: 0; }
  .key { height: 42px; padding: 0 14px; }
  .key.play { height: 50px; min-width: 0; flex: 1; }
  .vol { display: none; }
  .plate { grid-column: 1; grid-row: 4; min-height: 0; padding: 2px 6px 0; }
  .shelf { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: start; }
  .shelf-photo { width: 72px; }
}
/* блоки по сетке: контур тоньше и подпись тише — это план станции, не конкретная запись */
.item.grid { box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.item.grid b { font-weight: 400; opacity: .85; }

@media (max-width: 680px) and (orientation: portrait) {
  body { padding: 8px 10px; gap: 8px; }
  .set { flex: 1; min-height: auto; --g: clamp(80px, 24dvh, 240px); gap: 9px; padding: 10px; }
  .shelf { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; font-size: 12px; }
  .shelf-photo { width: 48px; }
  .shelf-text p + p { margin-top: 2px; }
}

@media (orientation: landscape) and (max-height: 600px) {
  body {
    padding: 6px max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
    gap: 6px; justify-content: flex-start;
  }
  .set {
    flex: 1; min-height: auto; padding: 8px; gap: 6px 12px;
    grid-template-columns: clamp(110px, 44dvh, 240px) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
  }
  .grille { grid-area: 1 / 1; width: min(100%, 44dvh); }
  .plate { grid-area: 2 / 1; padding: 0 4px; }
  .display {
    grid-area: 1 / 2; min-height: 0; padding: 6px 12px 0; gap: 3px 12px;
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .portrait { width: 48px; }
  .voice { font-size: 19px; max-width: none; }
  .piece, .role, .rubric { font-size: 13px; margin: 2px 0 0; max-width: none; }
  .meta { min-height: 0; gap: 2px 12px; font-size: 12px; }
  .dial { height: 72px; margin: 0 -12px; }
  .parts { height: 12px; margin-top: 1px; }
  .hours { margin-top: 0; }
  .track { height: 40px; }
  .item { top: 3px; height: 35px; padding-block: 1px; }
  .controls { grid-area: 2 / 2; min-height: 44px; gap: 6px; }
  .key, .key.play { height: 44px; }
  .key.play { min-width: 120px; }
  .hint { display: none; }
  .shelf { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; font-size: 12px; line-height: 1.25; }
  .shelf-photo { width: 40px; }
  .shelf-text p + p { margin-top: 1px; }
}

@media (orientation: portrait) and (max-width: 680px) and (max-height: 760px) {
  .set { --g: clamp(68px, calc(100dvh - 530px), 170px); }
  .display { gap: 6px 10px; grid-template-columns: 52px minmax(0, 1fr); }
  .portrait { width: 52px; }
  .shelf { grid-template-columns: 1fr; }
  .shelf-photo { display: none; }
}

@media (orientation: landscape) and (max-height: 350px) {
  body {
    display: grid; align-content: center; align-items: center;
    grid-template-columns: minmax(150px, 32%) minmax(0, 1fr);
    height: 100dvh; grid-template-rows: minmax(0, .75fr) 24px minmax(0, 1.25fr) 44px; gap: 4px 10px;
    background: var(--case);
  }
  .set { display: contents; }
  .grille { grid-area: 1 / 1; width: min(100%, 24dvh); }
  .plate { grid-area: 2 / 1; width: 100%; min-height: 22px; }
  .shelf { grid-area: 3 / 1 / 5 / 2; align-self: start; grid-template-columns: 1fr; color: var(--case-fg); }
  .shelf-photo { display: none; }
  .shelf .meet, .shelf .link { color: inherit; }
  .shelf .links a { display: inline-block; margin: 0 6px 0 0; }
  .display { grid-area: 1 / 2 / 4 / 3; align-self: stretch; }
  .controls { grid-area: 4 / 2; align-self: start; }
}

.item.sermon { border-left: 3px solid var(--live, var(--lime)); padding-left: 7px; }
.item.sermon b, .item.sermon i { display: block; }
.item.sermon.tight::before { display: none; }
#archive { margin: 6px 0; }
#archive summary { cursor: pointer; color: var(--room-fg); }
#archive label { display: block; margin: 6px 0; }
#recordings { max-width: 100%; font: inherit; padding: 7px; }
#archive-play { margin-block: 5px; }
.voice { overflow-wrap: anywhere; }

/* ---------- сменные корпуса (скины, как обложки Winamp) ----------
   Корпус — фотореалистичный рендер (assets/skins/<id>/body.webp), дисплей, клавиши, лампочка и ручки — HTML поверх по карте зон
   из skin.json (проценты от картинки). Переменные --d-*, --p-*, --m-*, --l-*, --s-*, --t-*, --w-*, --k-* ставит radio.js.
   Внутренние размеры дисплея в cqw: приёмник масштабируется целиком, как предмет. Скины работают от 1000px ширины экрана,
   на телефоне остаётся приёмник v6 (портретных рендеров пока нет). */
.set.skinned { position: relative; display: block; width: min(100%, var(--sk-max, 1400px)); aspect-ratio: var(--sk-w) / var(--sk-h); padding: 0; background: none; border-radius: 0; box-shadow: none; container-type: inline-size; }
.set.skinned::before { content: ""; position: absolute; inset: 0; background: var(--sk-img) center / 100% 100% no-repeat; filter: brightness(calc(100% - var(--shade))); transition: filter 1.2s ease; pointer-events: none; }
body.quiet .set.skinned { background: none; }
body.quiet .set.skinned::before { filter: brightness(calc(88% - var(--shade))); }
.set.skinned .grille, .set.skinned .hint, .set.skinned .state > .dot { display: none; }

/* дисплей: прозрачный над стеклом рендера, свои цвета из skin.json */
.set.skinned .display { position: absolute; left: var(--d-x); top: var(--d-y); width: var(--d-w); height: var(--d-h); min-height: 0; margin: 0; border-radius: var(--d-r, 0); background: var(--disp, transparent); box-shadow: none; overflow: hidden; --pw: clamp(52px, 6cqw, 96px); --dial-h: clamp(72px, 6.6cqw, 100px); padding: 1cqw 1.4cqw 0; grid-template-columns: var(--pw) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; gap: .6cqw 1.2cqw; text-shadow: var(--glow, none); }
.set.skinned .state { font-size: clamp(11px, .93cqw, 13px); gap: .7cqw; }
.set.skinned .state .plate { display: flex; align-items: center; gap: .6cqw; padding: 0; min-height: 0; margin-right: .4cqw; color: var(--disp-fg); font-size: clamp(12px, 1.15cqw, 16px); letter-spacing: 0; }
.set.skinned .state .plate .brand .mark { width: 2.3cqw; height: 1.3cqw; }
.set.skinned .clock { font-size: clamp(11px, 1cqw, 14px); }
.set.skinned .clock .tz { font-size: clamp(10px, .86cqw, 12px); }
.set.skinned .portrait { width: var(--pw); border-radius: .5cqw; }
.set.skinned .voice { font-size: clamp(16px, 2cqw, 30px); }
.set.skinned .rubric, .set.skinned .role, .set.skinned .meta { font-size: clamp(11px, .93cqw, 13px); }
.set.skinned .rubric { margin-bottom: .3cqw; }
.set.skinned .role { margin-top: .3cqw; }
.set.skinned .piece { font-size: clamp(12px, 1.15cqw, 16px); margin-top: .5cqw; }
.set.skinned .meta { gap: .6cqw 1.2cqw; min-height: 0; align-items: center; }
.set.skinned .dial { height: var(--dial-h); margin: 0 -1.4cqw 0; border-radius: 0; }
.set.skinned .parts { height: 12px; margin-top: 3px; }
.set.skinned .hours { height: 14px; margin-top: 0; }
.set.skinned .track { height: calc(var(--dial-h) - 31px); }
.set.skinned .item { top: 4px; height: calc(var(--dial-h) - 39px); }
.set.skinned .item.grid { box-shadow: inset 0 0 0 1px var(--item-line, rgba(255,255,255,.16)); opacity: .75; }
.set.skinned .needle { top: -22px; }

/* клавиши: тело клавиши уже на рендере, HTML — прозрачная зона со значком; нажатие — тень внутрь */
.set.skinned .controls { display: contents; }
.set.skinned .key { position: absolute; height: auto; padding: 0; border-radius: .5cqw; background: transparent; box-shadow: none; justify-content: center; transition: background .15s, box-shadow .15s; }
.set.skinned .key:hover { background: rgba(255,255,255,.07); }
.set.skinned .key:active { background: rgba(0,0,0,.16); box-shadow: inset 0 2px 8px rgba(0,0,0,.35); }
.set.skinned .key.play { left: var(--p-x); top: var(--p-y); width: var(--p-w); height: var(--p-h); min-width: 0; border-radius: var(--p-r, .5cqw); color: var(--play-fg, #1C1C1A); font-size: 0; }
.set.skinned .key.play svg { width: clamp(18px, 2.1cqw, 30px); height: clamp(18px, 2.1cqw, 30px); }
.set.skinned .key.play span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.set.skinned .key.play:disabled { opacity: .5; }
.set.skinned .key.on { box-shadow: inset 0 0 0 1.5px var(--bar-fg, var(--disp-fg)); }
/* вторичные клавиши переезжают на дисплей, в строку под карточкой */
.set.skinned .meta .key { position: static; height: clamp(20px, 2cqw, 26px); padding: 0 .8cqw; border-radius: 999px; background: transparent; color: var(--disp-fg); box-shadow: inset 0 0 0 1px var(--disp-line); font-size: clamp(10px, .86cqw, 12px); gap: .4cqw; }
.set.skinned .meta .key svg { width: clamp(12px, 1cqw, 14px); height: clamp(12px, 1cqw, 14px); }
.set.skinned .meta .key:hover { background: var(--item-bg, rgba(255,255,255,.09)); box-shadow: inset 0 0 0 1px var(--disp-line); }
.set.skinned .meta .key:active, .set.skinned .meta .key.on { box-shadow: inset 0 0 0 1.5px var(--disp-fg); background: transparent; }

/* громкость: три варианта органов по skin.json */
.set.skinned .vol { display: contents; }
.set.skinned #volume { position: absolute; margin: 0; width: auto; height: auto; opacity: 0; cursor: pointer; z-index: 2; }
/* keys — кремовый: тёмная планка, две клавиши (звук, сон) и окно с восемью сегментами */
.set.skinned.body-keys #mute { left: var(--m-x); top: var(--m-y); width: var(--m-w); height: var(--m-h); color: var(--bar-fg); }
.set.skinned.body-keys #mute svg { width: clamp(16px, 1.7cqw, 24px); height: clamp(16px, 1.7cqw, 24px); }
.set.skinned.body-keys #sleep { left: var(--s-x); top: var(--s-y); width: var(--s-w); height: var(--s-h); color: var(--bar-fg); font-size: clamp(10px, .9cqw, 12px); gap: .3cqw; }
.set.skinned.body-keys #sleep svg { width: clamp(16px, 1.7cqw, 24px); height: clamp(16px, 1.7cqw, 24px); }
.set.skinned.vol-keys #volume { left: var(--l-x); top: var(--l-y); width: var(--l-w); height: var(--l-h); }
.set.skinned .level { position: absolute; left: var(--l-x); top: var(--l-y); width: var(--l-w); height: var(--l-h); pointer-events: none; }
.set.skinned .level::before, .set.skinned .level::after { content: ""; position: absolute; top: 38%; bottom: 38%; left: 8%; right: 8%; border-radius: 1px; background: repeating-linear-gradient(90deg, var(--seg-off) 0 calc(100% / 8 - .45cqw), transparent 0 calc(100% / 8)); }
.set.skinned .level::after { background: repeating-linear-gradient(90deg, var(--seg-on) 0 calc(100% / 8 - .45cqw), transparent 0 calc(100% / 8)); clip-path: inset(0 calc((1 - var(--vol, 1)) * 100%) 0 0); clip-path: inset(0 calc((8 - round(up, var(--vol, 1) * 8, 1)) / 8 * 100%) 0 0); transition: clip-path .15s; }
.set.skinned:has(#volume:focus-visible) .level { outline: 2px solid var(--bar-fg); outline-offset: -2px; }
/* slider — орех: невидимый ползунок над дорожкой, бегунок — отдельный рендер, едет за громкостью */
.set.skinned.vol-slider #volume { left: var(--t-x); top: calc(var(--t-y) - var(--t-h) * 1.5); width: var(--t-w); height: calc(var(--t-h) * 4); }
.set.skinned .thumb { position: absolute; width: var(--thumb-w); aspect-ratio: 721 / 752; left: calc(var(--t-x) + (var(--t-w) - var(--thumb-w)) * var(--vol, 1)); top: calc(var(--t-y) + var(--t-h) / 2); transform: translateY(-47%); background: var(--thumb-img) center / 100% 100% no-repeat; pointer-events: none; filter: brightness(calc(100% - var(--shade))); transition: left .12s; }
.set.skinned:has(#volume:focus-visible) .thumb { outline: 2px solid var(--disp-fg); border-radius: 50%; }
/* knob — полевой: ручка на рендере неподвижна, крутится только светящаяся риска */
.set.skinned.vol-knob #volume { left: calc(var(--k-cx) - var(--k-r)); top: calc(var(--k-cy) - var(--k-ry)); width: calc(var(--k-r) * 2); height: calc(var(--k-ry) * 2); pointer-events: none; }
.set.skinned .knob { position: absolute; left: calc(var(--k-cx) - var(--k-r)); top: calc(var(--k-cy) - var(--k-ry)); width: calc(var(--k-r) * 2); aspect-ratio: 1; border-radius: 50%; cursor: ns-resize; touch-action: none; z-index: 2; }
.set.skinned .knob .mark { position: absolute; inset: var(--k-inset, 6%); border-radius: 50%; transform: rotate(calc(-135deg + var(--vol, 1) * 270deg)); transition: transform .12s; }
.set.skinned .knob .mark::before { content: ""; position: absolute; left: 50%; top: 8%; width: 7%; aspect-ratio: 1; margin-left: -3.5%; border-radius: 50%; background: var(--k-mark); box-shadow: 0 0 8px var(--k-mark); }
.set.skinned:has(#volume:focus-visible) .knob { outline: 2px solid var(--disp-fg); outline-offset: 2px; }
/* колесо настройки (кремовый): тянуть по вертикали — шкала едет по времени */
.set.skinned .wheel { position: absolute; left: var(--w-x); top: var(--w-y); width: var(--w-w); height: var(--w-h); cursor: ns-resize; touch-action: none; z-index: 2; }

/* выбор корпуса на полке */
.skins { margin-top: 8px; }
.skins select { font: inherit; font-size: 13px; padding: 4px 6px; margin-left: 4px; color: inherit; background: transparent; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 6px; }

@media (prefers-reduced-motion: reduce) { .set.skinned::before, .set.skinned .thumb, .set.skinned .knob .mark, .set.skinned .level::after { transition: none; } }

/* ---------- 10.11: приёмник — это и есть сайт ----------
   Со скином полки под приёмником нет: записи, «О станции» и выбор корпуса живут на дисплее листами,
   приёмник стоит на поверхности (отражение), стекло дисплея даёт блик поверх HTML. */
.sheet, .tabs { display: none; }
body.skin-on { overflow: hidden; padding-bottom: 12dvh; }
body.skin-on .shelf { display: none; }
.set.skinned::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 100%; background: var(--sk-img) center / 100% 100% no-repeat; transform: scaleY(-1); opacity: .26; filter: brightness(calc(100% - var(--shade))) blur(1.5px); -webkit-mask-image: linear-gradient(to top, #000, transparent 36%); mask-image: linear-gradient(to top, #000, transparent 36%); pointer-events: none; transition: filter 1.2s ease; }
.set.skinned.glass .display::after { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: inherit; background: linear-gradient(112deg, rgba(255,255,255,.075) 0%, rgba(255,255,255,.02) 20%, transparent 36%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), inset 0 16px 28px -20px #000; }

/* высокий дисплей (орех): карточка занимает высоту окна */
.set.skinned.lay-tall .display { --pw: clamp(64px, 7.4cqw, 104px); padding-top: 1.1cqw; }
.set.skinned.lay-tall .portrait, .set.skinned.lay-tall .card-text { align-self: center; }
.set.skinned.lay-tall .voice { font-size: clamp(18px, 2.7cqw, 38px); max-width: 26ch; }
.set.skinned.lay-tall .piece { font-size: clamp(13px, 1.3cqw, 18px); }

/* листы дисплея */
.set.skinned .meta .tabs { display: flex; gap: .6cqw; margin-left: auto; }
.set.skinned .display.sheet-open .portrait, .set.skinned .display.sheet-open .card-text { display: none; }
.set.skinned .display.sheet-open .sheet { display: block; grid-column: 1 / -1; grid-row: 2; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--disp-line) transparent; font-size: clamp(12px, 1.05cqw, 15px); color: var(--disp-2); }
.sheet-h { margin: 0 0 .7cqw; font-size: clamp(10px, .86cqw, 12px); letter-spacing: .08em; text-transform: uppercase; color: var(--disp-2); }
.recs { columns: 3; column-gap: 1.6cqw; }
.rec { display: flex; align-items: baseline; gap: .8cqw; width: 100%; padding: .2cqw .5cqw; border-radius: .4cqw; text-align: left; break-inside: avoid; color: var(--disp-fg); }
.rec:hover { background: var(--item-bg, rgba(255,255,255,.09)); }
.rec i { flex: none; font-style: normal; font-size: .86em; color: var(--disp-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec b { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.about-page:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2.4cqw; align-items: start; }
.sheet .about { margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(14px, 1.45cqw, 20px); line-height: 1.35; color: var(--disp-fg); max-width: 34ch; text-wrap: balance; }
.sheet .meet { margin: .9cqw 0 0; font-size: inherit; color: var(--disp-2); }
.sheet .meet b { color: var(--disp-fg); }
.sheet .link { color: var(--disp-fg); font-size: inherit; }
.sheet .links { margin: 0 0 1.1cqw; }
.sheet .links a { color: var(--disp-fg); }
.sheet .skins { display: none; }
.swatches { display: flex; flex-wrap: wrap; gap: .5cqw; }
.swatch { height: clamp(22px, 2.1cqw, 28px); padding: 0 .9cqw; border-radius: 999px; color: var(--disp-fg); box-shadow: inset 0 0 0 1px var(--disp-line); font-size: clamp(10px, .9cqw, 13px); }
.swatch:hover { background: var(--item-bg, rgba(255,255,255,.09)); }
.swatch.on { box-shadow: inset 0 0 0 1.5px var(--disp-fg); }
@media (prefers-reduced-motion: reduce) { .set.skinned::after { transition: none; } }
.set.skinned .parts span { font-size: 9.5px; line-height: 11px; }
.set.skinned .hours { margin-top: 2px; }

/* ---------- 10.11: шкала читается как программа ----------
   Песни — отрезки на одной линии (название по наведению и под стрелкой), блок песен подписан сверху;
   проповедь — карточка: имя и тема. Нижний край шкалы свободен. */
.item.song { background: none !important; box-shadow: none !important; overflow: visible; padding: 0; opacity: 1; }
.item.song::before { content: ""; position: absolute; left: 0; right: 0; top: auto; bottom: 10px; width: auto; height: 5px; margin: 0; border-radius: 3px; background: var(--disp-fg); opacity: .3; transition: opacity .2s, height .2s; }
.item.song.past::before { opacity: .16; }
.item.song:hover::before { opacity: .7; }
.item.song.now::before { background: var(--now-bg, var(--lime)); opacity: 1; height: 11px; bottom: 7px; }
.item.song.focus::before { opacity: 1; height: 11px; bottom: 7px; }
.run { position: absolute; top: 9px; padding-left: 1px; font-size: 11px; letter-spacing: .02em; color: var(--disp-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.item.sermon { justify-content: center; text-align: left; bottom: 7px; height: auto !important; background: var(--item-bg, rgba(255,255,255,.07)); }
.item.sermon.future { background: var(--item-bg, rgba(255,255,255,.05)); box-shadow: inset 0 0 0 1px var(--item-line, rgba(255,255,255,.14)); }
.item.sermon b { font-size: 12.5px; }
.item.sermon i { opacity: .7; }

/* ---------- 10.11: портретный корпус (телефон) — тот же приёмник, поставленный вертикально ---------- */
body.skin-on { justify-content: center; }
.set.skinned.lay-portrait { width: min(100%, var(--sk-max), calc((100dvh - 40px) * var(--sk-w) / var(--sk-h))); }
.set.skinned.lay-portrait .display { --pw: 24cqw; --dial-h: 25cqw; padding: 3.4cqw 4cqw 0; gap: 2.6cqw 3.6cqw; }
.set.skinned.lay-portrait .state, .set.skinned.lay-portrait .rubric, .set.skinned.lay-portrait .role, .set.skinned.lay-portrait .meta { font-size: 3.3cqw; }
.set.skinned.lay-portrait .state { gap: 2cqw; }
.set.skinned.lay-portrait .state .plate { font-size: 3.8cqw; gap: 1.6cqw; margin-right: 1cqw; }
.set.skinned.lay-portrait .state .plate .brand .mark { width: 7cqw; height: 4cqw; }
.set.skinned.lay-portrait .state .plate .brand { gap: 1.8cqw; }
.set.skinned.lay-portrait .clock { font-size: 3.4cqw; } .set.skinned.lay-portrait .clock .tz { display: none; }
.set.skinned.lay-portrait .portrait { border-radius: 1.6cqw; align-self: center; }
.set.skinned.lay-portrait .card-text { align-self: center; }
.set.skinned.lay-portrait .voice { font-size: 6.2cqw; }
.set.skinned.lay-portrait .piece { font-size: 3.9cqw; margin-top: 1.6cqw; }
.set.skinned.lay-portrait .meta { gap: 1.8cqw 3cqw; }
.set.skinned.lay-portrait .meta .key { height: 7.6cqw; padding: 0 3cqw; font-size: 3.2cqw; gap: 1cqw; }
.set.skinned.lay-portrait .meta .key svg { width: 4cqw; height: 4cqw; }
.set.skinned.lay-portrait .meta .tabs { gap: 1.8cqw; }
.set.skinned.lay-portrait .dial { margin: 0 -4cqw; }
.set.skinned.lay-portrait .key.play svg { width: 7cqw; height: 7cqw; }
.set.skinned.lay-portrait .display.sheet-open .sheet { font-size: 3.4cqw; }
.set.skinned.lay-portrait .sheet-h { font-size: 2.8cqw; margin-bottom: 2cqw; }
.set.skinned.lay-portrait .recs { columns: 1; }
.set.skinned.lay-portrait .rec { padding: 1.4cqw 1cqw; gap: 2.4cqw; }
.set.skinned.lay-portrait .about-page:not([hidden]) { grid-template-columns: 1fr; gap: 4cqw; }
.set.skinned.lay-portrait .sheet .about { font-size: 4cqw; }
.set.skinned.lay-portrait .sheet .meet { margin-top: 2.4cqw; }
.set.skinned.lay-portrait .sheet .links { margin-bottom: 3cqw; }
.set.skinned.lay-portrait .swatches { gap: 1.6cqw; }
.set.skinned.lay-portrait .swatch { height: 7.6cqw; padding: 0 3cqw; font-size: 3.2cqw; }
.set.skinned.lay-portrait::after { height: 30%; -webkit-mask-image: linear-gradient(to top, #000, transparent 70%); mask-image: linear-gradient(to top, #000, transparent 70%); }
@media (max-width: 999px) { body.skin-on { padding: 10px 10px 30px; gap: 0; } }
.set.skinned { min-height: 0; flex: none; }
.set.skinned.lay-tall .display { --dial-h: clamp(88px, 6.6cqw, 100px); }
.item.sermon { padding-block: 2px; line-height: 1.25; }
/* v6 убран из выбора (10.11): до загрузки корпуса страница пустая, CSS-приёмник — только запасной вид при сбое загрузки скина */
body:not(.skin-on):not(.skin-off) .set, body:not(.skin-on):not(.skin-off) .shelf { visibility: hidden; }

/* 10.11, по снимкам с iPhone: строка состояния портретного корпуса не переносится; альбомный телефон — альбомный корпус, уменьшенный целиком */
.set.skinned .state > span, .set.skinned .state .brand span { white-space: nowrap; }
.set.skinned .state { flex-wrap: nowrap; min-width: 0; }
.set.skinned.lay-portrait .state:has(.when:not(:empty)) .clock { display: none; }
body.skin-on { display: flex; height: auto; background: var(--room); }
@media (orientation: landscape) and (max-height: 600px) { body.skin-on { padding: 6px 10px; justify-content: center; gap: 0; } }
