/* ============================================================
   TaichiNOW — Circadian Organ Clock · desktop dashboard
   Shared by /health/clock.html and /vi/health/clock.html
   ============================================================ */

:root {
  --paper: #fbfaf6;
  --paper-2: #f4f1e8;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --line: #e6e2d8;
  --line-2: #efebe2;
  --emerald: #047857;
  --emerald-2: #10b981;
  --emerald-soft: #ecfdf5;
  --gold: #c9a961;
  --wood: #2f7d5d;
  --fire: #b4453a;
  --earth: #a97c2f;
  --metal: #5b7d95;
  --water: #2f4f7d;
  --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 8px 24px rgba(24, 24, 27, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background .9s ease;
}

button { font-family: inherit; }

/* ---------- ambient background ---------- */

#ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 700px at 30% 22%, rgba(4, 120, 87, .05), transparent 62%),
    radial-gradient(900px 600px at 82% 78%, rgba(201, 169, 97, .09), transparent 60%);
  opacity: 1;
  transition: opacity 1.2s ease;
}

body.saver #ambient { opacity: .55; }

/* ---------- top bar ---------- */

.topbar {
  position: relative;
  z-index: 30;
  flex: 0 0 auto;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line-2);
  background: rgba(251, 250, 246, .82);
  backdrop-filter: blur(10px);
  transition: opacity .6s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}

.brand svg { width: 24px; height: 24px; display: block; }

.top-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
  flex: 0 0 auto;
}

.top-title {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-spacer { flex: 1 1 auto; }

.top-clock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald);
  background: var(--emerald-soft);
  border: 1px solid #c9efe0;
  padding: 5px 11px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-2);
  display: inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(.85); opacity: .55; }
  50% { transform: scale(1.2); opacity: 1; }
}

.tbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .18s, background .18s, color .18s;
  white-space: nowrap;
}

.tbtn:hover {
  border-color: #cfc9bb;
  background: #fffdf8;
  color: var(--ink);
}

.tbtn svg { width: 14px; height: 14px; }

.tbtn.lang { color: var(--emerald); border-color: #c9efe0; background: var(--emerald-soft); }
.tbtn.lang:hover { background: #dff9ee; border-color: #a7f3d0; }

/* ---------- stage ---------- */

.stage {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "ring video"
    "panel tabs";
  gap: 14px 22px;
  padding: 8px 22px 14px;
  --row2min: clamp(300px, 42vh, 420px);
  transition: padding .9s cubic-bezier(.4, 0, .2, 1);
}

.ring-wrap {
  grid-area: ring;
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  transition: transform 1s cubic-bezier(.4, 0, .2, 1);
}

#oc-svg {
  width: min(100%, clamp(272px, 41vh, 460px));
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
  overflow: visible;
}

/* screensaver: ring alone, centred */

body.saver .stage {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "ring";
  padding-bottom: 96px;
}

body.saver .ring-wrap { width: min(74vh, 84vw); justify-self: center; }
body.saver #oc-svg { width: 100%; }

/* ---------- ring segments ---------- */

.seg { cursor: pointer; outline: none; }

.seg-fill {
  fill: var(--seg-tint);
  fill-opacity: .06;
  stroke: #e7e3d9;
  stroke-width: 1;
  transition: fill-opacity .2s ease, fill .3s ease, stroke .3s ease;
}

.seg:hover .seg-fill { fill-opacity: .15; }

.seg:focus-visible .seg-fill {
  stroke: var(--emerald);
  stroke-width: 2;
}

.seg.is-now .seg-fill {
  fill: var(--emerald);
  fill-opacity: 1;
  stroke: var(--emerald);
  filter: url(#segGlow);
}

.seg.is-selected:not(.is-now) .seg-fill {
  fill-opacity: .22;
  stroke: var(--emerald);
  stroke-width: 1.6;
}

.seg .lbl-branch {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  fill: var(--ink);
  transition: fill .3s ease;
}

.seg .lbl-time {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .04em;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: fill .3s ease;
}

.seg .lbl-organ {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .02em;
  fill: var(--ink-2);
  transition: fill .3s ease;
}

.seg.is-now .lbl-branch { fill: var(--emerald); }
.seg.is-now .lbl-organ { fill: var(--ink); }
.seg.is-now .lbl-time { fill: var(--emerald); font-weight: 600; }

.seg.is-now .seg-dot { fill: #ffffff; opacity: .9; }

.seg-dot { opacity: .5; }

/* ---------- centre readout ---------- */

.c-time {
  font-family: var(--serif);
  font-size: 84px;
  font-weight: 500;
  fill: var(--ink);
  letter-spacing: .01em;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}

.c-branch {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  fill: var(--emerald);
  text-transform: uppercase;
}

.c-organ {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  fill: var(--ink);
}

.c-remain {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .03em;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- detail panel ---------- */

.panel {
  grid-area: panel;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 11px 18px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: opacity .6s ease, transform .6s ease;
  scrollbar-width: thin;
  scrollbar-color: #d9d4c8 transparent;
}

.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: #ded9cd; border-radius: 4px; }
.panel::-webkit-scrollbar-track { background: transparent; }

body.saver .panel,
body.saver .topbar,
body.saver .band-tabs,
body.saver .band-video {
  opacity: 0;
  pointer-events: none;
}

body.saver .panel,
body.saver .band-tabs,
body.saver .band-video {
  position: absolute;
  inset: auto;
}

body.saver .panel { transform: translateY(10px); }

.p-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-bottom: 8px;
}

.p-eyebrow .p-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-2);
  animation: pulse 2.4s ease-in-out infinite;
}

.p-eyebrow.is-preview { color: var(--gold); }
.p-eyebrow.is-preview .p-dot { background: var(--gold); animation: none; }

.p-organ {
  font-family: var(--serif);
  font-size: clamp(25px, 2.7vh, 32px);
  line-height: 1.1;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px 0;
  letter-spacing: -.005em;
}

.p-sub {
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.p-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid #cdeee0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill.ghost {
  background: #faf9f5;
  color: var(--ink-2);
  border-color: var(--line);
}

.pill.gold {
  background: #fdf8ec;
  color: #8a6d24;
  border-color: #efe1bd;
}

.pill.link {
  background: #fff;
  color: var(--emerald);
  border-color: var(--line);
  cursor: pointer;
  text-decoration: none;
}

.pill.link:hover { border-color: var(--emerald); background: var(--emerald-soft); }

.p-bar {
  position: relative;
  flex: 0 0 5px;
  height: 5px;
  border-radius: 999px;
  background: #f0ede5;
  overflow: hidden;
  margin-bottom: 7px;
}

.p-bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald) 0%, var(--emerald-2) 100%);
  transition: width 1s linear;
}

.p-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.p-top-main { flex: 1 1 auto; min-width: 0; }

/* ---------- video card (bottom band, right column) ---------- */

.vcard {
  flex: 1 1 auto;
  min-height: 0;
  width: fit-content;
  max-width: 100%;
  padding: 8px 8px 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(28, 25, 23, .05);
}

.pv-frame {
  position: relative;
  width: auto;
  height: min(var(--vid-h), 100%);
  aspect-ratio: 16 / 9;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #10151a;
}

.pv-title {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-frame img,
.pv-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
}

.pv-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .04) 40%, rgba(0, 0, 0, .38));
  cursor: pointer;
}

.pv-play span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  transition: transform .15s ease;
}

.pv-play:hover span { transform: scale(1.08); }

.pv-play svg { width: 16px; height: 16px; margin-left: 3px; fill: var(--emerald); }

.p-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  flex: 1 1 auto;
  gap: 5px 16px;
  padding: 0;
}

.blk {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  border-left: 2px solid var(--line);
  padding: 1px 0 1px 12px;
}

.blk h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 3px 0;
  font-size: clamp(10px, 1.1vh, 12px);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.blk p {
  margin: 0;
  font-size: clamp(12.2px, 1.3vh, 14px);
  line-height: 1.42;
  color: var(--ink-2);
}

.blk.drill { border-left-color: var(--emerald); }
.blk.drill h4 { color: var(--emerald); }

.blk.life { border-left-color: var(--gold); }
.blk.life h4 { color: #96762a; }

.p-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 7px;
  border-top: 1px solid var(--line-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 9px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .18s, border-color .18s, color .18s, transform .12s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--emerald);
  color: #fff;
  box-shadow: 0 4px 12px rgba(4, 120, 87, .22);
}

.btn-primary:hover { background: #056a4c; }

.btn-ghost {
  background: #fff;
  color: var(--ink-2);
  border-color: var(--line);
}

.btn-ghost:hover { border-color: #cfc9bb; background: #fffdf8; color: var(--ink); }

.p-next {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}

.p-next .n-lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #a1a1aa;
}

.n-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #faf9f5;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: border-color .18s, background .18s;
}

.n-item:hover { border-color: var(--emerald); background: var(--emerald-soft); }

.n-item i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* the old footer row: its meta text now rides in the panel header row,
   and the "Health Series" link is already the topbar brand link */
.n-meta {
  flex: 0 0 auto;
  max-width: 48%;
  text-align: right;
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prog-arc {
  stroke: #059669;
  stroke-width: 6;
  stroke-linecap: round;
  fill: none;
}

/* ---------- stage panes: video (top right), 12 tabs (bottom right) ---------- */

.band-video {
  grid-area: video;
  --vid-h: min(calc(100vh - 124px - var(--row2min)), calc((56vw - 46px) * 9 / 16));
}

.band-tabs { grid-area: tabs; }

.band-video,
.band-tabs {
  min-height: 0;
  transition: opacity .6s ease;
}

.band-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.band-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  min-height: 13px;
}

.band-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--emerald);
  white-space: nowrap;
}

.band-hint {
  font-size: 9.5px;
  color: #a8a29e;
  white-space: nowrap;
}

.band-link {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.band-link:hover { color: var(--emerald); text-decoration: underline; }

.strip {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
}

.cell {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px 11px;
  cursor: pointer;
  overflow: hidden;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s, transform .12s;
}

.cell:hover { border-color: #cfc9bb; transform: translateY(-1px); }

.cell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--tint);
  opacity: .6;
}

.cell .c-organ {
  display: block;
  font-size: clamp(12px, .95vw, 17px);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.cell .c-range {
  display: block;
  font-size: clamp(10.5px, .8vw, 14.5px);
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  white-space: nowrap;
}

.c-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0%;
  background: var(--emerald-2);
  transition: width 1s linear;
}

.cell.now {
  background: var(--emerald);
  border-color: var(--emerald);
  box-shadow: 0 6px 18px rgba(4, 120, 87, .22);
}

.cell.now::before { opacity: 0; }
.cell.now .c-organ { color: #fff; }
.cell.now .c-range { color: #a7f3d0; }
.cell.now .c-fill { background: #6ee7b7; }

.cell.is-selected:not(.now) {
  border-color: var(--emerald);
  background: var(--emerald-soft);
}

/* ---------- screensaver note ---------- */

.saver-note {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(8px);
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: opacity .8s ease, transform .8s ease;
}

body.saver .saver-note { opacity: 1; transform: translateX(-50%) translateY(0); }

.saver-note .sn-drill {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink-2);
  margin-bottom: 8px;
  max-width: 760px;
  padding: 0 20px;
}

.saver-note .sn-hint {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #a1a1aa;
}

/* ---------- drill overlay ---------- */

.overlay {
  position: fixed;
  pointer-events: none;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(24, 24, 27, .38);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
}

.overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.overlay-card {
  position: relative;
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 28px 24px;
  box-shadow: 0 30px 80px rgba(24, 24, 27, .28);
  transform: translateY(12px) scale(.985);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.overlay.open .overlay-card { transform: translateY(0) scale(1); }

.overlay-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.overlay-x:hover { color: var(--ink); border-color: #cfc9bb; }

.ov-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--emerald);
  margin-bottom: 8px;
}

.ov-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.15;
}

.ov-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 18px 0;
}

.ov-clock {
  font-family: var(--serif);
  font-size: 76px;
  line-height: 1;
  font-weight: 500;
  text-align: center;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  color: var(--ink);
  letter-spacing: .01em;
}

.ov-clock.done { color: var(--emerald); font-size: 58px; }

.ov-presets {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 18px;
}

.ov-preset {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.ov-preset:hover { border-color: var(--emerald); color: var(--emerald); }

.ov-preset.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

.ov-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .stage { gap: 12px 14px; padding: 8px 14px 12px; }
  .strip { gap: 6px; }
  .cell { padding: 8px 10px 9px; }
  .cell .c-organ { font-size: 11.5px; }
  .cell .c-range { font-size: 10px; }
  .p-organ { font-size: 26px; }
}

@media (max-width: 960px) {
  body { display: block; height: auto; min-height: 100%; overflow: auto; }
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "ring" "video" "panel" "tabs";
    gap: 14px; padding: 10px 14px 18px;
  }
  .ring-wrap { width: min(78vw, 420px); margin: 0 auto; }
  #oc-svg { width: 100%; }
  .panel { overflow: visible; }
  .band-video .vcard { width: 100%; max-width: 520px; margin: 0 auto; }
  .pv-frame { width: 100%; height: auto; }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; }
  .cell { min-height: 60px; }
  .p-blocks { grid-template-columns: 1fr; }
}

@media (max-height: 760px) {
  .topbar { height: 50px; }
  .p-organ { font-size: 25px; }
  .blk p { font-size: 12.4px; line-height: 1.5; }
  .p-blocks { gap: 10px; }
  .c-organ { font-size: 21px; }
}

@media (max-height: 820px) {
  .stage { --row2min: 372px; }
  #oc-svg { width: min(100%, 34vh); }
  .p-organ { font-size: 24px; }
  .p-sub { display: none; }
  .p-blocks { gap: 6px 14px; }
  .blk { padding: 0 0 0 12px; }
  .blk p { font-size: 11.9px; line-height: 1.4; }
  .blk h4 { margin-bottom: 1px; font-size: 10.5px; }
  .p-actions { margin-top: 6px; padding-top: 7px; }
  .p-next { margin-top: 3px; }
  .pv-title { display: none; }
}

/* narrow desktops: the 2x2 panel blocks get cramped, so give the panel
   more of the column height and tighten its body text. Must come after the
   max-height rules above, otherwise those override these values. */

@media (max-width: 1180px) {
  .stage { --row2min: 400px; }
  .blk p { font-size: 11.6px; line-height: 1.38; }
}

/* very short windows: the ring would otherwise set the top row and squeeze
   the panel out of its own row */

@media (max-height: 700px) {
  #oc-svg { width: min(100%, 30vh); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
