:root {
  --ink: #16181d;
  --ink-soft: #6b7280;
  --line: #e5e7eb;
  --bg: #f7f8fa;
  --card: #ffffff;
  --brand: #0d9488;
  --brand-dark: #0f766e;
  --green: #d1fae5;
  --green-dark: #047857;
  --amber: #b45309;
  --danger: #dc2626;
  --sidebar-bg: #0f1c1b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
code { background: #f1f1f4; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

/* ---------- Public site ---------- */
body.pub { background: #fff; }
.pub-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 48px; border-bottom: 1px solid var(--line); }
.pub-brand { font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.brand-mark { background: var(--brand); color: #fff; width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.pub-nav { display: flex; align-items: center; gap: 28px; font-weight: 600; font-size: 14.5px; }
.btn-primary { background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 8px; }
.hero { text-align: center; padding: 100px 24px 70px; max-width: 800px; margin: 0 auto; }
.eyebrow { color: var(--brand-dark); font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.hero h1 { font-size: 46px; line-height: 1.15; margin: 0 0 18px; letter-spacing: -0.02em; }
.hero .sub { font-size: 18px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; }
.btn { display: inline-block; padding: 12px 22px; border-radius: 9px; font-weight: 700; font-size: 15px; cursor: pointer; border: none; }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn-block { width: 100%; text-align: center; }
.btn-danger { background: #fee2e2; color: var(--danger); }
.section { max-width: 1100px; margin: 0 auto; padding: 70px 24px; }
.section h2 { font-size: 32px; text-align: center; margin-bottom: 10px; letter-spacing: -0.01em; }
.lede { text-align: center; color: var(--ink-soft); font-size: 16px; margin-bottom: 46px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card { border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.feature-card .icon { font-size: 26px; margin-bottom: 10px; }
.feature-card h3 { margin: 0 0 8px; font-size: 17px; }
.feature-card p { margin: 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }
.pub-footer { text-align: center; padding: 40px 24px; color: var(--ink-soft); font-size: 13.5px; border-top: 1px solid var(--line); }

/* ---------- Auth ---------- */
.auth-wrap, .onboard-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.auth-card { background: var(--card); border-radius: 16px; padding: 40px; width: 420px; box-shadow: 0 4px 24px rgba(0,0,0,0.06); }
.auth-card h1 { margin: 0 0 6px; font-size: 24px; }
.auth-card .sub { color: var(--ink-soft); margin: 0 0 24px; font-size: 14.5px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--ink-soft); }
.auth-alt a { color: var(--brand-dark); font-weight: 600; }
.error-box { background: #fee2e2; color: var(--danger); padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 14.5px; font-family: inherit; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--sidebar-bg); color: #e5e7eb; display: flex; flex-direction: column; padding: 22px 16px; flex-shrink: 0; }
.brand { font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 8px; padding: 0 8px 20px; }
.store-name { padding: 10px 8px 18px; font-weight: 700; font-size: 14px; border-bottom: 1px solid #24312f; margin-bottom: 14px; }
.plan-sub { font-weight: 400; color: #8fa39e; font-size: 12px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side-nav a { padding: 10px 12px; border-radius: 8px; font-size: 14.5px; font-weight: 600; color: #c4d1cd; display: flex; align-items: center; gap: 10px; }
.side-nav a.active, .side-nav a:hover { background: #172b2880; color: #fff; }
.nav-icon { font-size: 15px; width: 18px; text-align: center; }
.sidebar-footer { border-top: 1px solid #24312f; padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-mode-pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; width: fit-content; }
.ai-mode-pill.live { background: #05372a; color: #34d399; }
.ai-mode-pill.test { background: #3a2e05; color: #fbbf24; }
.link-btn { background: none; border: none; color: #8fa39e; font-size: 13.5px; cursor: pointer; padding: 0; font-weight: 600; }
.link-btn:hover { color: #fff; }
.main-pane { flex: 1; padding: 32px 40px; max-width: 1240px; }
.flash { background: var(--green); color: var(--green-dark); padding: 10px 16px; border-radius: 8px; margin-bottom: 20px; font-weight: 600; font-size: 14px; }
.flash.danger { background: #fee2e2; color: var(--danger); }

.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; gap: 20px; }
.page-header h1 { margin: 0 0 4px; font-size: 26px; }
.page-header p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.stat-card .label { color: var(--ink-soft); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.stat-card .value { font-size: 26px; font-weight: 800; }
.stat-card .value.green { color: var(--green-dark); }
.stat-card .value.danger { color: var(--danger); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin-bottom: 20px; }
.card h2 { margin: 0 0 6px; font-size: 17px; }
.card h2.no-margin { margin: 0; }
.card-sub { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 16px; }
.empty-state { color: var(--ink-soft); font-size: 14px; padding: 30px 10px; text-align: center; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); padding: 12px 20px; border-bottom: 1px solid var(--line); }
td { padding: 14px 20px; border-bottom: 1px solid #f1f1f4; font-size: 14px; }
tr:last-child td { border-bottom: none; }
tr.row-link { cursor: pointer; }
tr.row-link:hover { background: #fafafb; }
.table-scroll { overflow-x: auto; }

.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: capitalize; background: #eef2ff; color: #4338ca; }
.pill.completed, .pill.done, .pill.active, .pill.open { background: var(--green); color: var(--green-dark); }
.pill.failed, .pill.closed { background: #fee2e2; color: var(--danger); }
.pill.running, .pill.draft { background: #fef3c7; color: var(--amber); }

.btn.btn-sm { padding: 7px 14px; font-size: 13px; }
.icon-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; color: var(--ink-soft); }
.icon-btn:hover { background: #f4f4f6; }
.icon-btn.danger { color: var(--danger); }
.add-btn { background: none; border: 1.5px dashed var(--line); border-radius: 8px; padding: 10px; width: 100%; font-weight: 700; font-size: 13.5px; color: var(--brand-dark); cursor: pointer; margin-top: 4px; }

.engine-badge { font-size: 10.5px; font-weight: 800; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.engine-badge.mock, .engine-badge.rules, .engine-badge.local { background: #fef3c7; color: var(--amber); }
.engine-badge.gemini, .engine-badge.claude { background: var(--green); color: var(--green-dark); }
.engine-badge.error { background: #fee2e2; color: var(--danger); }

@media (max-width: 900px) {
  .feature-grid, .stat-grid, .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; }
}

/* ---------- API docs ---------- */
.doc-wrap { max-width: 860px; margin: 0 auto; padding: 60px 24px 100px; }
.doc-wrap h1 { font-size: 34px; margin: 0 0 8px; letter-spacing: -0.01em; }
.doc-wrap .sub { color: var(--ink-soft); font-size: 16px; margin: 0 0 40px; }
.doc-group { margin-bottom: 40px; }
.doc-group h2 { font-size: 20px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; }
.doc-group-note { color: var(--ink-soft); font-size: 13.5px; line-height: 1.6; margin: 0 0 18px; }
.doc-endpoint { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.doc-endpoint p { font-size: 14px; color: var(--ink); margin: 0 0 14px; }
.doc-endpoint-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.doc-method { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 6px; letter-spacing: 0.03em; }
.doc-method-get { background: var(--green); color: var(--green-dark); }
.doc-method-post { background: #eef2ff; color: #4338ca; }
.doc-path { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; font-weight: 700; }
.doc-block { margin-bottom: 10px; }
.doc-block:last-child { margin-bottom: 0; }
.doc-block-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); margin-bottom: 4px; }
.doc-block pre { background: #0f1117; color: #d8dae2; border-radius: 8px; padding: 12px 14px; font-size: 12.5px; line-height: 1.6; overflow-x: auto; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ==================== Sift-specific ==================== */

/* Score badges (explainable scoring) */
.score-badge { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.score-num { font-weight: 800; font-size: 15px; }
.score-label { font-size: 10px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.score-pill { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.score-great, .score-great .score-pill { background: var(--green); color: var(--green-dark); }
.score-good, .score-good .score-pill { background: #ecfeff; color: #0e7490; }
.score-fair, .score-fair .score-pill { background: #fef3c7; color: var(--amber); }
.score-poor, .score-poor .score-pill { background: #fee2e2; color: var(--danger); }
.score-breakdown { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 14px 0; }
.score-breakdown-item { text-align: center; background: #fafafb; border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; }
.score-breakdown-item .sb-value { font-weight: 800; font-size: 17px; }
.score-breakdown-item .sb-label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; margin-top: 2px; }
.score-reasons { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.score-reasons li { font-size: 13.5px; padding-left: 22px; position: relative; line-height: 1.5; }
.score-reasons li.pass::before { content: '✓'; position: absolute; left: 0; color: var(--green-dark); font-weight: 800; }
.score-reasons li.fail::before { content: '✗'; position: absolute; left: 0; color: var(--danger); font-weight: 800; }
.knockout-banner { background: #fee2e2; color: var(--danger); border-radius: 10px; padding: 12px 16px; font-size: 13.5px; font-weight: 700; margin-bottom: 14px; }
.fairness-banner { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-top: 14px; line-height: 1.55; }
.fairness-banner ul { margin: 6px 0 0; padding-left: 18px; }

/* Candidate cards / rows */
.candidate-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid #f1f1f4; }
.candidate-row:last-child { border-bottom: none; }
.avatar-circle { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex-shrink: 0; }
.candidate-main { flex: 1; min-width: 0; }
.candidate-name { font-weight: 700; font-size: 14.5px; }
.candidate-meta { color: var(--ink-soft); font-size: 12.5px; margin-top: 2px; }
.skill-chip { display: inline-block; background: #f0fdfa; color: var(--brand-dark); font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin: 2px 4px 2px 0; }
.skill-chip.missing { background: #fef2f2; color: var(--danger); text-decoration: line-through; opacity: 0.7; }
.tag-chip { display: inline-block; background: #eef2ff; color: #4338ca; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-right: 4px; }

/* Upload dropzone */
.dropzone { border: 2px dashed var(--line); border-radius: 14px; padding: 40px 24px; text-align: center; background: #fafafb; }
.dropzone .dz-icon { font-size: 32px; margin-bottom: 10px; }
.dropzone p { color: var(--ink-soft); font-size: 13.5px; margin: 6px 0 0; }
.upload-result-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.upload-result-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
.upload-result-item.warn { border-color: #fde68a; background: #fffbeb; }

/* Kanban pipeline */
.kanban-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: #f4f4f7; border-radius: 12px; padding: 12px; min-height: 200px; }
.kanban-col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 12px; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink-soft); }
.kanban-col-head .count { background: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }
.app-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; font-size: 13.5px; cursor: grab; }
.app-card.dragging { opacity: 0.4; }
.app-card .ac-name { font-weight: 700; margin-bottom: 4px; }
.app-card .ac-score { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.app-card .ac-move { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.app-card .ac-move button { font-size: 10.5px; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-soft); }
.app-card .ac-move button:hover { background: #f4f4f6; color: var(--ink); }
.kanban-col.drag-over { outline: 2px dashed var(--brand); outline-offset: -4px; }
.stage-pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.stage-neutral { background: #f1f1f4; color: var(--ink-soft); }
.stage-info { background: #eef2ff; color: #4338ca; }
.stage-active { background: #fef3c7; color: var(--amber); }
.stage-warn { background: #ffedd5; color: #c2410c; }
.stage-success { background: var(--green); color: var(--green-dark); }
.stage-danger { background: #fee2e2; color: var(--danger); }

/* Match / comparison */
.match-list { display: flex; flex-direction: column; gap: 10px; }
.match-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.match-rank { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rediscovery-banner { background: #f0fdfa; border: 1px solid #99f6e4; color: #134e4a; border-radius: 12px; padding: 16px 20px; font-size: 14px; margin-bottom: 20px; display: flex; gap: 12px; align-items: center; }
.rediscovery-banner .rb-icon { font-size: 22px; }
.compare-table th, .compare-table td { text-align: center; }
.compare-table td:first-child, .compare-table th:first-child { text-align: left; }
.compare-winner { background: #f0fdfa; }

/* Interview / questions */
.question-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; }
.question-card .q-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.question-card .q-text { font-weight: 700; font-size: 14.5px; flex: 1; }
.question-card .q-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.question-card .q-detail { font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin-top: 6px; }
.difficulty-easy { background: var(--green); color: var(--green-dark); }
.difficulty-medium { background: #fef3c7; color: var(--amber); }
.difficulty-hard { background: #fee2e2; color: var(--danger); }

/* Chat (copilot) */
.chat-pane { background: var(--card); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; height: 620px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 75%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.bubble.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: #f1f1f4; border-bottom-left-radius: 4px; }
.chat-input-row { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.chat-input-row input { flex: 1; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: 14px; text-align: center; padding: 20px; }
.copilot-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.copilot-suggestions button { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 12.5px; cursor: pointer; color: var(--ink-soft); font-weight: 600; }
.copilot-suggestions button:hover { border-color: var(--brand); color: var(--brand-dark); }

/* Notes / activity timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { padding: 12px 0; border-top: 1px solid #f1f1f4; display: flex; gap: 10px; }
.timeline-item:first-child { border-top: none; }
.timeline-item .ti-icon { font-size: 15px; margin-top: 1px; }
.timeline-item .ti-body { flex: 1; font-size: 13.5px; white-space: pre-wrap; line-height: 1.55; }
.timeline-item .ti-meta { color: var(--ink-soft); font-size: 11.5px; margin-top: 4px; }

/* Message drafts */
.message-draft { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 10px; padding: 14px; font-size: 13.5px; line-height: 1.6; color: #134e4a; white-space: pre-wrap; }
.message-draft .md-actions { margin-top: 10px; display: flex; gap: 8px; }

/* Portal */
.portal-shell { max-width: 760px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.portal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.portal-tag { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-left: 8px; }
.portal-main { flex: 1; padding: 32px 0 60px; }
.status-tracker { display: flex; gap: 6px; margin: 16px 0 24px; }
.status-tracker .st-step { flex: 1; text-align: center; }
.status-tracker .st-bar { height: 6px; border-radius: 999px; background: var(--line); margin-bottom: 6px; }
.status-tracker .st-step.done .st-bar { background: var(--brand); }
.status-tracker .st-step.current .st-bar { background: var(--amber); }
.status-tracker .st-label { font-size: 11px; color: var(--ink-soft); }

/* Analytics */
.metric-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 10px 0; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar-chart .bar { width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 3px; }
.bar-chart .bar-label { font-size: 11px; color: var(--ink-soft); }
.bar-chart .bar-value { font-size: 11px; font-weight: 700; }

@media (max-width: 900px) {
  .score-breakdown, .metric-row { grid-template-columns: repeat(3, 1fr); }
}
