:root {
  --ink: #222222;
  --muted: #666666;
  --line: #d8c096;
  --line-soft: #eadcc4;
  --wash: #f6f6f4;
  --gold: #c6a66f;
  --danger: #a43a2f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

img { display: block; max-width: 100%; }

button, input { font: inherit; }

.desktop-page main { overflow: hidden; }

/* ═══════════════════════════════════════
   Desktop — Hero
   ═══════════════════════════════════════ */
.desktop-hero {
  min-height: 780px;
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.desktop-copy {
  position: relative;
  z-index: 1;
  width: min(560px, 42vw);
  margin-left: 14vw;
  padding: 72px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-kicker {
  margin: 0 0 26px;
  font-size: 18px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.desktop-copy h1 {
  margin: 0 0 24px;
  font-size: clamp(44px, 4vw, 76px);
  font-weight: 400;
}

.desktop-copy h2 {
  margin: 0 0 34px;
  font-size: clamp(32px, 3vw, 56px);
  font-weight: 400;
}

.desktop-copy > p:not(.brand-kicker) {
  margin: 0 0 48px;
  font-size: 26px;
}

/* ═══════════════════════════════════════
   Desktop — Sections
   ═══════════════════════════════════════ */
.qr-shell {
  width: 260px;
  height: 260px;
  display: grid;
  place-items: center;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line-soft);
}

.qr-shell.large {
  width: 340px;
  height: 340px;
  margin: 28px auto 0;
}

.intro-section {
  padding: 86px 24px 112px;
  text-align: center;
}

.intro-section h2 {
  margin: 0 0 18px;
  font-size: clamp(34px, 3.2vw, 58px);
  font-weight: 400;
}

.intro-section p {
  margin: 0;
  font-size: clamp(24px, 2.2vw, 38px);
}

.story-section {
  width: min(1480px, calc(100% - 120px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 96px;
  align-items: center;
}

.story-copy {
  text-align: center;
  font-size: clamp(22px, 1.65vw, 34px);
  line-height: 1.65;
}

.story-copy p { margin: 0 0 18px; }

.story-section img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.steps-section {
  width: min(1120px, calc(100% - 80px));
  margin: 118px auto 0;
  padding-bottom: 72px;
}

.steps-section h2 {
  margin: 0 0 56px;
  font-size: clamp(32px, 3vw, 54px);
  font-weight: 400;
  text-align: center;
}

.timeline {
  width: min(760px, 100%);
  margin: 0 auto;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 76px 1fr;
  column-gap: 56px;
  align-items: center;
  min-height: 112px;
}

.step::before {
  content: "";
  position: absolute;
  left: 37px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.step:first-child::before { top: 50%; }
.step:last-child::before { bottom: 50%; }

.step span {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #ecdcc1, #caaa78);
  font-size: 44px;
  font-weight: 300;
}

.step p {
  margin: 0;
  font-size: 24px;
  line-height: 1.55;
}

.scan-section {
  padding: 76px 24px 120px;
  text-align: center;
}

.scan-section h2 {
  margin: 0;
  font-size: clamp(38px, 4vw, 72px);
  font-weight: 400;
}

.scan-section p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
}

/* ═══════════════════════════════════════
   Desktop — Grade Cards (DFU 专用)
   ═══════════════════════════════════════ */
.grade-card {
  background: #ffffff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 28px 20px 24px;
  text-align: center;
  transition: box-shadow 0.2s;
}

.grade-card:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.grade-num {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #ecdcc1, #caaa78);
  color: #ffffff;
  font-size: 28px;
  font-weight: 600;
}

.grade-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
}

.grade-card p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.grade-tag {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: #e8f5e9;
  color: #2e7d32;
}

.grade-tag-warn {
  background: #fff3e0;
  color: #e65100;
}

.grade-tag-danger {
  background: #ffebee;
  color: #c62828;
}

/* ═══════════════════════════════════════
   Mobile
   ═══════════════════════════════════════ */
.mobile-page { background: #ffffff; }
.mobile-shell { min-height: 100vh; }

.mobile-nav {
  height: 56px;
  display: grid;
  grid-template-columns: 40px 40px 1fr auto 40px;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  border-bottom: 1px solid #eeeeee;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.nav-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.nav-account {
  min-width: 88px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: #ffffff;
  color: #735321;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.nav-account:active { background: #f8f2e8; }

.mobile-logo {
  justify-self: center;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: 1px;
}

.mobile-hero-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center right;
}

.mobile-hero {
  padding: 48px 24px 40px;
  text-align: center;
}

.mobile-hero h1 {
  margin: 0 0 24px;
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  line-height: 1.25;
  font-weight: 500;
}

.mobile-hero h2 {
  margin: 0 0 20px;
  font-size: clamp(1.15rem, 3.5vw, 1.6rem);
  line-height: 1.35;
  font-weight: 400;
}

.mobile-hero p {
  margin: 0 0 36px;
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  line-height: 1.45;
}

.outline-cta {
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border: 2px solid var(--gold);
  background: #ffffff;
  color: var(--ink);
  font-size: clamp(0.9rem, 2.2vw, 1.1rem);
  line-height: 1.45;
  cursor: pointer;
  border-radius: 10px;
}

.mobile-story {
  border-top: 2px solid var(--line);
  padding: 56px 24px 0;
  text-align: center;
}

.mobile-story p {
  margin: 0 auto 14px;
  max-width: 760px;
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  line-height: 1.65;
}

.mobile-steps {
  padding: 56px 24px 60px;
}

.mobile-steps h2 {
  margin: 0 0 36px;
  font-size: clamp(1.15rem, 3.5vw, 1.6rem);
  line-height: 1.35;
  text-align: center;
  font-weight: 500;
}

.mobile-steps .step {
  grid-template-columns: 54px 1fr;
  column-gap: 20px;
  min-height: 80px;
}

.mobile-steps .step::before { left: 27px; }

.mobile-steps .step span {
  width: 54px;
  height: 54px;
  font-size: 28px;
}

.mobile-steps .step p {
  font-size: clamp(0.9rem, 2.2vw, 1.1rem);
  line-height: 1.5;
}

/* ═══════════════════════════════════════
   Bottom CTA (mobile)
   ═══════════════════════════════════════ */
.bottom-cta {
  padding: 0 24px 48px;
}

/* ═══════════════════════════════════════
   Capture App
   ═══════════════════════════════════════ */
.capture-app {
  display: none;
  min-height: 100vh;
  background: #222222;
  color: #ffffff;
}

.capture-app.active { display: block; }

.capture-app .capture-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 96px;
  padding: 26px 18px 12px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  border: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0));
  color: #ffffff;
}

.capture-app .capture-header h1 {
  margin: 0;
  text-align: center;
  font-size: 20px;
  font-weight: 500;
  color: #ffffff;
}

.capture-app .nav-icon {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.capture-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.capture-main {
  min-height: 100vh;
  padding: 0;
  position: relative;
}

/* ── Notice (拍摄提示页) ── */
.capture-notice {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 128px 20px 44px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.28)),
    #1a1a2e center / cover no-repeat;
}

.capture-notice[hidden],
.capture-scene[hidden] {
  display: none;
}

.notice-card {
  width: min(100%, 382px);
  background: #ffffff;
  color: #111111;
  padding: 32px 28px 28px;
  border-radius: 12px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.24);
}

.capture-plan-kicker {
  display: block;
  color: #9a6b25;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
}

.notice-card h2 {
  margin: 10px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.2;
  color: #121829;
}

.notice-card > p {
  margin: 0 0 28px;
  font-size: 18px;
  line-height: 1.62;
  font-weight: 500;
  color: #161616;
}

.notice-card > .capture-privacy-note {
  margin: 24px 0 0;
  padding: 14px 16px;
  border-left: 3px solid #c89b54;
  background: #f7f2e8;
  color: #665b49;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
}

.notice-items {
  display: grid;
  gap: 22px;
}

.notice-items div {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 10px;
}

.notice-items span {
  color: #222222;
  font-size: 25px;
  line-height: 1;
  text-align: center;
}

.notice-items strong {
  font-size: 16px;
  line-height: 1.42;
  font-weight: 600;
  color: #101010;
}

.notice-start {
  width: 100%;
  min-height: 60px;
  margin-top: 36px;
  border: 0;
  border-radius: 999px;
  background: #09b596;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.notice-start:active { opacity: 0.8; }

/* ── Camera Scene ── */
.capture-scene {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #111111;
}

.capture-sequence-card {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 16px;
  align-items: center;
  padding: 24px 22px 18px;
  background: #f7f5f0;
  color: #111827;
}

.capture-sequence-copy h2 {
  margin: 6px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
}

.capture-sequence-copy p {
  margin: 0;
  color: #5f6470;
  font-size: 13px;
  line-height: 1.55;
}

.capture-guide {
  height: 104px;
  display: grid;
  place-items: center;
  border: 1px solid #e3d9c8;
  border-radius: 18px;
  background: #fff;
  color: #ad7c33;
}

.capture-guide svg {
  width: 92px;
  height: 88px;
  overflow: visible;
}

.capture-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 12px 12px;
  background: #ede9e1;
}

.capture-slot {
  min-width: 0;
  padding: 8px 3px 7px;
  border: 1px dashed #aaa59c;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #74716b;
  text-align: center;
  font-size: 10px;
  line-height: 1.25;
}

.capture-slot strong {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0 auto 5px;
  border-radius: 50%;
  background: #ddd8ce;
  color: #5f5a50;
  font-size: 11px;
}

.capture-slot.active {
  border-color: #b37b2c;
  background: #fff8e9;
  color: #7b531b;
}

.capture-slot.active strong { background: #b37b2c; color: #fff; }
.capture-slot.complete { border-style: solid; border-color: #18876f; color: #176c5b; }
.capture-slot.complete strong { background: #18876f; color: #fff; }

.camera-guide-overlay {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  border: 2px dashed rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.camera-guide-overlay.guide-side {
  width: 78%;
  height: 42%;
  border-radius: 54% 42% 36% 45%;
}

.camera-guide-overlay.guide-sole {
  width: 43%;
  height: 78%;
  border-radius: 48% 48% 36% 36% / 30% 30% 65% 65%;
}

.camera-guide-overlay.guide-wound {
  width: 58%;
  height: 58%;
  border-radius: 50%;
}

.camera-guide-overlay.guide-wound::before,
.camera-guide-overlay.guide-wound::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  background: rgba(255, 255, 255, 0.72);
  transform: translate(-50%, -50%);
}

.camera-guide-overlay.guide-wound::before { width: 26px; height: 1px; }
.camera-guide-overlay.guide-wound::after { width: 1px; height: 26px; }

.camera-panel {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #111111;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.camera-panel video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111111;
}

.preview-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.preview-image.visible { display: block; }

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  line-height: 1.6;
  z-index: 1;
  font-size: 15px;
}

.capture-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 18px 0;
}

.submit-row {
  padding: 14px 18px 8px;
  display: grid;
  gap: 10px;
}

.submit-row .primary-btn {
  width: 100%;
  min-height: 56px;
  font-size: 17px;
}

.capture-footer-note {
  padding: 14px 18px 28px;
  display: grid;
  place-items: center;
  min-height: 44px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  text-align: center;
}

.capture-confirm-btn {
  background: #fff;
  color: #151b2d;
}

.capture-stage-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 15, 28, 0.78);
  backdrop-filter: blur(6px);
}

.capture-stage-modal[hidden] { display: none; }

.capture-stage-dialog {
  width: min(100%, 390px);
  padding: 30px 26px 26px;
  border-radius: 20px;
  background: #fff;
  color: #151b2d;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.3);
}

.capture-stage-icon {
  width: 62px;
  height: 62px;
  margin-bottom: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #183153;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 20px;
}

.capture-stage-dialog h2 { margin: 8px 0 12px; font-size: 26px; }
.capture-stage-dialog > p { color: #5e6470; font-size: 14px; line-height: 1.65; }
.closeup-tips { display: grid; gap: 8px; margin: 18px 0; }
.closeup-tips span { padding: 10px 12px; border-radius: 9px; background: #f4f1eb; font-size: 13px; }
.capture-stage-dialog > .capture-stage-note { font-size: 12px; color: #8b6b38; }
.capture-stage-dialog .notice-start { margin-top: 20px; }

.primary-btn, .secondary-btn {
  min-height: 52px;
  border: 1px solid var(--gold);
  cursor: pointer;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
}

.primary-btn {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.secondary-btn {
  background: #ffffff;
  color: var(--ink);
}

.secondary-btn:active { background: #f2f2f7; }

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════
   Status Box
   ═══════════════════════════════════════ */
.status-box {
  display: none;
  margin: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 0;
  border-radius: 10px;
  line-height: 1.6;
  color: #333333;
  text-align: center;
  font-size: 14px;
}

.status-box.active { display: block; }

.error-text { color: #a43a2f; }

/* ═══════════════════════════════════════
   Loading
   ═══════════════════════════════════════ */
.loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  font-size: 15px;
  color: #8e8e93;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e5e5ea;
  border-top-color: #636366;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 14px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════
   Toast
   ═══════════════════════════════════════ */
.toast {
  display: none;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #1c1c1e;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  white-space: nowrap;
  pointer-events: none;
}

.toast.active { display: block; }

/* ═══════════════════════════════════════
   Report
   ═══════════════════════════════════════ */
.report-view { display: none; }

.report-view.active { display: block; }

.report-hero {
  padding: 46px 24px 32px;
  text-align: center;
  border-bottom: 1px solid #eee7dc;
}

.score-number {
  margin: 0 auto 12px;
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--gold);
  font-size: 46px;
}

.report-grid {
  padding: 24px;
  display: grid;
  gap: 12px;
}

.metric-card {
  padding: 18px;
  border: 1px solid #eadfcb;
  border-radius: 12px;
}

.metric-card strong {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.bar {
  height: 7px;
  background: #eeeae3;
  border-radius: 4px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
}

.report-text {
  padding: 8px 24px 48px;
  line-height: 1.8;
  font-size: 15px;
}

/* ═══════════════════════════════════════
   Report HTML (from backend format_report)
   ═══════════════════════════════════════ */
.result-grade {
  font-size: 52px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  color: var(--ink);
}

.result-confidence {
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 20px;
}

.result-borderline {
  text-align: center;
  padding: 10px 16px;
  margin-bottom: 20px;
  background: #fff3cd;
  border-radius: 10px;
  font-size: 13px;
  color: #856404;
  line-height: 1.5;
}

.result-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--ink);
}

.section-body {
  font-size: 14px;
  line-height: 1.7;
  color: #48484a;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 14px;
  font-weight: 600;
  margin: 14px 0 8px;
  color: var(--ink);
}

.advice-list {
  margin: 0;
  padding: 0 0 0 20px;
}

.advice-list li {
  font-size: 14px;
  line-height: 1.7;
  color: #3a3a3c;
  margin-bottom: 6px;
}

.urgency-tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
}

.urgency-常规 {
  background: #e8f5e9;
  color: #2e7d32;
}

.urgency-尽快就诊 {
  background: #fff3e0;
  color: #e65100;
}

.urgency-紧急就诊 {
  background: #fce4ec;
  color: #c62828;
}

.urgency-立即急诊 {
  background: #ff1744;
  color: #ffffff;
}

.secondary-section {
  border: 1px dashed #ff9f0a;
  border-radius: 12px;
  padding: 16px;
  background: #fffbf0;
}

.disclaimer {
  margin-top: 24px;
  padding: 14px 16px;
  background: #f2f2f7;
  border-radius: 10px;
  font-size: 12px;
  color: #8e8e93;
  line-height: 1.6;
  text-align: center;
}

/* ═══════════════════════════════════════
   Auth Overlay
   ═══════════════════════════════════════ */
.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-overlay.active { display: flex; }

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 24px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  animation: authFadeIn 0.25s ease;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 28px;
  color: #8e8e93;
  cursor: pointer;
  line-height: 1;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #f2f2f7;
}

.auth-tab {
  padding: 12px 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  color: #8e8e93;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.auth-tab.active { color: #222222; }

.auth-tab.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.auth-form.active { display: flex; }

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field span {
  font-size: 13px;
  color: #48484a;
  font-weight: 500;
}

.auth-field input {
  height: 46px;
  padding: 0 14px;
  border: 1px solid #dcdce0;
  border-radius: 10px;
  font-size: 15px;
  color: #1c1c1e;
  background: #fbfbfa;
  outline: none;
  transition: border-color 0.2s;
}

.auth-field input:focus { border-color: var(--gold); }

.auth-field-code {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.auth-send-code {
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--gold);
  background: #ffffff;
  color: var(--gold);
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.auth-send-code:active { background: var(--gold); color: #ffffff; }
.auth-send-code:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-submit {
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: #1c1c1e;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.2s;
}

.auth-submit:active { opacity: 0.75; }

.auth-error {
  font-size: 12px;
  color: #a43a2f;
  min-height: 18px;
  margin: 0;
}

.auth-required {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: #8e8e93;
  line-height: 1.6;
}

/* ═══════════════════════════════════════
   History
   ═══════════════════════════════════════ */
.history-item { transition: background 0.15s; }

.history-item:active { background: #f2f2f7 !important; }

/* ═══════════════════════════════════════
   Responsive
   ═══════════════════════════════════════ */
@media (max-width: 900px) {
  .desktop-hero { min-height: 660px; }

  .desktop-copy {
    width: min(520px, calc(100% - 56px));
    margin: 0 auto;
    padding: 72px 28px;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.72);
  }

  .story-section {
    width: calc(100% - 48px);
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .steps-section { width: calc(100% - 48px); }
  .step { column-gap: 28px; }
}

@media (max-width: 520px) {
  .mobile-nav {
    height: 52px;
    grid-template-columns: 36px 36px 1fr 36px 36px;
    padding: 0 8px;
  }

  .mobile-logo { font-size: 19px; }
  .mobile-hero-img { height: 200px; }
}

/* Patient profile onboarding / personal center */
.profile-view { min-height: 100dvh; background: #f6f4ef; }
.profile-page-body { max-width: 720px; margin: 0 auto; padding: 28px 18px 64px; }
.profile-intro {
  padding: 26px 24px; color: #fff;
  background: linear-gradient(145deg, #1a1a2e, #16213e 60%, #0f3460);
  border-radius: 22px; box-shadow: 0 18px 40px rgba(15, 24, 50, .18);
}
.profile-step {
  display: block; margin-bottom: 10px; color: #d7ba86;
  font-size: 11px; font-weight: 700; letter-spacing: 2.2px;
}
.profile-intro h2 {
  margin: 0 0 10px; font-family: Georgia, "Noto Serif SC", serif; font-size: 27px;
}
.profile-intro p { margin: 0; color: rgba(255,255,255,.68); font-size: 13px; line-height: 1.7; }
.profile-form {
  margin-top: 18px; padding: 24px 20px; background: #fff;
  border: 1px solid #ebe7df; border-radius: 22px;
}
.profile-field, .profile-fieldset { display: block; margin: 0 0 24px; padding: 0; border: 0; }
.profile-field > span, .profile-fieldset legend {
  display: block; margin-bottom: 10px; color: #26262d; font-size: 14px; font-weight: 700;
}
.profile-field > span small { margin-left: 6px; color: #8e8e93; font-size: 12px; font-weight: 400; }
.profile-fieldset legend small { margin-left: 6px; color: #8e8e93; font-size: 12px; font-weight: 400; }
.profile-field input[type="text"], .profile-field input[type="tel"],
.profile-field input[type="number"], .profile-field select {
  box-sizing: border-box; width: 100%; padding: 14px 15px; color: #1c1c1e;
  background: #f8f7f4; border: 1px solid #dfdcd5; border-radius: 13px;
  outline: none; font-size: 15px; transition: border-color .2s, box-shadow .2s;
}
.profile-field input[type="text"]:focus, .profile-field input[type="tel"]:focus,
.profile-field input[type="number"]:focus, .profile-field select:focus {
  border-color: #b8955e; box-shadow: 0 0 0 3px rgba(184,149,94,.14);
}
.choice-grid { display: grid; gap: 10px; }
.choice-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-card, .dietary-card { position: relative; cursor: pointer; }
.choice-card input, .dietary-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card span {
  display: grid; min-height: 48px; place-items: center; color: #4c4b50;
  background: #f8f7f4; border: 1px solid #dfdcd5; border-radius: 13px;
  font-weight: 700; transition: .2s ease;
}
.choice-card input:checked + span {
  color: #fff; background: #1a1a2e; border-color: #1a1a2e;
  box-shadow: 0 8px 18px rgba(26,26,46,.16);
}
.dietary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dietary-card > span {
  display: flex; box-sizing: border-box; min-height: 82px; flex-direction: column;
  justify-content: center; padding: 13px; color: #3a393d; background: #f8f7f4;
  border: 1px solid #e2ded6; border-radius: 14px; transition: .2s ease;
}
.dietary-card strong { font-size: 13px; line-height: 1.4; }
.dietary-card small { display: block; margin-top: 5px; color: #8e8e93; font-size: 10px; line-height: 1.4; }
.dietary-card input:checked + span {
  color: #5f4521; background: #faf3e6; border-color: #c6a66f;
  box-shadow: inset 0 0 0 1px #c6a66f;
}
.dietary-card input:checked + span::after {
  content: "✓"; position: absolute; top: 8px; right: 10px; color: #9b7338; font-weight: 800;
}
.profile-loading { grid-column: 1 / -1; padding: 24px; color: #8e8e93; text-align: center; }
.profile-save { width: 100%; }
.profile-logout {
  display: block; width: 100%; margin-top: 12px; padding: 13px;
  color: #a43a2f; background: transparent; border: 0; font-size: 14px; cursor: pointer;
}
@media (max-width: 420px) {
  .dietary-grid { grid-template-columns: 1fr; }
  .profile-page-body { padding-inline: 14px; }
  .profile-form { padding-inline: 16px; }
}
