/* =====================================================================
   MCCQE1 Master Command Center — design system
   Ayriq Technologies

   Hand-written rather than Tailwind-via-CDN (what the prototype used):
   the CDN build ships a compiler to every visitor, which is slow on the
   shared hosting this deploys to and is explicitly a development tool.

   The palette is built for long sittings. The page ground is a warm
   off-white (#FAFAF8), never #FFF — pure white at full screen brightness
   is what makes eyes ache after an hour. Ink is a deep slate rather than
   black for the same reason: high contrast without the harsh edge.
   ===================================================================== */

:root {
  /* Ground and surfaces */
  --ground:      #FAFAF8;
  --surface:     #FFFFFF;
  --surface-sunk:#F3F5F3;
  --surface-tint:#F0FDFA;

  /* Ink */
  --ink:         #1A2B33;
  --ink-soft:    #3D5460;
  --ink-muted:   #647983;
  --ink-faint:   #93A5AD;

  /* Lines */
  --line:        #E4E8E5;
  --line-strong: #D2D9D4;

  /* Brand — teal reads as clinical without the coldness of pure blue */
  --brand:       #0F766E;
  --brand-deep:  #115E59;
  --brand-soft:  #CCFBF1;
  --brand-ring:  rgba(15, 118, 110, .18);

  /* Support colours */
  --accent:      #0369A1;
  --accent-soft: #E0F2FE;
  --ok:          #15803D;
  --ok-soft:     #DCFCE7;
  --warn:        #B45309;
  --warn-soft:   #FEF3C7;
  --bad:         #BE123C;
  --bad-soft:    #FFE4E6;

  /* Shape */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Depth — shadows stay soft; hard drop shadows fight a light theme */
  --shadow-sm: 0 1px 2px rgba(26, 43, 51, .05);
  --shadow:    0 2px 8px rgba(26, 43, 51, .06), 0 1px 2px rgba(26, 43, 51, .04);
  --shadow-lg: 0 12px 32px rgba(26, 43, 51, .10), 0 2px 8px rgba(26, 43, 51, .05);

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --- Reset ---------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  /* 1.65 rather than the usual 1.5: this app is read for hours at a time */
  line-height: 1.65;
  font-size: 15px;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }
p  { margin: 0 0 .85em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

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

[hidden] { display: none !important; }

.mono { font-family: var(--mono); }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.small { font-size: .82rem; }
.tiny  { font-size: .74rem; }
.strong { font-weight: 650; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.eyebrow {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Visible only to screen readers — used for input labels the design hides. */
.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;
}

/* --- Layout --------------------------------------------------------- */

.stack   { display: flex; flex-direction: column; }
.stack-2 { gap: .5rem; }  .stack-3 { gap: .75rem; }
.stack-4 { gap: 1rem; }   .stack-5 { gap: 1.5rem; }
.stack-6 { gap: 2rem; }

.row {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap;
}
.row-tight { gap: .4rem; }
.row-between { justify-content: space-between; }
.row-nowrap { flex-wrap: nowrap; }
.spacer { flex: 1 1 auto; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.shell { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* --- Card ----------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}
.card-lg { padding: 2rem; border-radius: var(--r-xl); }
.card-flat { box-shadow: none; }
.card-sunk { background: var(--surface-sunk); border-color: var(--line); box-shadow: none; }
.card-highlight { border-color: #BBF7D0; background: var(--ok-soft); }

.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding-bottom: 1rem; margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin-bottom: .15rem; }

/* --- Buttons -------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .68rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--r);
  font-size: .9rem; font-weight: 650;
  white-space: nowrap;   /* "Sign out" must not break across two lines */
  cursor: pointer;
  background: var(--surface-sunk);
  color: var(--ink);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .06s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 1px; }
.btn[disabled], .btn.is-busy { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not([disabled]) { background: var(--brand-deep); }

.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-sunk); color: var(--ink); }

.btn-quiet { background: transparent; color: var(--ink-muted); padding: .4rem .6rem; }
.btn-quiet:hover:not([disabled]) { color: var(--brand); background: var(--surface-tint); }

.btn-danger { background: var(--bad); color: #fff; }

.btn-block { width: 100%; }
.btn-sm { padding: .45rem .8rem; font-size: .82rem; border-radius: var(--r-sm); }
.btn-lg { padding: .85rem 1.5rem; font-size: .98rem; }

/* --- Forms ---------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: .35rem; }

.label {
  font-size: .78rem; font-weight: 650; color: var(--ink-soft);
  letter-spacing: .01em;
}

.input, .select, .textarea {
  width: 100%;
  padding: .7rem .85rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.input[aria-invalid="true"] { border-color: var(--bad); }
.textarea { min-height: 96px; resize: vertical; }

.select {
  appearance: none;
  /* Chevron drawn inline so the control needs no image request */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23647983' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.2rem;
}

.hint { font-size: .78rem; color: var(--ink-muted); }
.error-text { font-size: .78rem; color: var(--bad); font-weight: 600; }

/* The 6-box OTP entry. One input per digit, so paste and per-digit
   backspace both behave the way people expect from a verification code. */
.otp-row { display: flex; gap: .5rem; justify-content: center; }
.otp-box {
  width: 3rem; height: 3.4rem;
  text-align: center;
  font-family: var(--mono); font-size: 1.4rem; font-weight: 700;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
}
.otp-box:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.otp-box.is-filled { border-color: var(--brand); background: var(--surface-tint); }

/* --- Badges and pills ----------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-brand { background: var(--brand-soft); color: var(--brand-deep); border-color: #99F6E4; }
.badge-ok    { background: var(--ok-soft);    color: #14532D;         border-color: #BBF7D0; }
.badge-warn  { background: var(--warn-soft);  color: #92400E;         border-color: #FDE68A; }
.badge-bad   { background: var(--bad-soft);   color: #9F1239;         border-color: #FECDD3; }
.badge-mute  { background: var(--surface-sunk); color: var(--ink-muted); border-color: var(--line-strong); }

/* --- Alerts --------------------------------------------------------- */

.alert {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .85rem 1rem;
  border-radius: var(--r);
  border: 1px solid;
  font-size: .88rem;
}
.alert-info { background: var(--accent-soft); border-color: #BAE6FD; color: #075985; }
.alert-ok   { background: var(--ok-soft);    border-color: #BBF7D0; color: #14532D; }
.alert-warn { background: var(--warn-soft);  border-color: #FDE68A; color: #92400E; }
.alert-bad  { background: var(--bad-soft);   border-color: #FECDD3; color: #9F1239; }

/* --- Progress ------------------------------------------------------- */

.meter {
  height: 8px; width: 100%;
  background: var(--surface-sunk);
  border-radius: 999px; overflow: hidden;
}
.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #14B8A6);
  border-radius: 999px;
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.meter-fill.is-full { background: linear-gradient(90deg, var(--ok), #22C55E); }

/* --- Auth gateway --------------------------------------------------- */

.gateway {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  /* Flat, matte ground — no gradient wash — to match the rest of the app. */
  background: var(--ground);
}

.gateway-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 2.1rem;
}

.brand-mark {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

/* --- App shell ------------------------------------------------------ */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: .75rem; padding: .85rem 0; }

/* The identity block is the only thing allowed to shrink, so the trial
   badge and Sign out button keep their full width on a narrow phone. */
.topbar-id { flex: 1 1 auto; min-width: 0; }
.topbar-id > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.navtabs {
  display: flex; gap: .3rem; padding: 0 0 .6rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.navtabs::-webkit-scrollbar { display: none; }

.navtab {
  padding: .5rem .9rem;
  border: 0; border-radius: var(--r);
  background: transparent; color: var(--ink-muted);
  font-size: .87rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.navtab:hover { background: var(--surface-sunk); color: var(--ink); }
.navtab[aria-selected="true"] { background: var(--brand); color: #fff; }

main.app-main { padding: 1.75rem 0 4rem; }

.app-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 1rem 1.75rem;
  line-height: 1.6;
}

/* --- Stat tile ------------------------------------------------------ */

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}
.stat-value {
  font-family: var(--mono);
  font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em;
  line-height: 1.1;
}
.stat-sub { font-size: .78rem; color: var(--ink-muted); }

/* --- Toasts --------------------------------------------------------- */

.toast-host {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 90;
  display: flex; flex-direction: column; gap: .55rem;
  max-width: min(94vw, 380px);
}
.toast {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--ink-faint);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  font-size: .87rem;
  animation: toast-in .22s cubic-bezier(.2, .9, .3, 1.2);
}
.toast-ok   { border-left-color: var(--ok); }
.toast-bad  { border-left-color: var(--bad); }
.toast-info { border-left-color: var(--accent); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* --- Spinner -------------------------------------------------------- */

.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  flex: none;
}
.spinner-lg { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block {
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
  padding: 3rem 1rem; color: var(--ink-muted);
}

/* --- Motion --------------------------------------------------------- */

.fade-in { animation: fade-in .25s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

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

/* --- Responsive ----------------------------------------------------- */

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .shell { padding: 0 1rem; }

  /* On a phone the header has to hold a name, a status and an action in
     375px. The email is the one piece that is always recoverable elsewhere,
     so it is what goes; the badge drops to its shortest form. */
  .topbar-id .tiny { display: none; }
  .topbar .badge { font-size: .65rem; padding: .18rem .45rem; }
  .topbar .btn-sm { padding: .4rem .6rem; }
  .card { padding: 1.1rem; border-radius: var(--r); }
  .card-lg, .gateway-card { padding: 1.4rem; border-radius: var(--r-lg); }
  h1 { font-size: 1.4rem; }
  .otp-box { width: 2.7rem; height: 3.1rem; font-size: 1.2rem; }
  .otp-row { gap: .35rem; }
  .toast-host { left: 1rem; right: 1rem; max-width: none; }
}

/* =====================================================================
   EXAM & ONBOARDING COMPONENTS
   ===================================================================== */

/* --- Answer choices --------------------------------------------------
   Whole-row targets rather than small radio buttons: on a phone this is
   the difference between a comfortable paper and a fiddly one. */

.choice {
  display: flex; align-items: flex-start; gap: .8rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.choice:hover { border-color: var(--brand); background: var(--surface-tint); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice-key {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-family: var(--mono); font-size: .78rem; font-weight: 700;
  color: var(--ink-muted);
  background: var(--surface-sunk);
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.choice-body { flex: 1 1 auto; min-width: 0; }

.choice.is-selected { border-color: var(--brand); background: var(--surface-tint); }
.choice.is-selected .choice-key { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Review state, shown only after grading */
.choice.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.choice.is-correct .choice-key { background: var(--ok); border-color: var(--ok); color: #fff; }
.choice.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice.is-wrong .choice-key { background: var(--bad); border-color: var(--bad); color: #fff; }

/* --- Question ------------------------------------------------------- */

.stem {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink);
}

.qprogress {
  display: flex; gap: .25rem; flex-wrap: wrap;
}
.qdot {
  width: 26px; height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  font-size: .7rem; font-family: var(--mono); font-weight: 700;
  color: var(--ink-faint);
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.qdot:hover { border-color: var(--brand); color: var(--brand); }
.qdot.is-answered { background: var(--brand-soft); border-color: #99F6E4; color: var(--brand-deep); }
.qdot.is-current  { background: var(--brand); border-color: var(--brand); color: #fff; }

/* --- Score ring ------------------------------------------------------
   An SVG donut. Drawn with stroke-dasharray so it needs no chart library
   and stays crisp at any size. */

.ring { display: block; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-sunk); }
.ring-value { fill: none; stroke: var(--brand); stroke-linecap: round;
              transition: stroke-dasharray .8s cubic-bezier(.4, 0, .2, 1); }
.ring-value.is-pass { stroke: var(--ok); }
.ring-value.is-low  { stroke: var(--warn); }

.ring-wrap { position: relative; display: inline-grid; place-items: center; }
.ring-label {
  position: absolute; text-align: center;
  font-family: var(--mono); font-weight: 700; line-height: 1.1;
}

/* --- System score bars ----------------------------------------------- */

.scorebar { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; align-items: center; }
.scorebar + .scorebar { margin-top: .7rem; }
.scorebar-track {
  grid-column: 1 / -1;
  height: 6px; background: var(--surface-sunk);
  border-radius: 999px; overflow: hidden;
}
.scorebar-fill { height: 100%; border-radius: 999px; background: var(--brand); }
.scorebar-fill.is-pass { background: var(--ok); }
.scorebar-fill.is-weak { background: var(--warn); }
.scorebar-fill.is-bad  { background: var(--bad); }

/* --- Roadmap timeline ------------------------------------------------ */

.phase {
  position: relative;
  padding-left: 1.9rem;
  padding-bottom: 1.5rem;
}
/* The connecting spine, drawn on the item rather than a wrapper so the
   last phase can stop it cleanly. */
.phase::before {
  content: '';
  position: absolute; left: 7px; top: 1.6rem; bottom: 0;
  width: 2px; background: var(--line);
}
.phase:last-child::before { display: none; }
.phase::after {
  content: '';
  position: absolute; left: 0; top: .45rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--brand);
}
.phase.is-revision::after { border-color: var(--accent); }

/* --- Blind-spot callout ---------------------------------------------- */

.spot {
  border-left: 3px solid var(--warn);
  padding: .1rem 0 .1rem .9rem;
}
.spot + .spot { margin-top: 1rem; }

/* =====================================================================
   CURRICULUM
   ===================================================================== */

.sysrow {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.sysrow + .sysrow { margin-top: .75rem; }
.sysrow.is-cleared { border-color: #BBF7D0; }

.sysrow-head {
  display: flex; align-items: center; gap: 1rem;
  width: 100%; padding: 1.1rem 1.35rem;
  background: none; border: 0; text-align: left;
  cursor: pointer;
  transition: background .12s ease;
}
.sysrow-head:hover { background: var(--surface-sunk); }

.sysrow-code {
  flex: none;
  min-width: 62px; padding: .28rem .5rem;
  border-radius: var(--r-sm);
  background: var(--surface-sunk);
  border: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: .7rem; font-weight: 700;
  color: var(--ink-muted); text-align: center;
}
.sysrow.is-cleared .sysrow-code {
  background: var(--ok-soft); border-color: #BBF7D0; color: #14532D;
}

/* Rotates when the system is open. */
.sysrow-caret { flex: none; color: var(--ink-faint); transition: transform .18s ease; }
.sysrow-head[aria-expanded="true"] .sysrow-caret { transform: rotate(90deg); }

.sysrow-body { border-top: 1px solid var(--line); padding: .5rem; }

.modrow {
  display: flex; align-items: center; gap: .85rem;
  width: 100%; padding: .75rem .9rem;
  background: none; border: 0; border-radius: var(--r);
  text-align: left; cursor: pointer;
  transition: background .12s ease;
}
.modrow:hover { background: var(--surface-tint); }
.modrow-dot {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: var(--line-strong);
}
.modrow.is-seen .modrow-dot { background: var(--accent); }
.modrow.is-cleared .modrow-dot { background: var(--ok); }

/* --- Module reader --------------------------------------------------- */

/* The Tier 1 Q-card grid: label above value, two up on desktop. */
.qcard { display: grid; gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.qcard-cell { background: var(--surface); padding: 1rem 1.1rem; }
.qcard-cell .eyebrow { margin-bottom: .3rem; display: block; }
.qcard-cell.is-warn { background: #FFFBEB; }
.qcard-cell.is-pearl { background: var(--surface-tint); }

@media (min-width: 720px) {
  .qcard { grid-template-columns: 1fr 1fr; }
  .qcard-cell.is-wide { grid-column: 1 / -1; }
}

/* --- Prose (Tier 2 deep dive) ---------------------------------------- */

.prose { font-size: .95rem; line-height: 1.75; color: var(--ink-soft); }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 .9em; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose ul, .prose ol { margin: 0 0 .9em; padding-left: 1.25rem; }
.prose li { margin-bottom: .35em; }
.prose code {
  font-family: var(--mono); font-size: .85em;
  background: var(--surface-sunk); padding: .1em .35em; border-radius: 5px;
}

/* Tables can be wider than a phone; they scroll inside their own box
   rather than making the whole page scroll sideways. */
.prose-table-wrap { overflow-x: auto; margin: 0 0 .9em; }
.prose table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: .88rem; }
.prose th, .prose td {
  text-align: left; padding: .5rem .7rem;
  border-bottom: 1px solid var(--line);
}
.prose th {
  font-weight: 650; color: var(--ink);
  background: var(--surface-sunk);
  white-space: nowrap;
}

/* --- Deep dive sections ---------------------------------------------- */

.section + .section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .7rem; }
.section-num {
  font-family: var(--mono); font-size: .75rem; font-weight: 700;
  color: var(--brand); flex: none;
}

/* --- Charts ----------------------------------------------------------- */

.radar-axis  { stroke: var(--line); stroke-width: 1; fill: none; }
.radar-ring  { stroke: var(--line); stroke-width: 1; fill: none; }
.radar-area  { fill: rgba(15, 118, 110, .16); stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; }
.radar-point { fill: var(--brand); }
.radar-label { font-family: var(--mono); font-size: 8px; fill: var(--ink-muted); }

.spark-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark-area { fill: rgba(15, 118, 110, .10); }
.spark-target { stroke: var(--ok); stroke-width: 1; stroke-dasharray: 3 3; }
.spark-dot { fill: var(--brand); }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 56px; }
.bars-col { flex: 1 1 0; background: var(--brand-soft); border-radius: 3px 3px 0 0; min-height: 2px; }
.bars-col.is-today { background: var(--brand); }

/* --- Skills Lab --------------------------------------------------------
   Interactive pattern-recognition tracings (skillslab.js). The monitor
   strips (ECG) get a dark, real-monitor look on purpose — it is a
   deliberate visual break from the rest of the light theme, signalling
   "this is a live reading," not a styling inconsistency.
   ------------------------------------------------------------------- */

.skl-station {
  text-align: left; cursor: pointer; border: 1px solid var(--line);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.skl-station:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand-soft); }
.skl-station:disabled { cursor: default; opacity: .6; }
.skl-station-icon { font-size: 1.8rem; line-height: 1; margin-bottom: .5rem; }

.skl-bench:empty { display: none; }

.skl-strip {
  width: 100%; height: auto; border-radius: var(--r); display: block;
  aspect-ratio: 640 / 160;
}
.skl-strip.is-monitor .skl-strip-bg { fill: #0B1F1C; }
.skl-strip.is-monitor .skl-grid-minor { stroke: rgba(15, 118, 110, .28); stroke-width: 1; }
.skl-strip.is-monitor .skl-grid-major { stroke: rgba(15, 118, 110, .5); stroke-width: 1; }
.skl-strip.is-monitor .skl-trace { stroke: #34D399; }
.skl-strip.is-monitor .skl-trace-label { fill: #6EE7B7; }

.skl-strip.is-paper .skl-strip-bg { fill: #FFF7F5; }
.skl-strip.is-paper .skl-grid-minor { stroke: #FBD5CC; stroke-width: .75; }
.skl-strip.is-paper .skl-grid-major { stroke: #F3A79A; stroke-width: 1; }
.skl-strip.is-paper .skl-trace { stroke: var(--brand-deep); }
.skl-strip.is-paper .skl-trace-label { fill: var(--ink-soft); font-weight: 700; }

.skl-trace { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.skl-trace-label { font-family: var(--mono); font-size: 9px; }

.skl-stage { padding: .5rem 0; }

.skl-fundamentals-toggle {
  display: flex; align-items: center; gap: .5rem;
  width: 100%; text-align: left;
  padding: .6rem .9rem; border-radius: var(--r);
  border: 1px dashed var(--line-strong); background: var(--surface-tint);
  color: var(--brand-deep); font-weight: 600; font-size: .9rem;
  cursor: pointer;
}
.skl-fundamentals-toggle:hover { background: var(--brand-soft); }
.skl-fundamentals-caret { flex: none; font-size: .75rem; color: var(--brand); }
.skl-fundamentals-body { padding: 1rem 1.1rem; }

.skl-cxr { width: 100%; max-width: 320px; display: block; margin: 0 auto; aspect-ratio: 400 / 420; }
.skl-cxr-bg { fill: #0D0D10; }
.skl-cxr-rib { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 1.5; }
.skl-lung { fill: #EAF2FF; fill-opacity: .06; stroke: rgba(234,242,255,.35); stroke-width: 1; }
.skl-heart { fill: #F4E4D4; fill-opacity: .55; stroke: rgba(244,228,212,.5); }
.skl-pleural-line { fill: none; stroke: #FDE68A; stroke-width: 1.5; stroke-dasharray: 2 2; }
.skl-lung-absent { fill: #0D0D10; }
.skl-effusion { fill: #93C5FD; fill-opacity: .55; }
.skl-consolidation { fill: #EAF2FF; fill-opacity: .55; }
.skl-edema { fill: #EAF2FF; fill-opacity: .3; }

/* --- Doctor reviews on the sign-in screen --------------------------- */
/* Sits under the gateway card, so it must not compete with it: the card
   is the thing a returning doctor came for, and these are for the visitor
   still deciding. Hence muted cards, no border emphasis, and a grid that
   collapses to one column before it can push the form off a phone. */
.gateway-reviews {
  width: min(100%, 60rem);
  margin: 2.25rem auto 0;
  padding: 0 1rem 2.5rem;
}
.review-grid {
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.review-card {
  margin: 0;
  padding: 1rem 1.1rem;
}
.review-card blockquote {
  /* Long reviews are trimmed rather than allowed to set the row height of
     every card beside them. */
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
