/* Interview Ready by LUUBA. Every colour is a token so the palette can be swapped in one place. */
:root {
  color-scheme: light;
  --bg: #f5f6f8; --card: #ffffff; --ink: #161a23; --muted: #5d6474; --line: #e2e5eb;
  --brand: #3451d1; --brand-2: #2640b0; --brand-ink: #ffffff; --brand-soft: #e8ecfb;
  --good: #217a5b; --good-soft: #e0f1ea; --warn: #92600e; --warn-soft: #fbf0dc; --bad: #b3372b; --bad-soft: #fbe6e3;
  --track: #e9ecf2; --top: #121726; --top-ink: #ffffff;
  --me: #3451d1; --me-ink: #ffffff; --them: #ffffff;
  --shadow: 0 6px 20px rgba(20, 28, 50, .06);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f121a; --card: #181c27; --ink: #eceef4; --muted: #9aa1b2; --line: #2a3040;
    --brand: #8ea2ff; --brand-2: #aebcff; --brand-ink: #0e1330; --brand-soft: #232a4a;
    --good: #5cc59d; --good-soft: #15302a; --warn: #e6b45e; --warn-soft: #33291a; --bad: #f08a7c; --bad-soft: #3a211e;
    --track: #262c3b; --top: #0a0d14; --top-ink: #eceef4;
    --me: #4a63e0; --me-ink: #ffffff; --them: #1f2431; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f121a; --card: #181c27; --ink: #eceef4; --muted: #9aa1b2; --line: #2a3040;
  --brand: #8ea2ff; --brand-2: #aebcff; --brand-ink: #0e1330; --brand-soft: #232a4a;
  --good: #5cc59d; --good-soft: #15302a; --warn: #e6b45e; --warn-soft: #33291a; --bad: #f08a7c; --bad-soft: #3a211e;
  --track: #262c3b; --top: #0a0d14; --top-ink: #eceef4;
  --me: #4a63e0; --me-ink: #ffffff; --them: #1f2431; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; }
a { color: var(--brand); }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.015em; }
h2 { font-size: 1.12rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 0 0 4px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.lede { color: var(--muted); margin: 0 0 18px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }
.stack > * + * { margin-top: 12px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--top); color: var(--top-ink);
          padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.topbar-inner { max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--top-ink); text-decoration: none; font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.brand small { font-weight: 600; opacity: .6; font-size: .78rem; }
.topnav { display: flex; gap: 2px; margin-left: auto; }
.topnav a { color: var(--top-ink); opacity: .78; text-decoration: none; padding: 7px 11px; border-radius: 9px; font-size: .92rem; white-space: nowrap; }
.topnav a.active { background: rgba(255,255,255,.14); opacity: 1; font-weight: 700; }
.app-refresh { display: inline-flex; align-items: center; gap: 5px; color: var(--top-ink); text-decoration: none; white-space: nowrap;
               padding: 7px 10px; border-radius: 9px; background: rgba(255,255,255,.1); font-size: .86rem; font-weight: 700; }
.app-refresh:hover { background: rgba(255,255,255,.18); }
@media (max-width: 620px) { .brand small { display: none; } .topnav a { padding: 7px 9px; font-size: .88rem; } }
@media (max-width: 520px) { .app-refresh span { display: none; } }
@media (max-width: 460px) { .brand-name { display: none; } }
.shell { max-width: 900px; margin: 0 auto; padding: 22px 16px 70px; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-weight: 700; font-size: .92rem; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; min-width: 0; }
.card.soft { background: var(--brand-soft); border-color: transparent; box-shadow: none; }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.grid > .card { margin-bottom: 0; }
.label { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.kpi { font-size: 1.7rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: .76rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--track); color: var(--ink); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.notice { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; background: var(--good-soft); border: 1px solid transparent; }
.notice.bad { background: var(--bad-soft); }
.notice.warn { background: var(--warn-soft); }
.notice.info { background: var(--brand-soft); }

/* forms + buttons */
button, .btn { appearance: none; border: 0; border-radius: 14px; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 800;
               padding: 12px 18px; min-height: 48px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:active, .btn:active { transform: scale(.98); }
button.ghost, .btn.ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
button.quiet, .btn.quiet { background: var(--bg); color: var(--ink); border: 1px solid var(--line); font-weight: 700; }
button.small, .btn.small { min-height: 36px; padding: 6px 12px; font-size: .88rem; border-radius: 11px; }
button.link { background: none; color: var(--brand); padding: 0; min-height: 0; font-weight: 700; }
button.danger, .btn.danger { background: var(--bad); color: #fff; }
button.full, .btn.full { width: 100%; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }
label { display: block; font-weight: 700; margin: 14px 0 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; min-height: 46px; }
textarea { min-height: 120px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); margin: 0; flex: none; }
input[type=file] { padding: 9px; }
.hint { font-size: .86rem; color: var(--muted); margin: 6px 0 0; }
.inline { display: inline; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }

/* choice tiles */
.choices { display: grid; gap: 10px; }
.choices.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .choices.cols-2 { grid-template-columns: minmax(0, 1fr); } }
.choice { position: relative; display: block; margin: 0; padding: 13px 15px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); font-weight: 700; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.choice .sub { display: block; font-weight: 500; font-size: .86rem; color: var(--muted); margin-top: 2px; }
.choices.cols-3 .choice { text-align: center; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs .choice { padding: 8px 14px; font-size: .92rem; }

/* score ring */
.ring { --p: 0; --c: var(--brand); width: 112px; height: 112px; border-radius: 50%; flex: none;
        background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--track) 0); display: grid; place-items: center; }
.ring > span { width: 88px; height: 88px; border-radius: 50%; background: var(--card); display: grid; place-items: center; text-align: center; line-height: 1.05; }
.ring strong { font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.ring small { display: block; font-size: .7rem; color: var(--muted); font-weight: 700; }
.ring.good { --c: var(--good); } .ring.warn { --c: var(--warn); } .ring.bad { --c: var(--bad); }
.ring.sm { width: 64px; height: 64px; } .ring.sm > span { width: 50px; height: 50px; } .ring.sm strong { font-size: 1.1rem; }
.hero { display: flex; gap: 20px; align-items: center; }
@media (max-width: 560px) { .hero { flex-direction: column; align-items: flex-start; } }
.bar { height: 8px; border-radius: 6px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.bar.good > i { background: var(--good); } .bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.ticks { margin: 0; padding-left: 20px; }
.ticks li { margin: 4px 0; }
.req { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.req .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .8rem; }
.req .dot.met { background: var(--good-soft); color: var(--good); }
.req .dot.partial { background: var(--warn-soft); color: var(--warn); }
.req .dot.missing { background: var(--bad-soft); color: var(--bad); }
.quote { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; color: var(--muted); font-style: italic; margin: 6px 0; font-size: .92rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--track); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.rewrite .was { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.rewrite .now { font-weight: 600; margin: 6px 0; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; gap: 8px; align-items: baseline; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; color: var(--brand); font-weight: 900; width: 14px; flex: none; }
details[open] > summary::before { content: "–"; }
details > div { padding: 8px 0 0 22px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.app-row { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.app-row:hover .t { color: var(--brand); }
.app-row .t { font-weight: 800; }

/* interview room */
.room { max-width: 720px; margin: 0 auto; }
.chat { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 18px; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.them { background: var(--them); border: 1px solid var(--line); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.me { background: var(--me); color: var(--me-ink); border-bottom-right-radius: 6px; align-self: flex-end; }
.msg .who { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; opacity: .7; margin-bottom: 2px; }
.msg.close { border-color: var(--brand); }
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.composer textarea { min-height: 96px; }
.mic { width: 52px; height: 48px; padding: 0; flex: none; }
.mic.on { background: var(--bad); color: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(179,55,43,.45); } 70% { box-shadow: 0 0 0 12px rgba(179,55,43,0); } 100% { box-shadow: 0 0 0 0 rgba(179,55,43,0); } }
.mic svg, .icon-btn svg { width: 22px; height: 22px; }
.progress-dots { display: flex; gap: 5px; }
.progress-dots span { width: 22px; height: 5px; border-radius: 3px; background: var(--track); }
.progress-dots span.on { background: var(--brand); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.waiting { text-align: center; padding: 40px 10px; }
.waiting .spinner { width: 34px; height: 34px; border-width: 4px; color: var(--brand); margin-bottom: 12px; }

/* feedback */
.crit { display: grid; grid-template-columns: 90px 1fr 26px; gap: 8px; align-items: center; font-size: .88rem; margin: 3px 0; }
.better { background: var(--good-soft); border-radius: 12px; padding: 12px 14px; margin-top: 10px; white-space: pre-wrap; }
.transcript { font-size: .92rem; }
.transcript p { margin: 6px 0; }
.transcript b { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: block; }

/* sign in */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; background: var(--top); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 22px; padding: 28px 24px; }
.error { color: var(--bad); background: var(--bad-soft); border-radius: 12px; padding: 10px 12px; }

@media print {
  .topbar, .composer, form, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Tap-to-open sections made by fold.js: each card becomes a headline that opens when tapped. */
details.fold-panel { padding: 0; border: 1px solid var(--line); scroll-margin-top: calc(70px + env(safe-area-inset-top)); }
details.fold-panel.soft { border-color: transparent; }
details.fold-panel > summary { display: flex; align-items: center; gap: 10px; padding: 16px 18px; min-height: 56px; cursor: pointer; list-style: none; font-weight: inherit;
                               -webkit-tap-highlight-color: transparent; border-radius: var(--radius); }
details.fold-panel > summary::-webkit-details-marker { display: none; }
details.fold-panel > summary::before { content: none; }
details.fold-panel > summary .fold-title { flex: 1; min-width: 0; }
details.fold-panel > summary .fold-title > * { margin: 0 !important; }
details.fold-panel > summary .fold-title .label { margin-bottom: 2px !important; }
details.fold-panel > summary .fold-title h2 { font-size: 1.12rem; overflow-wrap: anywhere; }
details.fold-panel > summary .fold-title h3 { font-size: 1rem; overflow-wrap: anywhere; }
details.fold-panel > summary .fold-title p { color: var(--muted); }
details.fold-panel > summary > .pill { flex: none; }
details.fold-panel[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
details.fold-panel.soft[open] > summary { border-bottom-color: rgba(0, 0, 0, .06); }
details.fold-panel > .section-body { padding: 14px 18px 18px; }
details.fold-panel > .section-body > .row.between:first-child { justify-content: flex-end; margin-bottom: 10px; }
.section-chevron { flex: none; font-size: 1.5rem; line-height: 1; color: var(--brand); transition: transform .15s; }
details.fold-panel[open] > summary .section-chevron { transform: rotate(90deg); }
.grid > details.fold-panel { align-self: start; }
.grid:has(> details.fold-panel) { margin-bottom: 14px; }
@media (max-width: 560px) {
  details.fold-panel > summary { padding: 14px 16px; }
  details.fold-panel > summary .fold-title h2 { font-size: 1.05rem; }
  details.fold-panel > .section-body { padding: 12px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) { .section-chevron { transition: none; } }
@media print { .section-chevron { display: none; } details.fold-panel > summary { padding-bottom: 6px; border-bottom: 0; } }
/* Narrow phones: the top links scroll sideways inside the bar instead of pushing the page wider. */
.topnav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.app-refresh { flex: none; }
@media (max-width: 400px) { .topbar-inner { gap: 8px; } .topnav a { padding: 7px 7px; } }
