:root {
  --zishi-navy: #1A1060; --zishi-gold: #C8973A; --zishi-gold-cta: #D4A843;
  --zishi-bg: #FFFFFF; --zishi-bg-alt: #F5F5F3; --zishi-border: #E8E8E4;
  --zishi-text: #444444; --zishi-text-light: #FFFFFF;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win, even over elements that set an
   explicit `display` (e.g. .progress-note { display: flex }). Without this,
   such elements show through their `hidden` attribute. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  color: var(--zishi-text);
  background: var(--zishi-bg-alt);
  line-height: 1.55;
}

h1, h2, h3 { font-weight: 600; color: var(--zishi-navy); margin-top: 0; }

/* ---------- Header ---------- */
.site-header {
  background: var(--zishi-navy);
  color: var(--zishi-text-light);
  padding: 18px 24px;
}
.header-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
}
.logo { height: 44px; background: var(--zishi-bg); padding: 6px 10px; border-radius: 6px; }
.header-text h1 { color: var(--zishi-text-light); font-size: 22px; margin: 0; }
.tagline { margin: 2px 0 0; color: var(--zishi-gold); font-size: 14px; letter-spacing: 0.04em; }

/* ---------- Stepper ---------- */
.stepper {
  max-width: 960px; margin: 24px auto 0; padding: 0 24px;
  display: flex; gap: 12px;
}
.step {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  background: var(--zishi-bg); border: 1px solid var(--zishi-border);
  opacity: 0.55;
}
.step.active { opacity: 1; border-color: var(--zishi-gold); }
.step.done { opacity: 0.85; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--zishi-navy); color: var(--zishi-text-light); font-weight: 600;
}
.step.active .step-dot { background: var(--zishi-gold); }
.step-label { font-weight: 600; color: var(--zishi-navy); }

/* ---------- Layout ---------- */
main { max-width: 960px; margin: 0 auto; padding: 24px; }
.card {
  background: var(--zishi-bg); border: 1px solid var(--zishi-border);
  border-radius: 10px; padding: 24px; margin-bottom: 20px;
}
.muted { color: #777; }
.center { text-align: center; }

/* ---------- Roles ---------- */
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.role-card {
  border: 2px solid var(--zishi-border); border-radius: 10px; padding: 16px;
  cursor: pointer; background: var(--zishi-bg); text-align: left;
  font: inherit; color: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
.role-card:hover { border-color: var(--zishi-gold); }
.role-card.selected { border-color: var(--zishi-gold); box-shadow: 0 0 0 3px rgba(200, 151, 58, 0.18); }
.role-card h3 { margin: 0 0 4px; font-size: 17px; }
.role-sector { color: var(--zishi-gold); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.role-desc { font-size: 14px; margin: 8px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--zishi-bg-alt); border: 1px solid var(--zishi-border);
  border-radius: 999px; padding: 2px 10px; font-size: 12px;
}

/* ---------- Forms ---------- */
.tabs { display: flex; gap: 8px; margin: 14px 0; }
.tab {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--zishi-border); background: var(--zishi-bg-alt); color: var(--zishi-text);
}
.tab.active { background: var(--zishi-navy); color: var(--zishi-text-light); border-color: var(--zishi-navy); }
textarea {
  width: 100%; font: inherit; padding: 12px;
  border: 1px solid var(--zishi-border); border-radius: 8px; resize: vertical;
}
textarea:focus { outline: 2px solid var(--zishi-gold); border-color: transparent; }

/* Login */
.card-narrow { max-width: 420px; margin: 0 auto; }
.field { display: block; margin: 14px 0; }
.field > span { display: block; font-weight: 600; color: var(--zishi-navy); margin-bottom: 6px; font-size: 14px; }
.field input {
  width: 100%; font: inherit; padding: 11px 12px;
  border: 1px solid var(--zishi-border); border-radius: 8px;
}
.field input:focus { outline: 2px solid var(--zishi-gold); border-color: transparent; }
.file-drop {
  display: block; border: 2px dashed var(--zishi-border); border-radius: 10px;
  padding: 36px; text-align: center; cursor: pointer; color: #777;
}
.file-drop:hover { border-color: var(--zishi-gold); }
.file-drop input { display: none; }

/* ---------- Buttons ---------- */
.actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.actions-center { justify-content: center; }
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 10px 22px; border-radius: 8px; border: 1px solid transparent;
  transition: filter 0.15s;
}
.btn:hover:not(:disabled) { filter: brightness(0.95); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { padding: 14px 32px; font-size: 17px; }
.btn-primary { background: var(--zishi-gold-cta); color: var(--zishi-navy); }
.btn-secondary { background: var(--zishi-bg); color: var(--zishi-navy); border-color: var(--zishi-navy); }
.btn-danger { background: var(--zishi-bg); color: #B03030; border-color: #B03030; }

/* ---------- Status / errors ---------- */
.progress-note { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--zishi-navy); font-weight: 600; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--zishi-border); border-top-color: var(--zishi-gold);
  animation: spin 0.8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: #B03030; font-weight: 600; margin-top: 12px; }

/* ---------- Scores ---------- */
.score-summary { display: flex; align-items: center; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.score-big { font-size: 52px; font-weight: 600; color: var(--zishi-navy); }
.score-denom { font-size: 24px; color: #999; }
.gate-badge { padding: 8px 18px; border-radius: 999px; font-weight: 600; }
.gate-pass { background: #E7F3E7; color: #2E6B2E; }
.gate-fail { background: #FBEAEA; color: #B03030; }

.dimension-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.dimension { background: var(--zishi-bg-alt); border-radius: 8px; padding: 12px 16px; }
.dimension-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dimension-name { font-weight: 600; color: var(--zishi-navy); text-transform: capitalize; }
.dimension-score { font-weight: 600; color: var(--zishi-gold); }
.bar { height: 8px; background: var(--zishi-border); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--zishi-gold); border-radius: 999px; transition: width 0.6s ease; }
.coaching-tip { font-size: 14px; margin: 8px 0 0; }

.improvements { padding-left: 20px; }
.improvements li { margin-bottom: 8px; }

/* ---------- Live interview ---------- */
.live-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: #FBEAEA; color: #B03030; font-weight: 600;
  padding: 4px 14px; border-radius: 999px; font-size: 14px;
}
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #B03030; animation: pulse 1.4s ease infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.attempt-count { margin-left: 12px; font-weight: 600; color: var(--zishi-navy); }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--zishi-navy); font-size: 18px; }

.transcript {
  height: 380px; overflow-y: auto;
  background: var(--zishi-bg-alt); border: 1px solid var(--zishi-border);
  border-radius: 10px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.transcript-hint { color: #999; text-align: center; margin: auto; }
.turn { max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 15px; }
.turn-interviewer { align-self: flex-start; background: var(--zishi-navy); color: var(--zishi-text-light); border-bottom-left-radius: 3px; }
.turn-student { align-self: flex-end; background: var(--zishi-bg); border: 1px solid var(--zishi-border); border-bottom-right-radius: 3px; }
.turn-who { display: block; font-size: 11px; font-weight: 600; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }

/* "Listening…" indicator shown in the student's bubble while they speak,
   before their transcribed text arrives. Animated equalizer bars. */
.listening { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.listening .bar {
  width: 3px; height: 5px; border-radius: 2px; background: var(--zishi-navy);
  animation: eq 0.9s ease-in-out infinite;
}
.listening .bar:nth-child(2) { animation-delay: 0.15s; }
.listening .bar:nth-child(3) { animation-delay: 0.30s; }
.listening .bar:nth-child(4) { animation-delay: 0.45s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 16px; } }

.brief-list li { margin-bottom: 6px; }

/* ---------- Outcome ---------- */
.outcome-banner {
  border-radius: 12px; padding: 36px 24px; text-align: center;
  margin-bottom: 20px; color: var(--zishi-text-light);
}
.outcome-offer { background: linear-gradient(135deg, var(--zishi-navy), #2A1D8F); }
.outcome-conditional { background: linear-gradient(135deg, #8A6A1F, var(--zishi-gold)); }
.outcome-notyet { background: linear-gradient(135deg, #555, #777); }
.outcome-label { font-size: 34px; font-weight: 600; }
.outcome-pct { font-size: 20px; margin-top: 6px; opacity: 0.9; }

.blend-row { display: flex; gap: 16px; flex-wrap: wrap; }
.blend-item {
  flex: 1; min-width: 200px; background: var(--zishi-bg-alt);
  border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 2px;
}
.blend-title { font-weight: 600; color: var(--zishi-navy); }
.blend-value { font-size: 28px; font-weight: 600; color: var(--zishi-gold); }
.blend-weight { font-size: 13px; color: #888; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; color: #999; font-size: 13px; padding: 24px; }

@media (max-width: 640px) {
  .stepper { flex-direction: column; }
  .step-label { font-size: 14px; }
  .score-big { font-size: 40px; }
}
