/* Otto Hire.
   Palette borrowed from apoorav.online so the whole estate looks like one
   company: warm paper ground, ink text, terracotta accent. Two surfaces with
   genuinely different jobs, so they get different densities:

   - The recruiter dashboard is information-dense. Small type, tight rows,
     tables that show twenty candidates without scrolling.
   - The candidate pages are the opposite: large type, one thing per screen,
     44px targets, designed at 360px first. Someone is doing this on a phone,
     on mobile data, possibly nervous.
*/

:root {
  --bg: #ede5d2;
  --surface: #fffdf9;
  --surface-2: #f7f2e7;
  --line: #e2d9c6;
  --line-strong: #cfc3a9;
  --text: #1c1410;
  --muted: #6f6555;
  --faint: #978d7b;
  --accent: #be5c33;
  --accent-dark: #9c4726;
  --accent-soft: #f6e6dd;
  --strong: #2f7d5c;
  --strong-soft: #e2f0e9;
  --ok: #6b7f2f;
  --ok-soft: #eef1e0;
  --weak: #b8791f;
  --weak-soft: #f8eeda;
  --poor: #a63a2c;
  --poor-soft: #f8e3df;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(28, 20, 16, .06), 0 8px 24px -12px rgba(28, 20, 16, .18);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f;
    --surface: #201a15;
    --surface-2: #29211b;
    --line: #362c24;
    --line-strong: #4b3e33;
    --text: #f2ece2;
    --muted: #a99c8c;
    --faint: #7e7365;
    --accent: #e07a4f;
    --accent-dark: #c9613a;
    --accent-soft: #38251c;
    --strong: #58b98d;
    --strong-soft: #1d3129;
    --ok: #a4bb5c;
    --ok-soft: #2a2f1c;
    --weak: #dfa451;
    --weak-soft: #35291a;
    --poor: #e07a6b;
    --poor-soft: #38221f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 1em; }
small { font-size: 12px; }

/* ---------- app shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 208px;
  flex: 0 0 208px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15px; letter-spacing: -.02em;
  padding: 0 8px 18px; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--muted); font-weight: 500; font-size: 13.5px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.nav-group { margin-top: 16px; padding: 0 10px 6px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--faint); font-weight: 600; }

.sidebar-foot { margin-top: auto; padding: 16px 8px 0; font-size: 12px; color: var(--faint); }

.main { flex: 1; min-width: 0; padding: 22px 28px 64px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 2px 0 0; }

/* ---------- cards, tables ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
}
.card.tight { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

.stat { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 26px; font-weight: 680; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--faint); padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
  position: sticky; top: 0; z-index: 1;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; font-size: 15px; }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; font-size: 13.5px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--poor); border-color: var(--line-strong); }
.btn.danger:hover { background: var(--poor-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted);
  margin-bottom: 5px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 500;
  color: var(--text); font-size: 13.5px; margin: 0; cursor: pointer; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 13.5px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 9px;
}
textarea { line-height: 1.55; resize: vertical; min-height: 76px; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--faint); margin-top: 5px; font-weight: 400; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* ---------- chips, scores ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.chip.strong { background: var(--strong-soft); color: var(--strong); border-color: transparent; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.weak { background: var(--weak-soft); color: var(--weak); border-color: transparent; }
.chip.poor, .chip.gate { background: var(--poor-soft); color: var(--poor); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent-dark); border-color: transparent; }

.score {
  display: inline-grid; place-items: center; min-width: 44px; height: 30px;
  padding: 0 9px; border-radius: 9px; font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--faint);
}
.score.strong { background: var(--strong-soft); color: var(--strong); }
.score.ok { background: var(--ok-soft); color: var(--ok); }
.score.weak { background: var(--weak-soft); color: var(--weak); }
.score.poor { background: var(--poor-soft); color: var(--poor); }
.score.big { min-width: 84px; height: 64px; font-size: 30px; border-radius: var(--radius); }

.bar { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.bar.strong > i { background: var(--strong); }
.bar.ok > i { background: var(--ok); }
.bar.weak > i { background: var(--weak); }
.bar.poor > i { background: var(--poor); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  background: var(--accent-soft); color: var(--accent-dark);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
}
.person { display: flex; align-items: center; gap: 9px; }
.person .n { font-weight: 600; }
.person .e { color: var(--faint); font-size: 12px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.inline-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.notice {
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px;
}
.notice.warn { background: var(--weak-soft); border-color: transparent; color: var(--weak); }
.notice.bad { background: var(--poor-soft); border-color: transparent; color: var(--poor); }
.notice.good { background: var(--strong-soft); border-color: transparent; color: var(--strong); }

/* ---------- pipeline board ---------- */

.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.column { flex: 0 0 264px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; }
.column h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); display: flex; justify-content: space-between; }
.column.drop { outline: 2px dashed var(--accent); outline-offset: -3px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 11px; margin-bottom: 8px; cursor: grab; }
.pcard:active { cursor: grabbing; }
.pcard .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }

/* ---------- transcript ---------- */

.transcript { max-height: 560px; overflow-y: auto; padding-right: 6px; }
.turn { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.turn:last-child { border-bottom: none; }
.turn .who { flex: 0 0 78px; font-size: 11.5px; font-weight: 650; color: var(--faint);
  text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.turn.agent .who { color: var(--accent); }
.turn .what { flex: 1; min-width: 0; }
.turn .at { font-family: var(--mono); font-size: 11px; color: var(--faint); cursor: pointer; }
.turn .at:hover { color: var(--accent); }

.evidence { border-left: 2px solid var(--line-strong); padding-left: 10px; margin: 6px 0;
  color: var(--muted); font-style: italic; font-size: 12.5px; }

/* ---------- candidate-facing ---------- */

.public {
  max-width: 640px; margin: 0 auto; padding: 28px 20px 72px;
  font-size: 16px; line-height: 1.6;
}
.public h1 { font-size: 27px; }
.public .lede { font-size: 17px; color: var(--muted); }
.public .card { padding: 22px; }
.public .btn { padding: 14px 22px; font-size: 16px; border-radius: 11px; min-height: 48px; }
.public input, .public select, .public textarea { font-size: 16px; padding: 12px 13px;
  min-height: 46px; border-radius: 11px; }
.public label { font-size: 14px; }
.jd { line-height: 1.65; }
.jd h2 { font-size: 18px; margin-top: 26px; }
.jd ul, .jd ol { padding-left: 20px; }
.jd li { margin-bottom: 6px; }

.checklist { list-style: none; padding: 0; margin: 0 0 20px; }
.checklist li { display: flex; gap: 11px; padding: 9px 0; align-items: flex-start;
  border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: none; }
.checklist .tick { flex: 0 0 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }

/* ---------- interview room ---------- */

.room {
  min-height: 100dvh; display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto; padding: 14px 16px 22px;
}
.room-head { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.room-head .role { font-weight: 650; font-size: 15px; }
.timer { font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums;
  color: var(--muted); }
.timer.low { color: var(--poor); font-weight: 700; }

.stage-area { flex: 1; display: flex; flex-direction: column; justify-content: center;
  gap: 18px; padding: 22px 0; text-align: center; }

.orb {
  width: 108px; height: 108px; border-radius: 50%; margin: 0 auto;
  background: radial-gradient(circle at 35% 30%, var(--accent), var(--accent-dark));
  display: grid; place-items: center; color: #fff; font-size: 30px;
  transition: transform .2s;
}
.orb.speaking { animation: pulse 1.4s ease-in-out infinite; }
.orb.listening { background: radial-gradient(circle at 35% 30%, var(--strong), #1f5a41); }
.orb.thinking { opacity: .65; }
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(190, 92, 51, .35); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 18px rgba(190, 92, 51, 0); }
}

.say { font-size: 18px; line-height: 1.55; min-height: 3em; }
.state { font-size: 13.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; font-weight: 600; }

.meter { height: 6px; border-radius: 3px; background: var(--surface-2);
  overflow: hidden; max-width: 220px; margin: 0 auto; width: 100%; }
.meter > i { display: block; height: 100%; width: 0; background: var(--strong);
  transition: width .08s linear; }

.room-actions { display: flex; flex-direction: column; gap: 10px; padding-top: 14px;
  border-top: 1px solid var(--line); }
.big-btn {
  width: 100%; min-height: 62px; border-radius: 14px; font-size: 17px; font-weight: 650;
  border: none; background: var(--accent); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.big-btn:disabled { background: var(--surface-2); color: var(--faint); cursor: not-allowed; }
.big-btn.recording { background: var(--poor); }

.selfie {
  position: fixed; right: 12px; bottom: 12px; width: 92px; height: 122px;
  border-radius: 12px; object-fit: cover; background: #000;
  border: 2px solid var(--surface); box-shadow: var(--shadow); z-index: 5;
  transform: scaleX(-1);
}

.live-transcript { max-height: 34vh; overflow-y: auto; text-align: left;
  font-size: 14.5px; color: var(--muted); }
.live-transcript .me { color: var(--text); }

.progress-dots { display: flex; gap: 5px; justify-content: center; }
.progress-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.progress-dots i.done { background: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3, .grid.side { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; flex: none; height: auto; position: static;
    border-right: none; border-bottom: 1px solid var(--line); padding: 12px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .nav-group, .sidebar-foot { display: none; }
  .main { padding: 16px 14px 56px; }
  .grid.c2, .grid.c4 { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 19px; }
}

@media print {
  .sidebar, .btn, .room-actions { display: none !important; }
  .main { padding: 0; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* ---------- sub-tabs ---------- */

.tabs {
  display: flex; gap: 2px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.tabs a {
  padding: 9px 14px; color: var(--muted); font-weight: 550; font-size: 13.5px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent-dark); border-bottom-color: var(--accent); }
.tabs a span {
  display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 999px;
  background: var(--surface-2); font-size: 11.5px; font-weight: 650; color: var(--faint);
}
.tabs a.on span { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- interview start gate ---------- */

/* The room is reached by a redirect, so the document has no user activation
   and browsers refuse to play audio. This gate exists to collect one tap
   before the first question is spoken. */
.gate {
  position: fixed; inset: 0; z-index: 20; background: var(--bg);
  display: grid; place-items: center; padding: 24px;
}
.gate-inner { max-width: 420px; text-align: center; }
.gate-inner h1 { font-size: 23px; margin-top: 18px; }
.gate-inner .lede { color: var(--muted); font-size: 16px; }
.gate-inner p { font-size: 16px; line-height: 1.6; }
.gate-inner .orb { margin: 0 auto; }
.gate-inner .big-btn { margin-top: 8px; }

/* ---------- device sheet ---------- */

.sheet {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(28, 20, 16, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-inner {
  background: var(--surface); width: 100%; max-width: 480px;
  border-radius: 18px 18px 0 0; padding: 20px 20px 28px;
  max-height: 86vh; overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(28, 20, 16, .25);
}
.sheet-inner select { font-size: 16px; min-height: 46px; }
@media (min-width: 560px) {
  .sheet { align-items: center; }
  .sheet-inner { border-radius: 18px; }
}

.rec-time {
  font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.rec-time.low { color: var(--poor); font-weight: 700; }

.timer { font-size: 20px; font-weight: 650; }
