:root {
  --ink: #14213d;
  --muted: #667085;
  --line: #e4e9f1;
  --panel: #ffffff;
  --canvas: #f4f7fb;
  --blue: #1769e0;
  --blue-soft: #eaf2ff;
  --green: #16825d;
  --green-soft: #e9f8f1;
  --red: #b42318;
  --red-soft: #fef3f2;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --shadow: 0 14px 34px rgba(23, 42, 78, .08);
}

html[data-theme="dark"] {
  --ink: #edf4ff;
  --muted: #9caac0;
  --line: #26354b;
  --panel: #111b2b;
  --canvas: #09111f;
  --blue: #59a4ff;
  --blue-soft: #172d49;
  --green: #55d6a5;
  --green-soft: #12392f;
  --red: #f97066;
  --red-soft: #3b1d1d;
  --amber: #fdb022;
  --amber-soft: #3a2a12;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 14px/1.5 "Source Sans 3", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.page-shell { min-height: 100vh; padding: 20px; }
.top-header, .setup-card, .card, .hub-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.top-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  margin-bottom: 18px;
}
.top-header h1 { margin: 0 0 4px; font-size: 24px; }
.top-header p { margin: 0; color: var(--muted); }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-btn, .secondary-btn, .primary-btn, .danger-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
}
.back-btn, .secondary-btn { background: var(--blue-soft); color: var(--blue); }
.primary-btn { background: var(--blue); color: #fff; }
.danger-btn { background: var(--red-soft); color: var(--red); }
.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-with-icon .btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 980px;
  margin: 40px auto;
}
.hub-card {
  display: block;
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, border-color .15s ease;
}
.hub-card:hover { transform: translateY(-2px); border-color: var(--blue); }
.hub-card h2 { margin: 0 0 8px; }
.hub-card p { margin: 0; color: var(--muted); }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}
.setup-card, .card { padding: 18px; margin-bottom: 16px; }
.setup-card.collapsed .setup-body { display: none; }
.setup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.setup-head h2, .card h2, .side-panel h2 { margin: 0 0 12px; font-size: 16px; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field span { color: var(--muted); font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 88%, var(--canvas));
  color: var(--ink);
  padding: 10px 12px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: var(--ink);
}
.chip.active { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); font-weight: 700; }
.question-row {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.question-title { font-size: 18px; line-height: 1.4; margin: 0; }
.read-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.read-row #readStatus {
  color: var(--blue);
  font-weight: 700;
}
.options { display: grid; gap: 8px; margin-bottom: 14px; }
.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--panel) 88%, var(--canvas));
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.audio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.audio-status { margin: 0; }
.audio-row.recording #recordStatus {
  color: var(--red);
  font-weight: 700;
}
.audio-row.recording #recordBtn {
  opacity: 0.55;
}
.status-line { color: var(--muted); margin: 0 0 12px; }
.side-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  height: fit-content;
  box-shadow: var(--shadow);
}
body.cert-page #itemNav {
  max-height: min(60vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}
body.cert-page #attemptList {
  max-height: min(28vh, 240px);
  overflow-y: auto;
  padding-right: 4px;
}
body.cert-page .page-shell {
  -webkit-user-select: none;
  user-select: none;
}
body.cert-page .page-shell input,
body.cert-page .page-shell textarea,
body.cert-page .page-shell select {
  -webkit-user-select: text;
  user-select: text;
}
.score-big { font-size: 34px; font-weight: 800; margin: 0 0 8px; }
.pass { color: var(--green); }
.fail { color: var(--red); }
.item-list, .area-list, .attempt-list { display: grid; gap: 8px; }
.item-btn, .attempt-btn {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: transparent;
  color: inherit;
}
.item-btn.active { border-color: var(--blue); background: var(--blue-soft); }
.badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge.answered { color: var(--green); }
.badge.later { color: var(--amber); }
.badge.unanswered { color: var(--muted); }
.badge.scored { color: var(--blue); }
.timer {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 12px;
}
.turn {
  border-left: 3px solid var(--line);
  padding: 8px 0 8px 12px;
  margin-bottom: 10px;
}
.turn.followup { border-color: var(--amber); }
.turn.user { border-color: var(--blue); }
.area-pill {
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--blue-soft);
}
.area-pill.weak { background: var(--red-soft); }
.results-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  background: color-mix(in srgb, var(--panel) 88%, var(--canvas));
}
.review-item {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.review-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.review-item .review-qid {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.review-options {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}
.review-option {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
}
.review-option.selected {
  border-color: var(--amber);
  background: var(--amber-soft);
}
.review-option.correct {
  border-color: var(--green);
  background: var(--green-soft);
}
.review-option.selected.correct {
  border-color: var(--green);
}
.review-option.selected:not(.correct) {
  border-color: var(--red);
  background: var(--red-soft);
}
.review-answer-line {
  color: var(--muted);
  margin: 6px 0;
  font-size: 13px;
}
.review-explanation {
  margin-top: 8px;
}
@media (max-width: 900px) {
  .layout, .hub-grid, .field-grid { grid-template-columns: 1fr; }
}

.hub-card {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hub-card[href="/interview-prep-interview.html"] {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)),
    url("/img/interview.png");
}

.hub-card[href="/interview-prep-certification.html"] {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)),
    url("/img/certification.png");
}

.hub-card h2,
.hub-card p {
  color: #fff;
}