/* Scholarar Profile Builder
 *
 * ChatGPT-style shell: quiet sidebar, a single centred reading column, and
 * assistant messages set as plain prose rather than bubbles — only the
 * student's own replies get a bubble, which is what makes a transcript
 * readable at length.
 *
 * Mobile-first. Bottom tab bar on phones, sidebar from 900px.
 * Light and dark are both defined; dark follows the OS setting.
 */

:root {
  /* surfaces */
  --bg:          #ffffff;
  --bg-sub:      #f9f9f9;   /* sidebar */
  --surface:     #ffffff;
  --surface-2:   #f7f7f8;

  /* text */
  --ink:         #0d0d0d;
  --ink-2:       #3f3f46;
  --muted:       #8e8ea0;

  /* lines */
  --line:        #e6e6e8;
  --line-soft:   #f0f0f2;

  /* brand — used sparingly, on actions and accents only */
  --accent:      #0b62f5;
  --accent-ink:  #ffffff;
  --accent-soft: #eef3ff;
  --accent-line: #d6e3ff;

  /* status */
  --good:        #12a150;
  --good-soft:   #e8f7ee;
  --warn:        #b45309;
  --warn-soft:   #fdf5e7;
  --bad:         #dc2626;
  --bad-soft:    #fdeceC;

  --user-bubble: #f4f4f5;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.07);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.10);

  --col:       min(100%, 46rem);   /* the reading column */
  --nav-w:     260px;
  --tabbar-h:  60px;
  --safe-b:    env(safe-area-inset-bottom, 0px);
}

/* Dark palette. Applied by the OS preference, or forced by data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #212121;
    --bg-sub:      #171717;
    --surface:     #2a2a2c;
    --surface-2:   #303032;

    --ink:         #ececec;
    --ink-2:       #c9c9cf;
    --muted:       #9a9aa5;

    --line:        #333336;
    --line-soft:   #2b2b2e;

    --accent:      #4d8dff;
    --accent-ink:  #0b1220;
    --accent-soft: #1c2740;
    --accent-line: #2c3d63;

    --good:        #3fcf8e;
    --good-soft:   #16301f;
    --warn:        #e0a458;
    --warn-soft:   #33260f;
    --bad:         #ff6b6b;
    --bad-soft:    #331a1a;

    --user-bubble: #303030;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }

/* The hidden attribute must beat any display rule we set on these elements. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

input, textarea, select, button { font-family: inherit; color: inherit; }
input:focus, textarea:focus, select:focus { outline: none; }
button { -webkit-tap-highlight-color: transparent; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.scr { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.scr::-webkit-scrollbar { width: 8px; height: 8px; }
.scr::-webkit-scrollbar-thumb { background: transparent; border-radius: 99px; }
.scr:hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 35%, transparent); }
.scr::-webkit-scrollbar-track { background: transparent; }

@keyframes rise  { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes pop   { from { transform: scale(.96); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes blink { 0%,80%,100% { opacity:.2 } 40% { opacity:1 } }

/* ═════════════════ shell ═════════════════ */

.app { display: flex; height: 100dvh; min-height: 100dvh; background: var(--bg); }

.main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  position: relative;
}

/* ═════════════════ sidebar ═════════════════ */

.sidenav {
  display: none;
  width: var(--nav-w); flex: none;
  flex-direction: column;
  background: var(--bg-sub);
  border-right: 1px solid var(--line);
  padding: 12px 10px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 8px 8px 16px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, #0b62f5, #4d8dff);
  color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; letter-spacing: -.3px;
}
.brand-mark.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.brand-name { font-size: 14.5px; font-weight: 650; letter-spacing: -.2px; }
.brand-sub  { font-size: 11.5px; color: var(--muted); margin-top: -1px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  border: none; background: none; cursor: pointer;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  text-align: left; width: 100%;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav-item.is-active { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); font-weight: 600; }
.nav-ico { display: grid; place-items: center; flex: none; color: var(--muted); }
.nav-item.is-active .nav-ico { color: var(--accent); }
.nav-ico svg { width: 18px; height: 18px; }
.nav-label { flex: 1; }
.nav-badge {
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; border-radius: var(--r-pill);
  padding: 1px 7px; min-width: 21px; text-align: center;
}

.sidenav-foot { padding: 10px 4px 4px; border-top: 1px solid var(--line); }
.status { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok  { background: var(--good); }
.dot.bad { background: var(--bad); }
.link-btn {
  background: none; border: none; cursor: pointer;
  padding: 8px 6px 2px; color: var(--muted);
  font-size: 12.5px; font-weight: 500;
}
.link-btn:hover { color: var(--ink); }

/* ═════════════════ top bar ═════════════════ */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
  flex: none; z-index: 5;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
.topbar-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center; cursor: pointer;
  border: none; border-radius: var(--r-sm);
  background: transparent; color: var(--muted);
  transition: background .12s ease, color .12s ease;
}
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }

/* hairline progress, pinned under the bar */
.progress-wrap { position: relative; height: 2px; background: var(--line-soft); flex: none; }
.progress-bar { position: absolute; inset: 0; }
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), #7aa9ff);
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.progress-label {
  position: absolute; right: 14px; top: 6px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  letter-spacing: .2px;
}

/* ═════════════════ views ═════════════════ */

.view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.view.is-active { display: flex; }

.view-body {
  flex: 1; min-height: 0;
  padding: 22px 18px;
  padding-bottom: calc(22px + var(--tabbar-h) + var(--safe-b));
}
.view-inner { width: var(--col); margin: 0 auto; }

/* ═════════════════ chat ═════════════════ */

.chat { flex: 1; min-height: 0; padding: 20px 18px 8px; }
.chat-inner { width: var(--col); margin: 0 auto; }

.msg { display: flex; gap: 12px; margin-bottom: 22px; animation: rise .24s ease both; }

.msg-avatar {
  width: 26px; height: 26px; flex: none; border-radius: 7px;
  background: linear-gradient(140deg, #0b62f5, #4d8dff);
  color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; margin-top: 1px;
  letter-spacing: -.3px;
}

.msg-body {
  font-size: 15.5px; line-height: 1.72; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
  padding-top: 1px;
}

/* the student's own replies — the only bubbles in the transcript */
.msg.me { justify-content: flex-end; margin-bottom: 20px; }
.msg.me .msg-body {
  background: var(--user-bubble);
  border-radius: var(--r-lg);
  padding: 10px 16px;
  max-width: 82%;
  font-size: 15px;
}

.msg.note .msg-body {
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
  border-radius: var(--r-md); padding: 11px 14px; font-size: 14px;
}

.typing { display: inline-flex; gap: 5px; padding: 8px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.25s infinite; }
.typing i:nth-child(2) { animation-delay: .16s }
.typing i:nth-child(3) { animation-delay: .32s }

.help {
  width: var(--col); margin: -14px auto 20px;
  padding-left: 38px;
  font-size: 13px; color: var(--muted); line-height: 1.55;
}

/* ═════════════════ composer ═════════════════ */

.composer {
  flex: none; background: var(--bg);
  padding: 4px 18px 14px;
  padding-bottom: calc(14px + var(--tabbar-h) + var(--safe-b));
}
.composer-inner { width: var(--col); margin: 0 auto; }

/* suggestion / option chips */
.chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
  max-height: 32vh; overflow-y: auto;
}
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--r-md); padding: 9px 14px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  animation: pop .16s ease both; text-align: left; line-height: 1.35;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.chip:active { transform: scale(.98); }
.chip.on {
  border-color: var(--accent); background: var(--accent);
  color: var(--accent-ink);
}
.chip .cnt { display: block; font-size: 11.5px; font-weight: 400; opacity: .65; margin-top: 2px; }
.chip.suggested { border-style: dashed; }
.chip.on .cnt { opacity: .8; }

/* the rounded input shell, ChatGPT-style */
.input-shell {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 7px 7px 7px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-shell:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow-md); }
.input-shell input, .input-shell textarea {
  flex: 1; border: none; background: none; resize: none;
  font-size: 16px; line-height: 1.5; padding: 8px 0;
  min-width: 0; color: var(--ink);
}
.input-shell textarea { min-height: 26px; max-height: 180px; }
.input-shell input::placeholder, .input-shell textarea::placeholder { color: var(--muted); }

.send-btn {
  width: 34px; height: 34px; flex: none; border: none; cursor: pointer;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  transition: opacity .15s ease, transform .12s ease;
}
.send-btn:hover { opacity: .88; }
.send-btn:active { transform: scale(.94); }
.send-btn svg { width: 17px; height: 17px; }

/* structured (composite) fields */
.field-row { display: flex; gap: 10px; align-items: center; margin-bottom: 9px; }
.field-row label { font-size: 13px; font-weight: 500; color: var(--muted); min-width: 118px; flex: none; }
input.txt, select.txt, textarea.txt {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px 14px; font-size: 15px;
  transition: border-color .15s ease;
}
input.txt:focus, select.txt:focus, textarea.txt:focus { border-color: var(--accent); }
textarea.txt { min-height: 84px; resize: vertical; line-height: 1.6; }

/* buttons */
.send-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn {
  flex: 1; min-width: 130px; min-height: 44px;
  border: none; border-radius: var(--r-md); padding: 11px 18px;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .14s ease, transform .12s ease;
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.99); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.sec {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); flex: 0 0 auto; min-width: 0;
}
.btn.sec:hover { background: var(--surface-2); opacity: 1; }
.btn.block { width: 100%; flex: none; }

/* ═════════════════ matches ═════════════════ */

.note {
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 24%, transparent);
  color: var(--warn); border-radius: var(--r-md);
  padding: 12px 15px; font-size: 13.5px; line-height: 1.55; margin-bottom: 18px;
}

.match-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }

.match {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.match:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--shadow-md); }
.match.ineligible { opacity: .72; }
.match.ineligible:hover { opacity: 1; }

.match-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.match-title { font-size: 16px; font-weight: 650; line-height: 1.35; letter-spacing: -.2px; }
.match-prov  { font-size: 13px; color: var(--muted); margin-top: 4px; }

.score {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 13px;
  font-size: 16px; font-weight: 700; letter-spacing: -.4px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-line);
}
.score.low { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 13px 0; }
.tag {
  font-size: 11.5px; font-weight: 500; border-radius: var(--r-sm);
  padding: 4px 9px; background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line-soft);
}
.tag.full { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 22%, transparent); }
.tag.cty  { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

.checks { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.check { display: flex; gap: 9px; font-size: 13px; line-height: 1.55; margin-bottom: 6px; color: var(--ink-2); }
.check .ic { flex: none; font-weight: 700; width: 14px; text-align: center; }
.check.pass .ic { color: var(--good); }
.check.fail .ic { color: var(--bad); }
.check.unknown .ic { color: var(--warn); }
.check.not_applicable .ic { color: var(--muted); }
.check.not_applicable { color: var(--muted); }
.check.fail { color: var(--bad); }

.match-links { display: flex; gap: 9px; margin-top: 14px; }
.match-links a {
  flex: 1; text-align: center; text-decoration: none;
  font-size: 13.5px; font-weight: 600; border-radius: var(--r-md); padding: 10px;
  background: var(--accent); color: var(--accent-ink);
  transition: opacity .14s ease;
}
.match-links a:hover { opacity: .9; }
.match-links a.sec {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
}
.match-links a.sec:hover { background: var(--surface-2); }

.empty {
  text-align: center; color: var(--muted); font-size: 14.5px;
  padding: 56px 18px; line-height: 1.65;
}

/* ═════════════════ CV ═════════════════ */

.cv-layout { display: grid; gap: 20px; grid-template-columns: 1fr; }
.side-h {
  margin: 0 0 12px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase; color: var(--muted);
}

.tpl-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.tpl {
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 0; overflow: hidden; cursor: pointer; background: var(--surface);
  font: inherit; text-align: left;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.tpl:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tpl.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tpl-swatch { height: 38px; }
.tpl-name {
  font-size: 13px; font-weight: 550; padding: 8px 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 4px;
}
.tpl-check { color: var(--accent); font-weight: 700; }

.hint { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; line-height: 1.55; }

.cv-prompt {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  justify-content: space-between;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 18px;
}
.cv-prompt-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; min-width: 220px; flex: 1; }
.cv-prompt-text strong { display: block; font-size: 14.5px; color: var(--ink); margin-bottom: 3px; font-weight: 650; }
.cv-prompt .btn { flex: 0 0 auto; min-height: 40px; min-width: 0; font-size: 13.5px; }

.cv-paper {
  background: #fff; color: #0d0d0d;
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-md);
}
.cv-head { padding: 26px 26px; }
.cv-head h3 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.5px; }
.cv-headline { font-size: 13.5px; opacity: .93; margin-top: 5px; font-weight: 500; }
.cv-contact { font-size: 12px; opacity: .82; margin-top: 8px; }
.cv-body { padding: 22px 26px 28px; }

.cv-sec { margin-bottom: 20px; }
.cv-sec:last-child { margin-bottom: 0; }
.cv-sec h4 {
  margin: 0 0 10px; font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; padding-bottom: 6px; border-bottom: 1px solid #e6e6e8;
}
.cv-entry { margin-bottom: 12px; }
.cv-t { font-size: 14.5px; font-weight: 650; }
.cv-s { font-size: 13.5px; color: #4a4a52; margin-top: 2px; }
.cv-m { font-size: 12px; color: #8e8ea0; margin-top: 3px; }
.cv-d { font-size: 13.5px; color: #55555e; margin-top: 5px; line-height: 1.6; }
.cv-b { font-size: 13.5px; color: #3f3f46; line-height: 1.65; margin-bottom: 5px; }

/* ═════════════════ bottom tab bar (phones) ═════════════════ */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar-item {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px; font-weight: 500;
  transition: color .12s ease;
}
.tabbar-item svg { width: 21px; height: 21px; }
.tabbar-item.is-active { color: var(--accent); font-weight: 600; }

/* ═════════════════ ≥900px: sidebar replaces the tab bar ═════════════════ */

@media (min-width: 900px) {
  .sidenav { display: flex; }
  .tabbar { display: none; }

  .view-body { padding: 28px 24px; }
  .composer { padding: 4px 24px 22px; }
  .chat { padding: 26px 24px 8px; }
  .topbar { padding: 12px 22px; }
  .progress-label { right: 22px; }
  .topbar-left .brand-mark.sm { display: none; }

  .match-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .view-body .view-inner { width: 100%; max-width: 1080px; }
}

/* ═════════════════ ≥1100px: split CV workspace ═════════════════ */

@media (min-width: 1100px) {
  .cv-layout { grid-template-columns: 268px minmax(0, 1fr); align-items: start; max-width: 1040px; }
  .cv-side { position: sticky; top: 0; }
  .tpl-row { grid-template-columns: 1fr; gap: 8px; }
  .tpl { display: flex; align-items: center; gap: 12px; }
  .tpl-swatch { width: 54px; height: 42px; flex: none; }
  .tpl-name { flex: 1; padding: 0 12px 0 0; }
}

/* ═════════════════ short viewports ═════════════════ */

@media (max-height: 640px) {
  .chips { max-height: 24vh; }
  .msg { margin-bottom: 16px; }
}

/* ═════════════════ explicit theme choice ═════════════════ */

:root[data-theme="dark"] {
  --bg: #212121;          --bg-sub: #171717;
  --surface: #2a2a2c;     --surface-2: #303032;
  --ink: #ececec;         --ink-2: #c9c9cf;    --muted: #9a9aa5;
  --line: #333336;        --line-soft: #2b2b2e;
  --accent: #4d8dff;      --accent-ink: #0b1220;
  --accent-soft: #1c2740; --accent-line: #2c3d63;
  --good: #3fcf8e;        --good-soft: #16301f;
  --warn: #e0a458;        --warn-soft: #33260f;
  --bad:  #ff6b6b;        --bad-soft:  #331a1a;
  --user-bubble: #303030;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
}

.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg { width: 15px; height: 15px; }

/* one glyph at a time: moon in light mode, sun in dark */
.ico-moon { display: block; }
.ico-sun  { display: none; }
:root[data-theme="dark"] .ico-moon { display: none; }
:root[data-theme="dark"] .ico-sun  { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico-moon { display: none; }
  :root:not([data-theme="light"]) .ico-sun  { display: block; }
}
:root[data-theme="light"] .ico-moon { display: block; }
:root[data-theme="light"] .ico-sun  { display: none; }

/* Consecutive assistant turns share one avatar — repeating it three times for
   a single spoken paragraph reads as three separate speakers. */
.msg.ai.grouped { margin-top: -14px; }
.msg.ai.grouped .msg-avatar { visibility: hidden; }

/* ═════════════════ CV: summary + enhancement notices ═════════════════ */

.cv-summary {
  font-size: 13.5px; line-height: 1.65; color: #3f3f46;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid #e6e6e8;
}
.cv-entry.needs-detail { border-left: 2px solid var(--warn); padding-left: 12px; }
.cv-flag {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 5px; font-size: 11.5px; font-weight: 500;
  color: var(--warn);
}
.cv-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--good-soft); color: var(--good);
  border: 1px solid color-mix(in srgb, var(--good) 25%, transparent);
  border-radius: var(--r-pill); padding: 4px 11px;
  font-size: 11.5px; font-weight: 600; margin-bottom: 12px;
}
.btn.is-busy { opacity: .6; pointer-events: none; }

/* ── consultant mode: prose answers and what SARA filed from them ── */
.alt-wrap { margin-top: 10px; }
.alt-link {
  background: none; border: none; padding: 4px 2px; cursor: pointer;
  color: var(--muted); font-size: 13px;
}
.alt-link:hover { color: var(--accent); }
.noted {
  margin: -10px 0 18px 42px; padding: 6px 10px;
  font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--r-sm); width: fit-content; max-width: 100%;
}
