/* Clinic Studio — Direction A, Clinical Editorial. White paper, deep ink, muted teal; dark player sheet. */
:root {
  --paper: #ffffff;
  --paper-2: #f5f4f0;          /* used sparingly: side cards, poster */
  --sea: #e7efec;
  --ink: #172c35;
  --ink-2: #33464e;
  --muted: #55656c;            /* 6.1:1 on white */
  --teal: #246f6b;             /* 5.9:1 on white */
  --teal-ink: #1b5552;
  --rule: #e2e0da;
  --warn: #8a3b12;
  --warn-bg: #fbf1ea;
  --night: #0d1b20;
  --night-2: #15282f;
  --night-text: #f1f5f4;
  --night-muted: #a9bab7;      /* 8.6:1 on --night */
  --night-teal: #7cc7be;
  --serif: "Iowan Old Style", "Charter", "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 16px;
  /* v5 design system: grouped canvas, white cards, one spacing/type/elevation scale. */
  --canvas: #f2f4f3;           /* phone grouped background; --muted is 5.2:1 on it */
  --stage: #e8ebe9;
  --tint: #e3efec;             /* tinted (secondary) button + selected surfaces */
  --tint-2: #d3e7e2;
  --hair: rgba(23, 44, 53, .09);
  --hair-2: rgba(23, 44, 53, .14);
  --live: #c8322a;
  --live-bg: #fcebe9;
  --amber: #7a4a0c;
  --amber-bg: #fbf0dc;
  --info: #2c3f66;
  --info-bg: #e5eaf5;
  --sh-1: 0 1px 2px rgba(23, 44, 53, .05), 0 1px 3px rgba(23, 44, 53, .04);
  --sh-2: 0 2px 4px rgba(23, 44, 53, .04), 0 8px 24px rgba(23, 44, 53, .08);
  --sh-3: 0 30px 70px -18px rgba(16, 33, 40, .38), 0 12px 24px -12px rgba(16, 33, 40, .25);
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --ion-font-family: var(--sans);
  --ion-text-color: #172c35;
  --ion-text-color-rgb: 23, 44, 53;
  --ion-background-color: #fff;
  --ion-color-primary: #246f6b;
  --ion-color-primary-rgb: 36, 111, 107;
  --ion-color-primary-contrast: #fff;
  --ion-color-primary-contrast-rgb: 255, 255, 255;
  --ion-color-primary-shade: #1b5552;
  --ion-color-primary-tint: #3a7d7a;
}
html[lang="ar"] {
  --serif: "Al Nile", "Noto Naskh Arabic", "Geeza Pro", "Times New Roman", serif;
  --sans: "SF Arabic", "Geeza Pro", "Noto Sans Arabic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  /* The presenter page scrolls; Ionic structure.css assumes a full-screen app. */
  position: static; height: auto; max-height: none; overflow-y: auto; transform: none;
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 var(--sans);
  overflow-x: hidden;
}
html[lang="ar"] body { line-height: 1.75; }
a { color: var(--teal-ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.sheet :focus-visible { outline-color: var(--night-teal); }
.sr, .sr-sm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; border-radius: 6px; }
.skip:focus { top: 8px; }
svg { flex: none; }
bdi { unicode-bidi: isolate; }

/* ---------- brand (presenter rail) ---------- */
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.1; }
.wordmark { font: 600 1.45rem/1 var(--serif); letter-spacing: -.01em; }
html[lang="ar"] .wordmark { font-family: "Iowan Old Style", Georgia, serif; }
.brand-sub { font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
html[lang="ar"] .brand-sub { text-transform: none; letter-spacing: 0; font-size: .72rem; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.persona select {
  font: inherit; font-size: .85rem; color: var(--ink); border: 1px solid var(--rule); border-radius: 999px;
  padding: 7px 12px; background: var(--paper); max-width: 270px;
}
.pill {
  font: inherit; font-size: .85rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: 7px 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 36px;
}
.pill:hover { border-color: var(--ink-2); }
.pill[aria-pressed="true"] { background: var(--teal); color: #fff; border-color: var(--teal); }
.pill.subtle { color: var(--muted); }
.pill.light { background: var(--paper); font-size: .9rem; }

/* ---------- typography + primitives ---------- */
main { max-width: 1200px; margin: 0 auto; padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 40px); outline: none; }
.display { font: 500 clamp(2.1rem, 5.4vw, 4.2rem)/1.04 var(--serif); letter-spacing: -.02em; margin: .2em 0 .35em; text-wrap: balance; }
.display.sm { font-size: clamp(1.7rem, 3.6vw, 2.7rem); line-height: 1.1; }
html[lang="ar"] .display { line-height: 1.35; letter-spacing: 0; font-weight: 600; }
.h2 { font: 500 1.6rem/1.2 var(--serif); margin: 0 0 16px; }
.h3 { font: 600 1.15rem/1.3 var(--serif); margin: 0 0 8px; }
html[lang="ar"] .h2, html[lang="ar"] .h3 { line-height: 1.5; }
.kicker { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
html[lang="ar"] .kicker { letter-spacing: 0; text-transform: none; font-size: .85rem; }
.kicker.teal { color: var(--teal); }
.kicker.warn { color: var(--warn); }
.kicker.light { color: var(--night-muted); }
.kicker svg { width: 16px; height: 16px; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 60ch; margin: 0 0 18px; }
.meta { color: var(--muted); margin: 0 0 6px; font-size: .95rem; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.meta svg { width: 18px; height: 18px; }
.fine { font-size: .82rem; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.row.stack { flex-direction: column; align-items: stretch; }
.muted-light { color: var(--night-muted); }
.fine-light { color: var(--night-muted); font-size: .8rem; }
code { font-family: var(--mono); font-size: .85em; background: var(--sea); padding: 1px 6px; border-radius: 4px; }
.btn {
  font: inherit; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  min-height: 46px; padding: 10px 20px; border-radius: 12px; border: 1px solid var(--rule); background: var(--paper);
  color: var(--ink); text-decoration: none; cursor: pointer; transition: background .18s, transform .18s;
}
.btn:hover { background: var(--sea); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost-light { background: transparent; color: var(--night-text); border-color: var(--night-muted); }
.btn .fine { color: inherit; opacity: .8; font-weight: 400; }
.link { font: inherit; background: none; border: 0; color: var(--teal-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 0; }
.link.light { color: var(--night-teal); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; padding: 0;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn.play { background: var(--ink); color: #fff; border-color: var(--ink); }
.card { border: 1px solid var(--rule); border-radius: var(--r); padding: 20px; background: var(--paper); }
.card.paper { background: var(--paper-2); border-color: transparent; }
.label-mock {
  font-size: .8rem; color: var(--warn); background: var(--warn-bg); border-inline-start: 3px solid var(--warn);
  padding: 6px 10px; border-radius: 4px; margin: 10px 0;
}
.sheet .label-mock { background: rgba(255,255,255,.06); color: #f3c9a9; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c0392b; display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- scope chips (hidden until Scope is pressed) ---------- */
.scope-chip {
  display: none; font: 600 .7rem/1 var(--sans); letter-spacing: .02em; text-transform: none;
  padding: 5px 8px; border-radius: 4px; white-space: nowrap; vertical-align: middle;
}
body.scope-on .scope-chip { display: inline-block; }
.k-inc { background: #dcefeb; color: #12403e; }
.k-opt { background: #f8ead3; color: #6a3f06; }
.k-dec { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.sheet .k-dec { background: transparent; color: var(--night-text); box-shadow: inset 0 0 0 1.5px var(--night-muted); }

/* ---------- covers (typographic artwork, no stock imagery) ---------- */
.cover {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; display: grid;
  grid-template-rows: auto 1fr auto auto; padding: 9%; color: #fff; background: var(--ink); isolation: isolate;
}
.cover::after { content: ""; position: absolute; inset: auto -20% -35% auto; width: 75%; aspect-ratio: 1; border-radius: 50%; border: 1px solid currentColor; opacity: .18; z-index: -1; }
.cover-ch { font: 600 .72em/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
html[lang="ar"] .cover-ch { letter-spacing: 0; }
.cover-no { font: 500 3.2em/1 var(--serif); align-self: end; letter-spacing: -.02em; }
.cover-no i { font-style: normal; opacity: .5; padding: 0 .08em; }
.cover-rule { height: 1px; background: currentColor; opacity: .5; margin: .7em 0 .5em; }
.cover-area { font: italic .85em/1.2 var(--serif); }
.cover.h0 { background: var(--ink); } .cover.h0 .cover-no { color: var(--night-teal); }
.cover.h1 { background: var(--sea); color: var(--ink); }
.cover.h2 { background: var(--teal); }
.cover.h3 { background: #efece4; color: var(--ink); }
.cover.h4 { background: #3a4f57; }
.cover.h5 { background: #0f3b3a; } .cover.h5 .cover-no { color: #bfe3dc; }
.cover.xs { width: 48px; font-size: 5px; padding: 7px; border-radius: 6px; }
.cover.sm { width: 64px; font-size: 6.5px; flex: none; }
.cover.lg { width: min(260px, 100%); font-size: 16px; }
.cover.xl { width: min(380px, 100%); font-size: 22px; margin-inline: auto; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.cover.hero { width: 100%; font-size: clamp(16px, 2.6vw, 28px); border-radius: 12px; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding-bottom: 40px; border-bottom: 1px solid var(--rule); }
.hero-art { display: block; transition: transform .22s; }
.hero-art:hover { transform: translateY(-3px); }
.disc-inline { font-size: .9rem; color: var(--ink-2); border-inline-start: 3px solid var(--teal); padding-inline-start: 10px; margin: 12px 0 18px; }
.progress { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; max-width: 520px; }
.progress span { display: block; height: 100%; background: var(--teal); transition: width .25s linear; }
.hero-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.left { color: var(--muted); font-variant-numeric: tabular-nums; }
.section { padding-top: 40px; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
.side { display: grid; gap: 16px; }
.ep-list { list-style: none; margin: 0; padding: 0; }
.ep-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.ep-row-link { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; min-width: 0; }
.ep-title { display: block; font: 500 1.08rem/1.3 var(--serif); color: var(--ink); }
html[lang="ar"] .ep-title { line-height: 1.6; }
.ep-row-link:hover .ep-title { text-decoration: underline; text-underline-offset: 3px; }
.ep-row .meta { font-size: .85rem; margin: 2px 0 0; }
.lang-pill { font: 600 .68rem/1 var(--sans); border: 1px solid var(--rule); border-radius: 4px; padding: 4px 6px; color: var(--muted); }
.dur { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
.live-card { text-decoration: none; color: inherit; border-color: var(--ink); transition: background .18s; }
.live-card:hover { background: var(--sea); }
.hub-link { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--rule); text-decoration: none; color: var(--ink); font-family: var(--serif); }
.hub-link svg { width: 16px; height: 16px; color: var(--muted); }

/* ---------- episode + gate ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); margin-bottom: 18px; }
html[dir="rtl"] .back svg { transform: scaleX(-1); }
.ep-head { display: grid; grid-template-columns: 260px 1fr; gap: clamp(20px, 4vw, 44px); align-items: start; }
.gate { margin-top: 32px; border: 1.5px solid var(--warn); border-radius: var(--r); padding: clamp(18px, 3vw, 28px); background: var(--paper); }
.gate .h2 { color: var(--ink); }
.mock { font: .82rem/1.5 var(--mono); background: var(--night); color: var(--night-text); padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 16px 0 4px; white-space: pre-wrap; }
.mock em { color: var(--night-muted); font-style: normal; }
.disclosure { margin-top: 28px; border-top: 1px solid var(--rule); padding-top: 14px; max-width: 760px; }
.disclosure summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.disclosure dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0; }
.disclosure dt { color: var(--muted); }
.disclosure dd { margin: 0; }

/* ---------- search ---------- */
.search-box { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--ink); border-radius: 999px; padding: 6px 18px; max-width: 720px; }
.search-box input { flex: 1; border: 0; font: 1.15rem var(--sans); padding: 10px 0; outline: none; background: transparent; color: var(--ink); min-width: 0; }
.search-box:focus-within { box-shadow: 0 0 0 3px #cfe5e1; }
.hint { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); margin: 16px 0; }
.sr-status { font-weight: 600; margin: 8px 0; }
.empty { padding: 28px 0; color: var(--muted); }

/* ---------- live ---------- */
.lobby { max-width: 640px; margin-top: 18px; display: grid; gap: 12px; }
.audio-only { display: flex; align-items: center; gap: 8px; font: 600 1.05rem var(--sans); color: var(--teal); margin: 0; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--teal); }
.room { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-top: 18px; }
.stage { background: var(--night); color: var(--night-text); border-radius: 14px; padding: clamp(18px, 3vw, 30px); display: grid; gap: 18px; }
.stage .audio-only { color: var(--night-teal); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile { background: var(--night-2); border-radius: 12px; padding: 18px 10px; display: grid; justify-items: center; gap: 8px; text-align: center; border: 1px solid transparent; transition: border-color .3s; }
.tile.speaking { border-color: var(--night-teal); }
.tile.me { border-color: #2f5560; }
.tile video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #000; display: block; }
.tile audio { display: none; }
.tile-sp { font-size: .72rem; color: var(--night-muted); }
.tile-note { font-size: .75rem; color: var(--night-muted); margin: 0; }
.tile-badge { margin: 0; font-size: .75rem; color: var(--night-muted); }
.stage .row { flex-wrap: wrap; }
.avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #24414a; font: 600 1.2rem var(--serif); color: var(--night-text); }
.avatar.sm { width: 32px; height: 32px; font-size: .85rem; background: var(--sea); color: var(--ink); flex: none; }
.tile-name { font-size: .85rem; color: var(--night-muted); }
.eq { display: flex; gap: 3px; height: 14px; align-items: end; opacity: 0; }
.tile.speaking .eq { opacity: 1; }
.eq i { width: 3px; background: var(--night-teal); animation: eq 0.9s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 14px; } }
.captions { border-top: 1px solid #2a3f46; padding-top: 12px; min-height: 84px; }
.captions p { margin: 0; }
#caption { font: 1.15rem/1.45 var(--serif); }
#caption b { font: 600 .8rem var(--sans); color: var(--night-teal); display: block; margin-bottom: 2px; }
.rec { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; color: #f3c9a9; font-weight: 600; font-size: .9rem; }
.rec svg { color: #e2735a; width: 14px; height: 14px; }
.qa { display: grid; gap: 14px; align-content: start; }
.qa textarea { width: 100%; font: inherit; border: 1.5px solid var(--ink); border-radius: 8px; padding: 10px 12px; resize: vertical; margin-bottom: 10px; }
.qa-list { list-style: none; padding: 0; margin: 0; }
.qa-item { border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; }
.qa-item p { margin: 0 0 6px; }
.qa-item.s-pending { border-style: dashed; }
.qa-item.s-answered { border-color: var(--teal); }
.answer { font-family: var(--serif); color: var(--teal-ink); }
.mod { border: 1px solid var(--ink); border-radius: var(--r); padding: 16px; background: var(--paper-2); display: grid; gap: 10px; }
.mod.dim { border-color: var(--rule); }
.mod-q { margin: 0; font-family: var(--serif); }

/* ---------- review ---------- */
.pipeline { display: flex; gap: 0; margin: 22px 0 28px; flex-wrap: wrap; }
.pipeline span { padding: 8px 14px; font-size: .85rem; border: 1px solid var(--rule); margin-inline-end: -1px; color: var(--muted); }
.pipeline span:first-child { border-start-start-radius: 999px; border-end-start-radius: 999px; }
.pipeline span:last-child { border-start-end-radius: 999px; border-end-end-radius: 999px; }
.pipeline .done { background: var(--sea); color: var(--ink); }
.pipeline .now { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
.tbl { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: .92rem; }
.tbl th, .tbl td { text-align: start; padding: 10px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl thead th { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom-color: var(--ink); }
.tbl tr.sub td { color: var(--muted); font-size: .85rem; padding-top: 0; }
.state { font-weight: 600; }
del { color: var(--muted); }
ins { text-decoration: none; background: #dcefeb; padding: 0 4px; border-radius: 3px; }
.actions { display: grid; gap: 12px; }
.approve { display: grid; gap: 10px; }
.approve select { font: inherit; padding: 8px; border-radius: 6px; border: 1px solid var(--rule); margin-inline-start: 8px; }
.refused { color: var(--warn); background: var(--warn-bg); padding: 10px 12px; border-radius: 6px; margin: 0; font-weight: 600; }
.ok { color: var(--teal); font-weight: 600; margin: 0; }
.audit { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: .88rem; }
.audit li { border-inline-start: 2px solid var(--rule); padding-inline-start: 10px; }

/* ---------- sponsor ---------- */
.banner { background: var(--sea); padding: 10px 14px; border-radius: 8px; font-size: .9rem; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; margin: 20px 0 10px; }
.kpi { background: var(--paper); padding: 20px; display: grid; gap: 4px; color: var(--muted); font-size: .88rem; }
.kpi-n { font: 500 2rem/1.1 var(--serif); color: var(--ink); }
.kpi.masked { background: repeating-linear-gradient(135deg, #f6f5f1 0 8px, #fff 8px 16px); }
.kpi.masked .kpi-n { font-size: 1.4rem; color: var(--warn); }
.xtab { margin: 28px 0 0; }
.scroll { overflow-x: auto; }
.tbl.num td, .tbl.num tfoot td { text-align: end; font-variant-numeric: tabular-nums; }
.tbl.num tbody th, .tbl.num tfoot th { text-align: start; font-weight: 500; }
.tbl td.sup { color: var(--muted); font-size: .78rem; background: repeating-linear-gradient(135deg, #f6f5f1 0 6px, #fff 6px 12px); }
.tbl .tot { font-weight: 600; }
.tbl tfoot th, .tbl tfoot td { border-top: 1.5px solid var(--ink); border-bottom: 0; }
.export { margin-top: 32px; display: grid; gap: 4px; justify-items: start; }

/* ---------- decisions ---------- */
.decisions { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 18px; }
.decision { border: 1px solid var(--rule); border-radius: var(--r); padding: clamp(16px, 3vw, 24px); }
.decision.first { border: 2px solid var(--ink); }
.dec-head { display: flex; gap: 16px; }
.dec-no { font: 500 2.4rem/1 var(--serif); color: var(--teal); min-width: 1.2em; }
fieldset { border: 0; padding: 0; margin: 14px 0; display: grid; gap: 6px; }
.opt { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--teal); background: var(--sea); }
.opt input { accent-color: var(--teal); width: 18px; height: 18px; }
.dec-fields { display: grid; grid-template-columns: 1fr 180px; gap: 10px; }
.dec-fields label { display: grid; gap: 4px; font-size: .82rem; color: var(--muted); }
.dec-fields .wide { grid-column: 1 / -1; }
.dec-fields input { font: inherit; color: var(--ink); padding: 9px 10px; border: 1px solid var(--rule); border-radius: 6px; min-height: 42px; }

/* ---------- appendix ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--rule); margin-bottom: 24px; flex-wrap: wrap; }
.tabs button { font: inherit; background: none; border: 0; padding: 12px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.patient-grid { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
.poster { background: var(--paper-2); border-radius: 14px; padding: 28px; text-align: center; display: grid; justify-items: center; gap: 4px; }
.poster-h { font: 600 2rem/1.4 "Al Nile", "Noto Naskh Arabic", "Geeza Pro", serif; margin: 6px 0 0; }
.poster-sub { font: italic 1.1rem var(--serif); margin: 0 0 14px; }
.qr-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 8px; }
.qr { width: 180px; height: 180px; display: block; box-shadow: 0 6px 24px rgba(23,44,53,.12); border-radius: 6px; transition: transform .18s; }
.qr-btn:hover .qr { transform: scale(1.03); }
.phone { border: 10px solid var(--ink); border-radius: 36px; min-height: 600px; background: var(--paper); display: flex; flex-direction: column; overflow: hidden; }
.ph-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--rule); font: 600 1rem var(--serif); }
.ph-bar .link { font: .85rem var(--sans); }
.ph-body { padding: 20px 18px; display: grid; gap: 12px; align-content: start; flex: 1; }
.ph-body.center { place-content: center; }
.ph-body h3 { font: 600 1.3rem/1.4 var(--serif); margin: 0; }
.phone[lang="ar"] .ph-body h3 { font-family: "Al Nile", "Noto Naskh Arabic", "Geeza Pro", serif; }
.ph-body input, .ph-body select { font: 1.3rem var(--sans); padding: 10px 12px; border: 1.5px solid var(--ink); border-radius: 8px; letter-spacing: .1em; }
.demo-code { background: var(--sea); padding: 8px 10px; border-radius: 6px; margin: 0; }
.p-card { display: flex; gap: 10px; align-items: center; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; }
.p-card span:nth-child(2) { flex: 1; }
.p-card .icon-btn { width: 38px; height: 38px; }
.gate-mini { color: var(--warn); background: var(--warn-bg); padding: 10px; border-radius: 8px; font-size: .9rem; margin: 0; }
.gate-mini svg { width: 16px; height: 16px; vertical-align: -3px; }
.ph-reset { margin: 10px auto 16px; font-size: .85rem; }
.stills { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.still { margin: 0; }
.still figcaption { font-size: .9rem; color: var(--ink-2); margin-top: 10px; }
.sb-in, .sc-in { aspect-ratio: 4/3; border-radius: 12px; padding: 24px; display: grid; align-content: end; gap: 10px; position: relative; overflow: hidden; }
.sb-in { background: radial-gradient(120% 90% at 80% 0%, #3b2a1d 0%, #16110d 60%); color: #f3e7d6; }
.sb-k { font: 600 .7rem var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #d9a56b; }
.sb-t { font: 500 1.8rem/1.1 var(--serif); }
.sb-w { display: flex; gap: 4px; align-items: end; height: 30px; }
.sb-w i { width: 5px; background: #d9a56b; border-radius: 2px; height: 40%; }
.sb-w i:nth-child(2n) { height: 90%; } .sb-w i:nth-child(3n) { height: 60%; }
.sb-p { position: absolute; top: 24px; inset-inline-end: 24px; width: 52px; height: 52px; border-radius: 50%; background: #d9a56b; color: #16110d; display: grid; place-items: center; }
.sc-in { background: #0b2540; color: #fff; align-content: start; }
.sc-live { background: #d7263d; font: 700 .75rem var(--sans); padding: 4px 8px; border-radius: 3px; justify-self: start; letter-spacing: .1em; }
.sc-t { font: 700 1.5rem var(--sans); letter-spacing: -.01em; }
.sc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sc-grid i { aspect-ratio: 16/10; background: linear-gradient(160deg, #1e4f7a, #0f3352); border-radius: 4px; }
.sc-tick { position: absolute; bottom: 0; inset-inline: 0; background: #f2c14e; color: #0b2540; font: 700 .75rem var(--sans); padding: 8px 14px; }

/* ---------- mini-player ---------- */
.mini {
  position: relative; flex: none; margin: 0 8px; height: 70px; background: var(--ink); color: #fff; border-radius: 12px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 4px; align-items: center; padding: 4px 8px;
}
body.sheet-open .mini { display: none; }
.mini-open { display: flex; gap: 12px; align-items: center; background: none; border: 0; color: inherit; text-align: start; cursor: pointer; min-width: 0; padding: 4px; font: inherit; }
.mini-meta { display: grid; min-width: 0; }
.mini-title { font: 500 .98rem/1.3 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: .78rem; color: var(--night-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-time { font: .8rem var(--mono); color: var(--night-muted); }
.mini .icon-btn { background: transparent; color: #fff; border-color: #34505a; }
.mini .icon-btn.play { background: #fff; color: var(--ink); border-color: #fff; }
.mini-bar { position: absolute; inset-inline: 16px; bottom: 6px; height: 2px; background: #2d4650; border-radius: 2px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--night-teal); }

/* ---------- full-screen player sheet (dark) ---------- */
.sheet {
  position: absolute; inset: 42px 0 18px; z-index: 40; overflow-y: auto; color: var(--night-text); border-radius: 20px 20px 0 0; overscroll-behavior: contain;
  background: radial-gradient(90% 60% at 20% 0%, #17404a 0%, var(--night) 55%), var(--night);
  animation: rise .2s ease-out;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.sheet[hidden] { display: none; }
.sheet-inner { max-width: 1100px; margin: 0 auto; padding: 16px clamp(16px, 4vw, 40px) 48px; }
.sheet-top { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; text-align: center; }
.sheet-top .kicker { justify-content: center; }
.icon-btn.ghost { background: transparent; color: var(--night-text); border-color: #34505a; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(24px, 5vw, 64px); align-items: center; margin-top: 24px; }
.sheet-title { font: 500 clamp(1.7rem, 3.4vw, 2.6rem)/1.12 var(--serif); margin: 4px 0 10px; }
html[lang="ar"] .sheet-title { line-height: 1.45; }
.sheet-speaker { color: var(--night-muted); margin: 0 0 12px; }
.sheet-disc { font-size: .88rem; color: #dbe5e3; border-inline-start: 3px solid var(--night-teal); padding-inline-start: 10px; margin: 0 0 20px; }
.seek input { width: 100%; accent-color: var(--night-teal); height: 28px; }
.seek-times { display: flex; justify-content: space-between; font: .82rem var(--mono); color: var(--night-muted); }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0; }
.controls .pill { background: transparent; color: var(--night-text); border-color: #34505a; min-width: 64px; justify-content: center; }
.controls .pill svg { width: 18px; height: 18px; }
.icon-btn.big { width: 56px; height: 56px; }
.icon-btn.huge { width: 76px; height: 76px; background: var(--night-text); color: var(--night); border: 0; }
.icon-btn.huge svg { width: 32px; height: 32px; }
.sheet-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; border-top: 1px solid #284049; padding-top: 14px; }
.sleep { display: inline-flex; gap: 8px; align-items: center; font-size: .9rem; }
.sleep select { font: inherit; background: var(--night-2); color: var(--night-text); border: 1px solid #34505a; border-radius: 999px; padding: 6px 10px; }
.offline { font-size: .8rem; color: var(--night-muted); display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.offline svg { width: 16px; height: 16px; }
.bms h3, .sample-transcript h3 { font: 600 .74rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--night-muted); margin: 0 0 .5rem; }
.bms ul { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 0; }
.bms p { margin: 0; font-size: .88rem; }

/* ---------- badge + toast ---------- */
.badge {
  margin: 0; font-size: .72rem; color: var(--muted); background: #fff; border: 1px solid var(--rule);
  padding: 4px 10px; border-radius: 999px; display: flex; gap: 6px; align-items: center; width: fit-content;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #d08a3e; }
.toast {
  position: absolute; left: 50%; top: 104px; transform: translate(-50%, -12px); z-index: 60; width: calc(100% - 24px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: .92rem; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- presentation stage + mobile app ---------- */
body { padding: 0; background: #eaece8; }
.presentation { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.presenter { padding: 32px 24px; border-inline-end: 1px solid #d0d6d0; background: #f5f4f0; }
.presenter-heading { margin-bottom: 24px; }
.presenter-note { color: var(--muted); font: italic 1rem var(--serif); }
.presenter-controls > summary { font-size: .85rem; cursor: pointer; min-height: 44px; }
.presenter .tools { justify-content: start; margin-bottom: 28px; }
.presenter .persona { width: 100%; font-size: .8rem; display: grid; gap: 6px; }
.presenter .persona select { width: 100%; max-width: 100%; border-radius: 8px; min-height: 44px; }
.pill { min-height: 44px; }
#stage-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 28px; }
#stage-modes a { border: 1px solid var(--rule); border-radius: 8px; padding: 10px; min-height: 44px; text-align: center; text-decoration: none; font-size: .8rem; }
#stage-modes a[aria-current] { background: var(--ink); color: #fff; }
.guided-steps { padding-inline-start: 20px; color: var(--muted); font-size: .8rem; }
.guided-steps a { display: block; padding: 10px 0; min-height: 44px; text-decoration: none; }
.guided-steps a[aria-current] { color: var(--ink); font-weight: 700; }
.appendix-link { display: block; font-size: .8rem; padding: 12px 0; }
.demo-stage { display: flex; justify-content: center; align-items: start; gap: 32px; padding: 28px; min-width: 0; }
.phone-wrap { flex: 0 0 390px; width: 390px; }
.device-label { margin: 0 0 12px; text-align: center; color: var(--muted); font: .7rem var(--mono); }
.device { position: relative; isolation: isolate; display: flex; flex-direction: column; width: 390px; height: 844px; border: 8px solid #17272d; border-radius: 48px; overflow: hidden; background: var(--paper); box-shadow: 0 25px 70px #172c3526, 0 0 0 1px #5c696d; }
.status-bar { height: 42px; flex: none; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; position: relative; font: 600 .75rem var(--sans); }
.status-bar > span:last-child { display: flex; align-items: center; gap: 6px; }
.notch { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 104px; height: 25px; background: #17272d; border-radius: 20px; }
.battery { width: 22px; height: 11px; border: 1.5px solid var(--ink); border-radius: 3px; box-shadow: inset 0 0 0 1.5px #fff; background: var(--ink); }
.app-header { display: flex; justify-content: space-between; align-items: center; min-height: 58px; padding: 0 20px; border-bottom: 1px solid var(--rule); }
.app-header a { color: var(--ink); text-decoration: none; }
.app-header .wordmark { font-size: 1.35rem; }
.app-header .avatar { width: 44px; height: 44px; }
.app-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.app-content main { padding: 22px 18px 28px; width: 100%; }
.device .display { font-size: 2rem; line-height: 1.13; }
.device .display.sm { font-size: 1.85rem; }
.device .lede { font-size: .95rem; }
.device .hero, .device .two-col, .device .ep-head, .device .room, .device .sheet-grid { grid-template-columns: 1fr; gap: 20px; }
.device .hero { padding-bottom: 24px; }
.device .hero-art { grid-row: 1; width: 100%; }
.device .cover.hero { aspect-ratio: 1.85; font-size: 15px; padding: 18px; }
.device .section { padding-top: 24px; }
.device .h2 { font-size: 1.4rem; }
.device .hero-actions { gap: 10px; }
.device .hero-actions .btn { flex: 1 1 100%; }
.device .ep-row { grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; padding: 14px 0; }
.device .ep-row-link { gap: 10px; }
.device .ep-row .lang-pill, .device .ep-row .dur { display: none; }
.device .ep-title { font-size: 1rem; }
.device .ep-row .meta { font-size: .75rem; }
.device .cover.sm { width: 56px; }
.device .cover.lg { width: 100%; max-width: 240px; margin-inline: auto; }
.device .card { padding: 16px; }
.device .tiles { gap: 6px; }
.device .tile { padding: 14px 5px; }
.device .tile .avatar { width: 48px; height: 48px; }
.device .tile video { aspect-ratio: 1 / 1; }
.device .tile .btn.sm { min-height: 0; padding: 6px 10px; }
.device .search-box { padding-inline: 12px; }
.device .search-box input { font-size: 1rem; }
.device .mock { overflow-wrap: anywhere; }
.device .disclosure dl { grid-template-columns: 1fr; gap: 4px; }
.device .disclosure dd { margin-bottom: 8px; }
.device .link, .device .back, .device summary, .device .hub-link { min-height: 44px; display: inline-flex; align-items: center; }
.device .hub-link { display: flex; }
.device input:not([type=checkbox]), .device select { min-height: 44px; }
.device .scope-chip { white-space: normal; line-height: 1.4; }
.mini-time, .mini > [data-act=skip] { display: none; }
.device .controls .pill span { display: none; }
.device .mini-open { gap: 8px; }
.device .mini-title { font-size: .88rem; }
.device .mini-sub { font-size: .68rem; }
#nav.bottom-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; flex: none; min-height: 62px; padding: 4px 8px 0; overflow: visible; background: #fff; }
#nav.bottom-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 10px; min-height: 54px; padding: 4px; font-size: .65rem; }
#nav.bottom-tabs a[aria-current=page] { color: var(--teal-ink); background: var(--sea); }
.home-indicator { height: 18px; flex: none; display: grid; place-items: center; }
.home-indicator::after { content: ''; width: 112px; height: 4px; border-radius: 4px; background: var(--ink); }
.device .sheet-inner { padding: 12px 18px 28px; }
.device .sheet-grid { margin-top: 16px; }
.device .cover.xl { width: 200px; font-size: 13px; }
.device .sheet-title { font-size: 1.6rem; }
.device .controls { gap: 4px; }
.device .controls .pill { min-width: 44px; padding: 6px; }
.device .icon-btn.huge { width: 64px; height: 64px; }
.device .icon-btn.big { width: 44px; height: 44px; }
.device .toast { font-size: .8rem; }
.phone-summary { padding: 24px 20px; }
.phone-summary .cover { margin: 18px auto 24px; }
.companion { flex: 1; min-width: 0; max-width: 1000px; border: 1px solid #d0d6d0; border-radius: 18px; background: #fff; max-height: 884px; overflow: auto; }
.companion[hidden] { display: none; }
.companion-header { padding: 20px 24px 12px; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.companion main { padding: 24px; }
.companion .two-col { grid-template-columns: 1fr; }
.companion .patient-grid { grid-template-columns: 1fr; }
.companion .kpis { grid-template-columns: 1fr 1fr; }
.companion .stills { grid-template-columns: 1fr; }
@media (min-width: 700px) and (max-width: 1150px) {
  .presentation { grid-template-columns: 220px minmax(0, 1fr); }
  .demo-stage { padding: 20px; gap: 20px; }
  .companion-mode .demo-stage { flex-wrap: wrap; }
  .companion { flex-basis: 100%; }
}
@media (max-width: 699px) {
  .presentation { display: block; }
  .presenter { padding: 12px 16px; border-inline-end: 0; border-bottom: 1px solid var(--rule); }
  .presenter-heading { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
  .presenter-heading > .kicker, .presenter-note, .brand-sub { display: none; }
  .presenter .wordmark { font-size: 1.15rem; }
  .presenter-controls > summary { padding-top: 8px; }
  .demo-stage { padding: 0; display: block; }
  .phone-wrap, .device { width: 100%; }
  .phone-wrap { margin: 0; }
  .device-label { display: none; }
  .device { height: 100svh; border: 0; border-radius: 0; box-shadow: none; }
  .companion { max-height: none; border-radius: 0; }
  .companion .dec-fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tile.speaking .eq i { height: 10px; }
}
@media print {
  .presenter, .phone-wrap, .companion-header, .row .btn { display: none !important; }
  .presentation, .demo-stage { display: block; padding: 0; }
  .companion { max-height: none; border: 0; overflow: visible; }
  body { background: #fff; }
}

/* ---------- v2: profile, chips, menus, polls, forms ---------- */
.nbadge { position: absolute; top: 2px; inset-inline-end: calc(50% - 22px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #b3261e; color: #fff; font: 700 .65rem/16px var(--sans); text-align: center; font-style: normal; }
.nbadge.static { position: static; display: inline-block; vertical-align: middle; }
#nav.bottom-tabs a { position: relative; color: var(--ink-2); text-decoration: none; }
.btn.sm { min-height: 44px; padding: 6px 14px; font-size: .85rem; }
.btn.sm svg { width: 16px; height: 16px; }
.icon-btn.sm { width: 44px; height: 44px; flex: none; }
.ep-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.btn[aria-pressed="true"]:not(.ghost-light) { background: var(--sea); border-color: var(--teal); color: var(--teal-ink); }
.btn.ghost-light[aria-pressed="true"] { background: rgba(124,199,190,.2); border-color: var(--night-teal); }
.menu, .inpanel { border: 1px solid var(--rule); border-radius: var(--r); padding: 14px; background: var(--paper-2); margin: 14px 0; display: grid; gap: 8px; }
.menu-item { font: inherit; text-align: start; min-height: 44px; border: 1px solid var(--rule); background: #fff; border-radius: 8px; padding: 8px 12px; cursor: pointer; color: var(--ink); }
.menu-item[aria-pressed="true"] { border-color: var(--teal); background: var(--sea); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input:not([type=hidden]) { flex: 1 1 140px; min-width: 0; font: inherit; border: 1px solid var(--ink-2); border-radius: 8px; padding: 8px 10px; min-height: 44px; }
.stackf { display: grid; gap: 12px; }
.stackf label, .stackf legend { display: grid; gap: 4px; font-size: .9rem; }
.stackf label.check { display: flex; }
.stackf textarea, .stackf select, .inpanel textarea, .card textarea { font: inherit; width: 100%; border: 1px solid var(--ink-2); border-radius: 8px; padding: 8px 10px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.kv { display: grid; gap: 2px; margin: 0 0 10px; }
.kv dt { color: var(--muted); font-size: .78rem; margin-top: 8px; }
.kv dd { margin: 0; }
.upnext { margin-top: 28px; border-top: 1px solid var(--rule); padding-top: 14px; }
.upnext .ep-row { grid-template-columns: minmax(0, 1fr) auto; }
.rail { list-style: none; display: flex; gap: 12px; overflow-x: auto; padding: 0 0 8px; margin: 0; scroll-snap-type: x proximity; }
.rail-card { display: grid; gap: 6px; width: 150px; flex: none; scroll-snap-align: start; text-decoration: none; color: inherit; }
.rail-card .cover.sm { width: 100%; }
.rail-card .ep-title { font-size: .88rem; line-height: 1.3; }
.filters { display: grid; gap: 8px; margin: 14px 0 6px; }
.chips { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.chips-l { font-size: .72rem; color: var(--muted); flex: none; min-width: 64px; }
.chip { position: relative; flex: none; font: inherit; font-size: .82rem; min-height: 44px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--rule); background: #fff; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"], .chip.radio:has(input:checked) { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip.radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip.radio:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }
.poll-res { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; margin: 6px 0; overflow: hidden; }
.poll-res > span, .poll-res > b { position: relative; z-index: 1; }
.poll-res i { position: absolute; inset: 0 auto 0 0; background: #cfe5e1; transition: width .4s; z-index: 0; }
.poll-res.mine { border-color: var(--teal); }
#poll { color: var(--ink); background: var(--paper); margin-top: 12px; }
.you-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.avatar.big { width: 64px; height: 64px; background: var(--ink); color: #fff; font-size: 1.3rem; flex: none; }
.vstat { font-weight: 600; margin: 4px 0 10px; }
.vstat.ok { color: var(--teal-ink); }
.vstat.warn { color: var(--warn); }
.you-sec { border-top: 1px solid var(--rule); padding: 16px 0; }
.plain { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; }
.notif { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--rule); }
.notif.unread { font-weight: 600; border-inline-start: 3px solid var(--teal); padding-inline-start: 8px; }
.pl { border: 1px solid var(--rule); border-radius: var(--r); padding: 12px; margin-bottom: 8px; }
.pl-head { display: flex; justify-content: space-between; gap: 8px; }
.pl-ep { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px dashed var(--rule); }
.switch select { font: inherit; border: 1px solid var(--ink-2); border-radius: 8px; padding: 6px 10px; }
.switch input[type=checkbox] { width: 44px; height: 26px; accent-color: var(--teal); }
.ph-mini { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
.ph-mini .link { color: var(--night-teal); margin-inline-start: auto; }
.ph-mini .eq { opacity: 1; display: inline-flex; gap: 2px; align-items: end; height: 16px; }
.ph-mini .eq i { width: 3px; height: 10px; background: var(--night-teal); animation: eq .9s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { .poll-res i { transition: none; } }

/* ---------- admin back-office (#/admin — companion surface, not the mobile app) ---------- */
.adm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding-bottom: 14px; margin-bottom: 18px; }
.adm-head .h2 { margin: 0; }
.adm-body { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 24px; align-items: start; }
.adm-side { display: flex; flex-direction: column; gap: 2px; border-inline-end: 1px solid var(--rule); padding-inline-end: 12px; position: sticky; top: 0; }
.adm-side button { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: start; padding: 9px 12px; border: 0; border-radius: 8px; background: none; font: 600 .92rem var(--sans); color: var(--muted); cursor: pointer; }
.adm-side button:hover { background: var(--paper-2); color: var(--ink); }
.adm-side button[aria-current="true"] { background: var(--ink); color: #fff; }
.adm-main > h2:first-child { margin-top: 0; }
.adm-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.adm-tools input[type="search"] { flex: 1 1 220px; min-width: 0; font: inherit; border: 1px solid var(--ink-2); border-radius: 8px; padding: 8px 12px; min-height: 42px; }
.adm-tools select, .kan-col select, .adm-create input { font: inherit; border: 1px solid var(--ink-2); border-radius: 8px; padding: 8px 10px; min-height: 42px; background: #fff; }
.adm-tools label { display: flex; gap: 8px; align-items: center; }
.adm .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chart-grid { display: grid; grid-template-columns: 2.2fr 1fr; gap: 16px; margin-top: 16px; }
.chart-grid + .chart-box { margin-top: 16px; }
.chart-box { margin: 0; border: 1px solid var(--rule); border-radius: var(--r); background: #fff; padding: 12px 14px 14px; min-width: 0; }
.chart-box figcaption { margin-bottom: 8px; }
.chart-cv { position: relative; height: 235px; }
.chart-fallback { max-height: 265px; overflow: auto; }
.kan { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; }
.kan-col { border: 1px dashed var(--rule); border-radius: var(--r); background: var(--paper-2); padding: 10px; min-height: 120px; }
.kan-col h3 { display: flex; justify-content: space-between; font: 600 .72rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 2px 4px 10px; }
.kan-card { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 10px; margin-bottom: 8px; font-size: .88rem; }
.kan-card strong { display: block; margin-bottom: 2px; }
.kan-card .row { margin: 8px 0 0; gap: 6px; }
.empty-col { color: var(--muted); font-size: .8rem; margin: 4px; }
.adm .icon-btn.sm { width: 32px; height: 32px; font-size: 1rem; }
.btn.star[aria-pressed="true"] { background: #fdf3d7; border-color: #c98a2d; color: #6a3f06; }
.adm-create { margin-top: 16px; }
.st { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.st.s-approved, .st.s-active, .st.s-verified { background: #dcefeb; color: #12403e; }
.st.s-pending, .st.s-inreview, .st.s-upcoming, .st.s-review { background: #f8ead3; color: #6a3f06; }
.st.s-rejected, .st.s-suspended, .st.s-cancelled { background: #f6d9d5; color: #7a1f15; }
.st.s-live, .st.s-new, .st.s-forwarded { background: #e2e8f5; color: #2c3f66; }
.st.s-closed, .st.s-past, .st.s-archived { background: var(--paper-2); color: var(--muted); }
.st.s-verification, .st.s-safety, .st.s-content, .st.s-webinar, .st.s-users, .st.s-editorial, .st.s-export { background: #eceae3; color: var(--ink-2); }
.ae-detail summary { cursor: pointer; color: var(--teal-ink); list-style: none; }
.ae-detail summary::before { content: "▸ "; }
.ae-detail[open] summary::before { content: "▾ "; }
.ae-detail p { margin: 6px 0 0; }
@media (max-width: 980px) {
  .adm-body { grid-template-columns: 1fr; }
  .adm-side { position: static; flex-direction: row; flex-wrap: wrap; border-inline-end: 0; padding-inline-end: 0; }
  .kan { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) { .kan { grid-template-columns: 1fr; } }

/* ---------- installed PWA: the device is the screen ---------- */
@media (display-mode: standalone) {
  .presenter, .status-bar, .home-indicator, .device-label, .companion { display: none; }
  .presentation { display: block; min-height: 0; }
  .demo-stage { display: block; padding: 0; }
  .phone-wrap, .device { width: 100%; flex: none; }
  .device { height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .app-header { padding-top: env(safe-area-inset-top); min-height: calc(58px + env(safe-area-inset-top)); padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
  .bottom-tabs { padding-bottom: env(safe-area-inset-bottom); }
  .sheet { inset: 0; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}

/* Unified catalogue and persistent video surface (never replaced by a render). */
.format-pill { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; border: 1px solid currentColor; border-radius: 999px; padding: 2px 7px; margin-inline-end: 5px; font: 600 .65rem/1.3 var(--sans); vertical-align: middle; }
.format-pill svg { width: 13px; height: 13px; flex-shrink: 0; }
.ep-row .format-pill { margin-bottom: 5px; }
.rail-card .format-pill { align-self: flex-start; }
.video-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.audio-only-badge { font-size: .75rem; color: var(--teal); }
.sheet .audio-only-badge { color: var(--night-teal); }
.sheet.watching:not([hidden]) { display: flex; flex-direction: column; gap: 16px; padding: 12px 18px 28px; }
.sheet.watching #sheet-content, .sheet.watching .sheet-inner { display: contents; }
.sheet.watching .sheet-top { order: 0; }
.sheet.watching #video-stage { order: 1; flex-shrink: 0; }
.device .sheet.watching .sheet-grid { display: block; order: 2; margin-top: 0; }
#episode-video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 220px; object-fit: contain; background: #081c22; border-radius: 10px; }
.waveform { display: flex; justify-content: center; align-items: center; gap: 5px; height: 36px; margin-top: 10px; color: var(--night-teal); }
.waveform i { display: block; width: 4px; height: 45%; border-radius: 3px; background: currentColor; animation: voice-wave .85s ease-in-out infinite alternate; animation-play-state: paused; }
.waveform i:nth-child(3n) { height: 90%; animation-delay: -.3s; }
.waveform i:nth-child(3n + 1) { height: 65%; animation-delay: -.6s; }
.is-playing .waveform i { animation-play-state: running; }
@keyframes voice-wave { to { transform: scaleY(.35); } }
@media (prefers-reduced-motion: reduce) { .waveform i { animation: none; } }

/* Simulated call-on promotion and moderation queues. */
.stage .tile.called-on { min-height: 230px; width: 100%; margin-bottom: 12px; border: 2px solid var(--teal, #188b85); }
.called-on .tile-badge { position: static; margin-top: 12px; }
.live-chat { margin-top: 24px; }
.qa-list .btn { margin: 4px 4px 4px 0; }
.qa-item.s-rejected { opacity: .7; border-inline-start: 3px solid #a34747; }

/* Round 3 sample transcript, downloads and queue; logical spacing follows RTL. */
/* Dark-surface buttons: the base .btn is paper-on-ink, and `color: inherit` on the sheet's
   near-white text made Download/Up next white-on-white. Every non-primary sheet button gets
   a night surface instead; disabled stays legible (night-muted on night-2). */
.sheet .btn:not(.primary) { background: var(--night-2); color: var(--night-text); border-color: #34505a; }
.sheet .btn:not(.primary):hover { background: #1d343c; }
.sheet .btn:not(.primary):disabled { background: var(--night-2); color: var(--night-muted); border-color: #34505a; opacity: .6; }
.sheet .btn:not(.primary)[aria-pressed="true"] { background: rgba(124,199,190,.18); border-color: var(--night-teal); color: var(--night-teal); }
/* One divider rhythm for the sheet-main sections: Bookmarks / actions / Transcript. */
.sheet-main .bms, .sheet-main .sheet-actions, .sheet-main .sample-transcript { margin-block-start: 1.125rem; padding-block-start: .875rem; border-block-start: 1px solid #284049; }
.sheet-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .75rem; align-items: start; }
.sheet-actions .download-control { margin-block: 0; }
.device .sheet-actions { grid-template-columns: 1fr; }
.transcript-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.transcript-head .btn { min-height: 0; padding: 4px 12px; }
.sample-transcript { padding-block-end: .5rem; }
.sample-transcript li { border-inline-start: 3px solid transparent; }
/* Caption and chapter rows: fixed LTR timecode column + text column, so time never touches
   text ("0:00 Welcome"); grid direction follows dir, so RTL mirrors the columns. */
.sample-transcript .transcript-row > button, .sample-transcript .chapter-row > button {
  display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: .65rem; align-items: start;
  text-align: start; width: 100%; padding: .45rem .65rem; line-height: 1.55;
}
.transcript-row .tc, .chapter-row .tc { font-family: var(--mono); font-size: .82rem; color: var(--night-muted); }
.sample-transcript .caption-active { background: #ffffff18; border-inline-start-color: #65d8c5; }
#episode-caption { padding: .75rem; background: #ffffff12; min-height: 3rem; }
.download-control { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-block: .75rem; }
.download-badge { display: inline-block; font-size: .72rem; padding: .15rem .4rem; border: 1px solid currentColor; border-radius: .3rem; }
.sheet-main .download-control .fine { color: #c5d5d5; }
.queue-item { padding-block: .75rem; border-block-end: 1px solid #88999940; }
.queue-item .row { margin-block-start: .5rem; }
.ph-mini { flex-wrap: wrap; }
.ph-mini progress { width: 100%; accent-color: var(--teal, #0a7773); }
.download-control progress { max-width: 9rem; }

/* Gesture feedback leaves existing button targets and scrolling dimensions intact. */
.gesture-guide { margin: 0; padding-inline-start: 20px; font-size: .78rem; color: var(--muted); }
.gesture-guide li { margin-block: 8px; }
.sheet-top { touch-action: pan-x; }
.sheet-art { touch-action: pan-y; }
.mini { touch-action: pan-x; }

/* Social slice stays within the existing clinical editorial palette. */
.live-now-link { display:block; color:inherit; text-decoration:none; margin-block:1rem; }
.presence-pill { display:flex; align-items:center; flex-wrap:wrap; gap:.45rem; padding:.65rem .9rem; border:1px solid var(--teal, #17685f); border-radius:1.2rem; color:var(--teal, #17685f); font-weight:600; }
.week-card, .speaker-profile, .thanks-option { margin-block:1rem; }
.admin-live { border-inline-start:4px solid var(--teal, #17685f); margin-block-end:1.5rem; }
.aggregate-feed { padding-inline-start:1.2rem; font-size:.85rem; line-height:1.9; }
.engagement-funnel { display:grid; gap:.7rem; list-style:none; padding:0; }
.engagement-funnel li { display:grid; grid-template-columns:minmax(5rem, 1fr) auto; gap:.35rem 1rem; }
.engagement-funnel progress { grid-column:1 / -1; width:100%; height:.55rem; accent-color:var(--teal, #17685f); }
.engagement-funnel .masked { color:var(--muted, #626b68); }
.report-metrics { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:.8rem 1rem; }
.report-metrics dd { margin:0; font-variant-numeric:tabular-nums; }
.guardrails { border-inline-start:4px solid var(--teal, #17685f); margin-block:1.25rem; }


/* Ionic iOS controls enhance native fallbacks without changing the phone shell. */
.device :is(.display, .h2, .h3, .ep-title, .sheet-title) { font-family: var(--sans); font-weight: 700; letter-spacing: -.02em; }
.row, .hero-actions, .ep-actions, .inline-form, .tools, .download-control, .kan-card .row { gap: 12px; flex-wrap: wrap; }
/* Ungrouped legacy actions (including table cells) still need space. */
.btn + .btn, .btn + .link, .link + .btn { margin-inline-start: 10px; margin-block-start: 10px; }
:is(.row, .hero-actions, .ep-actions, .inline-form, .download-control) > :is(.btn, .link) { margin: 0; }
.recording-actions, .sheet-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.recording-actions > .btn, .sheet-actions .btn { width: 100%; margin: 0; }
.recording-actions .fine { margin: 0; }
.sheet-actions .download-control { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0; }
.past-webinars .card + .card { margin-top: 14px; }
.device :is(.hero-actions, .ep-actions, .row) > :is(.btn, ion-button) { flex: 1 1 100%; width: 100%; min-width: 0; }
.device .card > .btn + .btn { display: flex; width: 100%; margin: 12px 0 0; }
.device .you-sec { background: var(--paper); border: 1px solid var(--rule); border-radius: 16px; padding: 16px; }
.notif, .switch { border-bottom: 1px solid var(--rule); }
.pl-ep + .pl-ep { border-top: 1px solid var(--rule); padding-top: 10px; }
ion-button { --border-radius: 12px; --padding-start: 16px; --padding-end: 16px; min-height: 46px; margin: 0; font: 600 .9rem var(--sans); text-transform: none; letter-spacing: 0; }
ion-button::part(native) { gap: 8px; white-space: normal; line-height: 1.35; padding-top: 12px; padding-bottom: 12px; }
ion-button svg { width: 18px; height: 18px; flex: none; }
ion-button[aria-pressed="true"] { --background: var(--sea); --color: var(--teal-ink); }
ion-button[disabled] { cursor: not-allowed; }
ion-chip.format-pill { --background: var(--sea); --color: var(--teal-ink); min-height: 24px; height: auto; margin: 2px 5px 2px 0; padding: 3px 8px; border: 0; font-size: .7rem; }
ion-toggle { flex: none; --track-background-checked: var(--teal); }
.sheet { --ion-text-color: var(--night-text); --ion-background-color: var(--night); }
.sheet ion-button { --color: var(--night-text); --border-color: #62838a; --background: var(--night-2); }
.sheet ion-chip { --background: var(--night-2); --color: var(--night-teal); }
@media (max-width: 699px) {
  .companion :is(.row, .adm-tools, .inline-form) > :is(.btn, ion-button) { flex: 1 1 100%; width: 100%; }
}

/* Section rhythm: editorial headings, quiet surfaces, and one level of grouping. */
.sec, .device .sec, .device .you-sec.sec {
  min-width: 0; margin-block: 32px 0; padding-block: 24px 0;
  border: 0; border-block-start: 1px solid var(--rule); border-radius: 0; background: transparent;
}
.sec-panel, .device .sec-panel, .device .you-sec.sec-panel {
  padding: 18px; border: 0; border-radius: 16px; background: #f1f6f4;
}
.sec-head { display: block; margin-block-end: 16px; }
.sec-head > .kicker { color: var(--teal); font-size: 11px; line-height: 1.5; margin-block: 0 5px; }
.sec-head :is(h2, h3, .h2, .h3), .device .sec-head :is(h2, h3, .h2, .h3) {
  font: 500 20px/1.4 var(--serif); letter-spacing: 0; color: var(--ink); margin: 0;
  text-transform: none; text-wrap: pretty;
}
:is(.device, .sponsor, .adm) h1, .device .display, .device .display.sm {
  font: 500 28px/1.25 var(--serif); letter-spacing: -.02em;
}
.device .ep-title, .device .rail-card .ep-title, .recording-row > h3 {
  font: 600 16px/1.5 var(--serif); letter-spacing: 0;
}
.device :is(.meta, .fine, .dur), .sec .meta { font-size: 13px; line-height: 1.5; }
.device :is(.lede, p, li) { line-height: 1.55; }
.device .lede { font-size: 16px; }
.sec p { margin-block: 0 12px; }
.sec > :last-child { margin-block-end: 0; }
.device :is(.hero-text, .ep-head > div, .sec p) { max-inline-size: 40ch; }
.device .hero.sec { margin-block-start: 24px; padding-block: 0 24px; border-block-start: 0; border-block-end: 1px solid var(--rule); }
.sec .rail { padding-block-end: 12px; gap: 16px; }
.sec .rail > li { flex: 0 0 150px; min-inline-size: 0; }
.sec .rail .btn { margin-block-start: 12px; }
.sec :is(.ep-row, .notif, .download-row, .queue-item, .recording-row, .pl) {
  padding-block: 16px; border: 0; border-block-end: 1px solid #d5e2dd;
  border-radius: 0; background: transparent; margin: 0;
}
.sec :is(.ep-row, .notif, .download-row, .queue-item, .recording-row, .pl):last-child { border-block-end: 0; }
.sec .plain { gap: 0; }
.sec .ep-row { column-gap: 10px; }
.device .side { gap: 0; }
.device .side > .sec:first-child { margin-block-start: 32px; }
.device .sec .switch { padding-block: 12px; border-block-end-style: solid; }
.live .qa { min-width: 0; }
.live .qa > .sec-head { margin-block-start: 32px; padding-block-start: 24px; border-block-start: 1px solid var(--rule); }
.live .mod.sec, .live .live-chat.sec { padding-block-start: 24px; background: transparent; }
.live .stage { margin-block-start: 32px; }
.sponsor .xtab.sec { margin-inline: 0; }
.sponsor .sec .report-metrics { margin: 0; }
.adm-tab-panel.sec { margin-block-start: 0; }
.adm-tab-panel > .sec:first-of-type { margin-block-start: 24px; }
.adm-tab-panel > .sec-head { margin-block-end: 24px; }
.adm .chart-box { margin-block-start: 32px; background: #f1f6f4; border: 0; padding: 18px; }
.adm .chart-grid { margin-block-start: 32px; gap: 24px; }
.adm .chart-grid .chart-box { margin-block-start: 0; }
.adm .kan-col { border: 0; border-inline-start: 1px solid #d5e2dd; border-radius: 0; background: transparent; }
.adm .kan-card { border: 0; border-block-end: 1px solid #d5e2dd; border-radius: 0; background: transparent; }
.sheet .sec, .sheet-main .bms.sec, .sheet-main .sample-transcript.sec {
  margin-block-start: 32px; padding-block-start: 24px; border-block-start: 1px solid #34505a;
  background: transparent; border-radius: 0;
}
.sheet .sec-head > .kicker { color: var(--night-teal); }
.sheet .sec-head :is(h2, h3), .device .sheet .sec-head :is(h2, h3) {
  font: 500 20px/1.4 var(--serif); color: var(--night-text); letter-spacing: 0; text-transform: none; margin: 0;
}
.sheet .sec p { color: var(--night-muted); }
.sheet .chapters .plain { margin-block-end: 0; }
html[lang="ar"] .sec-head > .kicker { letter-spacing: 0; font-size: 12px; }
html[lang="ar"] :is(.sec-head h2, .sec-head h3, .device h1) { line-height: 1.5; letter-spacing: 0; }

.adm-tab-panel:has(> .admin-live) { padding: 0; background: transparent; }
.adm-tab-panel:has(> .admin-live) > .admin-live { margin-block-start: 0; }
.device .sec :is(.ep-row, .notif, .download-row, .queue-item, .recording-row, .pl) { padding-block: 16px; }
.device .disclosure > summary.sec-head { display: block; }
.sec-head > .h3 { display: block; }

/* =====================================================================
   v5 REVAMP — design-system layer (overrides the accumulated rules above).
   Phone: grouped grey canvas, white cards, iOS nav/tab bars, one type scale.
   Stage: presenter rail with labelled surfaces; companion consoles as cards.
   ===================================================================== */

/* ---------- presentation stage ---------- */
body { background: var(--stage); }
.presenter { background: #f8f9f8; border-inline-end: 1px solid var(--hair); }
@media (min-width: 700px) { .presenter { padding: 28px 20px; } .demo-stage { gap: 36px; padding: 32px 28px; } }
.presenter .wordmark { font-size: 1.5rem; }
.presenter-note { margin: 10px 0 12px; }
.presenter .kicker { font-size: 11px; letter-spacing: .1em; margin: 0 0 10px; color: var(--muted); }
.presenter-controls > summary { font-weight: 600; color: var(--ink-2); }
.presenter .tools { gap: 8px; margin-bottom: 26px; }
.presenter .persona select, .presenter .pill { background: #fff; border-color: var(--hair-2); box-shadow: var(--sh-1); }
#stage-modes { grid-template-columns: 1fr; gap: 6px; }
#stage-modes a {
  display: grid; grid-template-columns: 10px 1fr; column-gap: 10px; align-items: center; text-align: start;
  padding: 9px 12px; border-radius: 12px; border: 1px solid var(--hair); background: #fff; color: var(--ink); box-shadow: var(--sh-1);
}
#stage-modes a::before { content: ""; grid-row: span 2; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
#stage-modes a b { font-size: .86rem; }
#stage-modes a small { font-size: .72rem; color: var(--muted); grid-column: 2; }
#stage-modes a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }
#stage-modes a[aria-current] small { color: #c5d3d1; }
#stage-modes .mode-review::before { background: #4a5fa0; }
#stage-modes .mode-sponsor::before { background: #b77d22; }
#stage-modes .mode-decide::before { background: #6c5aa8; }
#stage-modes .mode-admin::before { background: #2f8c7f; }
.guided-steps { padding-inline-start: 0; list-style: none; counter-reset: step; display: grid; gap: 2px; }
.guided-steps li { counter-increment: step; }
.guided-steps a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; color: var(--ink-2); min-height: 40px; }
.guided-steps a::before { content: counter(step); flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--hair-2); font: 600 .7rem var(--sans); color: var(--muted); }
.guided-steps a:hover { background: #fff; }
.guided-steps a[aria-current] { background: var(--tint); color: var(--teal-ink); }
.guided-steps a[aria-current]::before { background: var(--teal); border-color: var(--teal); color: #fff; }
.device-label { letter-spacing: .04em; }

/* ---------- device chrome ---------- */
.device { border: 10px solid #101d22; border-radius: 56px; background: var(--canvas); box-shadow: var(--sh-3), 0 0 0 1px #46545a; }
.status-bar { background: var(--canvas); }
.notch { background: #101d22; width: 112px; height: 28px; top: 4px; }
.app-header {
  position: relative; min-height: 52px; padding: 0 16px 0 18px; gap: 12px; background: var(--canvas);
  border-bottom: 1px solid var(--hair);
}
.app-title { display: flex; align-items: center; min-width: 0; flex: 1; }
.app-header .wordmark { font-size: 1.3rem; }
.app-header .avatar { width: 36px; height: 36px; font-size: .78rem; font-family: var(--sans); font-weight: 700; background: var(--ink); color: #fff; }
.nav-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-inline-start: -8px; padding-inline-end: 8px; color: var(--teal) !important; font: 500 16px var(--sans); }
.nav-back svg { width: 24px; height: 24px; }
html[dir="rtl"] .nav-back svg { transform: scaleX(-1); }
.nav-title { position: absolute; left: 50%; transform: translateX(-50%); font: 600 16px var(--sans); color: var(--ink); white-space: nowrap; pointer-events: none; }
.app-content { background: var(--canvas); scroll-behavior: smooth; }
.app-content main { padding: 16px 16px 32px; }
#nav.bottom-tabs {
  min-height: 58px; padding: 4px 6px 0; background: rgba(255, 255, 255, .92); border-top: 1px solid var(--hair);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
}
#nav.bottom-tabs a { color: #7d8b90; font-weight: 600; font-size: 10.5px; gap: 2px; min-height: 52px; border-radius: 12px; transition: color .15s; }
#nav.bottom-tabs a[aria-current=page] { color: var(--teal); background: transparent; }
#nav.bottom-tabs a[aria-current=page] .tab-ico svg { stroke-width: 2.2; }
#nav.bottom-tabs a:active .tab-ico { transform: scale(.92); }
.tab-ico { position: relative; display: grid; place-items: center; height: 28px; transition: transform .12s; }
.tab-ico svg { width: 25px; height: 25px; }
.live-dot { position: absolute; top: 1px; inset-inline-end: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 2px #fff; animation: pulse 1.6s infinite; }
.nbadge { box-shadow: 0 0 0 2px #fff; background: var(--live); }
.home-indicator { background: rgba(255, 255, 255, .92); }
.home-indicator::after { width: 128px; height: 5px; border-radius: 3px; }

/* mini-player: floating dark card above the tab bar */
.mini {
  margin: 0 8px 8px; height: 64px; border-radius: 16px; background: #14272f; padding: 4px 8px 4px 6px;
  box-shadow: 0 10px 24px -8px rgba(16, 33, 40, .45), 0 0 0 1px rgba(255, 255, 255, .04) inset;
}
.mini .cover.xs { width: 46px; border-radius: 9px; }
.mini .icon-btn.play { width: 42px; height: 42px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.mini-bar { inset-inline: 12px; bottom: 4px; height: 3px; background: rgba(255, 255, 255, .12); }
.mini-sub .format-pill, .mini-sub ion-chip.format-pill { --background: rgba(124, 199, 190, .16); --color: var(--night-teal); background: rgba(124, 199, 190, .16); color: var(--night-teal); border: 0; }

.toast { top: 96px; border-radius: 14px; background: rgba(23, 44, 53, .96); padding: 12px 16px; font-weight: 500; box-shadow: 0 16px 36px -10px rgba(0, 0, 0, .4); }

/* ---------- device typography ---------- */
.device .large-title, .device .search > h1.display, .device .you h1.display {
  font: 700 30px/1.15 var(--sans); letter-spacing: -.025em; color: var(--ink); margin: 0 0 6px;
}
.device .episode h1.display, .device .live h1.display, .hero-title {
  font: 600 25px/1.2 var(--serif); letter-spacing: -.015em; color: var(--ink); margin: 4px 0 8px; text-wrap: balance;
}
.hero-title { font-size: 21px; }
html[lang="ar"] .device :is(.large-title, .episode h1, .live h1, .hero-title, .search > h1, .you h1) { line-height: 1.45; letter-spacing: 0; }
.device .kicker { font-size: 11.5px; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
.device .kicker.teal, .sec-head > .kicker { color: var(--teal); }
.kicker.live { color: var(--live) !important; }
.kicker .dot, .presence-pill .dot { background: var(--live); }
.device .sec-head { margin-block-end: 12px; }
.device .sec-head :is(h2, h3, .h2, .h3), .companion .sec-head :is(h2, h3, .h2, .h3) {
  font: 700 18px/1.3 var(--sans); letter-spacing: -.01em; color: var(--ink);
}
html[lang="ar"] :is(.device, .companion) .sec-head :is(h2, h3, .h2, .h3) { line-height: 1.55; }
.device .meta { font-size: 13.5px; color: var(--muted); gap: 4px 6px; }
.device .lede { color: var(--ink-2); font-size: 15.5px; margin-bottom: 0; }
.device .fine { font-size: 12.5px; color: var(--muted); }
.device .ep-title { font: 600 15px/1.35 var(--serif); }
.sec-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.count { flex: none; font: 600 12px/1 var(--sans); color: var(--muted); background: var(--canvas); border-radius: 999px; padding: 5px 9px; }

/* ---------- surfaces ---------- */
.device .sec-panel, .device .you-sec.sec-panel, .device .sec.sec-panel {
  background: var(--paper); border: 0; border-radius: var(--r-lg); padding: 18px; margin-block: 16px 0; box-shadow: var(--sh-1);
}
.device main > :first-child { margin-block-start: 0; }
.device .sec-panel .fine:last-child { margin-bottom: 0; }
.label-mock { border-radius: 10px; font-size: 12.5px; line-height: 1.5; padding: 8px 12px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.tag, .verified-badge { display: inline-flex; align-items: center; gap: 4px; font: 600 12px/1 var(--sans); padding: 6px 10px; border-radius: 999px; background: var(--canvas); color: var(--ink-2); }
.verified-badge { background: var(--tint); color: var(--teal-ink); }
.private-note { display: flex; gap: 6px; align-items: flex-start; }
.private-note svg { width: 14px; height: 14px; margin-top: 2px; flex: none; }

/* ---------- buttons: filled (primary) / tinted (secondary) / plain (link) ---------- */
.btn {
  min-height: 48px; padding: 10px 18px; border-radius: var(--r-md); border: 1px solid transparent; background: var(--tint);
  color: var(--teal-ink); font-weight: 600; font-size: 15px; line-height: 1.3; transition: background .15s, transform .12s, box-shadow .15s;
}
.btn:hover { background: var(--tint-2); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--teal); color: #fff; border-color: transparent; box-shadow: 0 1px 2px rgba(23, 44, 53, .12), 0 6px 14px -6px rgba(36, 111, 107, .55); }
.btn.primary:hover { background: var(--teal-ink); }
.btn.sm { min-height: 44px; padding: 6px 14px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: 1; background: #eceeed; color: #8a9599; box-shadow: none; }
.btn[aria-pressed="true"]:not(.ghost-light) { background: var(--tint-2); border-color: rgba(36, 111, 107, .35); color: var(--teal-ink); }
.btn.ghost-light { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: var(--night-text); }
.btn.ghost-light:hover { background: rgba(255, 255, 255, .14); }
.link { color: var(--teal); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.icon-btn { border-color: var(--hair-2); }
.icon-btn:not(.play):not(.ghost):not(.huge) { background: var(--tint); color: var(--teal-ink); border-color: transparent; }
.chip { min-height: 38px; padding: 4px 14px; background: #fff; border-color: var(--hair-2); font-weight: 600; font-size: 13px; color: var(--ink-2); }
.chip[aria-pressed="true"], .chip.radio:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips { padding-block: 3px; }
ion-button { --border-radius: 14px; min-height: 48px; font-size: 15px; }
ion-button[fill="solid"] { --background: var(--teal); --background-hover: var(--teal-ink); --box-shadow: 0 6px 14px -6px rgba(36, 111, 107, .55); }
ion-button[fill="outline"] { --background: var(--tint); --background-hover: var(--tint-2); --border-width: 0; --color: var(--teal-ink); }
ion-button[aria-pressed="true"] { --background: var(--tint-2); }
ion-chip.format-pill { --background: var(--tint); --color: var(--teal-ink); font-weight: 600; }
.format-pill { border-color: transparent; background: var(--tint); color: var(--teal-ink); padding: 3px 8px; }
.download-badge { border: 0; background: #e4ecf7; color: var(--info); border-radius: 999px; padding: 3px 8px; font-weight: 600; }
.device input:not([type=checkbox]):not([type=radio]):not([type=range]), .device select, .device textarea, .companion input:not([type=checkbox]):not([type=radio]), .companion select, .companion textarea {
  border: 1px solid var(--hair-2); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-size: 15px;
}
:is(.device, .companion) :is(input, select, textarea):focus-visible { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(36, 111, 107, .18); }
.device :is(.hero-actions, .row) { gap: 10px; }

/* ---------- home ---------- */
.greet { padding: 6px 2px 2px; }
.greet .kicker { margin-bottom: 2px; }
.greet .lede { font-size: 15px; color: var(--muted); }
.live-card { position: relative; overflow: hidden; }
.device .live-card.sec-panel { background: linear-gradient(180deg, #fff 0%, #fff 60%, #fdf5f4 100%); box-shadow: var(--sh-1), inset 0 0 0 1px rgba(200, 50, 42, .14); }
.live-card .meta { margin: 0 0 2px; }
.presence-pill { display: block; margin: 12px 0 4px; border: 0; background: var(--tint); color: var(--teal-ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.live-card .presence-pill + .fine { margin: 0 0 14px; }
.device .hero.sec-panel { display: block; padding: 0; overflow: hidden; border-bottom: 0; }
.device .hero .hero-art { display: block; }
.device .hero .cover.hero { border-radius: 0; aspect-ratio: 2.1; }
.device .hero .hero-text { padding: 16px 18px 18px; max-inline-size: none; }
.device .hero .disc-inline { margin: 8px 0 14px; font-size: 13px; border-inline-start-color: var(--teal); }
.progress { height: 5px; border-radius: 3px; background: #e4e9e7; max-width: none; }
.device .hero-actions { margin-top: 14px; }
.left { font-size: 13px; font-weight: 600; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { margin: 0; background: var(--canvas); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.stat b { font: 700 28px/1.1 var(--sans); color: var(--ink); letter-spacing: -.02em; }
.stat span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.rail-note { margin: -6px 0 12px; }
.sec .rail { margin-inline: -18px; padding: 2px 18px 6px; scroll-padding-inline: 18px; scrollbar-width: none; gap: 12px; }
.sec .rail::-webkit-scrollbar { display: none; }
.sec .rail > li { flex: 0 0 148px; position: relative; }
.rail-card { gap: 4px; }
.rail-card .cover.sm { width: 148px; border-radius: 14px; box-shadow: var(--sh-1); }
.rail-card .format-pill, .rail-card ion-chip.format-pill { margin-top: 6px; }
.rail-card .ep-title { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rail-play {
  position: absolute; top: 98px; inset-inline-end: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; background: rgba(255, 255, 255, .95); color: var(--ink); cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
}
.rail-play span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rail-play svg { width: 20px; height: 20px; }
.rail-play:hover { transform: scale(1.05); }
.list-group { border-top: 1px solid var(--hair); margin: 10px 0 12px; }
.device .hub-link, .hub-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 10px 0; border-top: 0; border-bottom: 1px solid var(--hair); font-family: var(--sans); }
.hub-main { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.hub-title { font: 600 14.5px/1.35 var(--serif); color: var(--ink); }
.hub-link > svg { width: 18px; height: 18px; color: #9aa6aa; flex: none; }
html[dir="rtl"] .hub-link > svg { transform: scaleX(-1); }

/* ---------- lists (search results, library, history) ---------- */
.device .ep-list { background: #fff; border-radius: var(--r-lg); padding: 0 14px; box-shadow: var(--sh-1); }
.device .sec-panel .ep-list { background: none; box-shadow: none; padding: 0; }
.device .ep-row { padding: 12px 0; border-bottom: 1px solid var(--hair); }
.device .ep-row:last-child { border-bottom: 0; }
.device .ep-row .cover.sm { width: 56px; border-radius: 10px; }
.device .ep-row .meta { font-size: 12.5px; margin-top: 2px; }
.cover { border-radius: 12px; }

/* ---------- search ---------- */
.device .search-box { border: 1px solid var(--hair-2); background: #fff; border-radius: 14px; padding: 2px 14px; box-shadow: var(--sh-1); margin: 10px 0 6px; }
.device .search-box svg { color: var(--muted); }
.device .search-box input { border: 0 !important; box-shadow: none !important; padding: 10px 0; }
.search-box:focus-within { box-shadow: 0 0 0 3px rgba(36, 111, 107, .18) !important; border-color: var(--teal) !important; }
.device .filters { background: #fff; border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--sh-1); }
.device .chips-l { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; min-width: 72px; }
html[lang="ar"] .device .chips-l { text-transform: none; letter-spacing: 0; }
.device .hint { font-size: 13px; gap: 6px; }
.device .hint .pill { min-height: 36px; padding: 4px 12px; background: #fff; border-color: var(--hair-2); font-size: 13px; }
.sr-status { font-size: 14px; color: var(--ink-2); margin: 16px 2px 8px; }

/* ---------- episode ---------- */
.device .ep-head { gap: 4px; }
.device .ep-head > .cover.lg { max-width: 220px; margin: 4px auto 14px; box-shadow: 0 18px 36px -14px rgba(16, 33, 40, .45); border-radius: 18px; }
.device .ep-head .lede { margin: 10px 0 0; }
.device .episode .hero-actions { margin-top: 16px; display: grid; grid-template-columns: 1fr; }
.action-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; margin: 14px 0 4px; }
.action-grid > :is(.btn, ion-button) { width: 100%; min-height: 48px; font-size: 13.5px; margin: 0; }
.action-grid > :is(.btn, ion-button):last-child:nth-child(odd) { grid-column: 1 / -1; }
.device .download-control { margin: 12px 0 0; }
.device .gate { border: 0; border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-1), inset 0 0 0 1.5px rgba(138, 59, 18, .35); padding: 18px; margin-top: 16px; }
.device .mock { border-radius: 12px; font-size: 12px; }
.device .disclosure > summary { list-style: none; }
.device .disclosure > summary::-webkit-details-marker { display: none; }
.device .disclosure dl { margin: 4px 0 12px; }
.device .disclosure dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
html[lang="ar"] .device .disclosure dt { text-transform: none; letter-spacing: 0; }
.speaker-profile > .kicker:first-child { margin-bottom: 8px; }

/* ---------- live ---------- */
.live-head { padding: 4px 2px 0; }
.live-head .row { margin: 6px 0 0; }
.presence-card .presence-pill { margin-top: 0; }
.switch-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin: 6px 0 4px; padding: 8px 0;
  border: 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); background: none; color: var(--ink);
  font: 600 15px var(--sans); text-align: start; cursor: pointer;
}
.switch-row > span:first-child { flex: 1; }
.sw-state { font-size: 13px; font-weight: 500; color: var(--muted); }
.sw { position: relative; flex: none; width: 50px; height: 30px; border-radius: 15px; background: #d6dddb; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch-row[aria-checked="true"] .sw { background: var(--teal); }
.switch-row[aria-checked="true"] .sw::after { transform: translateX(20px); }
html[dir="rtl"] .switch-row[aria-checked="true"] .sw::after { transform: translateX(-20px); }
.presence-card .btn { width: 100%; margin-top: 8px; }
.device .lobby { max-width: none; margin-top: 16px; gap: 10px; }
.device .lobby .check { padding: 12px; border-radius: 14px; background: var(--canvas); font-size: 14.5px; }
.audio-only { font-size: 14px; }
.device .live .stage { border-radius: var(--r-lg); padding: 16px; margin-block-start: 16px; gap: 14px; background: radial-gradient(120% 70% at 0% 0%, #183a43 0%, var(--night) 60%); box-shadow: var(--sh-2); }
.device .tiles { gap: 8px; }
.device .tile { border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); padding: 12px 6px; }
.device .tile.speaking { border-color: var(--night-teal); box-shadow: 0 0 0 2px rgba(124, 199, 190, .25); }
.device .tile .avatar { width: 46px; height: 46px; font-family: var(--sans); font-size: 1rem; background: #24414a; }
.tile-name { font-size: 12px; line-height: 1.3; color: var(--night-text); }
.captions { border-top-color: rgba(255, 255, 255, .1); }
#caption { font-size: 1.02rem; }
.device .stage .row > .btn { min-height: 46px; }
.device .live .qa { display: grid; gap: 14px; margin-top: 16px; }
.live .qa > .sec-head { margin: 8px 2px 0 !important; padding: 0 !important; border: 0 !important; }
.qa-list { display: grid; gap: 8px; }
.device .qa-item { background: #fff; border: 0; border-radius: 16px; padding: 14px; box-shadow: var(--sh-1); }
.qa-item.s-pending { border-style: none; }
.qa-item.s-answered { box-shadow: var(--sh-1), inset 3px 0 0 var(--teal); }
html[dir="rtl"] .qa-item.s-answered { box-shadow: var(--sh-1), inset -3px 0 0 var(--teal); }
.qa-item.s-rejected { opacity: .75; border-inline-start: 0; }
.qa-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px !important; }
.qa-list .btn { margin: 6px 0 0 !important; margin-inline-end: 6px !important; min-height: 40px; }
.st { font-size: 11.5px; padding: 4px 10px; }
.st.s-accepted { background: var(--info-bg); color: var(--info); }
.st.s-answered { background: #dcefeb; color: #12403e; }
.st.s-offlabel { background: var(--live-bg); color: #8f2019; }
.device .qa form { display: grid; gap: 10px; background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--sh-1); }
.device .qa textarea { margin: 0; border: 1px solid var(--hair-2); }
.device .live .mod.sec, .device .live .live-chat.sec { background: #fff; border: 0; border-radius: var(--r-lg); padding: 16px; margin: 0; box-shadow: var(--sh-1); }
.device .live .mod { box-shadow: var(--sh-1), inset 0 3px 0 var(--ink); }
.device .live .mod h3:not(.h3) { font: 700 14px var(--sans); margin: 6px 0 2px; }
.mod .qa-list > li, .live-chat .qa-list > li { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.mod .qa-list > li:last-child, .live-chat .qa-list > li:last-child { border-bottom: 0; }
.live-chat .qa-list p { margin: 2px 0 0; }
.device #poll.sec-panel { margin: 0; background: #fff; color: var(--ink); }
.poll-res { border-radius: 12px; border-color: var(--hair-2); }
.poll-res i { background: var(--tint-2); }
.device .recording-row h3 { font: 600 15.5px/1.4 var(--serif); margin: 0 0 4px; }
.device .recording-row > p { font-size: 13px; color: var(--amber); }

/* ---------- you ---------- */
.device .you-head { display: flex; gap: 14px; align-items: flex-start; background: #fff; border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-1); margin: 0; }
.device .you-head h1 { font-size: 24px !important; margin-bottom: 2px !important; }
.device .you-head .lede { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.avatar.big { width: 60px; height: 60px; font-family: var(--sans); font-weight: 700; font-size: 1.15rem; background: linear-gradient(160deg, #2a5d62, var(--ink)); }
.vstat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 10px; border-radius: 999px; margin: 0 0 10px; }
.vstat.ok { background: var(--tint); }
.vstat.warn { background: var(--amber-bg); color: var(--amber); }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 0; }
.quick {
  position: relative; display: grid; justify-items: start; gap: 6px; min-height: 84px; padding: 12px; text-align: start;
  border: 0; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: var(--sh-1); cursor: pointer; font: 600 13px/1.25 var(--sans);
}
.quick svg { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--tint); color: var(--teal-ink); }
.quick b { position: absolute; top: 12px; inset-inline-end: 12px; font: 600 12px var(--sans); color: var(--muted); }
.quick:active { transform: scale(.97); }
.device .notif, .device .switch { min-height: 52px; }
.notif.unread { border-inline-start: 0; padding-inline-start: 0; }
.notif.unread > span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-inline-end: 8px; vertical-align: 1px; }
.device .pl { padding: 14px 0; }
.download-row > a { font: 600 15px/1.35 var(--serif); color: var(--ink); text-decoration: none; }
.queue-item > a { font: 600 15px/1.35 var(--serif); color: var(--ink); text-decoration: none; }
.queue-item .row { display: grid !important; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.device .queue-item .row > .btn { font-size: 13px; padding: 6px 8px; }

/* ---------- player sheet ---------- */
.sheet { border-radius: 24px 24px 0 0; background: radial-gradient(90% 55% at 20% 0%, #1b4a52 0%, var(--night) 58%), var(--night); }
.sheet-top { position: relative; padding-top: 30px; }
.grabber { position: absolute; top: 6px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(255, 255, 255, .32); }
.device .sheet-inner { padding: 8px 20px 32px; }
.device .cover.xl { width: 232px; border-radius: 18px; box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .6); }
.device .sheet-title { font: 700 22px/1.25 var(--sans); letter-spacing: -.015em; }
.seek input { accent-color: #fff; }
.device .controls { margin: 14px 0 18px; }
.device .icon-btn.huge { width: 68px; height: 68px; box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .45); }
.sheet-row { border-top-color: rgba(255, 255, 255, .1); }
.sleep select { border-color: rgba(255, 255, 255, .18) !important; background: rgba(255, 255, 255, .06) !important; color: var(--night-text) !important; border-radius: 999px !important; }
.sheet .btn:not(.primary) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); }
.sheet .format-pill, .sheet ion-chip.format-pill { background: rgba(124, 199, 190, .14); color: var(--night-teal); --background: rgba(124, 199, 190, .14); --color: var(--night-teal); }

/* ---------- companion consoles (back-office, sponsor, decisions, admin, appendix) ---------- */
.companion { border: 1px solid var(--hair); border-radius: 24px; background: #f6f7f6; box-shadow: var(--sh-2); }
.companion-header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 16px 24px; background: #fff; border-bottom: 1px solid var(--hair); position: sticky; top: 0; z-index: 5; }
.companion-header .kicker { margin: 0 0 2px; font-size: 11px; }
.companion-header .fine { margin: 0; font-size: .85rem; color: var(--ink-2); }
.surface-badge { flex: none; font: 700 .8rem/1 var(--sans); padding: 9px 12px; border-radius: 10px; background: var(--tint); color: var(--teal-ink); }
.surface-review { background: var(--info-bg); color: var(--info); }
.surface-sponsor { background: var(--amber-bg); color: var(--amber); }
.surface-decide { background: #ece9f6; color: #44397a; }
.surface-appendix { background: #f0ede5; color: #4b4536; }
.companion main { padding: 24px 28px 40px; }
.companion .display.sm, .companion h1 { font: 700 26px/1.2 var(--sans) !important; letter-spacing: -.02em; }
.companion .sec-panel, .companion .card, .companion .decision, .companion .chart-box, .companion .adm-tab-panel > .sec-panel {
  background: #fff; border: 1px solid var(--hair); border-radius: 18px; box-shadow: var(--sh-1);
}
.companion .sec-panel { padding: 20px; }
.companion .sec:not(.sec-panel) { border-top: 0; }
.companion .adm-tab-panel.sec-panel { background: transparent; border: 0; box-shadow: none; padding: 0; }
.companion .adm-tab-panel > :is(.scroll, .kan, .adm-tools, form) { margin-top: 12px; }
.companion .adm-tab-panel > .scroll { background: #fff; border: 1px solid var(--hair); border-radius: 16px; box-shadow: var(--sh-1); }
.companion .adm-tab-panel > .scroll .tbl { margin: 0; }
.kpis { gap: 12px; background: none; border: 0; border-radius: 0; overflow: visible; }
.kpi { background: #fff; border: 1px solid var(--hair); border-radius: 16px; padding: 16px 18px; box-shadow: var(--sh-1); font-size: .82rem; }
.kpi-n { font: 700 1.9rem/1.1 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi.masked { background: repeating-linear-gradient(135deg, #fbf6ec 0 8px, #fff 8px 16px); border-color: rgba(122, 74, 12, .25); }
.kpi.masked .kpi-n { color: var(--amber); font-size: 1.15rem; }
.tbl th, .tbl td { padding: 12px 14px; border-bottom-color: var(--hair); vertical-align: middle; }
.tbl thead th { font-size: .7rem; background: #f7f9f8; border-bottom: 1px solid var(--hair-2); position: sticky; top: 0; }
.tbl tbody tr:hover { background: #fafbfa; }
.tbl td.sup { background: repeating-linear-gradient(135deg, #fbf6ec 0 6px, #fff 6px 12px); color: var(--amber); font-weight: 600; }
.adm-head { border-bottom: 0; margin-bottom: 20px; padding-bottom: 0; }
.adm-head .h2 { font: 700 26px/1.2 var(--sans); }
/* Admin nav: horizontal pills by default; sidebar only when the companion panel itself is wide. */
.companion { container-type: inline-size; }
.adm-body { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.adm-side { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; }
@container (min-width: 980px) {
  .adm-body { grid-template-columns: 188px minmax(0, 1fr); gap: 24px; }
  .adm-side { position: sticky; flex-direction: column; flex-wrap: nowrap; gap: 2px; }
}
.adm-side { border-inline-end: 0; padding: 8px; background: #fff; border: 1px solid var(--hair); border-radius: 16px; box-shadow: var(--sh-1); top: 84px; }
.adm-side button { min-height: 42px; border-radius: 10px; color: var(--ink-2); font-weight: 600; }
.adm-side button[aria-current="true"] { background: var(--ink); color: #fff; }
.adm .admin-live { border-inline-start: 0; box-shadow: var(--sh-1), inset 0 3px 0 var(--live) !important; }
.adm .chart-box { background: #fff; border: 1px solid var(--hair); padding: 18px; }
.adm .kan { gap: 12px; }
.adm .kan-col { background: #eef1f0; border: 0; border-radius: 16px; padding: 10px; }
.adm .kan-card { background: #fff; border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--sh-1); margin-bottom: 8px; padding: 12px; }
.adm .kan-card .icon-btn.sm { width: 36px; height: 36px; }
.adm-tools { background: #fff; border: 1px solid var(--hair); border-radius: 14px; padding: 10px 12px; box-shadow: var(--sh-1); }
.adm .sec > .adm-tools { margin-bottom: 14px; }
.banner { border-radius: 14px; background: var(--amber-bg); color: var(--amber); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.guardrails { border-inline-start: 0 !important; box-shadow: var(--sh-1), inset 0 3px 0 var(--teal) !important; }
.guardrails ul { padding-inline-start: 20px; display: grid; gap: 4px; }
.engagement-funnel progress { -webkit-appearance: none; appearance: none; border: 0; height: 8px; border-radius: 4px; background: #e8ecea; overflow: hidden; }
.engagement-funnel progress::-webkit-progress-bar { background: #e8ecea; border-radius: 4px; }
.engagement-funnel progress::-webkit-progress-value { background: var(--teal); border-radius: 4px; }
.engagement-funnel progress::-moz-progress-bar { background: var(--teal); border-radius: 4px; }
.engagement-funnel .masked strong { color: var(--amber); }
.decision { background: #fff; }
.decision.first { border: 2px solid var(--teal) !important; }
.dec-no { font-family: var(--sans); font-weight: 700; }
.opt { border-radius: 12px; min-height: 46px; background: #fff; }
.pipeline span { background: #fff; }
.pipeline .done { background: var(--tint); color: var(--teal-ink); }
.phone-summary { background: var(--canvas); min-height: 100%; }
.phone-summary .cover { border-radius: 18px; box-shadow: 0 18px 36px -14px rgba(16, 33, 40, .45); }
.phone-summary .h2 { font: 600 22px/1.25 var(--serif); }
.phone-summary .btn { width: 100%; }
.poster { background: #fff; border: 1px solid var(--hair); box-shadow: var(--sh-1); border-radius: 20px; }
.companion .phone { border-color: #101d22; border-radius: 40px; box-shadow: var(--sh-2); }
.companion .tabs { border-bottom: 0; gap: 4px; background: #e9ecea; border-radius: 12px; padding: 4px; display: inline-flex; }
.companion .tabs button { border: 0; border-radius: 9px; padding: 8px 14px; min-height: 40px; }
.companion .tabs button[aria-selected="true"] { background: #fff; box-shadow: var(--sh-1); }

@media (max-width: 699px) {
  .device { border: 0; border-radius: 0; box-shadow: none; }
  .companion { border-radius: 0; }
  .companion main { padding: 18px 16px 32px; }
  .companion-header { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-content { scroll-behavior: auto; }
  .live-dot { animation: none; }
}

.presence-pill .dot { margin-inline-end: 8px; vertical-align: 1px; }
.rail-card > :is(.format-pill, ion-chip) { justify-self: start; width: fit-content; }
ion-button svg { margin-inline-end: 6px; }
/* v5 fixes from visual pass */
.sheet ion-button[fill] { --background: rgba(255, 255, 255, .08); --background-hover: rgba(255, 255, 255, .14); --color: var(--night-text); --border-width: 1px; --border-color: rgba(255, 255, 255, .14); --box-shadow: none; }
.sheet ion-button[disabled] { --color: var(--night-muted); opacity: .7; }
.sheet .sec-head :is(h2, h3), .device .sheet .sec-head :is(h2, h3) { font: 700 17px/1.35 var(--sans) !important; }
.sheet .bms h3, .sheet .sample-transcript h3 { letter-spacing: 0; text-transform: none; color: var(--night-text); }
.upnext > .row { display: grid !important; grid-template-columns: 1fr 1fr; }
.companion .phone { max-width: 360px; width: 100%; margin-inline: auto; min-height: 560px; }
.companion .patient-grid { gap: 24px; }
.stage [data-act="live-leave"] { color: #ffb4ac; border-color: rgba(255, 140, 130, .3); }
.p-card { background: #fff; border-color: var(--hair-2); border-radius: 14px; }
.ph-body { background: var(--canvas); }

.tbl .btn.sm { min-height: 38px; padding: 4px 12px; white-space: nowrap; }
.tbl td .btn.sm + .btn.sm { margin: 0; margin-inline-start: 6px; }
.kan-card .btn { white-space: nowrap; }
