/* =====================================================================
   AI Interview — shared stylesheet
   - Part 1: the in-call interview UI (dark, video-call look). Ported as-is.
   - Part 2: the product design system (light, calm, minimalist) used by the
     login, dashboard, and consent pages. Scoped under `.product` so it never
     touches the interview UI.
   ===================================================================== */

/* ============ Part 1: interview UI (light, matches the product theme) ============ */
/* Uses the same calm light palette as the owner dashboard. Video/agent tiles stay
   dark (var(--tile)) for camera contrast and so the speaking glow reads clearly. */
:root {
  --bg: #f7f6f3; --bg-2: #f0eee9; --panel: #ffffff; --border: #e6e4df;
  --text: #1d1d1f; --muted: #6b6b70; --blue: #2f6f5e; --blue-solid: #2f6f5e;
  --green: #2f9e6a; --red: #b3261e; --radius: 14px;
  --tile: #23252a;   /* dark surface for video / AI tiles (camera contrast) */
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 30px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font-family: inherit; }
.hidden { display: none !important; }

/* candidate boot / invalid-link screen */
.boot { height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.boot-msg { color: var(--muted); font-size: 16px; text-align: center; max-width: 460px; line-height: 1.5; }
.boot-msg.err { color: var(--red); }

/* candidate consent screen (shown before any camera/mic access) */
.consent { height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.consent-card { max-width: 560px; width: 100%; background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.consent-card h1 { font-weight: 600; font-size: 24px; letter-spacing: -.01em; margin: 0 0 12px; }
.consent-card p { color: var(--text); font-size: 15px; line-height: 1.6; margin: 0 0 14px; }
.consent-card ul { color: var(--text); font-size: 14px; line-height: 1.6; padding-left: 20px; margin: 0 0 16px; }
.consent-card li { margin-bottom: 8px; }
.consent .agree { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; cursor: pointer; }
.consent .agree input { margin-top: 2px; width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; }
.consent-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.consent .decline { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; text-decoration: underline; }
.consent .decline:hover { color: var(--text); }

/* language toggle (English / Gujarati) */
.lang-toggle { position: fixed; top: 14px; right: 16px; z-index: 50; display: flex;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; box-shadow: var(--shadow); }
.lang-toggle button { background: none; border: none; color: var(--muted); padding: 7px 14px; cursor: pointer; font-size: 13px; }
.lang-toggle button.active { background: var(--blue-solid); color: #fff; }

/* type-to-answer fallback bar (Gujarati mode) */
.type-answer { position: absolute; left: 50%; transform: translateX(-50%); bottom: 84px;
  display: flex; gap: 8px; width: min(620px, 90%); z-index: 5; }
.type-answer input { flex: 1; background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.type-answer input:focus { outline: none; border-color: var(--blue); }
.type-answer .mini-btn { padding: 0 18px; }

#lobby { height: 100%; display: flex; align-items: center; justify-content: center;
  padding: 24px; gap: 40px; flex-wrap: wrap; overflow-y: auto; }
.preview-wrap { position: relative; width: min(560px, 92vw); aspect-ratio: 16/9; background: #000;
  border-radius: var(--radius); overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.preview-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; color: rgba(255,255,255,.72); }
.avatar-circle { width: 96px; height: 96px; border-radius: 50%; background: var(--blue-solid);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 500; }
.preview-controls { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; gap: 14px; justify-content: center; }
.lobby-side { width: min(440px, 92vw); }
.lobby-side h1 { font-size: 26px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 6px; }
.lobby-side p.sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.join-btn { background: var(--blue-solid); color: #fff; border: none; border-radius: 24px;
  padding: 12px 28px; font-size: 15px; cursor: pointer; font-weight: 500; }
.join-btn:hover { filter: brightness(1.05); } .join-btn:disabled { opacity: .5; cursor: not-allowed; }
details.settings { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 10px; }
details.settings summary { cursor: pointer; color: var(--text); font-size: 14px; padding: 8px 0; outline: none; }
.field label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; }
.field input, .field select, .field textarea { width: 100%; background: var(--bg-2);
  border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 9px 11px; font-size: 13px; font-family: inherit; }
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); }
.inline { display: flex; gap: 8px; } .inline input { flex: 1; }
.mini-btn { background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 0 14px; cursor: pointer; font-size: 13px; }
.mini-btn:hover { border-color: var(--blue); }
ul.chips { list-style: none; padding: 0; margin: 8px 0 0; }
ul.chips li { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; margin-bottom: 6px; font-size: 13px; }
ul.chips li .grow { flex: 1; }
ul.chips li button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; }
ul.chips li button:hover { color: var(--red); }
.empty { color: var(--muted); font-size: 12px; font-style: italic; }
.micout { font-size: 12px; color: var(--muted); margin-top: 8px; min-height: 16px; }
.lobby-warn { background: #fbeae9; border: 1px solid #f0c9c6; color: #8f1d16;
  padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.lobby-warn.amber { background: #fdf4e7; border-color: #f0d9b5; color: #8a5a12; }

.ctrl { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border); cursor: pointer;
  background: var(--panel); color: var(--text); font-size: 20px; display: inline-flex;
  align-items: center; justify-content: center; box-shadow: var(--shadow); transition: background .15s, filter .15s; }
.ctrl:hover { background: var(--bg-2); }
/* line icons (mic / camera / skip / leave) — inherit the button's color so they
   stay clearly visible in light, dark, and the red on/off states.
   NOTE: the toggle rules below must include the `svg` type selector so they match
   the base rule's specificity; otherwise `.ctrl svg.ic { display:block }` (which
   includes a type selector) outranks a plain `.ctrl .ic-off` and both icons show. */
.ctrl svg.ic { width: 22px; height: 22px; display: block; }
.ctrl svg.ic-off { display: none; }          /* mic/camera: slashed icon hidden unless off */
.ctrl.off svg.ic-on { display: none; }
.ctrl.off svg.ic-off { display: block; }
.ctrl.off { background: var(--red); color: #fff; }
.ctrl.leave { width: 60px; border-radius: 30px; background: var(--red); color: #fff; }
.ctrl.leave:hover { background: #d33828; }

#meeting { height: 100%; display: none; flex-direction: column; }
#meeting.active { display: flex; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; font-size: 14px; color: var(--muted); }
.topbar .title { color: var(--text); }
.topbar-left { display: inline-flex; align-items: center; gap: 10px; }

/* Candidate-side per-owner branding: the owner's logo, or the default wordmark.
   A logo always sits on a white chip so it stays legible in light AND dark mode
   regardless of the logo's own colors. */
.cand-brand { display: inline-flex; align-items: center; margin: 0 0 18px;
  font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--text); line-height: 1; }
.cand-brand .dot { color: var(--blue); }
.cand-brand.has-logo { background: #fff; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); }
.cand-brand.has-logo img { display: block; height: 80px; max-width: 360px; object-fit: contain; }
.cand-brand-sm { margin: 0; font-size: 14px; }
.cand-brand-sm.has-logo { padding: 4px 8px; border-radius: 8px; }
.cand-brand-sm.has-logo img { height: 44px; max-width: 220px; }

/* Dashboard branding tab: logo preview (white surface = how candidates see it). */
.brand-preview { display: flex; align-items: center; justify-content: center; min-height: 96px;
  background: #fff; border: 1px dashed var(--p-border); border-radius: 12px; padding: 16px; }
.brand-preview img { max-height: 72px; max-width: 80%; object-fit: contain; display: block; }
.brand-preview .empty { color: var(--p-muted); font-size: 13.5px; text-align: center; }

/* API key tab: masked-field look + subtle "saved" tag + transient confirmation */
#apiKeyInput.masked, #sarvamKeyInput.masked { color: var(--p-muted); letter-spacing: 3px; font-family: inherit; }
.key-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; vertical-align: middle;
  color: var(--p-accent-ink); background: var(--p-accent); }
.key-ok { color: var(--p-accent); }
.stage { flex: 1; position: relative; padding: 0 20px; display: flex; align-items: center; justify-content: center; min-height: 0; }
.ai-tile { width: min(900px, 96%); height: 100%; max-height: 70vh; background: var(--tile);
  border-radius: 18px; position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 22px; overflow: hidden; border: 3px solid transparent; box-shadow: var(--shadow); transition: border-color .2s; }
.ai-tile.speaking { border-color: var(--blue); }
.ai-avatar { width: 140px; height: 140px; border-radius: 50%; background: linear-gradient(135deg, #3f9a82, #2f6f5e);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 54px; font-weight: 500; position: relative; }
.ai-avatar::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--blue); opacity: 0; transition: opacity .2s; }
.ai-tile.speaking .ai-avatar::after { opacity: 1; animation: ring 1.4s infinite; }
@keyframes ring { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.25); opacity: 0; } }
.ai-name { position: absolute; bottom: 14px; left: 16px; color: #fff; background: rgba(0,0,0,.5); padding: 5px 12px; border-radius: 8px; font-size: 13px; }
.ai-state { color: var(--muted); font-size: 14px; height: 18px; }
.wave { display: flex; gap: 5px; align-items: flex-end; height: 34px; }
.wave span { width: 5px; height: 8px; background: var(--blue); border-radius: 3px; }
.ai-tile.speaking .wave span { animation: wv .7s infinite ease-in-out; }
.wave span:nth-child(2){animation-delay:.1s}.wave span:nth-child(3){animation-delay:.2s}
.wave span:nth-child(4){animation-delay:.3s}.wave span:nth-child(5){animation-delay:.15s}
@keyframes wv { 0%,100%{height:8px}50%{height:30px} }

.self-tile { position: absolute; right: 36px; bottom: 18px; width: 230px; aspect-ratio: 16/9; background: #000;
  border-radius: 12px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.18); border: 2px solid transparent; transition: border-color .15s; }
.self-tile.talking { border-color: var(--green); }
.self-tile video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.self-tile .self-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.self-tile .self-name { position: absolute; bottom: 6px; left: 8px; color: #fff; font-size: 11px; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 6px; }

.captions { position: absolute; left: 50%; transform: translateX(-50%); bottom: 22px; max-width: min(760px, 90%);
  background: rgba(0,0,0,.72); border-radius: 10px; padding: 12px 18px; font-size: 17px; line-height: 1.45; text-align: center; min-height: 24px; }
.captions .who { color: var(--blue); font-size: 12px; display: block; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .5px; }
.captions.cand .who { color: var(--green); } .captions .interim { color: var(--muted); }

.srbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); max-width: 90%;
  background: rgba(234,67,53,.92); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; display: none; }
.srbar.show { display: block; }
.srbar.info { background: rgba(47,111,94,.95); }

.controlbar { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px; position: relative; }
.controlbar .hint { position: absolute; left: 20px; right: 200px; color: var(--muted); font-size: 12px; }

#post { height: 100%; display: none; overflow-y: auto; padding: 30px 20px; }
#post.active { display: block; }
.post-inner { max-width: 820px; margin: 0 auto; }
.post-inner h1 { font-weight: 600; font-size: 24px; letter-spacing: -.01em; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { font-size: 16px; margin: 0 0 4px; font-weight: 500; }
.card .hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.summary-out { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 16px; white-space: pre-wrap; font-size: 14px; min-height: 100px; }
.qa { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; font-size: 14px; }
.qa .who { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.qa .who.ai { color: var(--blue); } .qa .who.cand { color: var(--green); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn { background: var(--blue-solid); color: #fff; border: none; padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; }
.btn:hover { filter: brightness(1.05); } .btn.sec { background: var(--bg-2); border: 1px solid var(--border); color: var(--text); }
.btn.sec:hover { border-color: var(--blue); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.banner { padding: 11px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.banner.ok { background: #e9f5ef; border: 1px solid #bfe3d2; color: #1c5a48; }
.banner.err { background: #fbeae9; border: 1px solid #f0c9c6; color: #8f1d16; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: var(--bg-2); border: 1px solid var(--border); color: var(--muted); margin: 2px; }
.spinner { width: 15px; height: 15px; border: 2px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
small.note { color: var(--muted); font-size: 12px; display: block; margin-top: 8px; }

/* Candidate: clean screen — hide the AI's spoken text/captions and all action
   status text ("thinking/listening/transcribing/speaking"). The speaking GLOW
   (ai-tile.speaking border + avatar ring + wave) stays, as do the controls,
   the self-view, and the type-to-answer box. Backend logic is unchanged; these
   elements still update in the DOM, they're just not shown. */
#captions { display: none !important; }
#aiState { display: none !important; }
.controlbar .hint { display: none !important; }

/* ============ Part 2: product design system (light, minimalist) ============ */
/* Used by login / dashboard / consent. Scoped under `.product` so it is fully
   isolated from the dark interview UI above. Calm palette, lots of whitespace. */
.product {
  --p-bg: #f7f6f3;          /* warm off-white */
  --p-surface: #ffffff;
  --p-text: #1d1d1f;
  --p-muted: #6b6b70;
  --p-border: #e6e4df;
  --p-accent: #2f6f5e;      /* calm teal-green */
  --p-accent-ink: #ffffff;
  --p-danger: #b3261e;
  --p-radius: 14px;
  --p-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 30px rgba(0,0,0,.05);

  min-height: 100%;
  margin: 0;
  background: var(--p-bg);
  color: var(--p-text);
  overflow-y: auto;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* When a page is the product theme, let the body scroll (interview UI uses overflow:hidden) */
body.product-page { overflow: auto; background: var(--p-bg); }

.product .wrap { max-width: 960px; margin: 0 auto; padding: 32px 24px 64px; }
.product .narrow { max-width: 440px; }

.product .topnav { display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; margin: 0 auto; padding: 20px 24px; }
/* Dashboard header: a touch wider than the 1080px content column so the brand
   sits slightly left of the content edge and the avatar slightly right —
   nudged outward toward the screen edges, but still balanced (not in corners). */
.product .topnav-wide { max-width: 1140px; }
.product .nav-right { display: flex; align-items: center; gap: 12px; }

/* light/dark theme toggle button (uses the global :root tokens so it themes
   correctly on every page, owner or candidate) */
.theme-toggle { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); cursor: pointer; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; box-shadow: var(--shadow); transition: filter .15s, background .15s; }
.theme-toggle:hover { filter: brightness(1.06); }
.theme-toggle-fixed { position: fixed; bottom: 16px; left: 16px; z-index: 50; }
.product .brand { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--p-text); text-decoration: none; }
.product .brand .dot { color: var(--p-accent); }

/* account avatar + dropdown menu (dashboard top-right) */
.product .acct { position: relative; }
.product .avatar-btn { width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--p-accent); color: var(--p-accent-ink); font-size: 16px; font-weight: 600; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  transition: filter .15s, box-shadow .15s; }
.product .avatar-btn:hover { filter: brightness(1.06); }
.product .avatar-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(47,111,94,.25); }
.product .acct-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 248px;
  background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 12px;
  box-shadow: var(--p-shadow); padding: 6px; }
.product .acct-email { font-size: 13px; color: var(--p-muted); padding: 9px 10px 7px; word-break: break-all; }
.product .acct-sep { height: 1px; background: var(--p-border); margin: 4px 2px; }
.product .acct-item { display: block; width: 100%; text-align: left; background: none; border: none;
  cursor: pointer; font-size: 14px; color: var(--p-text); padding: 9px 10px; border-radius: 8px; font-family: inherit; }
.product .acct-item:hover { background: var(--p-bg); }
.product .pw-box { padding: 4px 10px 8px; }
.product .pw-box input { margin-bottom: 8px; }
.product .pw-box .note { margin: 8px 0 0; }

.product h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 8px; }
.product h2 { font-size: 18px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.01em; }
.product .lead { color: var(--p-muted); font-size: 15px; line-height: 1.6; margin: 0 0 28px; }

.product .card {
  background: var(--p-surface); border: 1px solid var(--p-border);
  border-radius: var(--p-radius); padding: 28px; margin: 0 0 20px;
  box-shadow: var(--p-shadow);
}
.product .field { margin-bottom: 18px; }
.product .field > label { display: block; font-size: 13px; font-weight: 500; color: var(--p-text); margin: 0 0 7px; }
.product .field .hint { color: var(--p-muted); font-size: 12.5px; margin: 5px 0 0; }
.product input[type=text], .product input[type=email], .product input[type=password],
.product select, .product textarea {
  width: 100%; background: var(--p-surface); color: var(--p-text);
  border: 1px solid var(--p-border); border-radius: 10px; padding: 11px 13px;
  font-size: 15px; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.product input:focus, .product select:focus, .product textarea:focus {
  outline: none; border-color: var(--p-accent); box-shadow: 0 0 0 3px rgba(47,111,94,.12);
}
.product .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--p-accent); color: var(--p-accent-ink); border: 1px solid transparent;
  padding: 11px 20px; border-radius: 10px; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: filter .15s, background .15s; text-decoration: none;
}
.product .btn:hover { filter: brightness(1.05); }
.product .btn:disabled { opacity: .5; cursor: not-allowed; }
.product .btn.sec { background: var(--p-surface); color: var(--p-text); border-color: var(--p-border); }
.product .btn.sec:hover { border-color: var(--p-accent); filter: none; }
.product .btn.block { width: 100%; }
.product .btn.danger { background: var(--p-surface); color: var(--p-danger); border-color: var(--p-border); }

.product .muted { color: var(--p-muted); }
.product .center { text-align: center; }
.product .row { display: flex; gap: 10px; flex-wrap: wrap; }
.product .spacer { height: 8px; }
.product a.link { color: var(--p-accent); text-decoration: none; }
.product a.link:hover { text-decoration: underline; }

.product .note { padding: 12px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; }
.product .note.ok { background: #e9f5ef; color: #1c5a48; }
.product .note.err { background: #fbeae9; color: #8f1d16; }
.product .note.info { background: #eef1f6; color: #3a4a63; }

/* dashboard layout: left sidebar nav + content */
.product .layout { display: flex; gap: 28px; max-width: 1080px; margin: 0 auto; padding: 24px 24px 64px; align-items: flex-start; }
.product .sidebar { width: 208px; flex-shrink: 0; position: sticky; top: 20px; }
.product .nav { display: flex; flex-direction: column; gap: 4px; }
.product .nav-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: none; border: 1px solid transparent; cursor: pointer; font-family: inherit; font-size: 14.5px;
  color: var(--p-muted); padding: 10px 12px; border-radius: 10px; transition: background .15s, color .15s, border-color .15s; }
.product .nav-item svg { flex-shrink: 0; }
.product .nav-item:hover { background: var(--p-surface); color: var(--p-text); }
.product .nav-item.active { background: var(--p-surface); border-color: var(--p-border); color: var(--p-text); font-weight: 600; box-shadow: var(--p-shadow); }
.product .content { flex: 1; min-width: 0; }
.product .content > h1 { margin-top: 2px; }
.product .view.hidden { display: none; }
@media (max-width: 760px) {
  .product .layout { flex-direction: column; gap: 14px; padding: 16px; }
  .product .sidebar { width: 100%; position: static; }
  .product .nav { flex-direction: row; }
  .product .nav-item { flex: 1; justify-content: center; }
}

/* spending: stat tiles + soft-limit status */
.product .stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.product .stat { flex: 1; min-width: 150px; background: var(--p-bg); border: 1px solid var(--p-border); border-radius: 12px; padding: 18px; }
.product .stat-num { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.product .stat-label { color: var(--p-muted); font-size: 13px; margin-top: 4px; }
.product .usage-line { font-size: 14.5px; font-weight: 500; margin: 0 0 14px; }
.product .note.warn { background: #fdf4e7; color: #8a5a12; }
.product .limit-bar { height: 8px; background: var(--p-bg); border: 1px solid var(--p-border); border-radius: 999px; overflow: hidden; margin: 10px 0 8px; }
.product .limit-bar > span { display: block; height: 100%; background: var(--p-accent); transition: width .2s; }
.product .limit-bar.over > span { background: #c9821a; }

/* delete confirmation (inline, inside an interview card) */
.product .del-confirm { margin-top: 12px; background: #fdf4e7; border: 1px solid #f0d9b5; border-radius: 10px; padding: 12px 14px; }
.product .del-confirm p { margin: 0 0 10px; font-size: 13.5px; color: #6b4a12; }
.product .del-confirm .row { gap: 8px; }

/* dashboard: question/recipient editors + interview list */
.product .qlist { list-style: none; padding: 0; margin: 10px 0 0; }
.product .qlist li { display: flex; gap: 10px; align-items: center; background: var(--p-bg);
  border: 1px solid var(--p-border); border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; font-size: 14px; }
.product .qlist li .grow { flex: 1; }
.product .qlist li.empty { color: var(--p-muted); font-style: italic; background: transparent; border: none; padding: 4px 0; }
.product .qlist li button { background: none; border: none; color: var(--p-muted); cursor: pointer; font-size: 15px; line-height: 1; }
.product .qlist li button:hover { color: var(--p-danger); }
.product .iv { border: 1px solid var(--p-border); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; background: var(--p-surface); }
.product .iv h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.product .iv .meta { color: var(--p-muted); font-size: 13px; margin-bottom: 12px; }
.product .linkrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.product .linkrow input { flex: 1; min-width: 200px; font-size: 13px; background: var(--p-bg); }
.product .empty { color: var(--p-muted); font-style: italic; font-size: 14px; }
.product .results { margin-top: 12px; }
.product .results:empty { margin-top: 0; }
.product .result { border-top: 1px solid var(--p-border); padding-top: 12px; margin-top: 12px; }
.product .result .meta { color: var(--p-muted); font-size: 12.5px; margin-bottom: 8px; }
.product .result .summary { white-space: pre-wrap; font-size: 14px; line-height: 1.55;
  background: var(--p-bg); border: 1px solid var(--p-border); border-radius: 10px; padding: 14px; }


/* =====================================================================
   DARK MODE  (toggled via data-theme="dark" on <html> — see assets/theme.js)
   Overrides BOTH token sets: the global/interview tokens on :root, and the
   product tokens on .product. A few component colors are hard-coded light
   tints (notes, banners, warnings), so they get explicit dark equivalents
   to stay legible — nothing should drop below readable contrast.
   ===================================================================== */
:root[data-theme="dark"] {
  --bg: #14151a; --bg-2: #1f2127; --panel: #1b1d22; --border: #2e3138;
  --text: #e8eaed; --muted: #9aa0a6;
  --blue: #5cc6a8; --blue-solid: #2c8a72;
  --green: #3fb985; --red: #e2685f;
  --tile: #23252a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.5);
}
[data-theme="dark"] .product {
  --p-bg: #14151a; --p-surface: #1b1d22; --p-text: #e8eaed; --p-muted: #9aa0a6;
  --p-border: #2e3138; --p-accent: #5cc6a8; --p-accent-ink: #0e211b; --p-danger: #e2685f;
  --p-shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.5);
}

/* product notes / confirm box — dark-friendly tints with legible text */
[data-theme="dark"] .product .note.ok   { background: rgba(92,198,168,.14); color: #9ee6cd; }
[data-theme="dark"] .product .note.err  { background: rgba(226,104,95,.15); color: #f3a39c; }
[data-theme="dark"] .product .note.info { background: rgba(120,150,200,.15); color: #b9c6e2; }
[data-theme="dark"] .product .note.warn { background: rgba(201,130,26,.16); color: #e6b873; }
[data-theme="dark"] .product .del-confirm { background: rgba(201,130,26,.13); border-color: rgba(201,130,26,.4); }
[data-theme="dark"] .product .del-confirm p { color: #e6b873; }

/* Apply-page role picker (dashboard): a wrap of selectable role chips. */
.roles-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.roles-picker .role-chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 12px; border: 1px solid var(--p-border, #e2e2e2);
  border-radius: 999px; font-size: 14px; user-select: none;
  background: var(--p-bg, #fff); color: var(--p-text, #1a1a1a);
}
.roles-picker .role-chip input { margin: 0; accent-color: var(--p-accent, #2c8a72); }
.roles-picker .role-chip:has(input:checked) {
  border-color: var(--p-accent, #2c8a72);
  background: color-mix(in srgb, var(--p-accent, #2c8a72) 12%, transparent);
}

/* interview-page banners + lobby warnings */
[data-theme="dark"] .banner.ok  { background: rgba(63,185,133,.14); border-color: rgba(63,185,133,.4); color: #9ee6cd; }
[data-theme="dark"] .banner.err { background: rgba(226,104,95,.14); border-color: rgba(226,104,95,.4); color: #f3a39c; }
[data-theme="dark"] .lobby-warn { background: rgba(226,104,95,.14); border-color: rgba(226,104,95,.4); color: #f3a39c; }
[data-theme="dark"] .lobby-warn.amber { background: rgba(201,130,26,.16); border-color: rgba(201,130,26,.45); color: #e6b873; }
