/* ==========================================================================
   Dermalyze — design tokens + components
   Palette/type scale carried over from the Stitch mockups (Frontend/*.txt)
   so every screen stays visually consistent with the original design.
   ========================================================================== */

:root {
  /* --- color: light (from the mockups' Tailwind theme) --- */
  --primary: #006a63;
  --primary-container: #2bb3a8;
  --on-primary: #ffffff;
  --on-primary-container: #003f3b;
  --on-primary-fixed-variant: #00504a;
  --inverse-primary: #5ddace;

  --secondary: #5f5e5e;
  --on-secondary: #ffffff;

  --tertiary: #984725;
  --tertiary-container: #ea8760;

  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;

  --background: #f5fbf8;
  --surface: #f5fbf8;
  --surface-bright: #f5fbf8;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #eff5f3;
  --surface-container: #e9efed;
  --surface-container-high: #e4e9e7;
  --surface-container-highest: #dee4e2;
  --surface-variant: #dee4e2;
  --surface-dim: #d5dbd9;

  --on-background: #171d1c;
  --on-surface: #171d1c;
  --on-surface-variant: #3d4947;
  --inverse-surface: #2c3231;
  --inverse-on-surface: #ecf2f0;

  --outline: #6c7a77;
  --outline-variant: #bcc9c7;

  /* --- spacing / radius scale --- */
  --container-padding: 16px;
  --touch-target-min: 44px;
  --unit: 4px;
  --stack-gap: 12px;
  --section-gap: 24px;

  --radius-sm: 4px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-container: 16px;
  --radius-full: 9999px;

  /* --- elevation (Clinical Clarity spec: tonal layers + diffused ambient shadows) --- */
  --shadow-1: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-2: 0 6px 12px rgba(0, 0, 0, 0.10);

  /* --- semantic risk colors (Low / High) --- */
  --risk-low-bg: #e1f0e5;
  --risk-low-fg: #1e6b3a;
  --risk-high-bg: var(--error-container);
  --risk-high-fg: var(--on-error-container);

  /* --- notice color (e.g. "this is demo data" banners; not a risk tier) --- */
  --notice-bg: #fdead2;
  --notice-fg: #8a4a10;

  /* --- type scale --- */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  color-scheme: light;
}

/* --- reset --- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--background);
  color: var(--on-background);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  user-select: none;
  line-height: 1;
}
.icon-filled { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

/* --- type utilities --- */
.text-display { font-size: 32px; line-height: 40px; letter-spacing: -0.02em; font-weight: 300; }
.text-display-mobile { font-size: 28px; line-height: 36px; font-weight: 300; }
.text-headline-md { font-size: 24px; line-height: 32px; letter-spacing: -0.01em; font-weight: 500; }
.text-headline-sm { font-size: 20px; line-height: 28px; font-weight: 600; }
.text-body-lg { font-size: 16px; line-height: 24px; font-weight: 400; }
.text-body-md { font-size: 14px; line-height: 20px; font-weight: 400; }
.text-label-md { font-size: 12px; line-height: 16px; letter-spacing: 0.05em; font-weight: 600; }
.text-label-sm { font-size: 11px; line-height: 14px; font-weight: 500; }
.uppercase-label { text-transform: uppercase; letter-spacing: 0.08em; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-outline { color: var(--outline); }
.text-error { color: var(--error); }
.text-on-surface-variant { color: var(--on-surface-variant); }

/* ==========================================================================
   App shell: mobile-first frame, phone-width card on wider viewports
   ========================================================================== */
.app-frame {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--background);
  position: relative;
  display: flex;
  flex-direction: column;
}
@media (min-width: 640px) {
  body { background: var(--surface-container); }
  .app-frame {
    min-height: calc(100vh - 48px);
    margin: 24px auto;
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 16px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }
}

/* --- top app bar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  min-height: 56px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--container-padding);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { font-size: 18px; font-weight: 700; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-logo { height: 28px; width: 28px; object-fit: contain; border-radius: var(--radius-sm); flex-shrink: 0; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-full);
  border: none; background: transparent; color: var(--primary);
  cursor: pointer; transition: background 0.15s ease, transform 0.1s ease;
}
.icon-btn:hover { background: var(--surface-container-low); }
.icon-btn:active { transform: scale(0.94); }
.avatar-btn {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  border: 1px solid var(--outline-variant); background: var(--surface-container-high);
  display: flex; align-items: center; justify-content: center; color: var(--secondary);
  cursor: pointer;
}

/* --- content area --- */
.screen {
  flex: 1;
  padding: var(--container-padding);
  padding-bottom: calc(80px + var(--container-padding));
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}
.screen-narrow { max-width: 480px; margin: 0 auto; width: 100%; }

/* --- bottom nav --- */
.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 20;
  height: 64px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  border-top: 1px solid var(--outline-variant);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--secondary); text-decoration: none;
  padding: 6px 14px; border-radius: var(--radius-lg);
  transition: transform 0.1s ease;
}
.nav-item span.label { font-size: 12px; line-height: 16px; font-weight: 600; }
.nav-item:active { transform: scale(0.92); }
.nav-item.active { color: var(--primary); }
.nav-item.active .material-symbols-outlined { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: flex; justify-content: space-between; align-items: center; }
.field label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--on-surface-variant);
}
.input-wrap { position: relative; }
.input-wrap .material-symbols-outlined {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--outline); font-size: 20px; pointer-events: none;
}
.input-wrap input, .input-wrap select {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 40px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-wrap input:focus, .input-wrap select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.input-wrap.has-trailing input { padding-right: 44px; }
.input-trailing-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--outline);
  width: 32px; height: 32px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.input-trailing-btn:hover { color: var(--on-surface); background: var(--surface-container-low); }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer;
}
.checkbox-row label { font-size: 13px; color: var(--on-surface-variant); cursor: pointer; }

.segmented { display: grid; gap: 8px; }
.segmented[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.segmented[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.segmented button {
  height: 46px; border-radius: var(--radius-lg); border: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest); color: var(--on-surface-variant);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s ease;
}
.segmented button:hover { background: var(--surface-container-low); }
.segmented button.selected {
  background: var(--primary-container); color: var(--on-primary-container);
  border-color: var(--primary-container);
}
.segmented button:active { transform: scale(0.97); }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--touch-target-min);
  padding: 0 20px;
  border-radius: var(--radius-lg);
  border: none;
  font-size: 14px; font-weight: 600; letter-spacing: 0.03em;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.08s ease, opacity 0.15s ease;
  font-family: inherit;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary-container); color: var(--on-primary-container); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-danger { background: var(--error); color: var(--on-error); }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-outline {
  background: transparent; color: var(--on-surface-variant);
  border: 2px solid var(--outline-variant);
}
.btn-outline:hover:not(:disabled) { background: var(--surface-container-low); }
.btn-text { background: transparent; color: var(--primary); padding: 0 4px; height: auto; }

/* --- cards / sections --- */
.card {
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  padding: 20px;
}
.card-soft { background: var(--surface-container-low); border: 1px solid color-mix(in srgb, var(--outline-variant) 60%, transparent); }
/* High-risk results get a red-tinted card, matching the Stitch high-risk mockup. */
.card.risk-high {
  border-color: color-mix(in srgb, var(--error) 45%, var(--outline-variant));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--error) 12%, transparent);
}

/* --- progress / stepper --- */
.stepper { display: flex; flex-direction: column; gap: 8px; }
.stepper-row { display: flex; justify-content: space-between; align-items: baseline; }
.stepper-track { height: 6px; background: var(--surface-container-highest); border-radius: var(--radius-full); overflow: hidden; }
.stepper-fill { height: 100%; background: var(--primary-container); border-radius: var(--radius-full); transition: width 0.3s ease; }
.stepper-fill.error { background: var(--error); }

/* --- toggle pill group (front / back view) --- */
.toggle-pill {
  display: flex; padding: 4px; background: var(--surface-container-high);
  border-radius: var(--radius-xl);
}
.toggle-pill button {
  flex: 1; padding: 10px 0; border: none; background: transparent;
  border-radius: var(--radius-lg); font-size: 13px; font-weight: 600;
  color: var(--on-surface-variant); cursor: pointer; transition: all 0.15s ease;
}
.toggle-pill button.active { background: var(--surface-container-lowest); color: var(--primary); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

/* --- body region list item --- */
.zone-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--outline-variant); background: var(--surface-container-lowest);
  cursor: pointer; transition: all 0.15s ease;
}
.zone-item:hover { background: var(--surface-container-low); }
.zone-item .zone-label { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--on-surface); }
.zone-item .check-icon { opacity: 0; color: var(--primary); transition: opacity 0.15s ease; }
.zone-item.selected {
  border-color: var(--primary); background: color-mix(in srgb, var(--primary-container) 10%, var(--surface-container-lowest));
  box-shadow: inset 0 0 0 1px var(--primary);
}
.zone-item.selected .check-icon { opacity: 1; }

/* --- upload dropzone --- */
.dropzone {
  border: 2px dashed var(--primary);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--primary-container) 8%, transparent);
  cursor: pointer;
  transition: background 0.15s ease;
  overflow: hidden;
}
.dropzone.dragover { background: color-mix(in srgb, var(--primary-container) 20%, transparent); }
.dropzone-grid { display: grid; grid-template-columns: 1fr 1fr; }
.dropzone-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 28px 16px; text-align: center;
  transition: background 0.15s ease;
}
.dropzone-cell:hover { background: color-mix(in srgb, var(--primary-container) 20%, transparent); }
.dropzone-cell + .dropzone-cell { border-left: 1px solid color-mix(in srgb, var(--primary) 20%, transparent); }
.dropzone-cell .material-symbols-outlined { font-size: 48px; color: var(--primary); }
.dropzone-cell strong { color: var(--primary); font-size: 15px; }
.dropzone-cell small { color: var(--outline); font-size: 12px; }

.preview-frame {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid var(--outline-variant);
  background: var(--surface-container);
}
.preview-frame img { width: 100%; height: 100%; object-fit: cover; }
.preview-badge {
  position: absolute; top: 12px; left: 12px;
  background: color-mix(in srgb, var(--primary) 90%, transparent);
  color: var(--on-primary); padding: 6px 12px; border-radius: var(--radius-full);
  display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  backdrop-filter: blur(6px);
}
.preview-remove {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: var(--radius-full);
  border: none; background: rgba(0,0,0,0.55); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* High-risk photo gets a pulsing red alert border (no badge/label on the image itself). */
.preview-frame.risk-high { border: 2px solid color-mix(in srgb, var(--error) 45%, transparent); }
.preview-frame.risk-high::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 4px solid color-mix(in srgb, var(--error) 40%, transparent);
  border-radius: inherit;
  animation: risk-pulse 1.8s ease-in-out infinite;
}
@keyframes risk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* --- risk badge / result heading --- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600;
}
.badge-error { background: var(--error-container); color: var(--on-error-container); border: 1px solid color-mix(in srgb, var(--error) 30%, transparent); }
.badge-success { background: color-mix(in srgb, var(--primary-container) 20%, transparent); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary-container) 30%, transparent); }

.result-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.result-heading-text { min-width: 0; }
.result-classification { font-size: 20px; font-weight: 600; color: var(--on-surface); line-height: 1.3; margin: 0; }
.result-subtitle { font-size: 14px; color: var(--on-surface-variant); margin: 4px 0 0; }
.result-heading-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.result-ref { font-size: 11px; color: var(--outline); white-space: nowrap; }

.result-success {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--primary); font-size: 16px; font-weight: 600;
  padding: 4px 0;
}

.quote-line {
  border-left: 4px solid var(--primary-container);
  padding-left: 16px; font-size: 16px; line-height: 1.6; color: var(--on-surface);
}

/* --- disclaimer --- */
.disclaimer {
  display: flex; gap: 12px; padding: 16px;
  background: var(--surface-container); border-radius: var(--radius-xl);
  border-top: 4px solid color-mix(in srgb, var(--secondary) 30%, transparent);
}
.disclaimer .material-symbols-outlined { color: var(--secondary); flex-shrink: 0; }
.disclaimer p { margin: 0; font-size: 11px; line-height: 1.5; color: var(--on-surface); }

/* Compact one-liner used on every other screen so the reference-only notice is
   visible throughout the flow, not just on the results page. */
.app-disclaimer {
  margin: 0; padding: 10px var(--container-padding, 16px);
  font-size: 10.5px; line-height: 1.4; color: var(--outline);
  text-align: center;
}

/* --- clinic card --- */
.clinic-card { display: flex; flex-direction: column; gap: 12px; }
.clinic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.clinic-head h4 { margin: 0; font-size: 16px; font-weight: 700; color: var(--on-surface); }
.clinic-meta { display: flex; gap: 16px; padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--outline-variant) 60%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--outline-variant) 60%, transparent); }
.clinic-meta span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--secondary); }
.status-pill { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-full); }
.status-open { background: color-mix(in srgb, var(--primary-container) 20%, transparent); color: var(--primary); }
.status-closed { background: var(--error-container); color: var(--on-error-container); }

/* --- empty / loading / error states --- */
.state-panel {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  padding: 40px 20px; color: var(--on-surface-variant);
}
.state-panel .material-symbols-outlined { font-size: 42px; color: var(--outline); }
.state-panel h3 { margin: 0; font-size: 16px; color: var(--on-surface); }
.state-panel p { margin: 0; font-size: 13px; line-height: 1.5; max-width: 34ch; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--on-primary-container) 30%, transparent);
  border-top-color: var(--on-primary-container);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-lg);
  font-size: 13px; line-height: 1.5;
}
.banner-error { background: var(--error-container); color: var(--on-error-container); }
.banner .material-symbols-outlined { font-size: 18px; }

.system-status { display: flex; justify-content: center; gap: var(--section-gap); margin-top: 8px; }
.system-status .dot { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--outline); }
.system-status .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.hidden { display: none !important; }

/* ==========================================================================
   4-step circular stepper (Account → Body Part → Capture → Review)
   ========================================================================== */
.circle-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.circle-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}
.circle-step::before {
  content: "";
  position: absolute;
  top: 15px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--surface-container-highest);
  z-index: 0;
}
.circle-step:first-child::before { display: none; }
.circle-step.done::before { background: var(--primary); }
.circle-step .dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  background: var(--surface-container-highest);
  color: var(--outline);
  position: relative; z-index: 1;
  transition: background 0.2s ease, color 0.2s ease;
}
.circle-step .step-label {
  font-size: 11px; font-weight: 600; color: var(--outline);
  text-align: center;
}
.circle-step.done .dot { background: var(--primary); color: var(--on-primary); }
.circle-step.done .step-label { color: var(--on-surface-variant); }
.circle-step.current .dot {
  background: var(--surface-container-lowest);
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}
.circle-step.current .step-label { color: var(--primary); font-weight: 700; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dash-hero {
  border-radius: var(--radius-container);
  padding: 22px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
  color: var(--on-primary);
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-2);
}
.dash-hero h2 { margin: 0; font-size: 19px; font-weight: 700; }
.dash-hero p { margin: 0 0 6px; font-size: 14px; opacity: 0.92; line-height: 1.5; }
.dash-hero .btn { background: var(--on-primary); color: var(--primary); align-self: flex-start; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-tile {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-1);
  padding: 14px 8px;
  text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-tile .stat-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--outline); text-transform: uppercase; }
.stat-tile .stat-value { font-size: 17px; font-weight: 700; color: var(--primary); }
.stat-tile .stat-sub { font-size: 10px; color: var(--outline); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.section-head a, .section-head button.link {
  font-size: 13px; font-weight: 600; color: var(--primary);
  background: none; border: none; cursor: pointer; text-decoration: none; padding: 0;
}

.activity-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  cursor: pointer;
}
.activity-card .thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--surface-container-high); }
.activity-card .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.activity-card .meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.activity-card .meta-row .when { font-size: 13px; color: var(--on-surface-variant); font-weight: 600; }
.activity-card .finding { margin: 0; font-size: 13.5px; color: var(--on-surface-variant); line-height: 1.5; }
.activity-card .view-link { font-size: 13px; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 2px; }

.risk-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  white-space: nowrap;
}
.risk-pill.low { background: var(--risk-low-bg); color: var(--risk-low-fg); }
.risk-pill.high { background: var(--risk-high-bg); color: var(--risk-high-fg); }

.detect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detect-card {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-1);
  padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.detect-card .detect-icon {
  width: 34px; height: 34px; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--primary-container) 20%, transparent);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.detect-card .detect-icon.detect-icon-danger {
  background: var(--error-container);
  color: var(--error);
}
.detect-card h4 { margin: 4px 0 0; font-size: 14px; font-weight: 700; color: var(--on-surface); }
.detect-card p { margin: 0; font-size: 12.5px; color: var(--on-surface-variant); line-height: 1.4; }

.tip-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-container-low);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
}
.tip-card .icon-badge {
  width: 32px; height: 32px; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--primary-container) 25%, transparent);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); flex-shrink: 0;
}
.tip-card p { margin: 0; font-size: 13.5px; color: var(--on-surface-variant); line-height: 1.5; }
.tip-card strong { color: var(--primary); }

/* ==========================================================================
   Body-part silhouette hotspots
   ========================================================================== */
.silhouette-card {
  position: relative;
  border-radius: var(--radius-container);
  background: var(--surface-container-lowest);
  box-shadow: var(--shadow-1);
  padding: 8px;
  overflow: hidden;
}
.silhouette-frame { position: relative; width: 100%; }
.silhouette-frame img { width: 100%; height: auto; display: block; }
.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 15%;
  aspect-ratio: 1;
  min-width: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.hotspot:hover, .hotspot:focus-visible { background: color-mix(in srgb, var(--primary) 14%, transparent); outline: none; }
.hotspot:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
.hotspot.selected { background: color-mix(in srgb, var(--primary) 22%, transparent); box-shadow: 0 0 0 2px var(--primary); }
.silhouette-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: color-mix(in srgb, var(--surface-container-lowest) 88%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12px; font-weight: 600; color: var(--primary);
  display: flex; align-items: center; gap: 6px;
  pointer-events: none;
}
.selected-region-label {
  text-align: center; font-size: 13px; font-weight: 600; color: var(--on-surface-variant);
  padding-top: 4px;
}
.selected-region-label strong { color: var(--primary); }

/* ==========================================================================
   Analysis result: texture/pigment note cards
   ========================================================================== */
.note-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .note-grid { grid-template-columns: 1fr; } }
.note-card {
  background: var(--surface-container-low);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.note-grid.risk-high .note-card { background: color-mix(in srgb, var(--error-container) 45%, var(--surface-container-low)); }
.note-grid.risk-high .note-card .note-label { color: var(--error); }
.note-card .note-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--primary);
}
.note-card p { margin: 0; font-size: 13px; color: var(--on-surface-variant); line-height: 1.5; }

/* ==========================================================================
   Clinics: search, filters, rating stars, map
   ========================================================================== */
.search-input-wrap {
  position: relative;
}
.search-input-wrap .material-symbols-outlined {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--outline);
}
.search-input-wrap input {
  width: 100%; height: 46px;
  padding: 0 16px 0 42px;
  border-radius: var(--radius-full);
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  font-size: 14px; color: var(--on-surface);
  outline: none;
}
.search-input-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }

.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.filter-chip {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  color: var(--on-surface-variant);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 4px;
}
.filter-chip:hover { background: var(--surface-container-low); }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.map-frame {
  width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radius-container);
  overflow: hidden;
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-1);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.stars { display: inline-flex; align-items: center; gap: 3px; }
.stars .material-symbols-outlined { font-size: 14px; color: var(--tertiary); }
.stars .rating-value { font-size: 12.5px; font-weight: 700; color: var(--on-surface); }
.stars .rating-count { font-size: 11.5px; color: var(--outline); }

/* ==========================================================================
   Support: FAQ accordion + contact form
   ========================================================================== */
.faq-group { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14.5px; font-weight: 600; color: var(--on-surface);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .material-symbols-outlined { color: var(--outline); transition: transform 0.2s ease; }
.faq-item[open] summary .material-symbols-outlined { transform: rotate(180deg); }
.faq-item .faq-body { padding: 0 16px 16px; font-size: 13.5px; color: var(--on-surface-variant); line-height: 1.6; }

.field textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
}
.field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }

/* Camera capture screen */
.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  flex-direction: column;
}
.camera-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px 16px 20px;
}
.camera-icon-btn {
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: var(--radius-full);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 0.1s ease, background 0.15s ease;
}
.camera-icon-btn:active { transform: scale(0.9); }
.camera-icon-btn.is-active { background: color-mix(in srgb, var(--primary-container) 80%, transparent); }

.camera-guide-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.camera-guide {
  width: 100%;
  max-width: 340px;
  height: 340px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
  position: relative;
}
.guide-corner {
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: rgba(255, 255, 255, 0.8);
  animation: corner-pulse 2s ease-in-out infinite;
}
.corner-tl { top: 0; left: 0; border-top: 4px solid; border-left: 4px solid; border-top-left-radius: var(--radius-xl); }
.corner-tr { top: 0; right: 0; border-top: 4px solid; border-right: 4px solid; border-top-right-radius: var(--radius-xl); }
.corner-bl { bottom: 0; left: 0; border-bottom: 4px solid; border-left: 4px solid; border-bottom-left-radius: var(--radius-xl); }
.corner-br { bottom: 0; right: 0; border-bottom: 4px solid; border-right: 4px solid; border-bottom-right-radius: var(--radius-xl); }
@keyframes corner-pulse {
  0%, 100% { border-color: rgba(255, 255, 255, 0.8); }
  50% { border-color: var(--primary-container); }
}
.camera-hint {
  margin: 0;
  padding: 8px 16px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

.camera-footer { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; padding-bottom: 48px; }
.shutter-ring {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  border: 4px solid #fff;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}
.shutter-ring:active { transform: scale(0.92); }
.shutter-btn {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--primary-container);
  box-shadow: var(--shadow-2);
}

.camera-flash-effect {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 75ms ease;
}
.camera-flash-effect.is-flashing { opacity: 1; }

.camera-error-state {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  padding: 24px;
  text-align: center;
}
