/* icia capture-flow mockup custom styles */
/* Tailwind handles utilities; this file owns: breathing circles, scan ring, landmarks, slide-up reveal */

/* ── Reset / base ── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg-base:#FBFCFD; --bg-elevated:#FFFFFF; --bg-sunken:#F2F5F7; --glass-fill:rgba(255,255,255,.62); --glass-stroke:rgba(17,24,39,.10);
  --ink-900:#0F1A24; --ink-700:#344251; --ink-500:#64748B; --ink-300:#CBD5E1; --hairline:#E4E9EF;
  --accent-600:#0E7C86; --accent-500:#15909B; --accent-050:#E6F3F4;
  --sev-info:#0072B2; --sev-low:#2E8B9E; --sev-moderate:#E69F00; --sev-high:#D55E00;
  --sev-info-bg:#E5F0F7; --sev-low-bg:#E3F1F4; --sev-moderate-bg:#FDF1DC; --sev-high-bg:#FBE7DC;
  --grade-strong:#0E7C86; --grade-moderate:#5B7186; --grade-low:#97A5B4;
  --accent: var(--accent-600);
  --accent-dim: rgba(14,124,134,.16);
  --accent-glow: rgba(14,124,134,.34);
  --fg: var(--ink-900);
  --fg-muted: var(--ink-500);
  --surface: var(--bg-elevated);
  --surface-raised: var(--bg-sunken);
  --border: var(--hairline);
  --ring-color: rgba(14,124,134,.55);
  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "SF Mono", "Fira Code", ui-monospace, monospace;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--fg);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* ── Concentric breathing circles (idle capture button) ── */
.capture-btn {
  position: relative;
  width: 96px;
  height: 96px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.capture-btn .ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  inset: 0;
  margin: auto;
  animation: breathe var(--delay, 3.2s) ease-in-out infinite;
}

.capture-btn .ring:nth-child(1) {
  width: 36px; height: 36px;
  background: var(--accent);
  border-color: var(--accent);
  --delay: 3.2s;
}
.capture-btn .ring:nth-child(2) {
  width: 56px; height: 56px;
  opacity: .55;
  --delay: 3.2s;
  animation-delay: -0.4s;
}
.capture-btn .ring:nth-child(3) {
  width: 76px; height: 76px;
  opacity: .30;
  --delay: 3.2s;
  animation-delay: -0.8s;
}
.capture-btn .ring:nth-child(4) {
  width: 96px; height: 96px;
  opacity: .15;
  --delay: 3.2s;
  animation-delay: -1.2s;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: var(--base-op, 1); }
  50%       { transform: scale(1.08); opacity: calc(var(--base-op, 1) * 0.7); }
}

/* Suppress rings 2-4 base opacity via custom prop */
.capture-btn .ring:nth-child(2) { --base-op: .55; }
.capture-btn .ring:nth-child(3) { --base-op: .30; }
.capture-btn .ring:nth-child(4) { --base-op: .15; }

/* ── Camera / face view ── */
#camera-view {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  background: #111;
}

#camera-video, #placeholder-face {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Face detection concentric-ring frame ── */
.face-frame {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(99,102,241,.6);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

/* ── Scan ring overlay ── */
.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--accent-glow) 20%,
    var(--accent) 50%,
    var(--accent-glow) 80%,
    transparent 100%);
  box-shadow: 0 0 12px 2px var(--accent-glow);
  top: 0;
  animation: none;
  pointer-events: none;
  z-index: 20;
}

.scan-line.animating {
  animation: scan-sweep 2.4s cubic-bezier(0.37,0,0.63,1) forwards;
}

@keyframes scan-sweep {
  0%   { top: 5%; opacity: 1; }
  48%  { top: 95%; }
  49%  { top: 95%; opacity: 1; }
  50%  { top: 5%; opacity: 0; }
  51%  { top: 5%; opacity: 1; }
  98%  { top: 95%; opacity: 1; }
  100% { top: 95%; opacity: 0; }
}

/* ── Landmark dots ── */
.landmark-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px 2px var(--accent-glow);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 25;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.landmark-dot.visible {
  transform: translate(-50%, -50%) scale(1);
}

/* ── Thread SVG overlay ── */
#landmark-threads {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 22;
}

#landmark-threads path {
  stroke: var(--accent);
  stroke-width: 0.8;
  fill: none;
  opacity: 0;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset 0.6s ease, opacity 0.3s ease;
}

#landmark-threads path.drawn {
  stroke-dashoffset: 0;
  opacity: 0.35;
}

/* ── Scan result ring (post-reveal) ── */
.scan-result-ring {
  position: absolute;
  inset: -3px;
  border-radius: 26px;
  border: 1.5px solid var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.scan-result-ring.visible {
  opacity: 0.4;
}

/* ── Report card ── */
#report-card {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 32px;
  max-height: 65%;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.32,0.72,0,1);
  z-index: 40;
  box-shadow: 0 -8px 40px rgba(0,0,0,.12);
}

#report-card.visible {
  transform: translateY(0);
}

/* Scrollbar */
#report-card::-webkit-scrollbar { width: 3px; }
#report-card::-webkit-scrollbar-track { background: transparent; }
#report-card::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Evidence level pills ── */
.evidence-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.evidence-pill.sysrev    { background: #d1fae5; color: #065f46; }
.evidence-pill.guideline { background: #dbeafe; color: #1e40af; }
.evidence-pill.rct       { background: #ede9fe; color: #4c1d95; }
.evidence-pill.cohort    { background: #fef3c7; color: #92400e; }
.evidence-pill.case_report { background: #fee2e2; color: #991b1b; }

/* ── PMID badge ── */
.pmid-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 500;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  transition: background .15s;
}
.pmid-badge:hover { background: var(--accent-dim); }

/* ── Workup chips ── */
.workup-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.workup-chip:hover { background: var(--accent-dim); border-color: var(--accent); }

/* ── Per-claim action buttons ── */
.claim-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  transition: background .15s, border-color .15s, color .15s;
  color: var(--fg-muted);
}
.claim-action.accept:hover { background: #d1fae5; border-color: #10b981; color: #065f46; }
.claim-action.reject:hover { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.claim-action.edit:hover   { background: #ede9fe; border-color: #8b5cf6; color: #4c1d95; }
.claim-action.accepted  { background: #d1fae5; border-color: #10b981; color: #065f46; }
.claim-action.rejected  { background: #fee2e2; border-color: #ef4444; color: #991b1b; }

/* ── Profile chip ── */
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  border: 1px solid var(--border);
  user-select: none;
  transition: background .2s, color .2s, border-color .2s;
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}
.profile-chip:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ── Countdown numeral ── */
.countdown-numeral {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  font-size: 72px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 24px rgba(0,0,0,.55);
  letter-spacing: -.04em;
  pointer-events: none;
  z-index: 35;
  opacity: 0;
  transition: opacity 120ms ease, transform 150ms cubic-bezier(0.34,1.56,0.64,1);
  line-height: 1;
}

.countdown-numeral.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Reduced-motion: hide numerals entirely */
@media (prefers-reduced-motion: reduce) {
  .countdown-numeral { display: none !important; }
}

/* ── Countdown ring contraction ── */
.countdown-ring {
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1) !important;
}
.countdown-ring.tick-2 { inset: 3% !important; }
.countdown-ring.tick-1 { inset: 4% !important; }
.countdown-ring.tick-0 { inset: 5% !important; }

/* ── Turn cue arrow overlay ── */
.turn-cue {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 36;
  pointer-events: none;
  font-size: 44px;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 2px 20px rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity 200ms ease;
  user-select: none;
}
.turn-cue.show { opacity: 1; }
.turn-cue.animate-left {
  animation: turn-arrow-left 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.turn-cue.animate-right {
  animation: turn-arrow-right 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes turn-arrow-left {
  0% { opacity: 0; transform: translate(-30%, -50%) scale(0.7); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes turn-arrow-right {
  0% { opacity: 0; transform: translate(-70%, -50%) scale(0.7); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .turn-cue { animation: none !important; }
}

/* ── Patient instruction caption (inside camera frame) ── */
.patient-caption {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.88);
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 99px;
  padding: 5px 14px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 38;
  letter-spacing: .01em;
  opacity: 0;
  transition: opacity 250ms ease;
}
.patient-caption.show { opacity: 1; }

/* ── No-camera fallback caption ── */
.no-camera-caption {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 400;
  font-family: var(--mono);
  color: rgba(255,255,255,.52);
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 37;
  letter-spacing: .01em;
}

/* ── Mode chip ── */
.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  border: 1px solid var(--border);
  user-select: none;
  transition: background .2s, color .2s, border-color .2s;
}
.mode-chip.samd    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.mode-chip.wellness { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }

/* ── Abstract preview popover ── */
#abstract-popover {
  position: fixed;
  max-width: 320px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.14);
  z-index: 100;
  font-size: 12px;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  transform: translateY(6px);
}
#abstract-popover.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ── Toast for workup copy ── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f0f0f;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 99px;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Reduced-motion overrides ── */
@media (prefers-reduced-motion: reduce) {
  .capture-btn .ring { animation: none !important; }
  .scan-line { animation: none !important; }
  .scan-line.animating { opacity: 1; top: 50%; }
  #report-card { transition: none !important; }
  .landmark-dot { transition: none !important; }
  #landmark-threads path { transition: none !important; }
}

/* ── Utility: hidden ── */
.hidden { display: none !important; }

/* ── State screens ── */
#idle-screen, #camera-screen {
  transition: opacity .3s ease;
}

/* ── Grab handle on report card ── */
.report-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,.12);
  margin: 0 auto 16px;
}

/* ── Scanning label (reduced-motion) ── */
#scanning-label {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.8);
  letter-spacing: .04em;
  pointer-events: none;
  z-index: 30;
  animation: pulse-text 1.4s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #scanning-label { animation: none; opacity: 1; }
}

/* ── Empty state ── */
#empty-state-card {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 40px;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.32,0.72,0,1);
  z-index: 40;
  box-shadow: 0 -8px 40px rgba(0,0,0,.12);
}

#empty-state-card.visible {
  transform: translateY(0);
}

/* ── Claim card (old in-camera version, superseded by page2 version below) ── */
.claim-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 12px;
  background: var(--surface-raised);
  transition: border-color .2s;
}
.claim-card:hover { border-color: rgba(99,102,241,.3); }
.claim-card.rejected { opacity: .45; }

/* ════════════════════════════════════════════════════════════════════════════
   PAGE 1 REVEAL BEAT
════════════════════════════════════════════════════════════════════════════ */

/* Face thumbnail (top-left corner) */
.page1-face-thumb {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 56px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  background: #111;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.page1-face-thumb.visible {
  opacity: 1;
  transform: scale(1);
}

/* Headline panel, slides up from below */
.headline-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.32,0.72,0,1);
  max-width: 360px;
  width: 100%;
  padding: 40px 32px 36px;
}
.headline-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

.headline-count {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 10px;
}

.headline-mode {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.01em;
  margin-bottom: 32px;
}

.view-report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--fg);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 14px 36px;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background 0.15s, transform 0.15s;
  min-width: 180px;
}
.view-report-btn:hover {
  background: #1f1f1f;
  transform: scale(1.03);
}
.view-report-btn:active { transform: scale(0.98); }

.headline-provenance {
  font-size: 11px;
  color: #9ca3af;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

/* Reduced-motion: no slide/fade, just appear */
@media (prefers-reduced-motion: reduce) {
  .headline-panel {
    transition: none !important;
  }
  .headline-panel.visible {
    opacity: 1;
    transform: none;
  }
  .page1-face-thumb {
    transition: none !important;
  }
  .page1-face-thumb.visible {
    opacity: 1;
    transform: none;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   PAGE 2 FULL REPORT
════════════════════════════════════════════════════════════════════════════ */

#page2-screen {
  position: fixed;
  inset: 0;
  background: var(--surface);
  overflow: hidden;
  z-index: 50;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.32,0.72,0,1);
  display: flex;
  flex-direction: column;
}
#page2-screen.visible {
  opacity: 1;
  transform: translateY(0);
}
#page2-screen.hidden {
  display: none !important;
}
#page2-screen.slide-down {
  transform: translateY(100%);
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  #page2-screen {
    transition: none !important;
  }
  #page2-screen.visible {
    transform: none;
    opacity: 1;
  }
  #page2-screen.slide-down {
    transform: none;
    opacity: 0;
  }
}

/* Page 2 thin header */
.page2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
  gap: 12px;
}

.page2-face-thumb {
  width: 36px;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #111;
  flex-shrink: 0;
}

.page2-encounter-chip {
  font-size: 10px;
  font-weight: 500;
  color: var(--fg-muted);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.page2-back-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.page2-back-btn:hover {
  background: var(--surface-raised);
  color: var(--fg);
}

/* Page 2 scrollable body */
.page2-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 40px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  -webkit-overflow-scrolling: touch;
}
.page2-body::-webkit-scrollbar { width: 4px; }
.page2-body::-webkit-scrollbar-track { background: transparent; }
.page2-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Claim cards, Page 2 full-width readable version */
.claim-card-p2 {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 24px 24px 20px;
  background: var(--surface);
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
  margin-bottom: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
  outline: none;
}
.claim-card-p2:focus {
  box-shadow: 0 0 0 3px var(--accent-dim), 0 1px 6px rgba(0,0,0,.05);
  border-color: var(--accent);
}
.claim-card-p2:hover {
  border-color: rgba(99,102,241,.22);
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
.claim-card-p2.rejected { opacity: 0.45; }

.claim-card-p2 .claim-sign-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.claim-card-p2 h2.claim-sign {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0;
}

.claim-card-p2 .claim-text {
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 14px;
  font-weight: 400;
}

.claim-card-p2 .claim-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.claim-card-p2 .claim-workup {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

/* Per-claim action row (Page 2), larger tap targets */
.claim-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(0,0,0,.06);
  padding-top: 14px;
  margin-top: 4px;
}

.claim-action-p2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-height: 40px;
}
.claim-action-p2:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.claim-action-p2.accept:hover,
.claim-action-p2.accepted {
  background: #d1fae5; border-color: #10b981; color: #065f46;
}
.claim-action-p2.reject:hover,
.claim-action-p2.rejected {
  background: #fee2e2; border-color: #ef4444; color: #991b1b;
}
.claim-action-p2.edit:hover {
  background: #ede9fe; border-color: #8b5cf6; color: #4c1d95;
}

/* Workup section label */
.page2-workup-section {
  margin-top: 8px;
  margin-bottom: 12px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-raised);
}
.page2-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 10px;
}

/* Clinician routing button row */
.page2-done-row {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}
.page2-done-btn {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 56px;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-height: 48px;
}
.page2-done-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.page2-done-btn:active { transform: scale(0.98); }
.page2-done-btn:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Page 2 empty state action buttons */
.page2-empty-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, border-color 0.15s;
}

/* Page 2 empty card */
.page2-empty-card {
  padding: 48px 32px;
  text-align: center;
}

/* ── Capture error overlay (live-mode failures) ────────────────────────── */
.capture-error-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.capture-error-overlay.visible { display: flex; }
.capture-error-card {
  background: #fff;
  border-radius: 18px;
  max-width: 360px;
  width: 100%;
  padding: 28px 24px 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.20);
  text-align: center;
}
.capture-error-title {
  font-size: 17px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.capture-error-msg {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 20px;
}
.capture-error-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.capture-error-btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.capture-error-btn.primary {
  background: #0E7C86;
  color: #fff;
}
.capture-error-btn.primary:hover { background: #0B6972; }
.capture-error-btn.secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #e5e7eb;
}
.capture-error-btn.secondary:hover { background: #f9fafb; border-color: #d1d5db; }

/* ── Analyzing globe (live capture indicator) ──────────────────────────── */
.analyzing-globe {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
  z-index: 40;
}
.analyzing-globe.visible { opacity: 1; }
.analyzing-globe svg {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 6px 20px rgba(92, 200, 255, 0.45));
}
.analyzing-globe .globe-meridians {
  transform-origin: 50% 50%;
  animation: globe-spin 4.2s linear infinite;
}
@keyframes globe-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .analyzing-globe .globe-meridians { animation: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   RESULT SCREEN, DOCTOR-FACING
════════════════════════════════════════════════════════════════════════════ */

#page2-screen {
  background: var(--bg-base);
  color: var(--ink-900);
}

.page2-header {
  background: rgba(251,252,253,.88);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--hairline);
}

.page2-body {
  max-width: 1040px;
  padding: 20px 16px 112px;
}

.page2-encounter-chip {
  background: var(--bg-sunken);
  border-color: var(--hairline);
  color: var(--ink-700);
}

.mode-chip.samd,
.mode-chip.wellness {
  background: var(--accent-050);
  border-color: rgba(14,124,134,.22);
  color: var(--accent-600);
}

.page2-back-btn {
  color: var(--ink-700);
}

.result-peak {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 360px);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

.viewer-shell {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: 1.25rem;
  padding: 10px;
  box-shadow: 0 18px 48px rgba(15,26,36,.10);
}

.viewer-toolbar {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 6;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  border-radius: .875rem;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.viewer-toggle {
  border: 0;
  border-radius: .625rem;
  background: transparent;
  color: var(--ink-700);
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  padding: 6px 11px;
  cursor: pointer;
}

.viewer-toggle.active {
  background: var(--bg-elevated);
  color: var(--ink-900);
  box-shadow: 0 1px 4px rgba(15,26,36,.10);
}

.annotated-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: .875rem;
  background: #111827;
}

.annotated-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.region-layer {
  position: absolute;
  inset: 0;
}

.annotated-photo.show-original .region-layer {
  opacity: .16;
}

.finding-region {
  position: absolute;
  border: 2px solid var(--sev-info);
  border-radius: .875rem;
  background: rgba(255,255,255,.03);
  box-shadow: 0 0 0 1px rgba(255,255,255,.62), 0 10px 22px rgba(15,26,36,.18);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}

.finding-region[aria-pressed="true"] {
  transform: scale(1.025);
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 5px rgba(14,124,134,.34), 0 18px 32px rgba(15,26,36,.22);
}

.finding-region.muted {
  opacity: .28;
}

.finding-region.sev-mild,
.finding-region.sev-low { border-color: var(--sev-low); border-style: solid; }
.finding-region.sev-moderate { border-color: var(--sev-moderate); border-style: dashed; }
.finding-region.sev-severe,
.finding-region.sev-high { border-color: var(--sev-high); border-style: solid; }

.region-pin {
  position: absolute;
  top: -14px;
  left: -14px;
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 999px;
  background: var(--ink-900);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid #fff;
}

.sev-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.sev-symbol.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}
.sev-symbol.triangle {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid currentColor;
}
.sev-symbol.diamond {
  width: 10px;
  height: 10px;
  background: currentColor;
  transform: rotate(45deg);
}
.sev-symbol.info {
  width: 15px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.top-finding {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: 1.25rem;
  padding: 24px;
  box-shadow: 0 18px 48px rgba(15,26,36,.08);
}

.quality-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.quality-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: .75rem;
  background: var(--bg-elevated);
}

.quality-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(0, 114, 178, .18);
  border-radius: .5rem;
  background: var(--sev-info-bg);
  color: #064C77;
  font-size: 12px;
  font-weight: 700;
}

.quality-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 13px;
  line-height: 1;
}

.quality-caveat {
  padding: 12px 13px;
  border: 1px solid rgba(230, 159, 0, .34);
  border-radius: .75rem;
  background: #FFF4D6;
  color: #6B4A00;
  font-size: 13px;
  line-height: 20px;
  font-weight: 720;
}

.quality-persistent {
  color: var(--ink-500);
  font-size: 12px;
  line-height: 18px;
  margin: 0;
}

.top-finding h1 {
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.06;
  letter-spacing: 0;
  font-weight: 750;
  margin: 0;
  color: var(--ink-900);
}

.top-finding-title {
  display: grid;
  gap: 8px;
  align-items: start;
  justify-items: start;
}

.top-finding p,
.finding-card p {
  color: var(--ink-700);
  font-size: 15px;
  line-height: 24px;
  margin: 0;
}

.finding-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--ink-500);
  font-size: 13px;
}

.severity-chip {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: .5rem;
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  border: 1px solid transparent;
}
.severity-chip.sev-absent { background: var(--sev-info-bg); color: #064C77; border-color: rgba(0,114,178,.20); }
.severity-chip.sev-mild,
.severity-chip.sev-low { background: var(--sev-low-bg); color: #1F6475; border-color: rgba(46,139,158,.22); }
.severity-chip.sev-moderate { background: var(--sev-moderate-bg); color: #7A5200; border-color: rgba(230,159,0,.26); }
.severity-chip.sev-severe,
.severity-chip.sev-high { background: var(--sev-high-bg); color: #923A00; border-color: rgba(213,94,0,.24); }

.confidence-tier {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 650;
}

.grade-dots {
  display: inline-flex;
  gap: 3px;
}
.grade-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ink-300);
}
.grade-dots i.on { background: var(--grade-moderate); }
.grade-high .grade-dots i.on { background: var(--grade-strong); }
.grade-low .grade-dots i.on { background: var(--grade-low); }

.findings-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.finding-card {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: .875rem;
  padding: 15px;
  box-shadow: 0 1px 4px rgba(15,26,36,.04);
  outline: none;
}

.finding-card.selected {
  border-color: rgba(14,124,134,.44);
  box-shadow: 0 0 0 3px rgba(14,124,134,.12), 0 8px 20px rgba(15,26,36,.06);
}

.finding-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.finding-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-900);
  text-align: left;
  font-size: 17px;
  line-height: 24px;
  font-weight: 720;
  padding: 0;
  margin-bottom: 5px;
  cursor: pointer;
}
.finding-title-btn .finding-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 750;
}

.finding-title-text {
  min-width: 0;
}

.diagnosis-tag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: .5rem;
  border: 1px solid rgba(14, 124, 134, .22);
  background: rgba(14, 124, 134, .08);
  color: #0B6972;
  font-size: 11px;
  line-height: 16px;
  font-weight: 750;
}

.evidence-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--hairline);
  border-radius: .5rem;
  background: var(--bg-sunken);
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 750;
  text-transform: capitalize;
  padding: 4px 8px;
}
.grade-badge.grade-strong { color: var(--grade-strong); }
.grade-badge.grade-moderate { color: var(--grade-moderate); }
.grade-badge.grade-weak { color: var(--grade-low); }

.citation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.citation-detail {
  position: relative;
  color: var(--ink-700);
  font-size: 12px;
  line-height: 18px;
}
.citation-detail summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--hairline);
  border-radius: .5rem;
  background: var(--bg-elevated);
  padding: 4px 7px;
  font-family: var(--mono);
  font-size: 11px;
}
.citation-detail summary::-webkit-details-marker { display: none; }
.citation-detail[open] {
  width: min(100%, 360px);
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: .875rem;
  background: var(--bg-sunken);
}
.citation-detail[open] summary {
  display: inline-flex;
  margin-bottom: 6px;
}
.citation-detail a {
  display: block;
  color: var(--accent-600);
  font-weight: 700;
  text-decoration: none;
}
.citation-detail span {
  display: block;
  color: var(--ink-500);
}

.page2-workup-section {
  background: var(--bg-elevated);
  border-color: var(--hairline);
  border-radius: .875rem;
  padding: 16px;
  margin-top: 16px;
}
.page2-section-label {
  color: var(--ink-700);
  letter-spacing: .04em;
}
.workup-chip {
  background: var(--bg-sunken);
  border-color: var(--hairline);
  color: var(--ink-700);
  min-height: 32px;
}
.workup-chip:hover {
  background: var(--accent-050);
  border-color: rgba(14,124,134,.34);
  color: var(--accent-600);
}

.page2-done-row {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(251,252,253,.86);
  border-top: 1px solid var(--hairline);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.page2-done-row::before {
  content: "Learn, not diagnose";
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: .5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  color: var(--ink-700);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}

.page2-done-btn {
  min-width: 220px;
  min-height: 48px;
  border: 0;
  border-radius: .875rem;
  background: var(--accent-600);
  color: #fff;
  font-size: 15px;
  line-height: 20px;
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(14,124,134,.26);
}
.page2-done-btn:hover {
  background: #0B6972;
  border-color: transparent;
}

@media (max-width: 760px) {
  .result-peak {
    grid-template-columns: 1fr;
  }
  .top-finding {
    padding: 18px;
  }
  .top-finding h1 {
    font-size: 28px;
  }
  .page2-done-row {
    display: grid;
    grid-template-columns: 1fr;
  }
  .page2-done-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .finding-region,
  .viewer-toggle,
  .finding-card {
    transition: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .viewer-toolbar,
  .page2-header,
  .page2-done-row {
    background: var(--bg-base);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ── Sample-case buttons (idle screen) ───────────────────────────────────── */
.sample-case-btn {
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid #cde7ea;
  background: #f3fbfc;
  color: #0E7C86;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.sample-case-btn:hover { background: #e3f5f7; border-color: #0E7C86; }
.sample-case-btn:active { transform: scale(0.97); }

/* ── Wellness (functional) report ────────────────────────────────────────── */
.sample-case-btn.primary {
  background: #0E7C86; color: #fff; border-color: #0E7C86;
  padding: 11px 14px; font-size: 13px; border-radius: 12px;
}
.sample-case-btn.primary:hover { background: #0a6670; }

.wellness-overall {
  margin-top: 12px; padding: 12px 14px; background: #f6fbfc;
  border: 1px solid #e1eef0; border-radius: 12px;
}
.wellness-overall .diagnosis-tag { margin-bottom: 6px; display: inline-block; }
.wellness-overall p { font-size: 13.5px; line-height: 1.5; color: #243; margin: 0; }

.wellness-themes { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wellness-themes-label, .wellness-indicators-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #8aa; font-weight: 600;
  margin-right: 2px;
}
.wellness-theme-chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: #eaf6f7; color: #0E7C86; font-weight: 600;
}

.wellness-card .wellness-zone-chip {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  color: #0E7C86; background: #eaf6f7; padding: 3px 8px; border-radius: 6px;
}
.wellness-insight {
  font-size: 12.5px; color: #557; margin: 6px 0 0; line-height: 1.45; font-style: italic;
}
.wellness-indicators { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.wellness-indicator {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: #f3f4f6; color: #475; border: 1px solid #e5e7eb;
}

.wellness-actions-section { margin-top: 14px; padding: 0 2px 8px; }
.wellness-actions-title { font-size: 13px; font-weight: 700; color: #243; margin: 0 0 8px; }
.wellness-action {
  border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 7px; background: #fff; overflow: hidden;
}
.wellness-action summary {
  cursor: pointer; padding: 10px 13px; font-size: 13px; font-weight: 600; color: #0E7C86;
  list-style: none;
}
.wellness-action summary::-webkit-details-marker { display: none; }
.wellness-action summary::after { content: '+'; float: right; color: #9ab; font-weight: 400; }
.wellness-action[open] summary::after { content: '–'; }
.wellness-action ul { margin: 0; padding: 0 16px 12px 30px; }
.wellness-action li { font-size: 12.5px; color: #344; line-height: 1.5; margin-bottom: 3px; }

/* ── Educated hypotheses ──────────────────────────────────────────────────── */
.hyp-section { margin-top: 16px; padding: 0 2px; }
.hyp-title-row { display: flex; align-items: center; gap: 8px; }
.hyp-title { font-size: 15px; font-weight: 700; color: #1a2b2e; margin: 0; }
.hyp-sub { font-size: 11.5px; color: #8aa; margin: 2px 0 10px; }
.hyp-card {
  border: 1px solid #e5e7eb; border-left-width: 3px; border-radius: 11px;
  padding: 11px 13px; margin-bottom: 9px; background: #fff;
}
.hyp-card.hyp-high { border-left-color: #d9534f; }
.hyp-card.hyp-moderate { border-left-color: #e0a23b; }
.hyp-card.hyp-low { border-left-color: #6aa9b0; }
.hyp-head { display: flex; align-items: center; gap: 8px; }
.hyp-rank {
  width: 20px; height: 20px; flex: none; border-radius: 50%; background: #0E7C86; color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.hyp-pattern { font-size: 13.5px; font-weight: 700; color: #1a2b2e; flex: 1; line-height: 1.25; }
.hyp-likelihood {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; flex: none;
}
.hyp-likelihood.hyp-high { background: #fdecea; color: #c0392b; }
.hyp-likelihood.hyp-moderate { background: #fcf3e3; color: #b9791c; }
.hyp-likelihood.hyp-low { background: #e8f4f5; color: #2c7a82; }
.hyp-rationale { font-size: 12.5px; color: #344; line-height: 1.5; margin: 7px 0 0; }
.hyp-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.hyp-row-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: #9ab; font-weight: 700;
  width: 100%;
}
.hyp-support { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #f3f4f6; color: #556; }
.hyp-check {
  font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #eaf6f7; color: #0E7C86;
  font-weight: 600;
}
.wellness-obs-title, .wellness-actions-title { font-size: 13px; font-weight: 700; color: #243; margin: 6px 0 9px; }

/* ── SOAP clinical note ───────────────────────────────────────────────────── */
.soap-note { margin-top: 14px; padding: 0 2px; }
.soap-note-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.soap-note-title { font-size: 16px; font-weight: 750; color: #14232b; margin: 0; letter-spacing: -0.01em; }
.soap-block { display: flex; gap: 11px; padding: 12px 0; border-top: 1px solid #eef1f3; }
.soap-block:first-of-type { border-top: none; }
.soap-letter {
  width: 26px; height: 26px; flex: none; border-radius: 7px; background: #0E7C86; color: #fff;
  font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.soap-letter-a { background: #b9791c; }
.soap-content { flex: 1; min-width: 0; }
.soap-content h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6b8088; font-weight: 700; margin: 2px 0 8px; }
.soap-count { display: inline-block; background: #eef4f5; color: #0E7C86; border-radius: 999px; padding: 0 7px; font-size: 10px; margin-left: 4px; }
.soap-subjective { font-size: 12.5px; color: #667; line-height: 1.5; margin: 0; font-style: italic; }

.soap-obj-list { list-style: none; margin: 0; padding: 0; }
.soap-obj-item { display: flex; gap: 9px; padding: 7px 0; border-bottom: 1px dashed #eef1f3; }
.soap-obj-item:last-child { border-bottom: none; }
.soap-obj-idx { width: 18px; height: 18px; flex: none; border-radius: 50%; background: #eef4f5; color: #0E7C86; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.soap-obj-finding { font-size: 13px; color: #243; line-height: 1.45; margin: 0; font-weight: 500; }
.soap-obj-meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.soap-location { font-size: 10.5px; color: #557; font-weight: 600; }
.soap-descriptor { font-size: 10.5px; padding: 1px 7px; border-radius: 5px; background: #f3f4f6; color: #566; }

.soap-impression { font-size: 13px; color: #243; line-height: 1.55; margin: 0 0 12px; padding: 10px 12px; background: #f8fafb; border-left: 3px solid #b9791c; border-radius: 0 8px 8px 0; }
.soap-ddx-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6b8088; font-weight: 700; margin: 0 0 8px; }

.ddx-list { display: flex; flex-direction: column; gap: 8px; }
.ddx-card { border: 1px solid #e5e7eb; border-left-width: 3px; border-radius: 10px; padding: 10px 12px; background: #fff; }
.ddx-high { border-left-color: #d9534f; }
.ddx-moderate { border-left-color: #e0a23b; }
.ddx-low { border-left-color: #6aa9b0; }
.ddx-redflag { background: #fffaf9; border-color: #f3c9c5; }
.ddx-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ddx-rank { width: 19px; height: 19px; flex: none; border-radius: 50%; background: #14232b; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ddx-name { font-size: 13.5px; font-weight: 700; color: #14232b; flex: 1; min-width: 0; line-height: 1.25; }
.ddx-flag { font-size: 9.5px; font-weight: 700; color: #c0392b; background: #fdecea; padding: 2px 6px; border-radius: 999px; }
.ddx-likelihood { font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.ddx-likelihood.ddx-high { background: #fdecea; color: #c0392b; }
.ddx-likelihood.ddx-moderate { background: #fcf3e3; color: #b9791c; }
.ddx-likelihood.ddx-low { background: #e8f4f5; color: #2c7a82; }
.ddx-reasoning { font-size: 12px; color: #445; line-height: 1.5; margin: 6px 0 0; }
.ddx-support-row { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ddx-support-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: #9ab; font-weight: 700; }
.ddx-support { font-size: 10.5px; padding: 2px 7px; border-radius: 5px; background: #f3f4f6; color: #566; }

.soap-plan { margin: 0; padding-left: 20px; }
.soap-plan li { font-size: 12.5px; color: #344; line-height: 1.55; margin-bottom: 5px; }
.soap-disclaimer { font-size: 10.5px; color: #9aa; line-height: 1.5; margin: 14px 0 0; padding-top: 10px; border-top: 1px solid #eef1f3; font-style: italic; }
