/* AI Hair Transplant Planning — page styles.
   Builds on the design tokens and components already defined in home.css. */

/* Both pages toggle visibility through the `hidden` attribute, but `hidden` is
   only a user-agent `display: none` and loses to any author rule that sets
   `display` — which most components here do (.btn, .ha-badge, .ha-deliver,
   .ha-login). Restoring its meaning once is what keeps the login overlay, the
   report card and the per-card buttons hideable at all. */
[hidden] {
  display: none !important;
}

/* The site header is fixed, so the first section carries the same top offset
   the hero uses on the other pages. The hospital background and its overlay
   gradient mirror `.hero` / `.page-hero`, so this hero matches the rest of the
   site rather than sitting on a flat gradient. */
.ha-hero {
  position: relative;
  color: #fff;
  padding: 168px 0 56px;
  background-image:
    linear-gradient(115deg, rgba(15, 23, 42, 0.95) 0%, rgba(12, 74, 110, 0.85) 60%, rgba(0, 121, 241, 0.5) 100%),
    url("hero-bg.webp");
  background-size: cover;
  background-position: center;
}
.ha-hero h1 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-black);
  line-height: 1.1;
  margin: 0 0 16px;
  max-width: 20ch;
}
/* Same accented keyword the other heroes use. */
.ha-hero h1 em {
  font-style: normal;
  color: var(--c-accent);
}
.ha-hero p {
  color: var(--c-text-on-dark);
  font-weight: var(--fw-light);
  max-width: 60ch;
  margin: 0;
}
.ha-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 74, 110, 0.35);
  border: 1px solid rgba(125, 211, 252, 0.3);
  color: var(--c-accent);
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.ha-hero__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.ha-hero__step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--fs-sm);
}
.ha-hero__step b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: rgba(125, 211, 252, 0.16);
  color: var(--c-accent);
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  flex-shrink: 0;
}

/* ===== SHARED CARD GRID ===== */
.ha-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-md);
}

/* ===== UPLOAD CARDS ===== */
.ha-card {
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ha-card[data-state="accepted"] {
  border-color: rgba(5, 150, 105, 0.45);
}
.ha-card[data-state="accepted-warning"] {
  border-color: rgba(217, 119, 6, 0.45);
}
.ha-card[data-state="rejected"] {
  border-color: rgba(220, 38, 38, 0.45);
}
.ha-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.ha-card__step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--c-near-white);
  color: var(--c-primary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-black);
}
.ha-card__head h3 {
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
  margin: 0;
}

.ha-drop {
  position: relative;
  border: 2px dashed var(--c-slate-lt);
  border-radius: var(--radius);
  background: var(--c-off-white);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.ha-card[data-state="accepted"] .ha-drop {
  border-style: solid;
  border-color: rgba(5, 150, 105, 0.35);
}
.ha-card[data-state="accepted-warning"] .ha-drop {
  border-style: solid;
  border-color: rgba(217, 119, 6, 0.35);
}
.ha-card[data-state="rejected"] .ha-drop {
  border-style: solid;
  border-color: rgba(220, 38, 38, 0.35);
}
.ha-drop.is-dragover {
  border-color: var(--c-primary-mid);
  background: #eaf1fb;
}
/* Visually hidden but still reachable by keyboard and by its label. */
.ha-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.ha-drop__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
  padding: 16px;
}
.ha-file:focus-visible + .ha-drop__label {
  outline: 3px solid var(--c-primary-mid);
  outline-offset: -3px;
}
.ha-drop__label svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--c-primary-lt);
  stroke-width: 1.6;
}
.ha-drop__label strong {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--c-primary);
}
.ha-drop__label span {
  font-size: var(--fs-xs);
  color: var(--c-muted);
}

/* Head-position diagrams. Two class selectors so they win over the generic
   `.ha-drop__label svg` sizing and its inherited `fill: none`. */
.ha-drop__label .ha-vec {
  width: 132px;
  height: 116px;
  stroke: var(--c-primary);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ha-drop__label .ha-vec__area {
  fill: rgba(2, 132, 199, 0.18);
  stroke: none;
}
.ha-drop__label .ha-vec__dot {
  fill: var(--c-primary);
  stroke: none;
}
/* A marked-out region rather than a plain shaded one: the donor horseshoe needs
   its own outline to read as a clinical marking. */
.ha-drop__label .ha-vec__zone {
  fill: rgba(2, 132, 199, 0.18);
  stroke: var(--c-primary-lt);
  stroke-width: 1.1;
}
.ha-preview {
  position: absolute;
  inset: 0;
  background: #0f172a;
}
.ha-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ha-preview__veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.ha-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
}
.ha-badge--ok {
  background: #059669;
}
.ha-badge--warn {
  background: #d97706;
}
.ha-badge--bad {
  background: #dc2626;
}

.ha-status {
  min-height: 20px;
  margin-top: 12px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--c-muted);
}
.ha-status strong {
  display: block;
  color: var(--c-dark);
  font-weight: var(--fw-bold);
}
.ha-status--ok strong {
  color: #047857;
}
.ha-status--warn strong {
  color: #b45309;
}
.ha-status--bad strong {
  color: #b91c1c;
}
.ha-status ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.ha-status li {
  font-size: var(--fs-xs);
}

.ha-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* ===== SPINNER ===== */
.ha-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: ha-spin 0.8s linear infinite;
}
.ha-spinner--dark {
  border-color: rgba(15, 23, 42, 0.18);
  border-top-color: var(--c-primary-mid);
}
@keyframes ha-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ha-spinner {
    animation-duration: 2.4s;
  }
}

/* ===== DOCTOR PLANNING ===== */
.ha-doctor {
  margin-top: var(--gap-md);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ha-doctor > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  font-weight: var(--fw-bold);
}
.ha-doctor > summary::-webkit-details-marker {
  display: none;
}
.ha-doctor > summary::after {
  content: "+";
  margin-left: auto;
  font-size: var(--fs-h5);
  font-weight: var(--fw-light);
  color: var(--c-primary-lt);
}
.ha-doctor[open] > summary::after {
  content: "–";
}
.ha-doctor > summary small {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--c-muted);
  margin-top: 2px;
}
/* Always-open header (replaces the collapsible summary on the clinic page). */
.ha-doctor__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  font-weight: var(--fw-bold);
}
.ha-doctor__head small {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--c-muted);
  margin-top: 2px;
}
.ha-doctor__body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--c-border);
}
.ha-doctor__intro {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin: 16px 0;
}
.ha-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  cursor: pointer;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-off-white);
}
.ha-toggle input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--c-primary-mid);
}
/* Sits inside a fieldset alongside the inputs rather than heading a section. */
.ha-toggle--inline {
  margin-top: 12px;
  font-weight: var(--fw-semibold);
  background: var(--c-white);
}
.ha-fieldset {
  border: 0;
  padding: 0;
  margin: 24px 0 0;
}
.ha-fieldset legend {
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-primary-lt);
  padding: 0;
  margin-bottom: 12px;
}
.ha-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--gap-sm);
}
.ha-fields--notes {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.ha-fields textarea {
  font-family: inherit;
  font-size: var(--fs-sm);
  color: #334155;
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 0.625rem 0.875rem;
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  outline: none;
  background: var(--c-white);
}
.ha-fields textarea:focus,
.ha-fields input:focus,
.ha-fields select:focus {
  border-color: var(--c-primary-mid);
}

/* ===== ACTION BAR ===== */
.ha-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: var(--gap-md);
  text-align: center;
}
.ha-actions .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.ha-hint {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin: 0;
}
.ha-alert {
  margin-top: var(--gap-sm);
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #fef2f2;
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #991b1b;
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* ===== PROGRESS ===== */
.ha-progress {
  margin-top: var(--gap-md);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 8px 20px;
  box-shadow: var(--shadow-sm);
}
.ha-progress__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  font-size: var(--fs-sm);
  color: var(--c-muted);
  border-bottom: 1px solid var(--c-border);
}
.ha-progress__row:last-child {
  border-bottom: 0;
}
.ha-progress__row[data-state="active"] {
  color: var(--c-dark);
  font-weight: var(--fw-semibold);
}
.ha-progress__row[data-state="done"] {
  color: #047857;
}
.ha-progress__row[data-state="failed"] {
  color: #b91c1c;
}
.ha-progress__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.ha-progress__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--c-slate-lt);
}
/* A step in flight pulses, so a run that takes a couple of minutes never looks
   like it has stalled. */
.ha-progress__row[data-state="active"] .ha-progress__dot {
  background: #059669;
  border-color: #059669;
  animation: ha-progress-pulse 1.2s ease-in-out infinite;
}
@keyframes ha-progress-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.25;
    transform: scale(0.7);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ha-progress__row[data-state="active"] .ha-progress__dot {
    animation: none;
  }
}
.ha-progress__row[data-state="done"] .ha-progress__dot {
  background: #059669;
  border-color: #059669;
}
.ha-progress__row[data-state="failed"] .ha-progress__dot {
  background: #dc2626;
  border-color: #dc2626;
}

/* ===== RESULTS ===== */
.ha-result {
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ha-result__head {
  padding: 18px 20px 12px;
}
.ha-result__head h3 {
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
  margin: 0 0 4px;
}
.ha-result__head p {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  margin: 0;
}
.ha-result__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--c-near-white);
  display: grid;
  place-items: center;
}
.ha-result__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0f172a;
}
.ha-result__pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--c-muted);
  padding: 20px;
  text-align: center;
}
.ha-result__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 18px;
  margin-top: auto;
}
.ha-result__status {
  flex: 1 1 100%;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}
.ha-result[data-state="failed"] .ha-result__status {
  color: #b91c1c;
}
.ha-result[data-state="done"] .ha-result__status {
  color: #047857;
}

/* ===== TREATMENT SUMMARY ===== */
.ha-summary {
  margin-top: var(--gap-md);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.ha-summary__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.ha-summary__head h3 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  margin: 0;
}
.ha-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--c-near-white);
  color: var(--c-primary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.ha-stats {
  display: grid;
  /* Eight figures read cleanest as a tidy 4 × 2 grid of tiles. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ha-stat {
  background: var(--c-white);
  padding: 16px;
}
.ha-stat__lbl {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 6px;
}
.ha-stat__val {
  font-size: var(--fs-h5);
  font-weight: var(--fw-black);
  color: var(--c-dark);
  line-height: 1.2;
}
.ha-stat--total {
  background: var(--g-primary);
}
.ha-stat--total .ha-stat__lbl {
  color: var(--c-accent);
}
.ha-stat--total .ha-stat__val {
  color: #fff;
}
.ha-summary__notes {
  margin-top: 18px;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--c-muted);
}
.ha-summary__notes ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.ha-final-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: var(--gap-md);
}
/* Clinic-only: PDF language picker beside the download button. */
.ha-lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-dark);
}
.ha-lang select {
  font-family: inherit;
  font-size: var(--fs-sm);
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-white);
  color: #334155;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}
.ha-lang select:focus {
  border-color: var(--c-primary-mid);
}
.ha-final-actions .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.ha-disclaimer {
  margin: var(--gap-md) auto 0;
  max-width: 70ch;
  padding: 16px 18px;
  border-left: 3px solid var(--c-primary-lt);
  background: var(--c-near-white);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--c-muted);
}
.ha-disclaimer strong {
  color: var(--c-dark);
}

/* ===== STEP 3: REPORT DELIVERY (patient page) =====
   The form card itself is the home page's `.hero__form`, reused as-is so the two
   forms stay identical; only the surrounding layout is defined here. */
.ha-report {
  /* Same light gradient as the .sec--light sections so the delivery block
     blends into the page instead of reading as a separate dark panel. */
  background: linear-gradient(180deg, #ffffff 0%, #eaf1fb 100%);
  color: var(--c-dark);
  padding: var(--section-pad) 0;
}
.ha-report__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: var(--gap-lg);
  /* The form card is the taller column; centring keeps the copy beside it
     instead of stranded at the top. */
  align-items: center;
}
.ha-report__intro h2 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-black);
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--c-dark);
}
.ha-report__intro > p {
  color: var(--c-muted);
  font-weight: var(--fw-regular);
  max-width: 46ch;
  margin: 0 0 26px;
}
.ha-report__list {
  list-style: none;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
}
.ha-report__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: #334155;
}
/* Scoped past `.ha-report__intro > p`, which is meant for the lead paragraph and
   would otherwise take this one's spacing and colour with it. */
.ha-report__intro > .ha-report__note {
  margin: 26px 0 0;
  max-width: 52ch;
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--c-muted);
}
.ha-report__list svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  fill: none;
  stroke: var(--c-primary);
  stroke-width: 2;
}
.ha-report__card {
  width: 100%;
}
/* The phone row sits inside a `.f-field` here so the label above it is styled,
   but that also makes home.css's `.f-field select { width: 100% }` apply to the
   country code — which would leave no room for the number itself. */
.ha-report__card .hero-phone-row .hero-cc {
  width: auto;
  flex: 0 0 auto;
}
/* The report section is light now, so the reused hero form is restyled from
   its dark-glass hero variant into a clean light card. */
.ha-report__card.hero__form {
  background: var(--c-white);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.ha-report__card.hero__form::before {
  display: none;
}
.ha-report__card .hero__form-title {
  color: var(--c-dark);
  text-shadow: none;
}
.ha-report__card .hero__form-sub {
  color: var(--c-muted);
}
.ha-report__card .f-field label {
  color: var(--c-muted);
}
.ha-report__card .f-field input,
.ha-report__card .f-field select,
.ha-report__card .hero-cc {
  background: var(--c-white);
  border: 2px solid var(--c-border);
  color: #334155;
  box-shadow: none;
}
.ha-report__card .f-field input::placeholder {
  color: #94a3b8;
}
.ha-report__card .f-field input:focus,
.ha-report__card .f-field select:focus,
.ha-report__card .hero-cc:focus {
  border-color: var(--c-primary-mid);
  background: var(--c-white);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.ha-report__card .hero-consent {
  color: var(--c-muted);
}
.ha-report__card .hero-consent a {
  color: var(--c-primary);
}
/* The shared alert component is built for light sections. */
.ha-alert--dark {
  margin-top: 0;
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.ha-deliver {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ha-deliver .btn {
  width: 100%;
  justify-content: center;
}
.ha-deliver .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.ha-deliver__ok {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: #16a34a;
}
.ha-deliver__ok svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.ha-deliver__hint {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--c-muted);
  text-align: center;
}

/* ===== ADMIN: PASSWORD GATE ===== */
.ha-login {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--g-primary, #0f172a);
  overflow-y: auto;
}
.ha-login__card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  background: var(--c-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg, 0 20px 60px rgba(0, 0, 0, 0.3));
  padding: 30px;
}
.ha-login__card img {
  height: 34px;
  width: auto;
  align-self: flex-start;
}
.ha-login__card h1 {
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
  margin: 6px 0 0;
}
.ha-login__card > p {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin: 0 0 6px;
}
/* The badge that used to head the clinic hero is gone; the sign-out control now
   sits on its own right-aligned bar above the title. */
.ha-hero__bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.ha-logout {
  padding: 5px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.25);
  color: #fff;
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.ha-logout:hover {
  background: rgba(15, 23, 42, 0.45);
  border-color: #fff;
}

/* ===== ADMIN: SAVED CASES ===== */
.ha-records__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--gap-sm);
}
.ha-records__head h2 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  margin: 4px 0 6px;
}
.ha-records__head .sec-sub {
  margin: 0;
  max-width: 68ch;
}
.ha-records {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.ha-records__table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.ha-records__table th {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-near-white);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--c-muted);
  white-space: nowrap;
}
.ha-records__table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
  line-height: 1.5;
}
.ha-records__table tr:last-child td {
  border-bottom: 0;
}
.ha-records__table tbody tr:nth-child(even) td {
  background: rgba(241, 245, 249, 0.45);
}
.ha-records__table tbody tr:hover td {
  background: var(--c-near-white);
}
.ha-records__empty {
  text-align: center;
  color: var(--c-muted);
  padding: 28px 16px;
}
.ha-records__id {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-muted);
}
.ha-records__files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ha-records__file {
  padding: 3px 9px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-primary);
  text-decoration: none;
  white-space: nowrap;
}
.ha-records__file:hover {
  background: var(--c-near-white);
}
.ha-records__file--pdf {
  border-color: var(--c-primary);
  background: var(--c-near-white);
}

@media (max-width: 980px) {
  .ha-report__grid {
    grid-template-columns: 1fr;
    gap: var(--gap-md);
  }
  .ha-report__card {
    max-width: 520px;
  }
}

@media (max-width: 900px) {
  .ha-grid {
    grid-template-columns: 1fr;
  }
  .ha-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* One card per row leaves a shorter box once the caption wraps, so the
     diagram gives back the difference. */
  .ha-drop__label .ha-vec {
    width: 108px;
    height: 94px;
  }
}

@media (max-width: 768px) {
  .ha-hero {
    padding-top: 210px;
    padding-bottom: 40px;
  }
  .ha-hero h1 {
    font-size: var(--fs-h3);
  }
  .ha-hero__steps {
    gap: 10px 18px;
  }
  .ha-card {
    padding: 16px;
  }
  .ha-summary {
    padding: 18px;
  }
  .ha-final-actions .btn,
  .ha-actions .btn {
    width: 100%;
    justify-content: center;
  }
  /* Language picker sits above the full-width download button, not beside it. */
  .ha-lang {
    width: 100%;
    justify-content: space-between;
  }
  .ha-lang select {
    flex: 0 1 60%;
  }
  .ha-report {
    padding: 56px 0;
  }
  .ha-report__intro h2 {
    font-size: var(--fs-h4);
  }
  .ha-report__list li {
    font-size: var(--fs-xs);
  }
  .ha-summary__head {
    gap: 6px;
  }
}

@media (max-width: 520px) {
  .ha-stats {
    grid-template-columns: 1fr;
  }
  .ha-hero h1 {
    font-size: var(--fs-h4);
  }
  .ha-hero__step {
    font-size: var(--fs-xs);
  }
  /* Trim the horizontal padding so cards keep usable width on narrow phones. */
  .ha-card,
  .ha-progress {
    padding: 14px;
  }
  .ha-doctor__head,
  .ha-doctor__body {
    padding-left: 14px;
    padding-right: 14px;
  }
  .ha-result__head {
    padding: 14px 16px 10px;
  }
  .ha-result__foot {
    padding: 12px 16px 14px;
  }
  .ha-stat {
    padding: 14px;
  }
}
