﻿/* ===== Design tokens ===== */
:root {
  --bg: #f6f7fb; --bg-2: #eef0f7; --panel: #ffffff; --panel-2: #f3f5fa; --line: #e3e6ef;
  /* text colours meet WCAG 2.2 AA (≥ 4.5:1) on every background token incl. the soft chip fills
     (computed; tests/ui_audit.py checks every page with axe-core) */
  --text: #141726; --muted: #555c72; --faint: #646b80;
  --brand: #4f46e5; --brand-2: #6d63ff; --brand-ink: #ffffff; --brand-soft: #eceafe;
  --accent: #0ea5a4; --accent-soft: #dff5f4;
  --ok: #08704a; --ok-soft: #e3f6ec; --warn: #8a5200; --warn-soft: #fdf1dc; --bad: #b02a2a; --bad-soft: #fde8e8;
  --info: #2a56bd; --info-soft: #e6eefd;
  --shadow-sm: 0 1px 2px rgba(20,23,38,.05); --shadow: 0 1px 2px rgba(20,23,38,.04), 0 8px 28px rgba(20,23,38,.07);
  --shadow-lg: 0 20px 60px rgba(40,34,120,.16);
  --r-sm: 10px; --r: 16px; --r-lg: 24px;
  --hero: radial-gradient(1200px 500px at 85% -10%, #dcd8ff 0%, transparent 60%), radial-gradient(900px 400px at 0% 0%, #d4f3f1 0%, transparent 55%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1017; --bg-2: #121621; --panel: #161a26; --panel-2: #1c2130; --line: #272d3d;
    --text: #e9ecf4; --muted: #9ba3b8; --faint: #8a92a8;
    --brand: #8b84ff; --brand-2: #a49eff; --brand-ink: #0c0b1f; --brand-soft: #24224a;
    --accent: #35d0cd; --accent-soft: #123332;
    --ok: #3fd096; --ok-soft: #12302a; --warn: #f2b54e; --warn-soft: #362a14; --bad: #ff7272; --bad-soft: #3a1c1f;
    --info: #78a2ff; --info-soft: #18243f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35); --shadow-lg: 0 20px 60px rgba(0,0,0,.5);
    --hero: radial-gradient(1200px 500px at 85% -10%, #2a2660 0%, transparent 60%), radial-gradient(900px 400px at 0% 0%, #0f3433 0%, transparent 55%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1017; --bg-2: #121621; --panel: #161a26; --panel-2: #1c2130; --line: #272d3d;
  --text: #e9ecf4; --muted: #9ba3b8; --faint: #8a92a8; --brand: #8b84ff; --brand-2: #a49eff; --brand-ink: #0c0b1f; --brand-soft: #24224a;
  --accent: #35d0cd; --accent-soft: #123332; --ok: #3fd096; --ok-soft: #12302a; --warn: #f2b54e; --warn-soft: #362a14;
  --bad: #ff7272; --bad-soft: #3a1c1f; --info: #78a2ff; --info-soft: #18243f; color-scheme: dark;
  /* the same as the phone's own dark mode (above): the 🌙 button must not keep the light page top and shadows */
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35); --shadow-lg: 0 20px 60px rgba(0,0,0,.5);
  --hero: radial-gradient(1200px 500px at 85% -10%, #2a2660 0%, transparent 60%), radial-gradient(900px 400px at 0% 0%, #0f3433 0%, transparent 55%);
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif; font-size: 15.5px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 30px; line-height: 1.35; margin: 0 0 10px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 21px; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 16px; margin: 0 0 8px; font-weight: 700; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.hidden { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; margin: 0 auto; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } h1 { font-size: 24px; } }

/* ===== Top bar ===== */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), var(--accent));
  display: grid; place-items: center; color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent); }
.logo-mark svg { width: 18px; height: 18px; }
.logo-mark img.rmark, .pmark img.rmark { width: 24px; height: 24px; object-fit: contain; }
.topbar .row { flex-wrap: nowrap; }
@media (max-width: 620px) {
  .topbar .wrap { gap: 8px; padding: 0 12px; }
  .topbar .chip.warn, .topbar #provChip { display: none; }
  .logo { font-size: 15px; min-width: 0; }
  .topbar .logo { flex: 1 1 auto; }
  .logo-mark { flex: none; }
  .logo > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 58vw; }
  .topbar .tabs button { padding: 6px 10px; }
  .stepper .s:not(.active) > span:last-child { display: none; }
}

/* ===== Buttons ===== */
.btn, button { font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 12px; padding: 10px 18px; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease; text-decoration: none; white-space: nowrap; }
.btn:hover, button:hover { text-decoration: none; box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 28%, transparent); }
.btn:active, button:active { transform: translateY(1px); }
.btn-lg { padding: 14px 26px; font-size: 16.5px; border-radius: 14px; }
.btn-ghost, button.ghost { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn-ghost:hover, button.ghost:hover { box-shadow: var(--shadow-sm); background: var(--panel-2); }
button.danger { background: var(--bad); color: #fff; }
button.link { background: none; color: var(--brand); padding: 4px 6px; }
button:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

/* ===== Cards & surfaces ===== */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; }
.card.flat { box-shadow: none; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section { padding-top: 28px; padding-bottom: 28px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ===== Forms ===== */
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 14px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); outline: none; }
textarea { min-height: 110px; resize: vertical; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; margin: 10px 0; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; box-shadow: var(--shadow-sm); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { inset-inline-start: 21px; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.checkline input { margin-top: 6px; width: 18px; height: 18px; accent-color: var(--brand); }

/* ===== Chips & badges ===== */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; background: var(--panel-2); color: var(--muted);
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); display: inline-block; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.chip.bad .dot.live { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 25%, transparent); }
.err { color: var(--bad); font-weight: 600; }
.ok-text { color: var(--ok); font-weight: 600; }

/* ===== Landing ===== */
.hero { background: var(--hero); padding: 64px 0 40px; }
.hero h1 { font-size: 40px; max-width: 760px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 640px; }
@media (max-width: 620px) { .hero { padding: 36px 0 20px; } .hero h1 { font-size: 28px; } }
.choice { display: flex; flex-direction: column; gap: 12px; padding: 28px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .2s, border-color .2s; color: var(--text); min-height: 230px; }
.choice:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); text-decoration: none; }
.choice .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.choice.alt .ico { background: var(--accent-soft); color: var(--accent); }
.choice .ico svg { width: 26px; height: 26px; }
.choice h2 { margin: 4px 0 0; }
.choice .go { margin-top: auto; font-weight: 700; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.choice.alt .go { color: var(--accent); }
.steps3 .step { display: flex; gap: 14px; align-items: flex-start; }
.steps3 .num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--brand-soft); color: var(--brand); }
.footer { padding: 30px 0 40px; color: var(--faint); font-size: 13px; text-align: center; }

/* ===== Wizard ===== */
.stepper { display: flex; gap: 8px; align-items: center; margin: 22px 0 18px; flex-wrap: wrap; }
.stepper .s { display: flex; align-items: center; gap: 8px; color: var(--faint); font-weight: 600; font-size: 14px; }
.stepper .s .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); font-size: 13px; background: var(--panel); }
.stepper .s.active { color: var(--text); } .stepper .s.active .n { border-color: var(--brand); color: var(--brand); }
.stepper .s.done .n { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.stepper .bar { flex: 1; min-width: 20px; height: 2px; background: var(--line); border-radius: 2px; }
.poslist { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pos { text-align: start; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--r); border: 1.5px solid var(--line);
  background: var(--panel); color: var(--text); cursor: pointer; font-weight: 500; white-space: normal; align-items: stretch; }
.pos:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); }
.pos.sel { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.pos .pi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 20px; }
.pos .pt { font-weight: 700; font-size: 15.5px; }
.pos .pd { color: var(--muted); font-size: 13px; line-height: 1.6; }
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 26px; text-align: center; background: var(--panel-2); cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .big { font-weight: 700; font-size: 16px; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 600; margin-top: 10px; }
.consent { background: var(--panel-2); border-radius: var(--r); padding: 16px 18px; font-size: 14px; border: 1px solid var(--line); }
ul.clean { padding-inline-start: 20px; margin: 6px 0; }
ul.clean li { margin: 3px 0; }
.analyzing { text-align: center; padding: 50px 20px; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 1s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Interview ===== */
.iv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; padding: 20px 0 30px; }
@media (max-width: 960px) { .iv-layout { grid-template-columns: 1fr; } }
.stage-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 26px; display: flex; flex-direction: column; gap: 18px; min-height: 520px; }
.progress { display: flex; align-items: center; gap: 12px; }
.progress .track { flex: 1; height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.progress .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 99px; transition: width .6s ease; }
.interviewer { display: flex; align-items: center; gap: 16px; }
.speed { margin-inline-start: auto; display: inline-flex; border: 1px solid var(--line, #d0d5dd); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.speed button { min-height: 34px; min-width: 44px; padding: 4px 10px; border: 0; border-radius: 0; background: transparent; color: inherit; font-weight: 600; font-size: 13px; box-shadow: none; }
.speed button.on { background: var(--brand, #2563eb); color: var(--brand-ink, #fff); }
.orb { position: relative; width: 74px; height: 74px; flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0%, transparent 30%), linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--brand) 35%, transparent); }
.orb::before, .orb::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); opacity: 0; }
.state-speaking .orb::before { animation: ring 1.4s ease-out infinite; }
.state-speaking .orb::after { animation: ring 1.4s ease-out .7s infinite; }
@keyframes ring { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.45); opacity: 0; } }
.state-thinking .orb { animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.94); filter: saturate(.7); } }
.status-text { font-weight: 700; font-size: 15px; }
.status-sub { color: var(--muted); font-size: 13px; }
.question { font-size: 24px; font-weight: 700; line-height: 1.75; min-height: 120px; }
@media (max-width: 620px) { .question { font-size: 19px; } }
.qkind { display: inline-block; margin-bottom: 4px; }
.answer-box { background: var(--panel-2); border-radius: var(--r); padding: 14px 16px; min-height: 84px; color: var(--muted); border: 1px solid var(--line); }
.answer-box.live { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.listen-bar { height: 5px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.listen-bar > span { display: block; height: 100%; width: 0; background: var(--warn); transition: width .2s; }
.wave { display: inline-flex; gap: 3px; align-items: center; height: 22px; }
.wave i { width: 3px; border-radius: 3px; background: var(--bad); height: 6px; transition: height .08s; }
.side { display: flex; flex-direction: column; gap: 14px; }
.videobox { position: relative; border-radius: var(--r); overflow: hidden; background: #0b0d14; aspect-ratio: 4/3; box-shadow: var(--shadow); }
.videobox video, .videobox canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.videobox .rec { position: absolute; top: 10px; inset-inline-end: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 99px; display: flex; gap: 6px; align-items: center; }
.hud { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.65); color: #fff; font: 11px/1.4 ui-monospace, monospace; padding: 8px; border-radius: 8px; direction: ltr; white-space: pre; max-width: 92%; }
.meter { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); font-size: 14px; }
.checks li .st { margin-inline-start: auto; font-weight: 600; }
.checks li .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--line); color: var(--muted); flex: none; }
.checks li.good .ic { background: var(--ok-soft); color: var(--ok); }
.checks li.bad .ic { background: var(--bad-soft); color: var(--bad); }
.tips { font-size: 13.5px; color: var(--muted); }
.calib { position: fixed; inset: 0; background: var(--bg); z-index: 50; }
.calib-dot { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--brand) 22%, transparent); transition: left .35s ease, top .35s ease; }
.calib-text { position: absolute; bottom: 28px; inset-inline: 0; text-align: center; font-size: 20px; font-weight: 700; }
.done-hero { text-align: center; padding: 60px 20px; }
.done-check { width: 84px; height: 84px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 18px; font-size: 42px; animation: pop .4s ease; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }

/* ===== Admin ===== */
.admin { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 64px); }
@media (max-width: 900px) { .admin { grid-template-columns: 1fr; } .sidenav { position: static !important; flex-direction: row !important; overflow-x: auto; border-inline-end: 0 !important; border-bottom: 1px solid var(--line); } }
.sidenav { position: sticky; top: 64px; align-self: start; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; border-inline-end: 1px solid var(--line); height: calc(100vh - 64px); }
.sidenav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.sidenav a:hover { background: var(--panel-2); text-decoration: none; color: var(--text); }
.sidenav a.active { background: var(--brand-soft); color: var(--brand); }
.sidenav a svg { width: 18px; height: 18px; flex: none; }
.sidenav .badge { margin-inline-start: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.main { padding: 24px; min-width: 0; }
@media (max-width: 620px) { .main { padding: 16px; } }
.kpi { padding: 18px; }
.kpi .v { font-size: 30px; font-weight: 800; line-height: 1.2; }
.kpi .l { color: var(--muted); font-size: 13px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; color: var(--muted); font-weight: 700; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--panel-2); }
.cand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--brand-soft); color: var(--brand); flex: none; }
.ring { --p: 0; --c: var(--brand); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--panel-2) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--panel); }
.ring span { position: relative; }
.ring.lg { width: 104px; height: 104px; font-size: 26px; }
.ring.lg::before { inset: 9px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel-2); border-radius: 12px; width: fit-content; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 9px; }
.tabs button:hover { box-shadow: none; color: var(--text); }
.tabs button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 160px; padding: 8px 12px; }
.monitor { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; }
@media (max-width: 1100px) { .monitor { grid-template-columns: 1fr; } }
.snap { width: 100%; aspect-ratio: 4/3; background: #0b0d14; border-radius: 12px; object-fit: cover; transform: scaleX(-1); display: block; }
.alerts { max-height: 320px; overflow: auto; display: grid; gap: 8px; }
.alert { border-inline-start: 4px solid var(--warn); background: var(--panel-2); padding: 8px 12px; border-radius: 10px; font-size: 13.5px; }
.alert.integrity { border-color: var(--bad); } .alert.event { border-color: var(--info); }
.seg { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--panel); }
.seg.hot { border-color: color-mix(in srgb, var(--bad) 60%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 12%, transparent); }
.seg .q { font-weight: 700; margin: 8px 0; }
.seg .a { background: var(--panel-2); padding: 10px 12px; border-radius: 12px; margin: 8px 0; }
.score { font-size: 26px; font-weight: 800; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 44px; gap: 10px; align-items: center; font-size: 14px; }
.bar .track { height: 9px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 99px; }
canvas.chart { width: 100%; height: 230px; display: block; background: var(--panel-2); border-radius: 12px; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.legend label { display: inline-flex; gap: 5px; align-items: center; margin: 0; font-weight: 500; cursor: pointer; }
.legend i { width: 12px; height: 4px; border-radius: 2px; display: inline-block; }
.report-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }
.qbank-q { padding: 14px 0; border-bottom: 1px solid var(--line); }
.qbank-q:last-child { border-bottom: 0; }
.empty { text-align: center; padding: 40px; color: var(--muted); }
.toast { position: fixed; bottom: 22px; inset-inline-start: 22px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 100; font-weight: 600; }
@media print {
  .topbar, .sidenav, .noprint { display: none !important; } .admin { display: block; } .main { padding: 0; }
  body { background: #fff; } .card { box-shadow: none; break-inside: avoid; }
}

/* ===== Framing check (device check) ===== */
.framebox { isolation: isolate; }
.cam-off { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #c9cede; font-size: 14px; text-align: center; padding: 20px;
  background: radial-gradient(400px 260px at 50% 40%, #1b2133 0%, #0b0d14 70%); }
.frame-guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.frame-guide .g-head, .frame-guide .g-body { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 2.5; stroke-dasharray: 7 6; transition: stroke .3s; }
.frame-guide .g-hands { fill: rgba(255,255,255,.06); stroke: rgba(255,255,255,.45); stroke-width: 2; stroke-dasharray: 4 6; transition: all .3s; }
.frame-guide.good .g-head, .frame-guide.good .g-body { stroke: #3fd096; stroke-dasharray: none; }
.frame-guide.warn .g-head, .frame-guide.warn .g-body { stroke: #f2b54e; }
.frame-guide .g-hands.done { stroke: #3fd096; fill: rgba(63,208,150,.12); stroke-dasharray: none; }
.frame-hint { position: absolute; inset-inline: 12px; bottom: 12px; display: flex; gap: 10px; align-items: center; justify-content: center;
  background: rgba(10,12,20,.72); backdrop-filter: blur(6px); color: #fff; font-weight: 600; font-size: 14.5px; padding: 9px 14px; border-radius: 14px;
  border: 1px solid rgba(242,181,78,.55); }
.frame-hint.good { border-color: rgba(63,208,150,.6); }
.frame-hint .arrow { font-size: 22px; line-height: 1; color: #f2b54e; direction: ltr; }
.frame-hint .arrow:empty { display: none; }
.frame-score { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 7px; align-items: center; font-size: 12.5px; font-weight: 600;
  background: rgba(10,12,20,.66); color: #fff; padding: 4px 11px; border-radius: 99px; }
.frame-score .dot { width: 8px; height: 8px; border-radius: 50%; background: #f2b54e; }
.frame-score.q-good .dot { background: #3fd096; } .frame-score.q-bad .dot { background: #ff7272; }
.warn-text { color: var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: 12px; margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ===== Accessibility: target sizes (WCAG 2.5.8) ===== */
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-width: 20px; flex: none; margin: 0; accent-color: var(--brand); }
label:has(> input[type="checkbox"]) { min-height: 32px; cursor: pointer; }
.icon-link { display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; border-radius: 10px; }
.icon-link:hover { background: var(--brand-soft); text-decoration: none; }

/* ===== Layout robustness: grid tracks must be able to shrink below their content (tables, long
   names) — otherwise one wide table widened the whole manager page to 686 px on a 375-px phone ===== */
.grid:not(.cols-2):not(.cols-3):not(.cols-4) { grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
@media (max-width: 900px) {
  /* the side menu becomes a horizontal tab strip on tablets/phones: it must not keep its full-height */
  .sidenav { height: auto !important; top: auto; padding: 8px 12px !important; gap: 6px; scrollbar-width: thin; }
}
@media (max-width: 620px) {
  .topbar .wrap { gap: 8px; }
  .topbar .logo > span:last-child { display: none; }          /* logo mark only: room for the controls */
  .topbar .row { gap: 6px; flex-wrap: nowrap; }
  .topbar .tabs { flex-wrap: nowrap; }
  .topbar .tabs button, .topbar .tabs a { padding: 6px 10px; }
  .topbar .chip.tiny { display: none; }
}
@media (max-width: 620px) {
  #kpis.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 26px; }
  /* interviews table → one card per candidate */
  .rtable thead { display: none; }
  .rtable, .rtable tbody { display: block; }
  .rtable tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; padding: 14px; margin-bottom: 10px;
    border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
  .rtable td { display: flex; flex-direction: column; gap: 2px; padding: 0 !important; border: 0 !important; min-width: 0; }
  .rtable td::before { content: attr(data-l); font-size: 11.5px; color: var(--muted); }
  .rtable td.r-cand { grid-column: 1 / -1; }
  .rtable td.r-cand::before { content: none; }
  .rtable td[colspan] { grid-column: 1 / -1; }
}
tr.click:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: -3px; }
@media (max-width: 620px) {
  .rtable td { display: block; }
  .rtable td::before { display: block; margin-bottom: 2px; }
  .filters { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filters > input[type="text"], .filters > button, .filters > label { grid-column: 1 / -1; }
  .filters select { width: 100%; min-width: 0; }
}

/* ===== Contrast fixes found by tests/ui_audit.py ===== */
:root { --accent-ink: #0f766e; --bad-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent-ink: #35d0cd; --bad-ink: #2a0d0f; } }
:root[data-theme="dark"] { --accent-ink: #35d0cd; --bad-ink: #2a0d0f; }
.choice.alt .go, .choice.alt .ico { color: var(--accent-ink); }
button.danger { color: var(--bad-ink); }
input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; min-width: 24px; }
/* text that is visually hidden but still read by screen readers (logo name on phones) */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 620px) {
  .topbar .logo > span:last-child { display: inline !important; position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ===== Compare candidates / pipeline stage ===== */
.cmp-cells { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 12px; }
.cmp-head { position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: 6px 0; }
.cmp-col { padding: 14px; }
.cmp-row { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cmp-q { font-weight: 600; }
.cmp-cell { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 4px; align-content: start; }
.cmp-score { font-size: 22px; line-height: 1; }
.cmp-bar { display: inline-block; width: 110px; height: 7px; border-radius: 4px; background: var(--line); vertical-align: middle; overflow: hidden; }
.cmp-bar > span { display: block; height: 100%; border-radius: 4px; }
.cmp-bar-fixed, .cmp-bar.cmp-fixed { }
#cmpBar { position: sticky; bottom: 14px; z-index: 15; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow-lg); }
#cmpBar.hidden { display: none !important; }
#cmpBar #cmpText { flex: 1; min-width: 140px; }
input.pick { margin-inline-end: 4px; }
.pick-gap { display: inline-block; width: 28px; }
.dlg { border: 1px solid var(--line); border-radius: 20px; padding: 22px; width: min(560px, calc(100vw - 32px)); background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg); }
.dlg::backdrop { background: rgba(10, 12, 20, .45); backdrop-filter: blur(2px); }
button.small { padding: 7px 12px; font-size: 13px; min-height: 32px; }
@media (max-width: 760px) {
  .cmp-head { position: static; }
  .cmp-cells { grid-template-columns: 1fr; }
  .cmp-cells .cmp-cell::before { content: attr(data-name); font-size: 11.5px; color: var(--muted); }
}

/* ===== Phones: portrait camera, safe areas, touch ===== */
/* the video inside is absolutely positioned (no intrinsic width): the box needs an explicit width —
   "width:auto" collapsed it to 0 px on phones (seen in the Pixel 7 e2e screenshots) */
.videobox.portrait { aspect-ratio: 3 / 4; width: min(100%, calc(62vh * 3 / 4)); margin-inline: auto; }
@media (max-width: 620px) {
  .iv-layout { padding-top: 12px; gap: 12px; }
  .stage-card { padding: 18px; min-height: 0; gap: 14px; }
  .question { font-size: 19px !important; line-height: 1.6; }
  .orb { width: 56px; height: 56px; }
  #scrLive .side { order: -1; }                                  /* camera above the question on phones */
  #scrLive .side .card { display: none; }                        /* tips + mic meter: no room on a phone */
  #liveBox { height: 34vh; width: 100%; aspect-ratio: auto; }
  #liveBox.portrait { width: min(100%, calc(34vh * 3 / 4)); aspect-ratio: auto; height: 34vh; }
  .btn-lg, button.btn-lg { min-height: 52px; width: 100%; }
  .row:has(> #btnDone) { flex-wrap: nowrap; }
  .frame-hint { font-size: 13.5px; inset-inline: 8px; bottom: 8px; }
}
body { padding-bottom: env(safe-area-inset-bottom); }
.topbar { padding-top: env(safe-area-inset-top); }
button, a, input, select, textarea, label { touch-action: manipulation; }   /* no double-tap zoom delay */

/* ===== device check: live guide on the picture ===== */
.frame-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transform: none !important; }
.cam-load { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; padding: 16px;
  background: rgba(11,13,20,.62); color: #fff; font-weight: 600; font-size: 14.5px; }
.cam-load-bar { width: min(260px, 70vw); height: 6px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; margin-inline: auto; }
.cam-load-bar span { display: block; height: 100%; width: 0; background: #3fd096; border-radius: inherit; transition: width .25s; }
/* how to sit */
.howto { margin: 0; display: grid; gap: 10px; }
.howto figcaption { font-size: 15px; }
.howto-pics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.howto-pic { width: 100%; height: auto; display: block; }
.howto.single .howto-pics { grid-template-columns: 1fr; }
.howto.single .howto-pic.off { display: none; }
.hp-bg { fill: var(--panel-2); }
.hp-desk { fill: var(--line); }
.hp-books { fill: color-mix(in oklab, var(--accent) 35%, var(--panel-2)); }
.hp-book1 { fill: #4f9fd6; } .hp-book2 { fill: #e07a5f; } .hp-book3 { fill: #81b29a; }
.hp-laptop { fill: var(--faint); }
.hp-cam { fill: #3fd096; }
.hp-eye { stroke: #3fd096; stroke-width: 2; stroke-dasharray: 5 5; fill: none; }
.hp-ray { stroke: #f2b54e; stroke-width: 10; opacity: .22; stroke-linecap: round; }
.hp-light circle { fill: #f2b54e; } .hp-light path { stroke: #f2b54e; stroke-width: 3; stroke-linecap: round; }
.hp-skin { fill: #d9a77f; } .hp-ink { fill: #3a2a20; }
.hp-shirt { fill: var(--brand); }
.hp-dim { stroke: var(--muted); stroke-width: 1.6; fill: none; }
.hp-label { fill: var(--muted); font-size: 12px; text-anchor: middle; font-family: inherit; }
.howto-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.howto-rules li { display: flex; gap: 8px; align-items: flex-start; }
.howto-rules .hr-ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  background: var(--ok-soft); color: var(--ok); margin-top: 2px; }
@media (max-width: 620px) { .howto-pics { grid-template-columns: 1fr; } .howto-pic.secondary { display: none; } }

/* phones: every button easy to hit with a finger (≥ 44 px) */
@media (pointer: coarse), (max-width: 620px) {
  button.ghost, button.small, #themeBtn, #btnMicTest { min-height: 44px; min-width: 44px; }
}

/* HR panel: the 3 key traits of a job (30 / 15 / 10 % of the score) */
.traits { margin: 12px 0; border: 1px solid var(--line, #e3e6ec); background: linear-gradient(180deg, var(--brand-soft, #eef3ff), transparent 70%); }
.share-bar { display: flex; height: 26px; border-radius: 999px; overflow: hidden; margin-bottom: 12px; font-size: 12px; font-weight: 700; color: #fff; }
.share-bar span { display: flex; align-items: center; justify-content: center; min-width: 0; }
.t1 { --c: #c2410c; } .t2 { --c: #6741d9; } .t3 { --c: #0e7490; } .rest { --c: #6b7280; }
.share-bar span { background: var(--c); }
.trait-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line, #e3e6ec); }
.trait-row input { width: 100%; font-weight: 600; }
.trait-row .rank, .rank.sm { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--c); color: #fff; font-weight: 800; }
.rank.sm { width: 22px; height: 22px; font-size: 12px; }
.trait-row .weight { flex-shrink: 0; min-width: 56px; text-align: center; padding: 4px 10px; border-radius: 999px; font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.rest-row { border-bottom: 0; opacity: .8; }
button.sugg { min-height: 36px; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: transparent; color: inherit; border: 1px solid var(--line, #d0d5dd); box-shadow: none; }
button.sugg:hover { border-color: var(--brand, #2563eb); color: var(--brand, #2563eb); }
.trait-bars { display: grid; gap: 8px; margin: 8px 0 14px; }
.trait-bar { display: grid; grid-template-columns: 26px minmax(80px, 1fr) 3fr 52px; align-items: center; gap: 8px; }
.trait-bar .track { height: 10px; border-radius: 999px; background: var(--line, #e9ecef); overflow: hidden; }
.trait-bar .fill { height: 100%; background: var(--c); }

/* ===== HR: candidates (personal link + login) ===== */
.cd-layout { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .cd-layout { grid-template-columns: 1fr; } }
.cd-form { position: sticky; top: 80px; }
@media (max-width: 1000px) { .cd-form { position: static; } }
.cd-plus { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 16px; }
.cd-step { display: flex; align-items: center; gap: 8px; margin: 18px 0 -4px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: none; }
.cd-step .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); font-size: 11px; }
.cd-step::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.req { color: var(--bad); }
.hint { color: var(--faint); font-weight: 400; font-size: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; padding: 4px; background: var(--panel-2); border-radius: 12px; }
.seg button { background: transparent; color: var(--muted); padding: 9px 10px; border-radius: 9px; box-shadow: none; }
.seg button[aria-checked="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.inbtn { display: flex; gap: 6px; }
.inbtn input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.inbtn button { padding: 0 12px; font-size: 17px; }
.cd-rules { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--info-soft); color: var(--info); }
.cd-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.cd-row:last-child { border-bottom: 0; }
.cd-av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--brand-soft); color: var(--brand); }
.cd-row .nm { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cd-row .sub { font-size: 12.5px; color: var(--muted); }
.cd-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 620px) { .cd-row { grid-template-columns: 36px minmax(0, 1fr); } .cd-row .acts { grid-column: 1 / -1; justify-content: flex-start; } .cd-av { width: 36px; height: 36px; } }
.cd-empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.cd-empty .big { font-size: 38px; }
.cd-dlg { width: min(560px, calc(100vw - 24px)); }
.cd-ok { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; font-size: 26px; font-weight: 800; background: var(--ok-soft); color: var(--ok); }
.cred { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cr { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.cr:last-child { border-bottom: 0; }
.cr .k { font-size: 12.5px; color: var(--muted); }
.cr code { font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; text-align: left; }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 13.5px; line-height: 1.9; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0; max-height: 230px; overflow: auto; }
.cd-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
.cd-actions .btn-lg { width: 100%; }
.cd-actions a { text-align: center; }
@media (min-width: 520px) { .cd-actions { grid-template-columns: 1fr 1fr; } .cd-actions .btn-lg { grid-column: 1 / -1; } }
.cd-open { display: flex; align-items: center; gap: 8px; width: 100%; background: none; color: var(--text); padding: 0; font-size: 16px; font-weight: 700; box-shadow: none; cursor: default; }
.cd-open:hover { box-shadow: none; }
.cd-open .chev { display: none; margin-inline-start: auto; font-size: 20px; color: var(--muted); transition: transform .2s; }
@media (max-width: 1000px) {
  .cd-layout .cd-list { order: 2; }
  .cd-open { cursor: pointer; min-height: 44px; }
  .cd-open .chev { display: inline; }
  .cd-form.closed #cdBody { display: none; }
  .cd-form:not(.closed) .chev { transform: rotate(180deg); }
  .cd-form.closed { padding-top: 12px; padding-bottom: 12px; }
}
@media (max-width: 620px) {
  #cdTabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  #cdTabs::-webkit-scrollbar { display: none; }
  #cdTabs button { white-space: nowrap; flex: none; }
  #cdSearch { max-width: none !important; width: 100%; }
  .cd-row .acts .btn, .cd-row .acts button { min-height: 44px; }
}

.cd-layout > * { min-width: 0; }
.cd-form select, .cd-form input { max-width: 100%; min-width: 0; }

/* a guest business's own logo in the top bar (applyBrand) */
.logo-mark.has-logo { background: #fff; padding: 2px; overflow: hidden; }

/* phones: inputs at 16px so iOS Safari does not zoom in when a field is tapped */
@media (max-width: 760px) { input, select, textarea { font-size: 16px !important; } }

/* ===== Al Rowad: the company behind every page ===== */
.rlogo { display: inline-grid; place-items: center; background: #1e2846; border-radius: 18px; padding: 14px 18px; margin-bottom: 6px; }
.rlogo img { width: 150px; height: auto; display: block; }
.rfoot { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 18px 12px 26px;
  color: var(--faint); font-size: 13px; text-align: center; }
.rfoot .rm { width: 26px; height: 26px; border-radius: 8px; background: #1e2846; display: inline-grid; place-items: center; flex: none; }
.rfoot .rm img { width: 18px; height: 18px; object-fit: contain; }
.rfoot a { color: inherit; }
/* candidate and interview pages: the business's name stays beside its mark on phones (only the theme button is beside it) */
@media (max-width: 620px) {
  .topbar.named .logo > span:last-child { display: block !important; position: static !important; width: auto; height: auto; clip: auto;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 62vw; }
}

/* ===== The live interview on a phone (Dec 2026 review) =====
   One screen, no page scrolling: camera on top, who is talking, the question (scrolls by itself if long),
   what was heard, and the main button at the bottom under the thumb. Nothing may be wider than the screen. */
.iv-layout > * { min-width: 0; }
@media (max-width: 620px) {
  .iv-layout { grid-template-columns: minmax(0, 1fr); }
  body:has(#scrLive:not(.hidden)) .rfoot { display: none; }
  body:has(#scrLive:not(.hidden)) main.wrap { padding-inline: 10px; }
  #scrLive:not(.hidden) { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 0;
    height: calc(100dvh - 66px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 420px; }
  #scrLive .side { order: -1; flex: none; }
  #liveBox, #liveBox.portrait { height: 24dvh; min-height: 130px; max-height: 230px; width: 100%; aspect-ratio: auto; border-radius: 14px; }
  #scrLive .stage-card { flex: 1 1 auto; min-height: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); gap: 10px; border-radius: 16px; }
  #scrLive .progress { gap: 8px; }
  #scrLive .progress .chip { font-size: 12px; padding: 3px 9px; }
  #scrLive .progress .small { font-size: 12px; white-space: nowrap; }
  #scrLive .interviewer { gap: 10px; }
  #scrLive .orb { width: 40px; height: 40px; }
  #scrLive .status-text { font-size: 12.5px; color: var(--muted); font-weight: 600; }
  #scrLive .status-sub { font-size: 15.5px; font-weight: 800; color: var(--text); }
  #scrLive .state-listening .status-sub { color: var(--bad); }
  #scrLive .state-speaking .status-sub { color: var(--brand); }
  #scrLive .speed button { min-height: 44px; min-width: 44px; padding: 4px 8px; font-size: 12.5px; }
  #scrLive .stage-card > div:has(> #question) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  #scrLive .qkind { align-self: flex-start; font-size: 12px; }
  #scrLive .question { flex: 1 1 auto; min-height: 3.2em; overflow-y: auto; font-size: 19px !important; line-height: 1.65; overscroll-behavior: contain; }
  #scrLive .stage-card > div[style*="margin-top:auto"] { margin-top: 0 !important; flex: none; }
  #scrLive .answer-box { min-height: 46px; max-height: 76px; overflow-y: auto; padding: 10px 12px; font-size: 14.5px; line-height: 1.6; }
  #scrLive .row:has(> #btnDone) { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px !important; }
  #scrLive #btnDone { grid-column: 1 / -1; min-height: 56px; font-size: 17px; }
  #scrLive #btnRepeat, #scrLive #btnEnd { min-height: 46px; width: 100%; margin: 0 !important; padding-inline: 8px; }
  /* "end the interview?" opens over the screen as a bottom sheet, it never pushes the layout */
  #endConfirm:not(.hidden) { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; margin: 0 !important; border-radius: 20px 20px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: var(--panel); box-shadow: 0 -10px 40px rgba(0,0,0,.25); }
  /* the rest of the page is dimmed and not tappable while the question is open */
  #endConfirm:not(.hidden) { box-shadow: 0 0 0 100vmax rgba(8, 10, 18, .55); }
  #endConfirm:not(.hidden)::before { content: ""; position: fixed; inset: 0; z-index: -1; }   /* catches taps on the dimmed page */
  #endConfirm .row { display: grid; grid-template-columns: 1fr; gap: 8px; }
  #endConfirm button { width: 100%; min-height: 50px; }
  /* the device check: the two buttons stay at the bottom of the screen, the page scrolls above them */
  body:has(#scrCheck:not(.hidden)) main.wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  #scrCheck .grid:has(> #btnStart) { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; margin: 0 !important;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--panel) 96%, transparent);
    backdrop-filter: blur(10px); box-shadow: 0 -6px 24px rgba(0,0,0,.12); grid-template-columns: 1fr; }
  #scrCheck .grid:has(> #btnStart) .btn-lg { min-height: 54px; }
  #scrCheck .grid:has(> #btnStart) > .hidden { display: none; }
}
/* a phone held sideways: camera beside the question */
@media (max-height: 500px) and (orientation: landscape) {
  #scrLive:not(.hidden) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 36%); align-items: start; }
  #scrLive .side { order: 0; }
  #liveBox, #liveBox.portrait { height: auto; aspect-ratio: 4 / 3; max-height: 70dvh; }
  #scrLive .side .card { display: none; }
  #scrLive .stage-card { min-height: 0; padding: 12px; gap: 8px; }
  #scrLive .question { font-size: 17px !important; min-height: 0; }
  .orb { width: 36px; height: 36px; }
}
/* short phones (iPhone SE and the like): less camera, the question never squeezed under the rest */
@media (max-width: 620px) {
  #scrLive .stage-card > div:has(> #question) { min-height: 4.6em; }
  #scrLive .stage-card { overflow-y: auto; }
}
@media (max-width: 620px) and (max-height: 700px) {
  #liveBox, #liveBox.portrait { height: 19dvh; min-height: 96px; }
  #scrLive .status-text { display: none; }
  #scrLive .orb { width: 32px; height: 32px; }
  #scrLive .answer-box { max-height: 54px; min-height: 40px; }
  #scrLive .row.between { display: none; }                      /* the "your answer" label: the box says it */
  #scrLive #btnDone { min-height: 52px; }
  #scrLive #btnRepeat, #scrLive #btnEnd { min-height: 44px; }
  #scrLive:not(.hidden) { min-height: 0; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .topbar .wrap { height: 48px; }
  #scrLive:not(.hidden) { height: calc(100dvh - 48px - env(safe-area-inset-top)); padding: 6px 0; }
  #scrLive .stage-card { max-height: 100%; overflow-y: auto; }
  #scrLive .status-text, #scrLive .row.between { display: none; }
  #scrLive .answer-box { max-height: 48px; min-height: 36px; }
  #scrLive .row:has(> #btnDone) { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; margin-top: 6px !important; }
  #scrLive #btnDone { grid-column: auto; min-height: 46px; }
  #scrLive #btnRepeat, #scrLive #btnEnd { min-height: 46px; width: 100%; margin: 0 !important; }
}
@media (max-width: 620px) and (max-height: 700px) { #scrLive .question { font-size: 17px !important; line-height: 1.6; } }
/* very short phones (320×568, 360×600 with the browser bars): the whole question must show without scrolling */
@media (max-width: 620px) and (max-height: 620px) {
  #liveBox, #liveBox.portrait { height: 15dvh; min-height: 84px; }
  #scrLive #qKind { display: none; }
  #scrLive .question { font-size: 16.5px !important; }
  #scrLive #btnDone { min-height: 48px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  body:has(#scrLive:not(.hidden)) .rfoot { display: none; }
  body:has(#scrLive:not(.hidden)) main.wrap { padding-bottom: 0; }
  #scrLive .stage-card { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
  #scrLive .stage-card > div:has(> #question) { flex: 1 1 auto; min-height: 2.4em; display: flex; flex-direction: column; overflow: hidden; }
  #scrLive .question { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
  #scrLive .stage-card > div[style*="margin-top:auto"] { margin-top: 0 !important; flex: none; }
  #scrLive .qkind { display: none; }
  #scrLive .speed button { min-height: 40px; min-width: 44px; font-size: 12.5px; padding: 2px 6px; }
}
/* phones and touch screens: every control at least 44 × 44 px (WCAG 2.5.8 / Apple HIG) */
@media (pointer: coarse), (max-width: 620px) {
  button, .btn, select, .topbar .tabs button, .topbar .tabs a { min-height: 44px; }
  .pw button { min-width: 44px; min-height: 44px; }
  a.logo { min-height: 44px; min-width: 44px; }
  .x, button.x { min-width: 44px; min-height: 44px; }
}
.rfoot a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 6px; }
@media (pointer: coarse), (max-width: 620px) {
  button.sugg { min-height: 44px; padding: 4px 12px; font-size: 13px; }
  summary { min-height: 44px; padding-block: 10px; box-sizing: border-box; }
  a.small, .row > a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* our own jobs and their questions (HR panel) */
.oj-item { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel); }
.oj-item textarea { width: 100%; min-height: 64px; }
.oj-item .view > div { line-height: 1.8; }
#ojDlg[open] { display: block; }
