/* Candidate portal styles — token-driven; follows the shared light/dark theme. */
body.candidate-page {
  background: var(--void);
  min-height: 100dvh;
}

/* Portal shell */
.candidate-shell { max-width: 1180px; margin: 0 auto; padding: 28px 18px 80px; }

/* Auth screen */
.auth-screen { max-width: 820px; margin: 0 auto; }
.auth-hero { border-radius: var(--radius-lg, 14px); padding: clamp(32px,5vw,52px); background: var(--surface-ink); border: 1px solid var(--border-on-ink); color: var(--text-on-ink); margin-bottom: 20px; }
.auth-hero h1 { margin: 0 0 12px; font-family: "Fraunces",Georgia,serif; font-size: clamp(32px,5vw,56px); line-height: 1.02; letter-spacing: -.03em; color: var(--text-on-ink); }
.auth-hero p { color: var(--text-on-ink-muted); font-size: 17px; max-width: 560px; margin: 0 0 20px; }
.auth-grid { display: block; }
.auth-card { max-width: 480px; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--radius-lg, 14px); background: var(--surface-primary); padding: 28px; }
.consent-box { margin: 14px 0; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; color: var(--text-secondary); }
.checkline input { margin-top: 3px; flex-shrink: 0; }

/* Auth tab switcher */
.auth-tab-bar {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-interactive);
  border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 22px;
}
.auth-tab-btn {
  flex: 1; padding: 11px 8px; border: none; border-radius: 7px;
  font-family: "Manrope",sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .18s, color .18s;
  background: transparent; color: var(--text-muted);
  touch-action: manipulation;
}
.auth-tab-btn.active { background: var(--action-primary); color: var(--action-primary-ink); }

/* Portal tabs */
.portal-tabs-nav { display: flex; gap: 4px; padding: 5px; background: var(--surface-primary); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 28px; width: fit-content; max-width: 100%; }
.portal-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; border: none; background: none; padding: 10px 22px 9px; font-family: "Manrope",sans-serif; font-size: 11px; font-weight: 700; color: var(--text-muted); border-radius: 8px; cursor: pointer; white-space: nowrap; letter-spacing: .025em; transition: color .18s, background .18s; }
.portal-tab svg { transition: color .18s; flex-shrink: 0; }
.portal-tab:hover { color: var(--text-primary); background: var(--action-soft); }
.portal-tab.active { color: var(--action-primary-ink); background: var(--action-primary); }
.portal-tab.active svg { color: var(--action-primary-ink); }
.tab-pip { position: absolute; top: 7px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--status-error); border: 2px solid var(--surface-primary); display: none; }
.portal-tab.has-badge .tab-pip { display: block; }

/* Dashboard view */
.dash-status-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 18px 0; }
.dash-status-card { border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 18px; background: var(--surface-interactive); min-width: 0; }
.dash-status-card span { display: block; text-transform: uppercase; letter-spacing:.1em; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.dash-status-card strong { display: block; font-family: "Fraunces",Georgia,serif; color: var(--text-primary); font-size: 28px; line-height: 1; text-transform: capitalize; overflow-wrap: break-word; }
.dash-checklist { margin-top: 22px; }
.dash-check { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.dash-check:last-child { border-bottom: 0; }
.dash-check strong { color: var(--text-primary); }
.dash-check-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; font-weight: 700; }
.dash-check-icon.done { background: var(--status-success-soft); color: var(--status-success); }
.dash-check-icon.todo { background: var(--action-soft); color: var(--text-secondary); border: 1px solid var(--border-default); }
.dash-check-icon.warn { background: var(--status-warning-soft); color: var(--status-warning); }
.dash-check p { margin: 3px 0 0; color: var(--text-secondary); font-size: 13px; }

/* Profile view */
.profile-form-wrap { }
.profile-section-title { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line-2); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.profile-preview { margin-top: 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md, 10px); padding: 20px; background: var(--surface-interactive); }
.field-help { margin: -6px 0 12px; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.field-help strong { color: var(--text-primary); }

/* Systems picker */
select[multiple] { min-height: 160px; border-radius: var(--radius-sm, 6px); padding: 10px; }
.systems-picker { border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 14px; background: var(--surface-interactive); }
.systems-picker input[type="search"] { width: 100%; margin-bottom: 10px; }
.systems-results-select { width: 100%; min-height: 200px; border: 1px solid var(--line); border-radius: var(--radius-sm, 6px); padding: 10px; background: var(--surface-primary); color: var(--text-primary); }
.systems-picker-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.systems-add-btn { border: 0; border-radius: 8px; padding: 10px 14px; background: var(--action-primary); color: var(--action-primary-ink); font-weight: 700; cursor: pointer; font-size: 13px; }
.systems-add-btn:hover { background: var(--action-primary-hover); }
.systems-clear-btn { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: transparent; color: var(--text-secondary); font-weight: 700; cursor: pointer; font-size: 13px; }
.systems-clear-btn:hover { background: var(--action-soft); color: var(--text-primary); }
.selected-systems { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; min-height: 34px; }
.system-chip { display: inline-flex; align-items: center; gap: 8px; border-radius: var(--radius-pill, 999px); padding: 7px 12px; background: var(--action-primary); color: var(--action-primary-ink); font-size: 13px; font-weight: 700; max-width: 100%; overflow-wrap: break-word; }
.system-chip button { border: 0; background: rgba(255,255,255,.22); color: inherit; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1; flex-shrink: 0; }
.systems-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; color: var(--text-muted); font-size: 12px; }

/* Evidence view */
.evidence-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.evidence-item { border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 18px; background: var(--surface-interactive); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.evidence-meta span { display: block; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing:.08em; margin-bottom: 4px; }
.evidence-form { border: 1px solid var(--line); border-radius: var(--radius-lg, 14px); padding: 24px; background: var(--surface-primary); margin-top: 18px; }
.badge-verified { background: var(--status-success-soft); color: var(--status-success); padding: 4px 10px; border-radius: var(--radius-pill, 999px); font-size: 12px; font-weight: 700; }
.badge-pending { background: var(--status-warning-soft); color: var(--status-warning); padding: 4px 10px; border-radius: var(--radius-pill, 999px); font-size: 12px; font-weight: 700; }
.badge-unverified { background: var(--action-soft); color: var(--text-secondary); padding: 4px 10px; border-radius: var(--radius-pill, 999px); font-size: 12px; font-weight: 700; }

/* Assessments view */
.assessment-card { border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 20px 22px; background: var(--surface-primary); margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.assessment-card h3 { margin: 0; color: var(--text-primary); font-size: 15px; }
.assessment-card .card-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.assessment-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* Per-task review — candidate sees which tasks were right/wrong and what good
   looks like, without the answer key (stripped server-side). */
.assessment-review { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.assessment-review > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--action-primary); list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.assessment-review > summary::-webkit-details-marker { display: none; }
.assessment-review > summary::before { content: "▸"; font-size: 11px; transition: transform .15s ease; }
.assessment-review[open] > summary::before { transform: rotate(90deg); }
.assessment-review-body { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.review-task { border: 1px solid var(--line); border-left: 3px solid var(--border-strong); border-radius: var(--radius-sm, 6px); padding: 12px 14px; background: var(--surface-interactive); }
.review-task--correct { border-left-color: var(--status-success); }
.review-task--incorrect { border-left-color: var(--status-error); }
.review-task--pending { border-left-color: var(--status-warning); }
.review-task-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.review-result-badge { font-size: 11px; font-weight: 800; letter-spacing: .03em; padding: 3px 9px; border-radius: var(--radius-pill, 999px); }
.review-result-badge--correct { color: var(--status-success); background: var(--status-success-soft); }
.review-result-badge--incorrect { color: var(--status-error); background: var(--status-error-soft); }
.review-result-badge--pending { color: var(--status-warning); background: var(--status-warning-soft); }
.review-competency { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.review-critical { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--status-error); background: var(--status-error-soft); padding: 2px 8px; border-radius: var(--radius-pill, 999px); }
.review-task-q { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; color: var(--text-primary); font-weight: 600; }
.review-task-a, .review-task-hint { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.review-task-a span, .review-task-hint span { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 2px; }
.review-task-hint { padding: 8px 10px; border-radius: var(--radius-sm, 6px); background: var(--action-soft); }
.band-badge { padding: 4px 12px; border-radius: var(--radius-pill, 999px); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.band-strong { background: var(--status-success-soft); color: var(--status-success); border: 1px solid var(--status-success); }
.band-competent { background: var(--status-info-soft); color: var(--status-info); border: 1px solid var(--status-info); }
.band-developing { background: var(--status-warning-soft); color: var(--status-warning); border: 1px solid var(--status-warning); }
.band-basic { background: var(--surface-interactive); color: var(--text-secondary); border: 1px solid var(--border-default); }
/* Assessment hub section header */
.assess-section-head { padding: 20px 0 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 20px; }
.assess-section-head h3 { margin: 0 0 4px; color: var(--text-primary); font-size: 17px; }
.assess-section-head p { margin: 0; font-size: 13px; color: var(--text-secondary); }

/* ── Assessment arena (taking screen) ── */
.assessment-screen { border: 1px solid var(--line); border-radius: var(--radius-lg, 14px); padding: 0; background: var(--surface-primary); box-shadow: var(--shadow-sm); overflow: hidden; max-width: 860px; margin: 0 auto; }
.assessment-screen-header { padding: clamp(18px, 3vw, 28px) clamp(24px, 5vw, 48px); border-bottom: 1px solid var(--line); background: var(--surface-interactive); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.assessment-screen-header .eyebrow { color: var(--action-primary); margin-bottom: 4px; }
.assessment-screen-header h2 { margin: 0; color: var(--text-primary); font-size: clamp(18px,2.5vw,24px); }
.assessment-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.assessment-counter { font-size: 13px; font-weight: 700; color: var(--action-primary); font-family: "Manrope",sans-serif; letter-spacing: .05em; }
/* Question progress dots */
.quest-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 200px; }
.quest-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bone-2); border: 1px solid var(--line); transition: background .22s, transform .22s; }
.quest-dot.answered { background: var(--status-success); border-color: var(--status-success); transform: scale(1.15); }
/* Assessment body + footer */
.assessment-screen-body { padding: clamp(24px, 4vw, 40px) clamp(24px, 5vw, 48px); }
.assessment-screen-footer { padding: 18px clamp(24px, 5vw, 48px) 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Exit confirmation — a fixed, centered overlay so it is always visible,
   whatever the scroll position within a long assessment. */
.assessment-exit-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--overlay, rgba(20, 17, 27, 0.55)); backdrop-filter: blur(2px); }
.assessment-exit-dialog { width: min(420px, 100%); background: var(--surface-primary); color: var(--text-primary); border: 1px solid var(--line); border-radius: var(--radius-lg, 14px); box-shadow: var(--shadow-md); padding: 24px; }
.assessment-exit-dialog h3 { margin: 0 0 8px; font-size: 18px; color: var(--text-primary); }
.assessment-exit-dialog p { margin: 0 0 20px; font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.assessment-exit-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Assessment toast — fixed feedback for start/exit actions so a failure
   (cooldown, exhausted attempts, empty battery) is never off-screen. */
.assessment-toast { position: fixed; top: 18px; left: 50%; transform: translate(-50%, -14px); z-index: 1100; max-width: min(560px, calc(100% - 32px)); padding: 12px 18px; border-radius: var(--radius-md, 10px); background: var(--surface-ink, #2B2138); color: var(--text-on-ink, #F3EFF9); border: 1px solid var(--border-on-ink, rgba(243,239,249,.16)); box-shadow: var(--shadow-md); font-size: 14px; font-weight: 600; line-height: 1.45; text-align: center; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.assessment-toast.show { opacity: 1; transform: translate(-50%, 0); }
.assessment-toast.error { background: var(--status-error, #B3261E); color: #fff; border-color: transparent; }
.assessment-toast.success { background: var(--status-success, #2980b9); color: #fff; border-color: transparent; }
@media (prefers-reduced-motion: reduce) { .assessment-toast { transition: opacity .18s ease; } }

/* Question styling */
.assessment-question { margin-bottom: 36px; }
.assessment-question-num { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--action-primary); margin: 0 0 10px; }
.assessment-question h3 { margin: 0 0 16px; font-size: clamp(17px, 2vw, 20px); color: var(--text-primary); line-height: 1.6; font-weight: 700; }
/* Answer options */
.answer-option { display: flex; align-items: center; gap: 13px; padding: 15px 20px; border: 1.5px solid var(--border-default); border-radius: var(--radius-md, 10px); margin-bottom: 10px; cursor: pointer; transition: border-color .15s, background .15s; background: var(--surface-primary); touch-action: manipulation; }
.answer-option:hover { border-color: var(--action-primary); background: var(--action-soft); }
.answer-option--selected { border-color: var(--action-primary); background: var(--action-soft); box-shadow: inset 3px 0 0 var(--action-primary); }
.answer-letter { width: 30px; height: 30px; min-width: 30px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; font-family: "Manrope",sans-serif; color: var(--text-muted); flex-shrink: 0; transition: background .15s, border-color .15s, color .15s; }
.answer-option--selected .answer-letter { background: var(--action-primary); border-color: var(--action-primary); color: var(--action-primary-ink); }
.answer-option label { cursor: pointer; flex: 1; font-size: clamp(14px, 1.5vw, 16px); margin-bottom: 0; line-height: 1.5; color: var(--text-secondary); pointer-events: none; }
.answer-option input[type="radio"] { display: none; }
/* Typed-answer questions (exact-match / formula syntax) */
.assessment-input { width: 100%; box-sizing: border-box; padding: 14px 18px; border: 1.5px solid var(--border-default); border-radius: var(--radius-sm, 6px); background: var(--surface-primary); color: var(--text-primary); font-size: clamp(14px, 1.5vw, 16px); transition: border-color .15s, box-shadow .15s; }
.assessment-input::placeholder { color: var(--text-placeholder); }
.assessment-input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--action-soft); }
.assessment-input--formula { font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace; letter-spacing: .02em; }
textarea.assessment-input--response { resize: vertical; min-height: 96px; font-family: inherit; line-height: 1.5; }
.assessment-response-note { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }
/* Score reveal */
@keyframes scoreIn { from { opacity:0; transform:scale(.95) translateY(8px); } to { opacity:1; transform:scale(1) translateY(0); } }
.score-reveal { text-align: center; padding: 44px 28px 36px; animation: scoreIn 320ms cubic-bezier(.19,1,.22,1) both; }
.score-reveal-icon { font-size: 52px; margin-bottom: 12px; line-height: 1; }
.score-reveal-num { font-family: "Fraunces",Georgia,serif; font-size: 72px; font-weight: 700; line-height: 1; color: var(--action-primary); margin-bottom: 14px; }
.score-reveal-band { margin-bottom: 18px; }
.score-reveal p.note { max-width: 320px; margin: 0 auto 28px; }

/* Opportunities view */
.intro-card { border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 22px; background: var(--surface-primary); margin-bottom: 12px; }
.intro-card h3 { margin: 0 0 8px; color: var(--text-primary); }
.intro-card p { margin: 6px 0; font-size: 14px; color: var(--text-secondary); }
.intro-card .card-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.intro-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* Assessment context panels */
.context-table { width: 100%; min-width: 320px; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.context-table th, .context-table td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; color: var(--text-secondary); }
.context-table th { background: var(--surface-interactive); font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.context-table td:first-child { color: var(--text-muted); font-size: 11px; text-align: center; width: 28px; }
.cell-formula { color: var(--status-success); font-family: monospace; font-weight: 700; }
.cell-discrepancy { background: var(--status-error-soft); color: var(--status-error); font-weight: 700; }
.reconcile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.reconcile-col-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 6px; }
.inbox-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.inbox-item { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm, 6px); background: var(--surface-interactive); font-size: 13px; }
.inbox-item--urgent { border-color: var(--status-error); background: var(--status-error-soft); }
.inbox-sender { font-weight: 700; color: var(--text-primary); flex-shrink: 0; width: 130px; font-size: 12px; }
.inbox-subject { color: var(--text-secondary); overflow-wrap: break-word; min-width: 0; }
.inbox-item--urgent .inbox-subject { color: var(--status-error); font-weight: 700; }

/* ── Typing test ── */
.typing-test-shell { border: 1px solid var(--line); border-radius: var(--radius-lg, 14px); padding: 28px; background: var(--surface-primary); box-shadow: var(--shadow-sm); }
.typing-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.typing-header h2 { color: var(--text-primary); margin: 0 0 6px; }
.typing-header .eyebrow { color: var(--action-primary); }
.typing-header p.note { color: var(--text-muted); }
.typing-timer-wrap { text-align: center; flex-shrink: 0; position: relative; }
.typing-timer-ring { position: relative; width: 90px; height: 90px; margin: 0 auto 2px; }
.typing-timer-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.typing-timer-ring-track { fill: none; stroke: var(--bone-2); stroke-width: 3.5; }
.typing-timer-ring-fill { fill: none; stroke: var(--action-primary); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset .9s linear, stroke .3s; }
.typing-timer-ring-fill.urgent { stroke: var(--status-error); }
.typing-timer-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: "Fraunces",Georgia,serif; font-size: 40px; line-height: 1; color: var(--text-primary); font-weight: 700; }
.typing-timer-num.urgent { color: var(--status-error); animation: pulse .7s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.55} }
.typing-timer-label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); margin-top: 4px; }
.typing-passage { font-family: "Courier New",monospace; font-size: 16px; line-height: 2.1; letter-spacing: .01em; border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 18px 22px; background: var(--surface-interactive); margin-bottom: 14px; user-select: none; word-break: break-word; color: var(--text-muted); }
.tch-pending { color: var(--text-muted); }
.tch-correct { color: var(--status-success); background: var(--status-success-soft); border-radius: 2px; }
.tch-wrong { color: var(--status-error); background: var(--status-error-soft); border-radius: 2px; }
.tch-cursor { border-bottom: 2px solid var(--action-primary); animation: blink .9s step-end infinite; }
@keyframes blink { 0%,100%{border-color:var(--action-primary)} 50%{border-color:transparent} }
.typing-input { width: 100%; border: 1.5px solid var(--border-default); border-radius: var(--radius-sm, 6px); padding: 14px 18px; font-size: 16px; font-family: "Courier New",monospace; background: var(--surface-primary); color: var(--text-primary); resize: none; height: 72px; box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.typing-input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--action-soft); }
.typing-stats-bar { display: flex; border: 1px solid var(--line); border-radius: var(--radius-md, 10px); overflow: hidden; margin: 14px 0; background: var(--surface-interactive); }
.typing-stat { flex: 1; padding: 14px 16px; border-right: 1px solid var(--line); min-width: 0; }
.typing-stat:last-child { border-right: 0; }
.typing-stat span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 4px; font-weight: 700; }
.typing-stat strong { display: block; font-family: "Fraunces",Georgia,serif; font-size: 30px; color: var(--text-primary); line-height: 1; }
/* Typing results */
.typing-result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0; }
.typing-result-stat { border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 20px; background: var(--surface-interactive); text-align: center; min-width: 0; }
.typing-result-stat > span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 10px; font-weight: 700; }
.typing-result-big { display: block; font-family: "Fraunces",Georgia,serif; font-size: 42px; line-height: 1; color: var(--action-primary); }
.typing-test-shell h2 { color: var(--text-primary); }
.typing-test-shell .eyebrow { color: var(--action-primary); }
.typing-test-shell p.note { color: var(--text-muted); }
/* Assessment context panels */
.assessment-context { border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 20px 24px; background: var(--surface-interactive); margin-bottom: 22px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.assessment-context .eyebrow { color: var(--action-primary); margin-bottom: 8px; font-size: 11px; }
.assessment-context p.note { color: var(--text-secondary); margin: 8px 0 0; font-size: 12px; }

/* Profile completeness bar */
.profile-progress-bar { height: 5px; background: var(--bone-2); border-radius: var(--radius-pill, 999px); margin-top: 8px; overflow: hidden; }
.profile-progress-fill { height: 100%; background: var(--action-primary); border-radius: var(--radius-pill, 999px); transition: width .4s cubic-bezier(.4,0,.2,1); }

/* Visibility reason */
.visibility-reason { font-size: 12px; color: var(--text-muted); display: block; margin-top: 4px; font-weight: 500; }

/* Next best action banner */
.nba-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--action-soft); border: 1px solid var(--border-default); border-radius: var(--radius-md, 10px); margin: 18px 0 4px; }
.nba-banner__icon { width: 34px; height: 34px; border-radius: 50%; background: var(--action-primary); color: var(--action-primary-ink); display: grid; place-items: center; flex-shrink: 0; font-size: 16px; font-weight: 700; }
.nba-banner__body { flex: 1; min-width: 0; }
.nba-banner__body strong { display: block; font-size: 14px; color: var(--text-primary); font-weight: 700; margin-bottom: 2px; }
.nba-banner__body p { font-size: 13px; color: var(--text-secondary); margin: 0; }

/* ── Skill / Challenge cards (available assessments) ── */
.avail-card { border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 22px; background: var(--surface-primary); display: flex; flex-direction: column; gap: 14px; transition: border-color .18s, box-shadow .18s; cursor: default; }
.avail-card:hover { border-color: var(--action-primary); box-shadow: var(--shadow-sm); }
.avail-card__icon { width: 52px; height: 52px; border-radius: var(--radius-md, 10px); background: var(--action-soft); border: 1px solid var(--border-default); display: grid; place-items: center; flex-shrink: 0; color: var(--action-primary); }
.avail-card__head { display: flex; align-items: flex-start; gap: 14px; }
.avail-card__head h3 { color: var(--text-primary); }
.avail-card__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.avail-card__tag { font-size: 10px; font-weight: 700; border: 1px solid var(--border-default); border-radius: var(--radius-pill, 999px); padding: 3px 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; }
.avail-card__tag.required { border-color: var(--status-success); color: var(--status-success); background: var(--status-success-soft); }
.avail-card .note { color: var(--text-secondary); font-size: 13px; margin: 0; }
/* Start button inside avail-card */
.avail-card .primary { align-self: flex-start; }

/* ── Proof Badge Cards ── */
.proof-badge-card { position: relative; border-radius: var(--radius-md, 10px); padding: 20px; display: flex; gap: 16px; align-items: flex-start; border: 1.5px solid; background: var(--surface-primary); transition: border-color .2s; }
.proof-badge-card--awarded { border-color: var(--status-success); background: var(--status-success-soft); }
.proof-badge-card--pending { border-color: var(--status-warning); background: var(--status-warning-soft); }
.proof-badge-card--other { border-color: var(--border-default); background: var(--surface-interactive); }
.proof-badge-icon { flex-shrink: 0; width: 60px; height: 68px; display: flex; align-items: center; justify-content: center; background: var(--surface-primary); border-radius: 14px 14px 14px 5px; border: 1px solid; position: relative; }
.proof-badge-icon--awarded { border-color: var(--status-success); color: var(--status-success); }
.proof-badge-icon--pending { border-color: var(--status-warning); color: var(--status-warning); }
.proof-badge-icon--other { border-color: var(--border-default); color: var(--text-muted); }
.proof-badge-awarded-tick { position: absolute; bottom: -5px; right: -5px; width: 20px; height: 20px; border-radius: 50%; background: var(--status-success); display: grid; place-items: center; font-size: 11px; color: #fff; border: 2px solid var(--surface-primary); }
.proof-badge-body { flex: 1; min-width: 0; }
.proof-badge-body h3 { margin: 0 0 8px; font-size: 15px; color: var(--text-primary); font-weight: 700; }
.proof-badge-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.proof-badge-meta { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
/* Score on badge */
.proof-badge-score { position: absolute; top: 14px; right: 16px; font-family: "Fraunces",Georgia,serif; font-size: 22px; font-weight: 700; line-height: 1; }
.proof-badge-score--awarded { color: var(--status-success); }
.proof-badge-score--pending { color: var(--status-warning); }
.proof-badge-score--other { color: var(--text-muted); }
/* Passport section header */
.passport-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.passport-tally { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--radius-pill, 999px); background: var(--status-success-soft); border: 1px solid var(--status-success); font-size: 13px; font-weight: 700; color: var(--status-success); font-family: "Manrope",sans-serif; }

/* Feedback messages */
.portal-message { border-radius: var(--radius-md, 10px); padding: 14px 18px; margin-top: 14px; background: var(--surface-interactive); color: var(--text-primary); border: 1px solid var(--border-default); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.portal-message:empty { display: none; }
.portal-message.error { border-color: var(--status-error); color: var(--status-error); background: var(--status-error-soft); }
.portal-message.success { border-color: var(--status-success); color: var(--status-success); background: var(--status-success-soft); }

/* View entrance/exit animations */
@keyframes viewIn  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes viewOut { from { opacity:1; transform:translateY(0); }  to { opacity:0; transform:translateY(-5px); } }
.view-entering { animation: viewIn  220ms cubic-bezier(.19,1,.22,1) both; }
.view-exiting  { animation: viewOut 140ms ease-in both; pointer-events:none; }

/* Account dropdown in topbar (topbar is an ink panel in both themes) */
/* .topbar is a 3-column grid, so the trailing controls share one cell — otherwise
   the fourth child auto-flows to a second row at the left edge of the header. */
.topbar-actions { display:flex; align-items:center; gap:14px; flex-wrap:wrap; justify-content:flex-end; margin-left:auto; }
.topbar-account { position:relative; flex-shrink:0; }
.topbar-account-btn { display:flex; align-items:center; gap:7px; border:1px solid var(--border-on-ink); background:rgba(243,239,249,.08); color:var(--text-on-ink); padding:8px 13px 8px 10px; border-radius:var(--radius-pill, 999px); cursor:pointer; font-family:"Manrope",sans-serif; font-size:13px; font-weight:700; transition:background .15s, border-color .15s; white-space:nowrap; min-height: 42px; }
.topbar-account-btn:hover { background:rgba(243,239,249,.16); }
.topbar-account-btn .acct-chevron { opacity:.65; transition:transform .2s; }
.topbar-account-btn[aria-expanded="true"] .acct-chevron { transform:rotate(180deg); }
@keyframes dropIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.account-dropdown { position:absolute; top:calc(100% + 10px); right:0; left:auto; min-width:220px; max-width:calc(100vw - 24px); background:var(--surface-elevated); border:1px solid var(--border-default); border-radius:var(--radius-md, 10px); box-shadow:var(--shadow-md); overflow:hidden; z-index:300; animation:dropIn 180ms cubic-bezier(.19,1,.22,1) both; }
/* Below 1040px .topbar collapses to a single left-aligned column, so a
   right-anchored panel would hang off the left edge. See _positionAccountDropdown(). */
.account-dropdown.anchor-left { left:0; right:auto; }
.account-dropdown__name { padding:13px 16px 11px; font-size:12px; color:var(--text-muted); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.account-dropdown__div { height:1px; background:var(--line-2); margin:0 8px; }
.account-dropdown__item { display:flex; align-items:center; gap:10px; width:100%; padding:11px 16px; border:none; background:none; color:var(--text-secondary); font-family:"Manrope",sans-serif; font-size:13px; font-weight:600; cursor:pointer; text-align:left; text-decoration:none; transition:background .12s, color .12s; }
.account-dropdown__item:hover { background:var(--action-soft); color:var(--text-primary); }
/* Scoped past styles.css's `button.danger` (0,1,1), which otherwise fills the row
   with --status-error and leaves the red label unreadable on a red block. */
.account-dropdown .account-dropdown__item.danger { background:none; color:var(--status-error); }
.account-dropdown .account-dropdown__item.danger:hover { background:var(--status-error-soft); color:var(--status-error); }

/* Mobile bottom nav */
.mobile-bottom-nav { display:none; position:fixed; bottom:0; left:0; right:0; z-index:200; background:var(--surface-elevated); border-top:1px solid var(--border-default); padding-bottom:env(safe-area-inset-bottom,0); box-shadow: var(--shadow-md); }
.mobile-nav-inner { display:flex; }
.mobile-nav-btn { flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; border:none; background:none; padding:10px 4px 11px; color:var(--text-muted); font-family:"Manrope",sans-serif; font-size:10px; font-weight:700; letter-spacing:.03em; cursor:pointer; position:relative; transition:color .15s; -webkit-tap-highlight-color:transparent; touch-action:manipulation; min-height:52px; }
.mobile-nav-btn svg { transition:color .15s; }
.mobile-nav-btn.active { color:var(--action-primary); }
.mobile-nav-btn.active svg { color:var(--action-primary); }
.mobile-nav-pip { position:absolute; top:8px; right:calc(50% - 16px); width:7px; height:7px; border-radius:50%; background:var(--status-error); border:2px solid var(--surface-elevated); display:none; }
.mobile-nav-btn.has-badge .mobile-nav-pip { display:block; }

/* Skeleton shimmer */
@keyframes shimmer { 0%{background-position:-600px 0} 100%{background-position:600px 0} }
.skel { border-radius:10px; background:linear-gradient(90deg,var(--glass) 25%,var(--bone-2) 50%,var(--glass) 75%); background-size:1200px 100%; animation:shimmer 1.5s ease-in-out infinite; }
.skel-line { height:13px; margin-bottom:10px; }
.skel-line.w60 { width:60%; }
.skel-line.w40 { width:40%; }
.skel-card { height:78px; border-radius:var(--radius-md, 10px); margin-bottom:12px; }
.skel-wrap { padding:8px 0; }

/* Evidence section in Profile tab */
.evidence-subsection { margin-top:20px; }
.evidence-subsection .eyebrow { margin-bottom:6px; }

@media (max-width: 860px) {
  .auth-grid { grid-template-columns: 1fr; }
  .dash-status-grid, .profile-grid { grid-template-columns: 1fr; }
  .portal-tabs-nav { gap: 0; }
  .portal-tab { padding: 10px 14px 9px; font-size: 10px; }
}
@media (max-width: 600px) {
  .reconcile-grid { grid-template-columns: 1fr; }
  .context-table { min-width: 0; }
}
@media (max-width: 768px) {
  .portal-tabs-nav { display: none; }
  .mobile-bottom-nav { display: block; }
  .candidate-shell { padding-bottom: 84px; }
  .acct-name { display: none; }
}

/* Profile builder */
.builder-chooser { border-radius: var(--radius-lg, 14px); padding: 22px 24px; background: var(--surface-interactive); border: 1px solid var(--line); margin-bottom: 20px; }
.builder-option-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 16px 0 0; }
.builder-option-card { border: 2px solid var(--line); border-radius: var(--radius-md, 10px); padding: 18px 16px; background: var(--surface-primary); cursor: pointer; text-align: center; transition: border-color .15s, box-shadow .15s; }
.builder-option-card:hover { border-color: var(--action-primary); box-shadow: var(--shadow-sm); }
.builder-option-card.selected { border-color: var(--action-primary); background: var(--action-soft); }
.builder-option-card__icon { width: 44px; height: 44px; border-radius: var(--radius-md, 10px); background: var(--action-soft); display: grid; place-items: center; margin: 0 auto 10px; color: var(--action-primary); }
.builder-option-card h4 { margin: 0 0 4px; font-size: 14px; color: var(--text-primary); }
.builder-option-card p { margin: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.builder-method-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg, 14px); padding: 24px; background: var(--surface-primary); margin-bottom: 20px; }
.builder-steps-bar { display: flex; gap: 4px; margin-bottom: 20px; }
.builder-step-pip { flex: 1; height: 4px; border-radius: var(--radius-pill, 999px); background: var(--bone-2); transition: background .2s; }
.builder-step-pip.done { background: var(--action-primary); }
.builder-step-nav { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); align-items: center; flex-wrap: wrap; }
.builder-step-nav .step-label { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.builder-field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.builder-drop-zone { border: 2px dashed var(--border-strong); border-radius: var(--radius-md, 10px); padding: 36px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.builder-drop-zone:hover, .builder-drop-zone.drag-over { border-color: var(--action-primary); background: var(--action-soft); }
.builder-drop-zone__title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 10px 0 6px; display: block; }
.builder-drop-zone__sub { font-size: 13px; color: var(--text-muted); margin: 0; }
.builder-extracted-result { border: 1px solid var(--status-success); border-radius: var(--radius-md, 10px); padding: 18px; background: var(--status-success-soft); margin-top: 18px; }
.builder-extracted-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; gap: 12px; color: var(--text-primary); }
.builder-extracted-row:last-child { border-bottom: 0; }
.builder-extracted-row .er-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); flex-shrink: 0; padding-top: 2px; }
.builder-extracted-row .er-value { color: var(--text-primary); font-weight: 600; word-break: break-word; text-align: right; }
.builder-li-steps { margin: 16px 0; }
.builder-li-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.builder-li-step:last-child { border-bottom: 0; }
.builder-li-step__num { width: 26px; height: 26px; border-radius: 50%; background: var(--action-primary); color: var(--action-primary-ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.builder-li-step p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.builder-li-step strong { color: var(--text-primary); }
@media (max-width: 660px) { .builder-option-grid { grid-template-columns: 1fr; } .builder-field-pair { grid-template-columns: 1fr; } }

@media (max-width: 480px) {
  .dash-status-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 20px; }
}

/* Consent status pill on dashboard */
.consent-status-value.ok { color: var(--status-success); }
.consent-status-value.pending { color: var(--status-warning); }
.consent-status-value.warn { color: var(--status-error); }

/* Activity / access log */
.access-log-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.access-log-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-2); }
.access-log-item:last-child { border-bottom: none; }
.access-log-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--status-success); }
.access-log-item strong { font-weight: 600; color: var(--text-primary); font-size: 14px; }
.access-log-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* References */
.references-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.reference-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md, 10px); background: var(--surface-interactive); }
.reference-item__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.reference-item__head strong { color: var(--text-primary); overflow-wrap: break-word; min-width: 0; }
.reference-status { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: var(--radius-pill, 999px); background: var(--bone-2); color: var(--text-secondary); }
.reference-status.submitted { background: var(--status-success-soft); color: var(--status-success); }
.reference-status.pending { background: var(--status-warning-soft); color: var(--status-warning); }
.reference-status.cancelled, .reference-status.expired { background: var(--status-error-soft); color: var(--status-error); }
.reference-rating { font-size: 14px; margin: 8px 0 2px; color: var(--text-secondary); }
.reference-comment { font-size: 13px; font-style: italic; color: var(--text-muted); margin: 4px 0 0; }
.reference-cancel { margin-top: 10px; font-size: 12px; padding: 7px 14px; min-height: 0; }

/* CV detail editors */
.cv-completeness { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: var(--radius-pill, 999px); margin-left: 10px; vertical-align: middle; }
.cv-completeness.ok { background: var(--status-success-soft); color: var(--status-success); }
.cv-completeness.todo { background: var(--status-warning-soft); color: var(--status-warning); }
.cv-block { margin: 14px 0 6px; }
.cv-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cv-block-head h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--text-primary); }
.cv-optional { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.cv-add-btn { background: var(--action-soft); border: 1px solid var(--border-default); color: var(--action-secondary-ink); font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer; transition: background .15s, border-color .15s; min-height: 0; }
.cv-add-btn:hover { background: var(--bone-2); border-color: var(--border-strong); }
.cv-list { display: flex; flex-direction: column; gap: 10px; }
.cv-empty { font-size: 13px; color: var(--text-muted); font-style: italic; margin: 2px 0 4px; }
.cv-entry { position: relative; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md, 10px); background: var(--surface-interactive); }
.cv-remove { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 8px; border: none; background: var(--status-error-soft); color: var(--status-error); font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; min-height: 0; }
.cv-remove:hover { background: var(--bone-2); }
.cv-entry-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 12px; }
.cv-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cv-field > span { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.cv-field input, .cv-field textarea { width: 100%; box-sizing: border-box; }
.cv-field.cv-half { grid-column: span 2; }
.cv-field.cv-quarter { grid-column: span 1; }
.cv-field.cv-full { grid-column: span 4; }
@media (max-width: 640px) { .cv-entry-grid { grid-template-columns: repeat(2, 1fr); } .cv-field.cv-half, .cv-field.cv-full { grid-column: span 2; } .cv-field.cv-quarter { grid-column: span 1; } }

/* Secondary link styled as a button (used in portal views) */
.candidate-page a.secondary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--action-secondary-ink);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 18px;
  min-height: 42px;
  font-weight: 700;
  font-size: 14px;
  font-family: "Manrope",sans-serif;
  transition: background .18s, border-color .18s;
}
.candidate-page a.secondary:hover { background: var(--action-soft); }

/* Account view labels */
.candidate-page #view-account label { display: block; margin-bottom: 10px; }

/* Excel sandbox (spreadsheet_formula) — a read-only "live sheet" with a highlighted target cell. */
.sim-sheet-wrap { margin: 4px 0 12px; }
.sim-sheet { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.sim-sheet th, .sim-sheet td { border: 1px solid rgba(148, 163, 184, .35); padding: 5px 12px; text-align: left; min-width: 68px; white-space: nowrap; }
.sim-sheet thead th, .sim-sheet .sheet-corner, .sim-sheet .sheet-rownum { background: rgba(148, 163, 184, .16); font-weight: 700; text-align: center; opacity: .8; }
.sim-sheet .sheet-rownum { min-width: 34px; }
.sim-sheet .sheet-target { outline: 2px solid var(--aqua, #2980b9); outline-offset: -2px; background: rgba(41, 128, 185, .16); }
.sim-sheet .sheet-target-mark { color: var(--aqua, #2980b9); font-weight: 800; }
.sim-formula-label { display: block; margin: 12px 0 5px; font-size: 13px; opacity: .85; }
