﻿:root {
  color-scheme: light;
  --ink: #1a2229;
  --muted: #5c6b70;
  --line: #dce4e1;
  --surface: #ffffff;
  --panel: #f4f7f6;
  --ground: #eef2f0;
  --green: #176c5f;
  --green-dark: #0e5148;
  --tint: rgba(23, 108, 95, 0.08);
  --gold: #b06d14;
  --red: #bd3f2f;
  --blue: #2f66b3;
  --shadow: 0 14px 40px rgba(10, 30, 25, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  /* Green-tinted grey ground: white cards get figure/ground contrast from
     the surface behind them, not from borders alone. */
  background: var(--ground);
}

/* Headings and the brand mark carry the display face; body stays on the
   zero-cost system stack (the Google Fonts link degrades gracefully). */
h1, h2, h3, .logo-mark {
  font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  letter-spacing: -0.015em;
}

.brand h1 {
  font-size: 27px;
  font-weight: 800;
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 32px auto;
}

.setup-shell {
  display: grid;
  min-height: calc(100vh - 64px);
  align-items: center;
  /* Single-column setup since the preview panel retired into a summary line. */
  width: min(780px, calc(100vw - 32px));
}

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

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.interview-shell {
  min-height: calc(100vh - 64px);
}

.setup-page,
.interview-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  /* Grid items default to min-width:auto, so one long nowrap string (a
     saved question) would inflate the whole card past its track instead
     of letting text-overflow do its job. */
  min-width: 0;
  max-width: 100%;
}

.setup-page {
  padding: 30px;
}

.interview-page {
  display: grid;
  gap: 20px;
  padding: 28px;
}

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

.setup-brand {
  margin-bottom: 28px;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #ffffff;
  background: var(--green);
  border-radius: 8px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--green);
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

/* Login-lite account chip (top-right of each page header; account.js). */
.account-mount {
  margin-left: auto;
  position: relative;
}

.account-chip {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
}

.account-chip:hover {
  border-color: var(--green);
}

.account-chip-paid {
  border-color: var(--green);
  color: var(--green-dark);
  background: rgba(23, 108, 95, 0.08);
}

/* display:grid below would defeat the hidden attribute's UA display:none,
   so hidden must win explicitly - the popover opens only from the chip. */
.account-pop[hidden] {
  display: none;
}

.account-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: 270px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  text-align: left;
}

.account-pop label {
  font-size: 13px;
  font-weight: 750;
}

.account-pop input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 10px;
  font: inherit;
}

.account-pop-row {
  display: flex;
  gap: 8px;
}

.account-pop-row button {
  min-height: 38px;
  flex: 1;
}

.account-pop .muted-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* Entry to the mock interview: the setup page is the app's front door,
   and before this banner the mock lived only behind a typed URL. */
.mock-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 18px 24px;
  border-radius: 12px;
  background: var(--green);
  text-decoration: none;
}

.mock-banner:hover {
  background: var(--green-dark);
}

.mock-banner .eyebrow {
  color: #ffffff;
}

.mock-banner-text {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

.mock-banner .secondary-action {
  background: #ffffff;
  color: var(--green-dark);
}

.mock-banner:hover .secondary-action {
  background: #ffffff;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(300px, 440px) minmax(280px, 1fr);
  gap: 24px;
}

.setup-card,
.preview-panel,
.timer-strip,
.question-card,
.evaluation {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.setup-card,
.preview-panel {
  padding: 24px;
}

.section-heading {
  margin-bottom: 22px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

label {
  font-size: 13px;
  font-weight: 750;
  color: #344149;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

select,
input {
  height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 210px;
  padding: 13px;
  line-height: 1.5;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 108, 95, 0.12);
}

.segmented {
  display: grid;
  /* One equal column per visible track button: two-track installs get
     1fr 1fr as before, and the optional Real Qs track joins the row
     instead of wrapping onto its own. */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f1;
}

.segment {
  height: 36px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.segment.active {
  color: #ffffff;
  background: var(--green);
}

.primary-action,
.secondary-action,
.ghost-action,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.primary-action,
.secondary-action {
  border: 0;
  color: #ffffff;
  background: var(--green);
}

/* One primary per view, sized to its label - full-width primaries made
   every action carry the same visual weight. */
.primary-action {
  width: auto;
  min-width: 170px;
  padding: 0 22px;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.setup-summary {
  margin: 0 0 0 auto;
  font-size: 13.5px;
  color: var(--muted);
}

.setup-summary b {
  color: var(--ink);
}

/* Grouped form sections: dividers inside one card, never nested boxes. */
.form-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 20px;
}

.form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.form-section > h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
}

.form-section .section-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin: -8px 0 12px;
}

.advanced-box {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 14px;
}

.advanced-box summary {
  cursor: pointer;
  font-weight: 750;
  font-size: 14px;
  color: var(--muted);
}

.advanced-box summary:hover {
  color: var(--ink);
}

.advanced-box[open] summary {
  margin-bottom: 10px;
}

.compact-action {
  width: auto;
  min-width: 150px;
}

.primary-action:hover,
.secondary-action:hover {
  background: var(--green-dark);
}

.ghost-action,
.back-link {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

.ghost-action:hover,
.back-link:hover {
  border-color: var(--green);
  color: var(--green);
}

.inline-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.session-list {
  display: grid;
  gap: 16px;
  margin: 0;
}

.session-list div {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.session-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.session-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.session-list dd {
  margin: 5px 0 0;
  font-size: 18px;
  font-weight: 750;
}

.interview-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.status-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.busy {
  color: var(--gold);
  border-color: rgba(176, 109, 20, 0.35);
}

.status-badge.error {
  color: var(--red);
  border-color: rgba(189, 63, 47, 0.35);
}

.timer-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
}

/* Bookmark star on the question card + the saved-questions review list. */
.question-card {
  position: relative;
}

.question-card .question-text {
  padding-right: 44px;
}

.bookmark-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: 0;
  padding: 4px 6px;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
}

.bookmark-btn:hover {
  color: var(--gold);
}

.bookmark-btn.on {
  color: var(--gold);
}

.saved-box summary {
  cursor: pointer;
  font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.saved-box summary:hover {
  color: var(--green-dark);
}

.saved-box[open] summary {
  margin-bottom: 12px;
}

.saved-count {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.saved-list {
  display: grid;
  gap: 8px;
}

.saved-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 0; /* see .setup-page: never let the question set the width */
  max-width: 100%;
}

.saved-open {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-open:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.saved-meta {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.saved-remove {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 14px;
  padding: 2px 6px;
}

.saved-remove:hover {
  color: var(--red);
}

.timer-display {
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 40px;
  line-height: 1;
  font-weight: 600;
  color: var(--green-dark);
}

.timer-actions {
  display: flex;
  gap: 10px;
}

.question-card,
.evaluation {
  padding: 20px;
}

.question-card.empty {
  display: grid;
  min-height: 170px;
  place-items: center;
  background: var(--panel);
}

.empty-state {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.question-text {
  margin-bottom: 16px;
  font-size: 20px;
  line-height: 1.42;
}

.testing-note {
  margin-bottom: 12px;
  color: var(--muted);
}

.guidance-list,
.feedback-list {
  margin: 0;
  padding-left: 20px;
  color: #334148;
}

.guidance-list li,
.feedback-list li {
  margin: 7px 0;
}

.answer-area {
  display: grid;
  gap: 8px;
}

.answer-actions,
.evaluation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.answer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.chip-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.time-chip {
  padding: 7px 10px;
  border: 1px solid rgba(47, 102, 179, 0.22);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(47, 102, 179, 0.08);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.score-tile {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.score-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.score-value {
  font-size: 26px;
  font-weight: 850;
  color: var(--blue);
}

.evaluation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 16px;
}

.suggested-answer {
  margin: 16px 0 0;
  padding: 14px;
  border-left: 4px solid var(--green);
  background: #f3f8f6;
  line-height: 1.5;
}

.error-message {
  margin: 0;
  color: var(--red);
  font-weight: 750;
}

.hints {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.hints summary {
  padding: 11px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  color: var(--green);
}

.hints[open] summary {
  border-bottom: 1px solid var(--line);
}

.key-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.key-input-row input {
  flex: 1;
  min-width: 0;
}

/* Filled circle with a knocked-out (white) check or cross inside. */
.key-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.key-status[hidden] {
  display: none;
}

.key-status.valid {
  background: var(--green);
}

.key-status.invalid {
  background: var(--red);
}

.disclosure-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.answer-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.force-llm {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}

#micBtn.recording {
  border-color: var(--red);
  color: var(--red);
}

.hints .guidance-list {
  padding: 12px 14px 14px 32px;
}

.next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
  .app-shell {
    width: 100%;
    margin: 0;
  }

  .setup-shell,
  .interview-shell {
    min-height: 100vh;
  }

  .setup-page,
  .interview-page {
    min-height: 100vh;
    border: 0;
  }

  .setup-page,
  .interview-page {
    padding: 20px;
  }

  .setup-grid,
  .score-row,
  .evaluation-grid {
    grid-template-columns: 1fr;
  }

  .interview-topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .timer-strip,
  .answer-actions,
  .evaluation-header {
    align-items: stretch;
    flex-direction: column;
  }

  .timer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .compact-action {
    width: 100%;
  }
}
