/* ==========================================================================
   CityLine Express 360 — Driver Interview Console
   Tokens mirror cityline-project/src/styles/tokens.css (the live design system).
   ========================================================================== */

:root {
  --canvas: #0f0f0f;
  --panel: #1a1a1a;
  --panel-raised: #242424;
  --edge: rgba(255, 255, 255, 0.08);
  --edge-strong: rgba(255, 255, 255, 0.15);

  --accent: #ff5a1f;
  --accent-hover: #ff6b00;
  --accent-strong: #e54d00;
  --accent-dim: rgba(255, 90, 31, 0.1);
  --accent-glow: rgba(255, 90, 31, 0.35);

  --gold: #d4af37;
  --cyan: #7dd3e0;
  --positive: #4ade80;
  --negative: #f87171;

  --text-hi: #f8fafc;
  --text-mid: rgba(248, 250, 252, 0.7);
  --text-low: rgba(248, 250, 252, 0.45);
  --text-faint: rgba(248, 250, 252, 0.3);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-pill: 999px;

  --container: 80rem;
  --pad: clamp(1.25rem, 4vw, 3rem);

  --duration-fast: 150ms;
  --duration-base: 250ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Class-based display rules (.btn, .grid, .row…) otherwise win over the
   `hidden` attribute, leaving hidden controls visible. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background-color: var(--canvas);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  color: var(--text-hi);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
}

/* ------------------------------------------------------------------ rails */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 60;
  background: var(--accent);
  box-shadow: 0 0 20px rgba(255, 90, 31, 0.5);
  pointer-events: none;
}
body::before {
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}
body::after {
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
}

/* ------------------------------------------------------------------ a11y */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ----------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem var(--pad);
  background: rgba(15, 15, 15, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--edge);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.brand-logo {
  height: 38px;
  width: auto;
}
.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-name {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-low);
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pill {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- screens */
main {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) var(--pad) 6rem;
}

.screen[hidden] {
  display: none;
}

.screen {
  animation: screen-in var(--duration-base) var(--ease-out);
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.screen-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.screen-head {
  max-width: 46rem;
  margin-bottom: 2rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* ------------------------------------------------------------------ type */
.overline {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.overline::before {
  content: "› ";
}

.h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.h2 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-low);
  margin-bottom: 0.85rem;
}
.h2-positive {
  color: var(--positive);
}
.h2-negative {
  color: var(--negative);
}

.gradient-text {
  background: linear-gradient(90deg, #fff 0%, #9b9b9b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.muted {
  color: var(--text-mid);
}
.small {
  font-size: 0.9rem;
}
.hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 0.45rem;
}
.error-text {
  color: var(--negative);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.count {
  color: var(--text-faint);
  font-weight: 400;
}

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius-xl);
  padding: clamp(1.1rem, 2.5vw, 1.6rem);
  margin-bottom: 1.1rem;
}

.card-glass {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );
  backdrop-filter: blur(16px);
  border-color: var(--edge-strong);
}

.grid {
  display: grid;
  gap: 1.1rem;
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid > .card {
  margin-bottom: 0;
}
.grid {
  margin-bottom: 1.1rem;
}

.row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}
.row-wrap {
  flex-wrap: wrap;
}

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.6rem 0 0.8rem;
}

/* ----------------------------------------------------------------- forms */
.field {
  display: block;
  margin-bottom: 1rem;
}
.field:last-child {
  margin-bottom: 0;
}

.label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-low);
  margin-bottom: 0.45rem;
}

.input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: #131313;
  color: var(--text-hi);
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}
.input:hover {
  border-color: rgba(255, 255, 255, 0.24);
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.input::placeholder {
  color: var(--text-faint);
}

.textarea {
  resize: vertical;
  line-height: 1.5;
  font-size: 0.9rem;
}

select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-low) 50%),
    linear-gradient(135deg, var(--text-low) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    background-color var(--duration-fast) ease, filter var(--duration-fast) ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 90, 31, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-hi);
  border-color: var(--edge-strong);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border-color: var(--edge);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text-hi);
  border-color: var(--edge-strong);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--negative);
  border-color: rgba(248, 113, 113, 0.3);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.2);
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 0.95rem;
}
.btn-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.78rem;
}

.btn-file {
  position: relative;
  cursor: pointer;
}

.actions {
  margin-top: 1.4rem;
}
.actions-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------ gate + chips */
.gate-card {
  max-width: 27rem;
  width: 100%;
  padding: 2.2rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chips li {
  font-size: 0.8rem;
  color: var(--text-mid);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--edge);
  border-left: 2px solid var(--cyan);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
}

/* -------------------------------------------------------- question cards */
.question-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.q-card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  transition: border-color var(--duration-fast) ease;
}
.q-card:hover {
  border-color: var(--edge-strong);
  border-left-color: var(--accent-hover);
}

.q-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.q-index {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.q-cat {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  border: 1px solid rgba(125, 211, 224, 0.25);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.55rem;
}
.q-spacer {
  flex: 1;
}
.q-remove {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
}
.q-remove:hover {
  color: var(--negative);
  background: rgba(248, 113, 113, 0.1);
}

.q-input {
  width: 100%;
  background: #131313;
  border: 1px solid var(--edge);
  border-radius: var(--radius-md);
  color: var(--text-hi);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.65rem 0.8rem;
  resize: vertical;
}
.q-input:focus {
  outline: none;
  border-color: var(--accent);
}

.q-detail {
  margin-top: 0.7rem;
}
.q-detail summary {
  cursor: pointer;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.q-detail summary:hover {
  color: var(--text-mid);
}
.q-detail-body {
  margin-top: 0.6rem;
  font-size: 0.86rem;
  color: var(--text-mid);
  display: grid;
  gap: 0.55rem;
}
.q-detail-body strong {
  color: var(--text-low);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.2rem;
}
.q-flags li {
  color: var(--negative);
  font-size: 0.86rem;
  padding-left: 0.9rem;
  position: relative;
}
.q-flags li::before {
  content: "!";
  position: absolute;
  left: 0;
  color: var(--negative);
  font-weight: 700;
}

/* ------------------------------------------------------------ interview */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  box-shadow: 0 0 14px var(--accent-glow);
  transition: width var(--duration-base) var(--ease-out);
}
.progress-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-low);
  white-space: nowrap;
}

.interview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.4rem;
}
@media (max-width: 900px) {
  .interview-grid {
    grid-template-columns: 1fr;
  }
}

.interview-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.orb-wrap {
  position: relative;
  width: min(340px, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
#orb {
  width: 100%;
  height: 100%;
  display: block;
}
.orb-status {
  position: absolute;
  bottom: 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.current-block {
  text-align: center;
  max-width: 40rem;
  min-height: 5.5rem;
}
.current-question {
  font-size: clamp(1.1rem, 2.1vw, 1.5rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-hi);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.interview-side {
  display: flex;
  flex-direction: column;
}
.transcript {
  flex: 1;
  min-height: 22rem;
  max-height: 32rem;
  overflow-y: auto;
  background: #131313;
  border: 1px solid var(--edge);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--edge-strong) transparent;
}
.t-full {
  min-height: 0;
  max-height: 40rem;
}
.transcript::-webkit-scrollbar {
  width: 8px;
}
.transcript::-webkit-scrollbar-thumb {
  background: var(--edge-strong);
  border-radius: var(--radius-pill);
}

.turn {
  max-width: 90%;
}
.turn-label {
  display: block;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.25rem;
}
.turn-body {
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
}
.turn-interviewer {
  align-self: flex-start;
}
.turn-interviewer .turn-label {
  color: var(--accent);
}
.turn-interviewer .turn-body {
  background: var(--accent-dim);
  border: 1px solid rgba(255, 90, 31, 0.22);
}
.turn-candidate {
  align-self: flex-end;
}
.turn-candidate .turn-label {
  color: var(--cyan);
}
.turn-candidate .turn-body {
  background: rgba(125, 211, 224, 0.08);
  border: 1px solid rgba(125, 211, 224, 0.2);
}
.turn-pending .turn-body {
  color: var(--text-faint);
  font-style: italic;
}

.level-wrap {
  margin-top: 0.9rem;
}
.level-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.level-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--accent));
  transition: width 80ms linear;
}

/* ------------------------------------------------------------ scorecard */
.score-gauge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.gauge {
  position: relative;
  width: 190px;
  height: 190px;
}
.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.gauge-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 9;
}
.gauge-value {
  fill: none;
  stroke: var(--accent);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 900ms var(--ease-out),
    stroke var(--duration-base) ease;
}
.gauge-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.gauge-number {
  font-size: 2.9rem;
  font-weight: 700;
  line-height: 1;
}
.gauge-unit {
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.14em;
}

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
}
.badge-strong {
  color: var(--positive);
  background: rgba(74, 222, 128, 0.1);
}
.badge-possible {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
}
.badge-not {
  color: var(--negative);
  background: rgba(248, 113, 113, 0.1);
}

.dims {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.dim-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.dim-name {
  font-weight: 600;
  font-size: 0.92rem;
}
.dim-score {
  font-size: 0.82rem;
  color: var(--text-low);
}
.dim-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.dim-fill {
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 900ms var(--ease-out);
}
.dim-note {
  font-size: 0.84rem;
  color: var(--text-mid);
  margin-top: 0.4rem;
}

.list li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-mid);
}
.list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}
details.card summary {
  cursor: pointer;
  list-style: none;
}
details.card summary::-webkit-details-marker {
  display: none;
}
details.card summary.h2 {
  margin-bottom: 0;
}

/* --------------------------------------------------------------- toasts */
.toasts {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(24rem, 90vw);
}
.toast {
  background: var(--panel-raised);
  border: 1px solid var(--edge-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: toast-in var(--duration-base) var(--ease-out);
}
.toast-error {
  border-left-color: var(--negative);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ----------------------------------------------------------------- print */
@media print {
  body {
    background: #fff !important;
    color: #111 !important;
    background-image: none !important;
  }
  body::before,
  body::after,
  .topbar,
  .actions,
  .toasts,
  .toast {
    display: none !important;
  }
  main {
    max-width: none;
    padding: 0;
  }
  .screen:not(#screen-scorecard) {
    display: none !important;
  }
  .card {
    border: 1px solid #ccc !important;
    background: #fff !important;
    backdrop-filter: none !important;
    break-inside: avoid;
  }
  .gradient-text {
    -webkit-text-fill-color: #111 !important;
    color: #111 !important;
  }
  .h2,
  .muted,
  .dim-note,
  .list li {
    color: #333 !important;
  }
  .overline,
  .dim-name,
  .gauge-number {
    color: #111 !important;
  }
  .transcript {
    background: #fff !important;
    border-color: #ccc !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .turn-body {
    background: #f5f5f5 !important;
    color: #111 !important;
    border-color: #ccc !important;
  }
  .turn-label {
    color: #555 !important;
  }
}

/* ==========================================================================
   MOBILE FIXES
   The original topbar had no width breakpoint: at 390px the brand wrapped to
   five lines and collided with the model pill. Measured at 390x844.
   ========================================================================== */

@media (max-width: 640px) {
  .topbar {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
  }
  .brand {
    gap: 0.55rem;
    min-width: 0;
    flex: 1 1 auto;
  }
  .brand-logo {
    height: 30px;
    flex: 0 0 auto;
  }
  .brand-text {
    min-width: 0;
  }
  .brand-name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* The subtitle is decoration; it is the main cause of the wrap. */
  .brand-sub {
    display: none;
  }
  .topbar-meta {
    flex: 0 0 auto;
    gap: 0.4rem;
  }
  .pill {
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .h1 {
    font-size: 1.6rem;
  }
  .gate-card {
    padding: 1.5rem 1.25rem;
  }
  main {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Touch targets: every interactive control reaches at least 44px tall on a
   touch device. Measured failures were 24x24 (question remove), 19px
   ("What to listen for") and 43px (interview controls). */
@media (hover: none), (pointer: coarse) {
  .btn,
  .btn-sm {
    min-height: 44px;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }
  .q-remove {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
  }
  .q-detail summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.35rem 0;
  }
  .input,
  select.input {
    min-height: 48px;
    font-size: 16px; /* stops iOS zoom-on-focus */
  }
  .q-input {
    font-size: 16px;
  }
  .consent {
    min-height: 48px;
  }
  details.card > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* ==========================================================================
   CANDIDATE (phone) INTERVIEW
   ========================================================================== */

body.candidate {
  /* Clear the notch / home bar when run from a phone browser. */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.candidate-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: rgba(15, 15, 15, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--edge);
}
.candidate-logo {
  height: 32px;
  width: auto;
}
.candidate-bar-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-low);
}

body.candidate main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.disclosure {
  margin: 1.25rem 0;
}
.disclosure .list li {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 1.1rem 0;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--edge);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-mid);
}
.consent input {
  width: 22px;
  height: 22px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.candidate-orb {
  position: relative;
  width: min(260px, 68vw);
  margin: 0 auto 0.5rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
#orb {
  width: 100%;
  height: 100%;
  display: block;
}

body.candidate .current-question {
  font-size: 1.15rem;
  text-align: center;
}

.candidate-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1.25rem 0 1rem;
}

.transcript-details {
  margin-top: 1.25rem;
  border-top: 1px solid var(--edge);
  padding-top: 0.75rem;
}
.transcript-details summary {
  cursor: pointer;
  list-style: none;
}
.transcript-details summary::-webkit-details-marker {
  display: none;
}
body.candidate .transcript {
  max-height: 18rem;
  min-height: 4rem;
  margin-top: 0.6rem;
}

