/* Interview Copilot
 *
 * Design brief: this is read for one second at a time, mid-interview, while
 * someone watches your face. That single constraint drives everything below —
 * the answer is set at teleprompter scale, and every other element is
 * deliberately quieter than it would be in a normal app.
 *
 * Two signal colours, chosen so they can never be confused at a glance:
 *   amber = the tally light, you are being listened to
 *   mint  = the cue, this is the question being answered
 * Nothing else in the interface is allowed to use them.
 *
 * No webfonts on purpose: a font fetch stalling mid-interview is a real cost.
 * The personality comes from the scale jump between the sans and the mono.
 */

:root {
  --ink:    #0b0e14;   /* deep blue-black, never pure black */
  --panel:  #131823;
  --raised: #1b2231;
  --line:   #262f42;
  --paper:  #f2f0ea;   /* warm off-white: the answer, teleprompter glass */
  --dim:    #7b8699;   /* lifted from #6b7689 to clear 4.5:1 on --ink */
  --tally:  #ff7a18;   /* live */
  --cue:    #6fe3c4;   /* the question */
  --alert:  #ff6b6b;

  --placeholder: #4a5468;
  --scrim: rgba(6, 8, 12, .72);
  --tally-glow: rgba(255, 122, 24, .55);
  --tally-glow-out: rgba(255, 122, 24, 0);

  --sans: ui-sans-serif, -apple-system, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --rail: 232px;
}

/* Light theme.
 *
 * Not a straight inversion. The two signal colours have to survive the change:
 * mint and amber read fine against near-black but wash out on white, so both
 * darken until they hold contrast against paper. Everything else follows a warm
 * off-white rather than pure #fff — the teleprompter text is the one thing meant
 * to be read hard, and a pure-white field behind it is fatiguing under lights.
 *
 * data-theme is stamped on <html> before first paint, so there is no flash and
 * no need to duplicate this block for prefers-color-scheme. */
:root[data-theme="light"] {
  --ink:    #f7f6f3;
  --panel:  #ffffff;
  --raised: #efece6;
  --line:   #e0dbd2;
  --paper:  #14171d;   /* now the foreground, not the background */
  --dim:    #6a7180;
  --tally:  #b4530a;
  --cue:    #0d6e64;
  --alert:  #b42318;

  --placeholder: #9aa1ad;
  --scrim: rgba(20, 23, 29, .38);
  --tally-glow: rgba(180, 83, 10, .40);
  --tally-glow-out: rgba(180, 83, 10, 0);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cue); outline-offset: 2px; }

.hidden { display: none !important; }

/* ---------------------------------------------------------------- *
 * Sign in — the only full-bleed centred view                        *
 * ---------------------------------------------------------------- */

#authView {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.wordmark {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
}

.auth-card h1 {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -.02em;
  margin: 0 0 6px;
}

.auth-card .lede {
  color: var(--dim);
  margin: 0 0 28px;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
}

.field input::placeholder,
.field textarea::placeholder { color: var(--placeholder); }

.field .note {
  font-size: 12px;
  color: var(--dim);
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled { opacity: .45; cursor: default; }

.btn-quiet {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper);
  font-weight: 500;
}

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--cue);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-wide { width: 100%; justify-content: center; margin-top: 8px; }

.msg { font-size: 13px; margin-top: 12px; min-height: 18px; }
.msg-err { color: var(--alert); }
.msg-ok  { color: var(--cue); }

.auth-switch { margin-top: 20px; font-size: 13px; color: var(--dim); }

/* ---------------------------------------------------------------- *
 * Dashboard: nav + session grid                                     *
 *                                                                    *
 * The prep surface, deliberately calmer than the live view. Nothing  *
 * here is read under pressure, so it can afford ordinary density.    *
 * ---------------------------------------------------------------- */

#dashView {
  height: 100%;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.nav {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--cue);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex: none;
}

.brand-name { font-weight: 600; letter-spacing: -.01em; }

.nav-group > h2 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 8px;
  font-weight: 400;
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 14px;
}

.nav-item:hover { color: var(--paper); }
.nav-item.is-current { background: var(--raised); color: var(--paper); }

.nav-foot { margin-top: auto; display: grid; gap: 14px; }

.quota-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

.quota-card-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 9px;
}

.quota-card-head > span:first-child {
  font-family: var(--mono);
  font-size: 17px;
}

.quota-card-sub, .quota-card-note { font-size: 11px; color: var(--dim); }
.quota-card-note { margin-top: 7px; }

.nav-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-user { display: flex; align-items: center; gap: 10px; }

.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--raised);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}

.nav-user-text { display: grid; min-width: 0; }
.nav-user-text strong {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-user-text span { font-size: 11px; color: var(--dim); }

/* --- main dashboard --- */

.dash { padding: 32px 36px; overflow-y: auto; }

.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.dash-head h1 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.02em;
  margin: 0 0 3px;
}

.dash-head .lede { margin: 0; color: var(--dim); font-size: 14px; }

.dash-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.tab {
  padding: 9px 13px;
  border: 0;
  background: none;
  color: var(--dim);
  cursor: pointer;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover { color: var(--paper); }
.tab.is-current { color: var(--paper); border-bottom-color: var(--cue); }

.dash-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}

.dash-search {
  width: 100%;
  max-width: 380px;
  padding: 9px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
  margin-bottom: 22px;
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 14px;
}

.session-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-card .when {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}

.session-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.session-card .role { color: var(--dim); font-size: 13px; margin: 0; }

.session-card .chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

.session-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: auto;
}

.status { display: flex; align-items: center; gap: 7px; font-size: 13px; }

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
  flex: none;
}

.status[data-status="ready"]::before { background: var(--cue); }
.status[data-status="active"]::before { background: var(--tally); }

.status .cost {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
}

.btn-small { padding: 7px 13px; font-size: 13px; }

.dash-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: var(--dim);
}

/* ---------------------------------------------------------------- *
 * Session review: rail of panes + one pane at a time                *
 * ---------------------------------------------------------------- */

#reviewView {
  height: 100%;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.review-rail {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.review-rail h2 {
  margin: 0 0 3px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -.01em;
}

.review-role { margin: 0; color: var(--dim); font-size: 13px; }

.review-nav { display: grid; gap: 3px; }

.review-tab {
  text-align: left;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 14px;
}

.review-tab:hover { color: var(--paper); }

.review-tab.is-current {
  background: var(--raised);
  border-color: var(--line);
  color: var(--paper);
}

.review-rail .btn { margin-top: auto; justify-content: center; }

.review-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}

.review-head h3 { margin: 0; font-size: 17px; font-weight: 500; }
.review-head-actions { display: flex; gap: 10px; align-items: center; }

.review-body {
  padding: 26px 28px;
  overflow-y: auto;
  min-height: 0;
}

/* --- notes --- */

.notes-section { margin-bottom: 26px; max-width: 68ch; }

.notes-section > h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 10px;
  font-weight: 400;
}

.notes-summary { line-height: 1.6; margin: 0; }

.notes-qa { border-left: 2px solid var(--line); padding-left: 14px; margin-bottom: 16px; }
.notes-qa .nq { font-weight: 500; margin: 0 0 5px; }
.notes-qa .na { margin: 0; color: var(--dim); line-height: 1.55; }

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

.review-transcript { max-width: 74ch; }

.turn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--panel);
}

.turn .turn-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 7px;
}

.turn[data-kind="question"] { border-left: 2px solid var(--cue); }
.turn[data-kind="question"] .turn-label { color: var(--cue); }
.turn .turn-text { white-space: pre-wrap; line-height: 1.55; }

/* --- ask --- */

.ask-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.ask-thread { max-width: 68ch; margin-bottom: 20px; }

.ask-turn { margin-bottom: 18px; }

.ask-turn .you {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--cue);
  margin-bottom: 7px;
}

.ask-turn .reply { white-space: pre-wrap; line-height: 1.6; }

.ask-form { display: flex; gap: 10px; max-width: 68ch; }

.ask-form input {
  flex: 1;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
}

/* --- details --- */

.detail-group { margin-bottom: 24px; max-width: 60ch; }

.detail-group > h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 10px;
  font-weight: 400;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row dt { color: var(--dim); font-size: 14px; }
.detail-row dd { margin: 0; text-align: right; font-size: 14px; }

/* --- new-session sheet --- */

.sheet {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 10;
}

.sheet-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}

.sheet-card h2 { margin: 0 0 4px; font-size: 19px; font-weight: 500; }
.sheet-card .lede { margin: 0 0 18px; color: var(--dim); font-size: 13px; }

.rail-session {
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 12px;
}

.rail-session:empty { display: none; }
.rail-session .co { display: block; font-weight: 500; }
.rail-session .ro { display: block; color: var(--dim); font-size: 12px; }

/* ---------------------------------------------------------------- *
 * App shell: console rail + stage                                   *
 * ---------------------------------------------------------------- */

#appView {
  height: 100%;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
}

.rail {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
}

.rail-section > h2 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 10px;
  font-weight: 400;
}

/* --- tally light: the signature element ------------------------- */

.tally {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}

.tally-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  flex: none;
}

/* Only the live state earns amber, and only it moves. */
.tally[data-state="listening"] { color: var(--tally); }
.tally[data-state="listening"] .tally-dot {
  background: var(--tally);
  animation: breathe 1.6s ease-in-out infinite;
}
.tally[data-state="answering"] { color: var(--cue); }
.tally[data-state="answering"] .tally-dot { background: var(--cue); }

@keyframes breathe {
  0%, 100% { opacity: 1;  box-shadow: 0 0 0 0 var(--tally-glow); }
  50%      { opacity: .6; box-shadow: 0 0 0 7px var(--tally-glow-out); }
}

@media (prefers-reduced-motion: reduce) {
  .tally[data-state="listening"] .tally-dot { animation: none; }
}

.elapsed {
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: -.01em;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.source-choice { display: grid; gap: 8px; }

.source-choice label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.source-choice label:has(input:checked) {
  border-color: var(--cue);
  background: var(--raised);
}

.source-choice input { margin-top: 3px; flex: none; accent-color: var(--cue); }
.source-choice .sub { display: block; color: var(--dim); font-size: 12px; }

.toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  cursor: pointer;
}

.toggle input { accent-color: var(--cue); }

.mode-select {
  width: 100%;
  padding: 8px 10px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
  margin-bottom: 7px;
}

/* Contextual actions: available, never competing with the answer for attention. */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.actions button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
}

.actions button:hover:not(:disabled) { color: var(--paper); border-color: var(--dim); }
.actions button:disabled { opacity: .4; cursor: default; }

/* --- history --- */

.history-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
  background: var(--panel);
}

.history-item .q {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--cue);
  margin-bottom: 10px;
}

.history-item .a {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.55;
}

.history-item .when {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-top: 10px;
}

/* --- quota ------------------------------------------------------ */

.meter {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 8px;
}

.meter-fill {
  height: 100%;
  background: var(--cue);
  width: 0;
  transition: width .4s ease;
}

.meter-fill[data-low="true"] { background: var(--tally); }

.rail-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  line-height: 1.7;
}

.rail-foot { margin-top: auto; display: grid; gap: 10px; }

/* ---------------------------------------------------------------- *
 * Stage                                                             *
 * ---------------------------------------------------------------- */

.stage {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
}

.answer-pane {
  padding: 40px 48px;
  overflow-y: auto;
  min-height: 0;
}

.cue-line {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cue);
  letter-spacing: .02em;
  margin-bottom: 20px;
  max-width: 62ch;
}

.cue-line:empty { display: none; }

/* Question type. A quiet label, not a badge — it tells you which shape the
   points below are in, and then gets out of the way. */
.qtype {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 12px;
}

.qtype:empty { display: none; }

/* The beats to hit. Scanned in a glance, before the prose is read. */
.points {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  max-width: 46ch;
}

.points:empty { display: none; }

.points li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 7px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--paper);
}

.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 6px;
  height: 1px;
  background: var(--cue);
}

/* STAR beats carry their letter, so it gets typographic treatment rather than
   being swallowed into the sentence. */
.points li .star {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cue);
  letter-spacing: .08em;
  margin-right: 7px;
}

/* Teleprompter scale. This is the one thing on screen meant to be read. */
.answer {
  font-size: 27px;
  line-height: 1.45;
  letter-spacing: -.015em;
  font-weight: 400;
  max-width: 30ch;
  white-space: pre-wrap;
  color: var(--paper);
}

.answer:empty { display: none; }

/* Caret that marks live streaming, and vanishes when the answer settles. */
.answer[data-streaming="true"]::after {
  content: "";
  display: inline-block;
  width: .5ch;
  height: 1.05em;
  margin-left: .12em;
  background: var(--cue);
  vertical-align: -.15em;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .answer[data-streaming="true"]::after { animation: none; }
}

.empty-state {
  max-width: 44ch;
  color: var(--dim);
}

.empty-state strong {
  display: block;
  color: var(--paper);
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 8px;
}

.answer-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-top: 26px;
}

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

.transcript {
  border-top: 1px solid var(--line);
  background: var(--panel);
  max-height: 30vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.transcript-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}

.transcript-body {
  padding: 12px 20px 16px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--dim);
}

.transcript-body p { margin: 0 0 2px; }

/* The handoff: the detected question lifts out of the dim transcript. */
.transcript-body p.is-question {
  color: var(--cue);
  padding-left: 10px;
  border-left: 2px solid var(--cue);
}

.ask-bar {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}

.ask-bar input {
  flex: 1;
  padding: 9px 12px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ---------------------------------------------------------------- *
 * Setup view                                                        *
 * ---------------------------------------------------------------- */

.setup {
  padding: 40px 48px;
  overflow-y: auto;
  max-width: 720px;
}

.setup h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.02em;
  margin: 0 0 4px;
}

.setup .lede { color: var(--dim); margin: 0 0 28px; }

.doc-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
  background: var(--panel);
}

.doc-block h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 2px;
}

.doc-block .why { color: var(--dim); font-size: 13px; margin: 0 0 14px; }

.doc-block .optional {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-left: 8px;
}

.doc-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--raised);
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 14px;
}

.doc-current .none { color: var(--dim); }
.doc-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.file-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
}

.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---------------------------------------------------------------- *
 * Overlay chrome — only present inside the desktop shell            *
 *                                                                    *
 * The Tauri window is frameless and skips the Dock, so without this  *
 * bar there is no way to move it or shut it. It is the title bar,    *
 * so it must stay draggable and must never scroll away.             *
 * ---------------------------------------------------------------- */

.tauri-chrome {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  cursor: grab;
  user-select: none;
}

.tauri-chrome:active { cursor: grabbing; }

.tauri-chrome .tc-name {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.tauri-chrome .tc-hint {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  margin-left: auto;
}

.tauri-chrome button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
}

.tauri-chrome button:hover { color: var(--paper); border-color: var(--dim); }

/* The shell is a narrow column; give the dense views room to breathe. */
body[data-shell="tauri"] .answer { font-size: 22px; max-width: none; }
body[data-shell="tauri"] .answer-pane { padding: 20px 22px; }

/* ---------------------------------------------------------------- *
 * Narrow screens                                                    *
 * ---------------------------------------------------------------- */

@media (max-width: 860px) {
  #dashView { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }
  .nav-group { display: flex; align-items: center; gap: 4px; }
  .nav-group > h2 { display: none; }
  .nav-foot { margin-top: 0; grid-auto-flow: column; align-items: center; }
  .quota-card { display: none; }
  .dash { padding: 20px 16px; }

  #reviewView { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .review-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    gap: 12px;
  }
  .review-nav { grid-auto-flow: column; overflow-x: auto; }
  .review-rail .btn { margin-top: 0; }
  .review-body, .review-head { padding-left: 16px; padding-right: 16px; }

  #appView { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
  }
  .rail-section > h2 { display: none; }
  .rail-foot { margin-top: 0; grid-auto-flow: column; }
  .elapsed { font-size: 18px; margin-top: 0; }
  .answer-pane, .setup { padding: 24px 20px; }
  .answer { font-size: 22px; max-width: none; }
  .source-choice { grid-auto-flow: column; }
}

/* --- create-session form --- */

.segmented {
  display: grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.seg {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 13.5px;
  padding: 7px 10px;
  cursor: pointer;
}

.seg.is-current { background: var(--panel); color: var(--paper); font-weight: 600; }

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.context-row { display: flex; flex-wrap: wrap; gap: 8px; }

.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12.5px;
  color: var(--dim);
}

.context-pill[data-on="true"] { border-color: var(--cue); color: var(--paper); }
.context-pill input { accent-color: var(--cue); }

@media (max-width: 560px) { .field-pair { grid-template-columns: 1fr; } }

/* --- document library --- */

.lib-kinds { display: flex; gap: 8px; margin-bottom: 14px; }

.doc-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-card[data-active="true"] { border-color: var(--cue); }

.doc-card .when {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}

.doc-card h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 500;
  word-break: break-word;
}

.doc-card .chips { display: flex; gap: 6px; flex-wrap: wrap; }

.doc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: auto;
}

.chip-active {
  border-color: var(--cue);
  color: var(--cue);
}

/* ---------- Session detail + transcript ---------- */
.sheet-wide { max-width: 780px; width: 92vw; }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-sub { color: var(--muted, #6b7280); font-size: 13px; margin-top: 4px; }

.detail-tabs { display: flex; gap: 6px; margin: 18px 0 14px; }

/* Conversation — speaker-separated, chronological, scrollable. */
.convo { max-height: 58vh; overflow-y: auto; padding-right: 6px; }
.convo-empty { color: var(--muted, #6b7280); font-size: 14px; padding: 24px 0; }

.turn { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.turn:last-child { border-bottom: 0; }
.turn .who { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.turn.interviewer .who { color: #2563eb; }
.turn.candidate  .who { color: #059669; }
.turn .body { font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; }
.turn .at { display: block; font-size: 11px; color: var(--muted, #9ca3af); margin-top: 4px; font-weight: 500; letter-spacing: 0; }

/* Details — label/value pairs. */
.detail-grid { display: grid; grid-template-columns: 190px 1fr; gap: 10px 18px; margin: 0; }
.detail-grid dt { font-size: 12.5px; color: var(--muted, #6b7280); }
.detail-grid dd { margin: 0; font-size: 14px; }
.detail-grid dd.mono { font-variant-numeric: tabular-nums; }
.detail-grid dd .pill-none { color: var(--muted, #9ca3af); }

.card-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Billing choice on Create Session ---------- */
.billing-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.bill-opt {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; text-align: left; cursor: pointer;
  border: 1.5px solid rgba(0,0,0,.12); border-radius: 12px;
  background: transparent; font: inherit; color: inherit;
  transition: border-color 120ms ease, background 120ms ease;
}
.bill-opt:hover:not([disabled]) { border-color: rgba(0,0,0,.28); }
.bill-opt.is-current { border-color: #0f766e; background: rgba(15,118,110,.06); }
.bill-opt[disabled] { opacity: .5; cursor: not-allowed; }

.bill-title { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.bill-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; background: #0f766e; color: #fff;
}
.bill-line { font-size: 13px; }
.bill-sub  { font-size: 12px; color: var(--muted, #6b7280); }

.chip-billing { font-weight: 700; letter-spacing: .04em; }
.chip-billing[data-kind="paid"]  { background: #0f766e; color: #fff; border-color: #0f766e; }
.chip-billing[data-kind="trial"] { background: rgba(0,0,0,.06); }

/* ---------- Account strip ---------- */
.account-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin: 18px 0 6px;
}
.acct {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px; border-radius: 12px;
  border: 1px solid rgba(0,0,0,.09); background: rgba(0,0,0,.02);
}
.acct-label { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted, #6b7280); }
.acct-value { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.acct-sub   { font-size: 12px; color: var(--muted, #6b7280); }
@media (max-width: 720px) { .account-strip { grid-template-columns: 1fr; } .billing-choice { grid-template-columns: 1fr; } }

/* ---------- Admin ---------- */
.admin-table-wrap { overflow-x: auto; margin-bottom: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted, #6b7280); padding: 8px 12px; border-bottom: 1px solid rgba(0,0,0,.1);
  white-space: nowrap;
}
.admin-table td { padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,.06); vertical-align: middle; }
.admin-table tbody tr:hover { background: rgba(0,0,0,.02); }
.admin-table .num { font-variant-numeric: tabular-nums; }
.admin-table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.credit-form { display: grid; grid-template-columns: 130px 110px 1fr auto; gap: 8px; align-items: center; }
.ledger-head { font-size: 13px; margin: 22px 0 8px; }

.tx-amt.pos { color: #0f766e; font-weight: 650; }
.tx-amt.neg { color: #b91c1c; font-weight: 650; }

@media (max-width: 860px) { .credit-form { grid-template-columns: 1fr; } }
