/* ============================================================
   TalentLens AI — Hiring OS Workspace
   Self-contained tokens + app shell. Palette from TT Love logo.
   Themes: aurora (light teal) · dark (deep sea) · pearl (pearl white)
   ============================================================ */

:root {
  --cyan: #5FC4CC; --cyan-soft: #8FD6DA; --teal: #1F7E91; --teal-deep: #12586A;
  --gold: #C9A24B; --gold-light: #E8CE73;
  --gold-grad: linear-gradient(135deg,#B8862F,#E8CE73 38%,#C9A24B 70%,#F2DE96);
  --brand-grad: linear-gradient(120deg,var(--cyan),var(--teal));
  --glow: 1;
  --ease: cubic-bezier(.22,.61,.30,1);

  --r-sm: 10px; --r-md: 16px; --r-lg: 24px;
  --font-ui: "Manrope","Noto Sans TC",system-ui,sans-serif;
  --font-display: "Sora","Noto Sans TC",system-ui,sans-serif;
  --font-mono: "Space Mono","SFMono-Regular",ui-monospace,monospace;

  /* status */
  --ok: #1f9d6b; --warn: #d9a521; --bad: #e0594f; --info: #3d8fd6;
  --pass: #1f9d6b; --fail: #e0594f; --unknown: #9aa6a8;
}

/* ---------- AURORA (default light) ---------- */
:root, [data-theme="aurora"] {
  --bg-grad: radial-gradient(1100px 720px at 8% -10%,#DCF1EB 0%,transparent 55%),
             radial-gradient(900px 640px at 104% 4%,#E6F2E8 0%,transparent 52%),
             linear-gradient(160deg,#E8F6F1,#E0F0EB 50%,#DAEEE8);
  --ink:#143A42; --ink-2:#3C5C63; --ink-3:#6E8A8F;
  --panel: rgba(255,255,255,.66); --panel-2: rgba(255,255,255,.82); --panel-solid:#F4FAF8;
  --rail: rgba(255,255,255,.55);
  --stroke: rgba(31,126,145,.15); --stroke-2: rgba(31,126,145,.27);
  --hover: rgba(31,126,145,.07); --active: rgba(31,126,145,.12);
  --shadow: 0 24px 60px -26px rgba(18,88,106,.30);
  --shadow-sm: 0 10px 26px -16px rgba(18,88,106,.28);
  --blur: 18px; --on-brand:#fff;
  --orb-a: rgba(95,196,204,.5); --orb-b: rgba(201,162,75,.3); --orb-c: rgba(143,214,218,.46);
  --track: rgba(31,126,145,.12);
  --bg-veil: linear-gradient(160deg, rgba(233,245,241,.70), rgba(224,240,235,.80));
}
/* ---------- DARK (deep sea) ---------- */
[data-theme="dark"] {
  --bg-grad: radial-gradient(1100px 760px at 8% -12%,#0F4351 0%,transparent 55%),
             radial-gradient(900px 680px at 108% 2%,#123E3C 0%,transparent 52%),
             linear-gradient(160deg,#072329,#08262E 50%,#061E25);
  --ink:#EAF7F4; --ink-2:#A9CBCD; --ink-3:#6F9498;
  --panel: rgba(17,60,72,.46); --panel-2: rgba(20,72,84,.62); --panel-solid:#0C2E37;
  --rail: rgba(12,42,50,.55);
  --stroke: rgba(143,214,218,.16); --stroke-2: rgba(143,214,218,.28);
  --hover: rgba(143,214,218,.08); --active: rgba(95,196,204,.16);
  --shadow: 0 30px 70px -30px rgba(0,0,0,.6);
  --shadow-sm: 0 14px 34px -20px rgba(0,0,0,.5);
  --blur: 22px; --on-brand:#072329;
  --orb-a: rgba(95,196,204,.36); --orb-b: rgba(201,162,75,.26); --orb-c: rgba(31,126,145,.46);
  --track: rgba(143,214,218,.14);
  --bg-veil: linear-gradient(160deg, rgba(7,36,43,.80), rgba(6,31,38,.88));
}
/* ---------- PEARL WHITE ---------- */
[data-theme="pearl"] {
  --bg-grad: radial-gradient(1000px 700px at 12% -8%,#F2F6F7 0%,transparent 55%),
             radial-gradient(820px 600px at 106% 6%,#F3F1EC 0%,transparent 52%),
             linear-gradient(160deg,#FBFCFC,#F4F7F7 55%,#EEF2F2);
  --ink:#23323A; --ink-2:#4E626B; --ink-3:#8A9AA0;
  --panel: rgba(255,255,255,.78); --panel-2: rgba(255,255,255,.92); --panel-solid:#FFFFFF;
  --rail: rgba(255,255,255,.74);
  --stroke: rgba(35,50,58,.10); --stroke-2: rgba(35,50,58,.18);
  --hover: rgba(31,126,145,.06); --active: rgba(31,126,145,.10);
  --shadow: 0 22px 54px -28px rgba(60,80,90,.30);
  --shadow-sm: 0 10px 26px -18px rgba(60,80,90,.25);
  --blur: 16px; --on-brand:#fff;
  --orb-a: rgba(95,196,204,.28); --orb-b: rgba(201,162,75,.20); --orb-c: rgba(143,214,218,.26);
  --track: rgba(35,50,58,.10);
  --bg-veil: linear-gradient(160deg, rgba(251,252,252,.78), rgba(238,242,242,.86));
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--panel-solid); color: var(--ink);
  font-family: var(--font-ui); -webkit-font-smoothing: antialiased; }
#root { min-height: 100vh; }

/* ambient bg */
.app-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--bg-grad); transition: background .5s var(--ease); }
.app-bg .orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: calc(.85*var(--glow)); }
.orb.a { width:520px;height:520px;background:var(--orb-a);top:-140px;left:-60px; animation: of1 24s var(--ease) infinite; }
.orb.b { width:460px;height:460px;background:var(--orb-b);bottom:-160px;right:-40px; animation: of2 28s var(--ease) infinite; }
.orb.c { width:380px;height:380px;background:var(--orb-c);top:46%;left:60%; animation: of3 32s var(--ease) infinite; }
@keyframes of1 {0%,100%{transform:translate(0,0)}50%{transform:translate(50px,40px) scale(1.1)}}
@keyframes of2 {0%,100%{transform:translate(0,0)}50%{transform:translate(-50px,-30px) scale(1.08)}}
@keyframes of3 {0%,100%{transform:translate(0,0)}50%{transform:translate(-40px,50px) scale(1.12)}}
[data-anim="off"] .orb { animation: none !important; }

/* optional photographic ambient background (softened by veil so glass floats over it) */
.app-bgimg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.app-bgveil { position: absolute; inset: 0; background: var(--bg-veil); -webkit-backdrop-filter: saturate(1.05); backdrop-filter: saturate(1.05); }

/* ---------- APP SHELL ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sb,264px) 1fr; height: 100vh; transition: grid-template-columns .28s var(--ease); }
.shell.collapsed { --sb: 76px; }

/* sidebar */
.sidebar { display: flex; flex-direction: column; background: var(--rail);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3); backdrop-filter: blur(var(--blur)) saturate(1.3);
  border-right: 1px solid var(--stroke); overflow: hidden; }
.sb-head { display: flex; align-items: center; gap: 11px; padding: 16px 16px 12px; }
.sb-logo { width: 40px; height: 40px; border-radius: 11px; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 6px 16px -6px rgba(31,126,145,.5), 0 0 0 1px rgba(255,255,255,.4) inset; }
/* Full TT Love brand logo (square asset) shown complete. */
.sb-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-name { font-family: var(--font-display); font-weight: 800; font-size: 16.5px; letter-spacing: -.01em; white-space: nowrap; }
.sb-name small { display: block; font-family: var(--font-ui); font-weight: 600; font-size: 10.5px; color: var(--ink-3); letter-spacing: .02em; margin-top: 1px; }
.collapsed .sb-name, .collapsed .sb-section-label, .collapsed .nav-item span, .collapsed .sb-foot-txt { display: none; }
.collapsed .sb-head { justify-content: center; padding: 16px 0 12px; }
.collapsed .nav-item { justify-content: center; padding: 10px 0; }

.sb-scroll { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.sb-scroll::-webkit-scrollbar { width: 7px; } .sb-scroll::-webkit-scrollbar-thumb { background: var(--stroke-2); border-radius: 99px; }
.sb-section-label { font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border-radius: 11px;
  border: none; background: none; cursor: pointer; color: var(--ink-2); font-family: var(--font-ui); font-weight: 600; font-size: 13.7px;
  text-align: left; transition: background .16s var(--ease), color .16s var(--ease); position: relative; }
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.active { background: var(--active); color: var(--teal); font-weight: 700; }
.nav-item.active::before { content:""; position:absolute; left:-12px; top:50%; transform:translateY(-50%); width:3px; height:18px; border-radius:99px; background: var(--brand-grad); box-shadow: 0 0 calc(10px*var(--glow)) rgba(95,196,204,.8); }
.nav-item .nav-ic { flex-shrink: 0; }
.nav-badge { margin-left: auto; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--brand-grad); color: #fff; }
.collapsed .nav-badge { display: none; }

.sb-foot { padding: 12px; border-top: 1px solid var(--stroke); display: flex; align-items: center; gap: 10px; }
.collapse-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--stroke); background: var(--panel); color: var(--ink-2); cursor: pointer; flex-shrink: 0; }
.collapse-btn:hover { color: var(--teal); border-color: var(--teal); }

/* main */
.main { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 13px clamp(16px,2.4vw,30px); border-bottom: 1px solid var(--stroke);
  background: var(--panel); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); flex-shrink: 0; }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 9px 15px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--stroke); color: var(--ink-3); }
.search input { flex: 1; border: none; background: none; outline: none; color: var(--ink); font-family: var(--font-ui); font-size: 14px; }
.search kbd { font-family: var(--font-ui); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--track); color: var(--ink-3); border: 1px solid var(--stroke); }
.search-portal { max-height: min(420px, calc(100vh - 80px)); overflow-y: auto; padding: 8px; border-radius: 14px; box-shadow: var(--shadow); }
.search-empty { padding: 12px 13px; color: var(--ink-3); font-size: 13px; font-weight: 700; }
.search-group + .search-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--stroke); }
.search-group-title { padding: 5px 7px 6px; color: var(--ink-3); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.search-result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; text-align: left; font-family: var(--font-ui); }
.search-result:hover, .search-result:focus-visible { background: var(--hover); outline: none; }
.search-result-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-result-copy b, .search-result-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-copy b { font-size: 13px; }
.search-result-copy small { color: var(--ink-3); font-size: 11.5px; font-weight: 650; }
.tb-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--stroke);
  background: var(--panel-2); color: var(--ink-2); cursor: pointer; font-family: var(--font-ui); font-weight: 700; font-size: 13px; }
.tb-btn:hover { color: var(--teal); border-color: var(--teal); }
.tb-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--stroke); background: var(--panel-2); color: var(--ink-2); cursor: pointer; }
.tb-icon:hover { color: var(--teal); border-color: var(--teal); }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--stroke); }
.seg button { padding: 6px 11px; border-radius: 8px; border: none; background: none; cursor: pointer; font-family: var(--font-ui); font-weight: 700; font-size: 12.5px; color: var(--ink-3); }
.seg button.on { background: var(--brand-grad); color: #fff; }

.content { flex: 1; overflow-y: auto; padding: clamp(18px,2.6vw,34px); }
.content::-webkit-scrollbar { width: 10px; } .content::-webkit-scrollbar-thumb { background: var(--stroke-2); border-radius: 99px; }
.page { max-width: 1240px; margin: 0 auto; animation: fade .4s var(--ease) both; }
[data-anim="off"] .page { animation: none; }

/* dashboard welcome hero banner (uses a brand background image) */
.dash-hero { position: relative; border-radius: var(--r-lg); overflow: hidden; padding: clamp(22px,3vw,38px) clamp(22px,3.4vw,44px);
  border: 1px solid var(--stroke); box-shadow: var(--shadow-sm); margin-bottom: 18px; min-height: 150px; display: flex; flex-direction: column; justify-content: center; }
.dash-hero .hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 38%; }
.dash-hero .hero-scrim { position: absolute; inset: 0; background: linear-gradient(100deg, var(--panel-solid) 4%, color-mix(in srgb, var(--panel-solid) 62%, transparent) 44%, transparent 78%); }
[data-theme="dark"] .dash-hero .hero-scrim { background: linear-gradient(100deg, #06222A 4%, rgba(6,34,42,.7) 46%, rgba(6,34,42,.15) 82%); }
.dash-hero > * { position: relative; }

/* ---------- GLASS / CARD ---------- */
.glass { background: var(--panel); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3); backdrop-filter: blur(var(--blur)) saturate(1.3);
  border: 1px solid var(--stroke); border-radius: var(--r-md); box-shadow: var(--shadow-sm); position: relative; }
.glass-2 { background: var(--panel-2); }
.card-hover { transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .24s var(--ease); }
.card-hover:hover { transform: translateY(-3px); border-color: var(--stroke-2); box-shadow: var(--shadow), 0 0 calc(30px*var(--glow)) -12px rgba(95,196,204,.45); }
.glow-cyan { box-shadow: var(--shadow-sm), 0 0 calc(40px*var(--glow)) -8px rgba(95,196,204,calc(.5*var(--glow))); }
.glow-teal { box-shadow: var(--shadow-sm), 0 0 calc(40px*var(--glow)) -8px rgba(31,126,145,calc(.5*var(--glow))); }
.glow-gold { box-shadow: var(--shadow-sm), 0 0 calc(40px*var(--glow)) -8px rgba(201,162,75,calc(.45*var(--glow))); }

/* text accents */
.text-brand { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.text-gold { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---------- buttons ---------- */
.btn { font-family: var(--font-ui); font-weight: 700; font-size: 13.5px; border: 1px solid transparent; border-radius: 11px; padding: 10px 18px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: transform .16s var(--ease), box-shadow .2s var(--ease), background .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(31,126,145,calc(.6*var(--glow))), 0 0 calc(24px*var(--glow)) -8px rgba(95,196,204,.6); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold-grad); color: #3a2c08; }
.btn-gold:hover { transform: translateY(-2px); }
.btn-ghost { background: var(--panel-2); color: var(--ink); border: 1px solid var(--stroke-2); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 9px; }

/* ---------- chips / tags ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--stroke); color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 7px; background: var(--track); color: var(--ink-2); }
.tag.req { background: rgba(31,126,145,.12); color: var(--teal); }
.tag.pref { background: rgba(201,162,75,.16); color: #9a7414; }
.tag.gold { background: rgba(201,162,75,.16); color: #9a7414; }

.auth-shell, .auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-grad); }
.auth-shell { gap: 12px; align-content: center; color: var(--ink-2); }
.auth-card { width: min(390px, 100%); display: grid; gap: 16px; padding: 28px; border: 1px solid var(--stroke); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.auth-card h1 { margin: 0; font-size: 28px; line-height: 1.05; letter-spacing: 0; }
.auth-card p { margin: 6px 0 0; color: var(--ink-3); line-height: 1.45; }
.auth-logo { width: 54px; height: 54px; border-radius: 14px; overflow: hidden; border: 1px solid var(--stroke); }
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-card label { display: grid; gap: 7px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.auth-card input, .auth-create-grid input, .auth-create-grid select {
  width: 100%; min-width: 0; border: 1px solid var(--stroke-2); border-radius: 9px; background: var(--panel-2); color: var(--ink);
  padding: 9px 10px; font: 600 13px var(--font-ui); outline: none;
}
.auth-card input:focus, .auth-create-grid input:focus, .auth-create-grid select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(95,196,204,.18); }
.auth-error { border: 1px solid rgba(185,67,67,.28); border-radius: 9px; background: rgba(185,67,67,.1); color: var(--bad); padding: 9px 10px; font-size: 12.5px; font-weight: 700; }
.auth-foot { color: var(--ink-3); font-size: 11.5px; text-align: center; }
.auth-user-menu { width: min(440px, calc(100vw - 24px)); max-height: min(78vh, 680px); overflow: auto; padding: 10px; border-radius: 14px; box-shadow: var(--shadow); }
.auth-user-head { display: flex; align-items: center; gap: 10px; padding: 5px 5px 10px; border-bottom: 1px solid var(--stroke); margin-bottom: 8px; }
.auth-user-head b { display: block; color: var(--ink); font-size: 13.5px; }
.auth-user-head small, .auth-user-row small { display: block; color: var(--ink-3); font-size: 11px; margin-top: 2px; line-height: 1.35; }
.auth-menu-note { border-radius: 9px; background: var(--track); color: var(--ink-2); padding: 8px 9px; font-size: 12px; font-weight: 700; line-height: 1.4; margin: 8px 0; }
.auth-menu-title { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 8px 2px 6px; }
.auth-manage { display: grid; gap: 8px; margin-top: 8px; }
.auth-create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.auth-create-grid button { grid-column: 1 / -1; justify-content: center; }
.auth-user-list { display: grid; gap: 7px; }
.auth-user-row { display: grid; gap: 8px; padding: 9px; border: 1px solid var(--stroke); border-radius: 10px; background: rgba(255,255,255,.03); }
.auth-user-row b { color: var(--ink); font-size: 13px; }
.auth-user-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.auth-user-actions .btn { flex: 1 1 120px; justify-content: center; }
.pill-pass { color: var(--pass); background: rgba(31,157,107,.12); }
.pill-fail { color: var(--fail); background: rgba(224,89,79,.13); }
.pill-unknown { color: var(--unknown); background: rgba(154,166,168,.16); }
.status-dot { width: 8px; height: 8px; border-radius: 99px; flex-shrink: 0; }
.jd-status-cell .tag { white-space: nowrap; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(22px,2.6vw,30px); letter-spacing: -.02em; }
.page-sub { margin: 5px 0 0; color: var(--ink-2); font-size: 14.5px; }
.dashboard-list { overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.dashboard-list-activity { max-height: 430px; }
.dashboard-list-sessions { max-height: 470px; }
.dashboard-list::-webkit-scrollbar { width: 7px; }
.dashboard-list::-webkit-scrollbar-thumb { background: var(--stroke-2); border-radius: 99px; }
.dash-empty {
  display: grid;
  place-items: center;
  min-height: 96px;
  border: 1px dashed var(--stroke-2);
  border-radius: 12px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 700;
}
.kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); margin-bottom: 8px; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 800; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 11px 14px; border-bottom: 1px solid var(--stroke); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--stroke); color: var(--ink); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .15s; cursor: pointer; }
.tbl tbody tr:hover { background: var(--hover); }

/* ---------- meters / bars ---------- */
.meter-track { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; background: var(--brand-grad); transition: width 1s var(--ease); }

.legacy-upload-progress {
  margin: -8px 0 14px;
  padding: 14px;
  border: 1px solid var(--stroke-2);
  border-radius: 14px;
  background:
    radial-gradient(420px 160px at 12% 0%, rgba(95,196,204,.22), transparent 62%),
    var(--panel-2);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.25);
  backdrop-filter: blur(var(--blur)) saturate(1.25);
  box-shadow: var(--shadow-sm);
  animation: rise .32s var(--ease) both;
}

.legacy-upload-progress.done {
  border-color: rgba(31,157,107,.34);
}

.legacy-upload-progress.error {
  border-color: rgba(224,89,79,.36);
}

.legacy-upload-progress-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.legacy-upload-progress-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--teal);
  background: rgba(31,126,145,.12);
  border: 1px solid rgba(31,126,145,.18);
}

.legacy-upload-progress.active .legacy-upload-progress-icon svg {
  animation: spin 1.1s linear infinite;
}

.legacy-upload-progress.done .legacy-upload-progress-icon {
  color: var(--ok);
  background: rgba(31,157,107,.12);
  border-color: rgba(31,157,107,.24);
}

.legacy-upload-progress.error .legacy-upload-progress-icon {
  color: var(--bad);
  background: rgba(224,89,79,.12);
  border-color: rgba(224,89,79,.24);
}

.legacy-upload-progress-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.legacy-upload-progress-copy strong {
  font-size: 13.5px;
  color: var(--ink);
}

.legacy-upload-progress-copy span {
  font-size: 12.5px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.legacy-upload-progress-head b {
  font-family: var(--font-mono);
  color: var(--teal);
  font-size: 13px;
}

.legacy-upload-progress-track {
  position: relative;
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--track);
}

.legacy-upload-progress-fill {
  position: relative;
  height: 100%;
  min-width: 10px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--teal) 58%, var(--gold));
  box-shadow: 0 0 calc(18px * var(--glow)) rgba(95,196,204,.45);
  transition: width .46s var(--ease);
  overflow: hidden;
}

.legacy-upload-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.58), transparent);
  transform: translateX(-100%);
  animation: uploadShimmer 1.05s linear infinite;
}

.legacy-upload-progress.error .legacy-upload-progress-fill {
  background: linear-gradient(90deg, var(--bad), #f08a82);
}

.legacy-upload-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.legacy-upload-progress-steps span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.legacy-upload-progress-steps span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  vertical-align: 0;
  border-radius: 99px;
  background: var(--track);
  border: 1px solid var(--stroke-2);
}

.legacy-upload-progress-steps span.on {
  color: var(--teal);
}

.legacy-upload-progress-steps span.on::before {
  background: var(--brand-grad);
  box-shadow: 0 0 calc(10px * var(--glow)) rgba(95,196,204,.6);
  animation: progressDotPulse 1.15s ease-in-out infinite;
}

@keyframes uploadShimmer {
  to { transform: translateX(100%); }
}

@keyframes progressDotPulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.28); opacity: .72; }
}

[data-anim="off"] .legacy-upload-progress,
[data-anim="off"] .legacy-upload-progress-icon svg,
[data-anim="off"] .legacy-upload-progress-fill::after,
[data-anim="off"] .legacy-upload-progress-steps span.on::before {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .legacy-upload-progress,
  .legacy-upload-progress-icon svg,
  .legacy-upload-progress-fill::after,
  .legacy-upload-progress-steps span.on::before {
    animation: none !important;
  }

  .legacy-upload-progress-fill {
    transition: none !important;
  }
}

@media (max-width: 640px) {
  .legacy-upload-progress-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .legacy-upload-progress-head b {
    grid-column: 2;
    justify-self: start;
  }

  .legacy-upload-progress-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* avatar */
.avatar { display: grid; place-items: center; border-radius: 11px; color: #fff; font-weight: 800; font-family: var(--font-display); flex-shrink: 0; }

/* drawer / modal */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(8,30,36,.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .25s var(--ease) both; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; width: min(720px, 94vw); background: var(--panel-solid);
  border-left: 1px solid var(--stroke); box-shadow: -30px 0 80px -30px rgba(0,0,0,.4); animation: slideIn .32s var(--ease) both; display: flex; flex-direction: column; }
@keyframes slideIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--stroke); flex-shrink: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.x-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--stroke); background: var(--panel-2); color: var(--ink-2); cursor: pointer; }
.x-btn:hover { color: var(--bad); border-color: var(--bad); }

/* JD markdown studio: source + live preview + download */
.jd-md-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jd-md-studio { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
@media (max-width: 760px) { .jd-md-studio { grid-template-columns: 1fr; } }
.jd-md-pane { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jd-md-pane-label { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.jd-md-src { width: 100%; min-height: 340px; resize: vertical; box-sizing: border-box; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--stroke); border-radius: 12px; padding: 14px; }
.jd-md-src:focus { outline: none; border-color: var(--teal); }
.jd-md-preview { min-height: 340px; max-height: 560px; overflow: auto; background: var(--panel-2); border: 1px solid var(--stroke); border-radius: 12px; padding: 16px 18px; color: var(--ink); }
.jd-md-preview h1 { font-size: 21px; font-weight: 800; margin: 0 0 8px; font-family: var(--font-display); }
.jd-md-preview h2 { font-size: 15px; font-weight: 800; margin: 18px 0 7px; color: var(--ink); border-bottom: 1px solid var(--stroke); padding-bottom: 4px; }
.jd-md-preview h3 { font-size: 13.5px; font-weight: 700; margin: 14px 0 6px; }
.jd-md-preview p { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); margin: 7px 0; }
.jd-md-preview ul { margin: 6px 0; padding-left: 20px; }
.jd-md-preview li { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); margin: 3px 0; }
.jd-md-preview code { background: rgba(127,127,127,.16); border-radius: 5px; padding: 1px 5px; font-family: var(--font-mono); font-size: 12px; }
.jd-md-preview a { color: var(--teal); }

/* Live interview recording workspace */
.live-workspace {
  max-width: 1380px;
}

.live-recording-toolbar {
  margin-bottom: 14px;
}

.live-recording-toolbar > * {
  min-width: 0;
}

.live-toolbar-spacer {
  flex: 1;
  min-width: 16px;
}

.live-recording-grid {
  align-items: start;
}

.live-context-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  margin-bottom: 14px;
}

.live-meta-pill {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--panel-2);
}

.live-meta-pill span {
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.live-meta-pill b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-stage {
  margin-bottom: 14px;
}

.live-status-pill.is-recording {
  color: var(--bad) !important;
}

.live-rec-dot {
  background: var(--bad);
  box-shadow: 0 0 calc(12px * var(--glow)) color-mix(in srgb, var(--bad) 72%, transparent);
  animation: pulse 1.2s infinite;
}

.live-timer {
  min-width: 76px;
  justify-content: center;
  font-family: var(--font-mono);
}

.live-transcript-disabled {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--panel-2) 82%, transparent);
}

.live-transcript-disabled b {
  color: var(--ink);
  font-size: 13px;
}

.live-transcript-disabled span {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.5;
}

.live-panel {
  padding: 18px;
}

.live-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.live-panel-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
}

.live-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px dashed var(--stroke-2);
  border-radius: 12px;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.55;
}

.live-empty.subtle {
  border-style: solid;
  background: var(--panel-2);
}

.live-inline-error,
.live-inline-ok {
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.55;
}

.live-inline-error {
  color: var(--bad);
}

.live-inline-ok {
  color: var(--teal);
}

.live-prep-list,
.live-note-list {
  display: grid;
  gap: 9px;
}

.live-prep-item {
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--panel-2);
}

.live-prep-item.is-asked {
  opacity: .58;
}

.live-prep-item p {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.live-prep-item small {
  display: block;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.45;
}

.live-note-panel {
  margin-top: 14px;
}

.live-note-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
}

.live-note-item span,
.live-note-item b {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.live-note-item p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.live-note-compose {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.live-note-compose input {
  min-width: 0;
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
}

.live-spinner {
  width: 12px;
  height: 12px;
  display: inline-block;
  border: 2px solid var(--track);
  border-top-color: var(--teal);
  border-radius: 99px;
  animation: spin .8s linear infinite;
}

[data-anim="off"] .live-rec-dot,
[data-anim="off"] .live-spinner {
  animation: none !important;
}

@media (max-width: 1080px) {
  .live-recording-grid {
    grid-template-columns: 1fr !important;
  }

  .live-transcript-disabled,
  .live-note-compose {
    align-items: stretch;
    flex-direction: column;
  }
}

/* JD builder inline (in-place) editing */
.jdb-editable { border-radius: 6px; outline: none; cursor: text; transition: background .15s var(--ease), box-shadow .15s var(--ease); }
.jdb-editable:hover { background: rgba(255,255,255,.05); }
.jdb-editable:focus { background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px var(--teal); }
.jdb-editable:empty::before { content: attr(data-ph); color: var(--ink-3); }

/* theme dropdown */
.theme-menu { transform-origin: top right; animation: menuIn .18s var(--ease) both; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
[data-anim="off"] .theme-menu { animation: none; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--stroke); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 10px 15px; border: none; background: none; cursor: pointer; font-family: var(--font-ui); font-weight: 700; font-size: 13.5px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--teal); border-bottom-color: var(--teal); }

/* grids */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2,1fr); } .g3 { grid-template-columns: repeat(3,1fr); } .g4 { grid-template-columns: repeat(4,1fr); }
.row { display: flex; align-items: center; gap: 12px; } .col { display: flex; flex-direction: column; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wrap { flex-wrap: wrap; }

/* animations */
@keyframes fade { from{opacity:0} to{opacity:1} }
@keyframes rise { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:none} }
@keyframes pop { from{opacity:0;transform:scale(.95)} to{opacity:1;transform:none} }
@keyframes equalize { 0%,100%{transform:scaleY(.35)} 50%{transform:scaleY(1)} }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes drawbar { from { height: 0 } }
[data-anim="on"] .rise { animation: rise .55s var(--ease) both; }
[data-anim="on"] .pop { animation: pop .45s var(--ease) both; }
[data-anim="on"] .stagger > * { animation: rise .55s var(--ease) both; }
[data-anim="on"] .stagger > *:nth-child(1){animation-delay:.03s} [data-anim="on"] .stagger > *:nth-child(2){animation-delay:.07s}
[data-anim="on"] .stagger > *:nth-child(3){animation-delay:.11s} [data-anim="on"] .stagger > *:nth-child(4){animation-delay:.15s}
[data-anim="on"] .stagger > *:nth-child(5){animation-delay:.19s} [data-anim="on"] .stagger > *:nth-child(6){animation-delay:.23s}
[data-anim="on"] .stagger > *:nth-child(7){animation-delay:.27s} [data-anim="on"] .stagger > *:nth-child(8){animation-delay:.31s}
[data-anim="off"] .rise, [data-anim="off"] .pop, [data-anim="off"] .stagger > * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .orb { animation: none !important; } }

/* mobile */
.sb-overlay { display: none; }
@media (max-width: 1080px) { .g4 { grid-template-columns: repeat(2,1fr); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 90; top: 0; bottom: 0; left: 0; width: 264px; transform: translateX(-100%); transition: transform .28s var(--ease); }
  .shell.mobile-open .sidebar { transform: none; }
  .sb-overlay { display: block; position: fixed; inset: 0; z-index: 89; background: rgba(8,30,36,.4); }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
}
.menu-btn { display: none; }
@media (max-width: 860px) { .menu-btn { display: grid; } }

/* ---------- TASK-009: live recording view (design: Docs/UI_live_interview) ---------- */
.live-rec-view { display: flex; flex-direction: column; gap: 14px; height: calc(100vh - 140px); min-height: 480px; }
.live-rec-topbar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; flex-wrap: wrap; }
.live-rec-cand { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-rec-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-rec-divider { width: 1px; align-self: stretch; background: var(--stroke); }
.live-rec-time { font-family: var(--font-mono); font-weight: 700; font-size: 20px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.live-autofill-on { color: var(--teal); border-color: var(--teal); }
.live-rec-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,9fr) minmax(0,11fr); gap: 16px; }
.live-rec-panel { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.live-rec-panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px 10px; }
.live-rec-panel-head h2 { margin: 0; flex: 1; font-family: var(--font-display); font-weight: 800; font-size: 15.5px; }
.live-rec-seg { flex-shrink: 0; }
.live-rec-qlist { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 18px 14px; display: flex; flex-direction: column; gap: 12px; }
.live-q-card { border: 1.5px solid var(--stroke); background: var(--panel-2); border-radius: 14px; padding: 12px 14px; transition: border-color .2s var(--ease), background .2s var(--ease); }
.live-q-card.is-active { border-color: var(--teal); background: var(--active); }
.live-q-card.is-answered { opacity: .72; }
.live-q-head { display: flex; gap: 10px; align-items: flex-start; }
.live-q-num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 9px; background: var(--track); color: var(--teal); font-size: 12.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.live-q-card.is-answered .live-q-num { background: var(--teal); color: var(--on-brand); }
.live-q-body { flex: 1; min-width: 0; }
.live-q-text { font-size: 13.8px; font-weight: 600; line-height: 1.5; }
.live-q-active-hint { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--teal); display: flex; align-items: center; gap: 6px; }
.live-q-actions { display: flex; gap: 6px; flex-shrink: 0; }
.live-q-note { margin-top: 10px; width: 100%; resize: vertical; border: 1px solid var(--stroke); border-radius: 10px; padding: 9px 11px; font-family: var(--font-ui); font-size: 13px; line-height: 1.6; color: var(--ink); background: var(--panel-2); }
.live-q-note:focus { outline: 2px solid var(--stroke-2); outline-offset: 1px; }
.live-q-add { display: flex; gap: 8px; }
.live-q-add input { flex: 1; border: 1.5px dashed var(--stroke-2); background: var(--panel-2); border-radius: 10px; padding: 10px 12px; font-family: var(--font-ui); font-size: 13px; color: var(--ink); }
.live-rec-free { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 6px 18px 14px; }
.live-rec-free-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.live-cv-embed { min-height: 0; }
.live-stop-confirm { position: fixed; z-index: 2001; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 48px)); padding: 20px 22px; border-radius: 16px; box-shadow: var(--shadow); }
.live-stop-confirm h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.live-stop-confirm p { margin: 0 0 16px; font-size: 12.8px; line-height: 1.65; color: var(--ink-2); }
.live-stop-discard { color: var(--bad); }
/* interview prep: floating window (body portal) + idle-page launcher */
.live-prep-launcher { padding: 14px 18px; }
.live-prep-window { position: fixed; top: 92px; right: 24px; z-index: 2001; width: min(460px, calc(100vw - 32px)); max-height: min(74vh, 760px); display: flex; flex-direction: column; border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; background: color-mix(in srgb, var(--panel-solid) 96%, transparent); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }
.live-prep-win-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--stroke); cursor: grab; user-select: none; touch-action: none; }
.live-prep-win-head:active { cursor: grabbing; }
.live-prep-win-head b { font-size: 13.5px; }
.live-prep-win-controls { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--stroke); }
.live-prep-count { width: 74px; border: 1px solid var(--stroke); border-radius: 9px; padding: 8px 9px; font-size: 13px; font-family: var(--font-ui); color: var(--ink); background: var(--panel-2); }
.live-prep-custom { flex: 1; min-width: 0; border: 1px solid var(--stroke); border-radius: 9px; padding: 7px 9px; resize: vertical; font-family: var(--font-ui); font-size: 12.5px; line-height: 1.5; color: var(--ink); background: var(--panel-2); }
.live-prep-win-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; }
@media (max-width: 1080px) { .live-rec-main { grid-template-columns: minmax(0,1fr); } }
