:root {
  --color-primary: #178255;
  --color-primary-hover: #126b46;
  --color-primary-soft: #e8f4ed;
  --color-background: #f6f7f4;
  --color-surface: #ffffff;
  --color-text: #17201c;
  --color-text-muted: #6d7972;
  --color-border: #dce3de;
  --color-success: #18794e;
  --color-warning: #9a6700;
  --color-danger: #b42318;
  --color-info: #175cd3;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-card:
    0 16px 45px rgba(20, 52, 37, 0.08);

  --focus-ring:
    0 0 0 4px rgba(23, 107, 69, 0.18);

  --header-height: 68px;
  --sidebar-width: 260px;
  --content-max: 1180px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
}

/* 2026 user-facing product redesign */
:root {
  --color-primary: #174f38;
  --color-primary-hover: #103d2b;
  --color-primary-soft: #eaf2ed;
  --color-background: #f7f7f3;
  --color-surface: #fff;
  --color-text: #18201c;
  --color-text-muted: #667069;
  --color-border: #dfe4df;
  --color-success: #267255;
  --color-warning: #986500;
  --color-danger: #b42318;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 12px 32px rgba(24, 32, 28, .06);
  --content-max: 1160px;
}

.button, .btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; text-decoration: none; transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease; }
.button-primary, .btn-primary, .pop-btn { background: var(--color-primary); color: #fff; }
.button-primary:hover, .btn-primary:hover, .pop-btn:hover { background: var(--color-primary-hover); }
.button-secondary, .btn-secondary, .pop-close { background: #fff; border-color: var(--color-border); color: var(--color-text); }
.eyebrow { color: var(--color-primary); font-size: .75rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }

.home-page main { overflow: hidden; }
.home-page .home-hero { padding: clamp(88px, 12vw, 150px) 0 clamp(80px, 10vw, 124px); border-bottom: 1px solid var(--color-border); background: linear-gradient(180deg, #fbfcf9 0%, var(--color-background) 100%); }
.home-page .home-hero__copy { max-width: 900px; text-align: center; }
.home-page .home-hero h1 { max-width: 850px; margin: 18px auto 22px; color: #13251c; font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1.03; letter-spacing: -.055em; }
.home-page .home-hero__lead { max-width: 690px; margin: 0 auto; color: var(--color-text-muted); font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.7; }
.home-page .hero-actions { justify-content: center; margin: 32px 0 18px; }
.home-page .hero-note { color: var(--color-text-muted); font-size: .86rem; }
.home-page .workflow-section, .home-page .value-section, .home-page .conditions-section, .home-page .users-section { padding: clamp(72px, 9vw, 112px) 0; }
.home-page .value-section, .home-page .users-section { background: #fff; border-block: 1px solid var(--color-border); }
.home-page .section-heading { max-width: 680px; margin-bottom: 44px; }
.home-page .section-heading h2, .home-page .users-layout h2, .home-page .final-cta h2 { margin: 10px 0 12px; font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1.12; letter-spacing: -.035em; }
.home-page .section-heading p, .home-page .users-layout p, .home-page .final-cta p { color: var(--color-text-muted); }
.home-page .section-heading--split { max-width: none; display: block; grid-template-columns: 1.4fr 1fr; align-items: end; gap: 48px; }
.home-page .workflow-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--color-border); }
.home-page .workflow-step { min-width: 0; padding: 28px 24px 30px; border-right: 1px solid var(--color-border); }
.home-page .workflow-step:last-child { border-right: 0; }
.home-page .step-number { display: block; margin-bottom: 44px; color: var(--color-primary); font-size: .75rem; font-weight: 800; }
.home-page .workflow-step h3, .home-page .value-grid h3 { margin: 0 0 9px; font-size: 1.05rem; }
.home-page .workflow-step p, .home-page .value-grid p { margin: 0; color: var(--color-text-muted); font-size: .92rem; }
.home-page .value-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--color-border); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.home-page .value-grid article { padding: 30px; background: #fff; }
.home-page .conditions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.home-page .condition-item { display: flex; align-items: center; gap: 16px; min-height: 116px; padding: 22px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: rgba(255,255,255,.65); }
.home-page .condition-item h3, .home-page .condition-item p { margin: 0; }
.home-page .condition-item p { color: var(--color-text-muted); font-size: .82rem; }
.condition-marker { width: 12px; height: 36px; flex: 0 0 auto; border-radius: 6px; background: #a77a43; }
.condition-marker--healthy { background: var(--color-success); }
.home-page .users-layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: 72px; align-items: center; }
.home-page .users-layout ul { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 0; list-style: none; }
.home-page .users-layout li { padding: 16px 18px; border-bottom: 1px solid var(--color-border); font-weight: 650; }
.home-page .final-cta { padding: 72px 0; background: #173d2d; color: #fff; }
.home-page .final-cta .eyebrow { color: #a9d5bd; }
.home-page .final-cta p { margin: 0; color: #cadbd2; }
.home-page .final-cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.home-page .final-cta .button { background: #fff; color: #173d2d; flex: 0 0 auto; }

.dashboard-page .page-shell { padding-block: 52px 80px; }
.dashboard-page .dashboard-hero { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 0 0 38px; }
.dashboard-page .dashboard-hero h1 { margin: 7px 0 3px; color: var(--color-text); font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; }
.dashboard-page .dashboard-hero p { margin: 0; color: var(--color-text-muted); overflow-wrap: anywhere; }
.dashboard-page .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 62px; }
.dashboard-page .stat-card { padding: 22px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
.dashboard-page .stat-card span, .dashboard-page .stat-card small { display: block; color: var(--color-text-muted); }
.dashboard-page .stat-card span { font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.dashboard-page .stat-card strong { display: block; margin: 10px 0 4px; color: var(--color-text); font-size: 2rem; line-height: 1.2; }
.dashboard-page .stat-card__text { font-size: 1.25rem !important; overflow-wrap: anywhere; }
.dashboard-page .history-header { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 22px; }
.dashboard-page .history-header h2 { margin: 6px 0 0; font-size: 1.8rem; }
.dashboard-page .history-header p { margin: 0; color: var(--color-text-muted); }
.dashboard-page .history-list { display: grid; gap: 14px; }
.dashboard-page .history-item { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 22px; padding: 18px; border: 1px solid var(--color-border); border-left: 3px solid var(--color-success); border-radius: var(--radius-md); background: #fff; }
.dashboard-page .history-item.low-confidence-item { border-left-color: var(--color-warning); }
.dashboard-page .history-item.invalid-item { border-left-color: var(--color-danger); }
.dashboard-page .history-item.pending-item { border-left-color: var(--color-info); }
.dashboard-page .image-box img { width: 100%; height: 150px; object-fit: cover; border-radius: 9px; }
.dashboard-page .history-filename { margin: 0 0 10px; color: var(--color-text-muted); font-size: .82rem; overflow-wrap: anywhere; }
.dashboard-page .meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dashboard-page .meta-badge, .dashboard-page .quality-badge { padding: 5px 9px; border: 1px solid var(--color-border); border-radius: 999px; background: #f8f9f7; color: #425048; font-size: .78rem; }
.dashboard-page .quality-badge { font-weight: 750; }
.dashboard-page .quality-badge.low-confidence { color: #805400; border-color: #e7d19d; background: #fff9e9; }
.dashboard-page .quality-badge.invalid { color: #912018; border-color: #efc3bf; background: #fff6f5; }
.dashboard-page .warning-note, .dashboard-page .pending-note, .dashboard-page .invalid-note { margin-top: 12px; padding: 9px 12px; border-left: 3px solid currentColor; background: #fafaf8; color: var(--color-warning); font-size: .86rem; }
.dashboard-page .invalid-note { color: var(--color-danger); }
.dashboard-page .pending-note { color: var(--color-info); }
.dashboard-page .history-details { margin-top: 15px; border-top: 1px solid var(--color-border); }
.dashboard-page .history-details summary { padding: 12px 0 5px; color: var(--color-primary); font-size: .88rem; font-weight: 750; cursor: pointer; }
.dashboard-page .history-details__body { display: grid; grid-template-columns: minmax(180px,.7fr) 1.3fr; gap: 20px; padding-top: 10px; }
.dashboard-page .probability-box, .dashboard-page .recommendation { color: #3f4b44; font-size: .9rem; line-height: 1.65; }
.dashboard-page .probability-box strong, .dashboard-page .recommendation strong { display: block; margin-bottom: 6px; color: var(--color-text); }
.dashboard-page .prob-row { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border-bottom: 1px solid #edf0ed; }
.dashboard-page .prob-value { font-weight: 750; }
.dashboard-page .item-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.dashboard-page .delete-btn { min-height: 38px; padding: 7px 10px; border: 0; background: transparent; color: var(--color-danger); font-weight: 700; cursor: pointer; }
.dashboard-page .empty-state { padding: 54px 24px; border: 1px dashed #cbd2cc; border-radius: var(--radius-lg); background: #fff; text-align: center; }
.dashboard-page .empty-state h3 { margin: 0 0 6px; font-size: 1.35rem; }
.dashboard-page .empty-state p { margin: 0 auto 22px; color: var(--color-text-muted); }
.dashboard-page .dashboard-message { margin-bottom: 20px; padding: 12px 16px; border-radius: 10px; }

.result-page .page-shell { max-width: 1080px; padding-block: 52px 80px; }
.result-page .result-card { padding: 0; }
.result-page .header-text { margin-bottom: 24px; }
.result-page .header-text h1 { margin: 7px 0; font-size: clamp(2.2rem,5vw,3.5rem); letter-spacing: -.045em; }
.result-page .header-text p { margin: 0; color: var(--color-text-muted); }
.result-page .status-box { margin-bottom: 20px; padding: 14px 16px; border: 1px solid; border-left-width: 4px; border-radius: 10px; font-weight: 700; }
.result-page .status-success { border-color: #b8d8c8; color: #175d42; background: #f6fbf8; }
.result-page .status-warning { border-color: #e6cc91; color: #805400; background: #fffbef; }
.result-page .status-error { border-color: #e8b7b2; color: #912018; background: #fff7f6; }
.result-page .grid-layout { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 18px; }
.result-page .panel { padding: 24px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
.result-page .panel h2 { margin: 0 0 18px; font-size: 1rem; }
.result-page .image-panel img { width: 100%; max-height: 430px; object-fit: contain; border-radius: 8px; background: #f1f3f0; }
.result-page .info-item + .info-item { margin-top: 22px; }
.result-page .info-label { display: block; margin-bottom: 7px; color: var(--color-text-muted); font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.result-page .final-tag { color: var(--color-primary); font-size: clamp(1.8rem,4vw,2.8rem); font-weight: 800; letter-spacing: -.04em; }
.result-page .final-tag.low { color: var(--color-warning); }
.result-page .info-value { font-size: 1.4rem; font-weight: 800; }
.result-page .conf-bar-wrap { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #e9edea; }
.result-page .conf-bar { height: 100%; background: var(--color-success); }
.result-page .conf-bar.low { background: var(--color-warning); }
.result-page .probability-row { margin-top: 10px; }
.result-page .probability-row > div { display: flex; justify-content: space-between; gap: 15px; font-size: .86rem; }
.result-page progress { width: 100%; height: 7px; accent-color: var(--color-primary); }
.result-page .evidence-section { margin-top: 54px; }
.result-page .evidence-heading { max-width: 680px; margin-bottom: 22px; }
.result-page .evidence-heading h2 { margin: 7px 0; font-size: 1.7rem; }
.result-page .evidence-heading p { margin: 0; color: var(--color-text-muted); }
.result-page .evidence-flow { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.result-page .evidence-flow figure { margin: 0; padding: 10px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
.result-page .evidence-flow img, .result-page .evidence-placeholder { width: 100%; aspect-ratio: 4/3; object-fit: contain; border-radius: 7px; background: #f1f3f0; }
.result-page .evidence-placeholder { display: grid; place-items: center; padding: 16px; color: var(--color-text-muted); text-align: center; }
.result-page .evidence-flow figcaption { display: grid; padding: 11px 5px 2px; }
.result-page .evidence-flow figcaption span { color: var(--color-text-muted); font-size: .8rem; }
.result-page .recom-panel { max-width: 820px; margin-top: 54px; padding: 28px; border-top: 3px solid var(--color-primary); background: #fff; box-shadow: var(--shadow-card); }
.result-page .recom-panel h2 { margin: 7px 0 16px; }
.result-page .recom-text { color: #37433c; line-height: 1.8; }
.result-page .actions { display: flex; gap: 12px; margin-top: 40px; }
.popup-overlay { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: rgba(14,24,18,.62); }
.popup-overlay.hidden { display: none; }
.popup-card { width: min(100%, 520px); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; border-radius: var(--radius-lg); background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.2); }
.popup-card h2 { margin: 14px 0 7px; }
.dialog-status { display: block; width: 34px; height: 5px; border-radius: 999px; background: var(--color-warning); }
.dialog-status--error { background: var(--color-danger); }
.popup-guide { display: grid; grid-template-columns: 100px 1fr; gap: 16px; margin: 20px 0; padding: 14px; background: #f7f8f6; }
.guide-sample-popup img { width: 100%; height: 100px; object-fit: cover; }
.popup-guide-text h4, .popup-guide-text p { margin: 0 0 5px; }
.popup-buttons { display: flex; flex-wrap: wrap; gap: 10px; }

.auth-page { background: #f6f7f4; }
.auth-main { min-height: calc(100vh - var(--header-height)); display: grid; place-items: center; padding: 56px 0 72px; }
.auth-page .auth-layout { display: block; max-width: 500px; }
.auth-page .auth-intro { display: none; }
.auth-page .auth-card { padding: clamp(26px,5vw,42px); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-card); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; font-weight: 800; }
.auth-page .card-heading h1, .auth-page .card-heading h2 { margin: 8px 0; color: var(--color-text); font-size: 2rem; letter-spacing: -.035em; }
.auth-page .card-heading p { margin: 0 0 26px; color: var(--color-text-muted); }
.auth-page .form-field { margin-bottom: 17px; }
.auth-page .form-field label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 750; }
.auth-page input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #cbd3cd; border-radius: 9px; background: #fff; color: var(--color-text); }
.auth-page input:focus { border-color: var(--color-primary); box-shadow: var(--focus-ring); outline: 0; }
.auth-page .password-field { position: relative; }
.auth-page .password-field input { padding-right: 68px; }
.auth-page .password-toggle { position: absolute; top: 5px; right: 5px; min-height: 38px; padding: 0 10px; border: 0; background: transparent; color: var(--color-primary); font-weight: 750; cursor: pointer; }
.auth-page small, .auth-page .form-guidance { display: block; margin-top: 5px; color: var(--color-text-muted); font-size: .78rem; }
.auth-page .button-block { width: 100%; margin-top: 8px; }
.auth-page .auth-switch { margin: 22px 0 0; text-align: center; color: var(--color-text-muted); }
.auth-page .form-alert { margin: 12px 0; padding: 11px 13px; border-radius: 9px; }

@media (max-width: 900px) {
  .home-page .workflow-grid, .home-page .conditions-grid, .dashboard-page .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .home-page .workflow-step:nth-child(2) { border-right: 0; }
  .home-page .workflow-step:nth-child(-n+2) { border-bottom: 1px solid var(--color-border); }
  .result-page .grid-layout { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .content-shell, .page-shell { width: min(calc(100% - 28px), var(--content-max)); }
  .home-page .section-heading--split, .home-page .users-layout { grid-template-columns: 1fr; gap: 22px; }
  .home-page .final-cta__inner, .dashboard-page .dashboard-hero, .dashboard-page .history-header { align-items: flex-start; flex-direction: column; }
  .home-page .final-cta .button, .dashboard-page .dashboard-hero .button { width: 100%; }
  .dashboard-page .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-page .history-item { grid-template-columns: 92px minmax(0,1fr); gap: 14px; padding: 13px; }
  .dashboard-page .image-box img { height: 92px; }
  .dashboard-page .history-details, .dashboard-page .item-actions { grid-column: 1 / -1; }
  .dashboard-page .history-details__body { grid-template-columns: 1fr; }
  .result-page .evidence-flow { grid-template-columns: 1fr; }
  .result-page .actions, .popup-buttons { flex-direction: column; }
  .result-page .actions .btn, .popup-buttons .btn { width: 100%; }
}
@media (max-width: 430px) {
  .home-page .workflow-grid, .home-page .conditions-grid, .home-page .value-grid, .home-page .users-layout ul { grid-template-columns: 1fr; }
  .home-page .workflow-step { border-right: 0; border-bottom: 1px solid var(--color-border); }
  .home-page .workflow-step:last-child { border-bottom: 0; }
  .home-page .step-number { margin-bottom: 20px; }
  .dashboard-page .stats-grid { grid-template-columns: 1fr; }
  .dashboard-page .history-item { grid-template-columns: 1fr; }
  .dashboard-page .image-box img { height: 190px; }
  .popup-guide { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .is-reveal-ready, [data-reveal-item], .site-footer { opacity: 1; transform: none; transition: none; }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top:
    calc(var(--header-height) + 20px);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--color-background);
  color: var(--color-text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

a {
  color: var(--color-primary);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.content-shell,
.page-shell {
  width:
    min(
      calc(100% - 40px),
      var(--content-max)
    );

  margin-inline: auto;
}

/* =========================================================
   Header
========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  border-bottom:
    1px solid rgba(217, 226, 220, 0.92);
  background:
    rgba(255, 255, 255, 0.96);
}

.site-header__inner {
  width:
    min(
      calc(100% - 40px),
      var(--content-max)
    );

  height: 100%;
  margin-inline: auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text);
  text-decoration: none;
}

.site-brand__mark {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border-radius: 12px;
  background: var(--color-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-brand__copy {
  display: grid;
  line-height: 1.15;
}

.site-brand__copy strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.site-brand__copy small {
  margin-top: 4px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-nav a {
  min-height: 42px;

  display: inline-flex;
  align-items: center;

  padding: 8px 14px;
  border-radius: 10px;

  color: #31453a;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a.is-active {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
}

.primary-nav .nav-cta {
  margin-left: 4px;
  background: var(--color-primary);
  color: #ffffff;
}

.primary-nav .nav-cta:hover,
.primary-nav .nav-cta.is-active {
  background: var(--color-primary-hover);
  color: #ffffff;
}

.primary-nav .nav-signout {
  color: var(--color-danger);
}

.nav-toggle {
  width: 44px;
  height: 44px;

  display: none;
  place-content: center;
  gap: 5px;

  border:
    1px solid var(--color-border);
  border-radius: 11px;

  background: #ffffff;
  cursor: pointer;
}

.nav-toggle > span:not(.sr-only) {
  width: 19px;
  height: 2px;

  display: block;

  border-radius: 99px;
  background: var(--color-text);
}

/* =========================================================
   Hero
========================================================= */
.hero-section {
  padding: 76px 0 84px;

  border-bottom:
    1px solid var(--color-border);

  background:
    linear-gradient(
      120deg,
      #f7faf8 0%,
      #edf7f1 100%
    );
}

.hero-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(390px, 500px);

  align-items: center;
  gap: clamp(48px, 7vw, 96px);
}

.eyebrow,
.step-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: currentColor;
}

.hero-copy h1,
.auth-intro h1 {
  max-width: 700px;

  margin: 18px 0 20px;

  font-size:
    clamp(40px, 5vw, 64px);

  line-height: 1.06;
  letter-spacing: -0.045em;
}

.hero-lead,
.auth-intro > p {
  max-width: 650px;
  margin: 0;

  color: var(--color-text-muted);
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.supported-classes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.supported-classes span {
  padding: 6px 11px;

  border: 1px solid #c8d8ce;
  border-radius: 999px;

  background:
    rgba(255, 255, 255, 0.7);

  color: #355144;
  font-size: 12px;
  font-weight: 700;
}

.trust-note {
  max-width: 620px;
  margin: 20px 0 0;

  color: #687970;
  font-size: 12px;
}

/* =========================================================
   Cards
========================================================= */
.upload-card,
.auth-card,
.result-card,
.user-panel,
.stat-card,
.history-item {
  border:
    1px solid var(--color-border);

  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.upload-card {
  padding:
    clamp(24px, 4vw, 36px);

  border-radius: var(--radius-lg);
}

.card-heading {
  margin-bottom: 24px;
}

.card-heading h2 {
  margin: 8px 0 6px;

  font-size:
    clamp(25px, 3vw, 32px);

  line-height: 1.2;
  letter-spacing: -0.025em;
}

.card-heading p {
  margin: 0;
  color: var(--color-text-muted);
}

/* =========================================================
   Photo guidance
========================================================= */
.photo-guidance {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;

  padding: 16px;
  margin-bottom: 20px;

  border:
    1px solid var(--color-border);

  border-radius: var(--radius-md);
  background: #f7faf8;
}

.photo-guidance img {
  width: 84px;
  height: 108px;
  border-radius: 10px;
  object-fit: cover;
}

.photo-guidance strong {
  font-size: 14px;
}

.photo-guidance ul {
  padding-left: 18px;
  margin: 8px 0 0;

  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.65;
}

/* =========================================================
   Upload input
========================================================= */
.upload-file-input {
  position: absolute !important;

  width: 1px !important;
  height: 1px !important;

  padding: 0 !important;
  margin: -1px !important;

  overflow: hidden !important;

  clip:
    rect(0, 0, 0, 0) !important;

  clip-path:
    inset(50%) !important;

  white-space: nowrap !important;

  border: 0 !important;
  opacity: 0 !important;
}

/* =========================================================
   Upload area
========================================================= */
.upload-dropzone {
  min-height: 210px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;

  padding: 28px;

  border:
    1.5px dashed #91aa9b;

  border-radius: var(--radius-md);

  background: #fbfdfc;
  color: var(--color-text);

  text-align: center;
  text-decoration: none;

  cursor: pointer;

  transition:
    border-color 0.18s,
    background 0.18s,
    transform 0.18s;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragging {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.upload-dropzone:focus-visible {
  box-shadow: var(--focus-ring);
}

.upload-dropzone[hidden] {
  display: none !important;
}

.upload-dropzone.is-locked {
  cursor: pointer;
}

.upload-dropzone__icon {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  margin-bottom: 5px;

  border-radius: 12px;

  background: var(--color-primary-soft);
  color: var(--color-primary);

  font-size: 25px;
  line-height: 1;
}

.upload-dropzone strong {
  font-size: 16px;
}

.upload-dropzone > span:not(.upload-dropzone__icon):not(.button) {
  color: var(--color-text-muted);
  font-size: 12px;
}

.upload-choose-button {
  margin-top: 6px;

  /*
   * The upload box itself is the label.
   * The visual button must not capture the click.
   */
  pointer-events: none;
}

.drop-hint {
  max-width: 330px;
  margin-top: 2px;

  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.45;
}

/* =========================================================
   Upload preview
========================================================= */
.upload-preview {
  display: grid;

  grid-template-columns:
    82px
    minmax(0, 1fr)
    auto;

  align-items: center;
  gap: 14px;

  padding: 12px;
  margin-bottom: 14px;

  border:
    1px solid var(--color-border);

  border-radius: var(--radius-md);
  background: #f9fbfa;
}

.upload-preview[hidden] {
  display: none !important;
}

.upload-preview img {
  width: 82px;
  height: 70px;

  border-radius: 9px;
  object-fit: cover;
}

.upload-preview__details {
  min-width: 0;
}

.upload-preview strong,
.upload-preview span {
  display: block;
  min-width: 0;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-preview span {
  color: var(--color-text-muted);
  font-size: 12px;
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-actions label.button {
  margin-top: 0;
  cursor: pointer;
}

/* =========================================================
   Signed-out upload
========================================================= */
.signed-out-upload-link {
  color: inherit;
  text-decoration: none;
}

.signed-out-upload-link:hover {
  color: inherit;
  text-decoration: none;
}

.signed-out-upload > .button,
[data-upload-form] > .button {
  margin-top: 14px;
}

.signed-out-upload > p,
.processing-note {
  margin: 12px 0 0;

  color: var(--color-text-muted);
  font-size: 12px;
  text-align: center;
}

/* =========================================================
   Buttons
========================================================= */
.button {
  min-height: 46px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 10px 19px;

  border: 1px solid transparent;
  border-radius: 11px;

  font-weight: 750;
  text-decoration: none;

  cursor: pointer;

  transition:
    background 0.16s,
    border-color 0.16s,
    transform 0.16s;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--color-primary);
  color: #ffffff;
}

.button-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.button-secondary {
  border-color: var(--color-border);
  background: #ffffff;
  color: var(--color-text);
}

.button-secondary:hover {
  border-color: #a9bbb0;
  background: #f8faf9;
}

.button-quiet {
  min-height: 38px;
  padding: 7px 10px;

  border-color: transparent;

  background: transparent;
  color: var(--color-danger);
}

.button-small {
  min-height: 36px;
  padding: 6px 13px;
  margin-top: 8px;
  font-size: 12px;
}

.button-block {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button .button-loading {
  display: none;
}

.button.is-loading .button-label {
  display: none;
}

.button.is-loading .button-loading {
  display: inline;
}

/* =========================================================
   Process and guidance
========================================================= */
.process-section {
  padding: 88px 0;
}

.section-heading {
  max-width: 660px;
  margin-bottom: 36px;
}

.section-heading h2,
.guidance-panel h2 {
  margin: 12px 0 8px;

  font-size:
    clamp(30px, 4vw, 44px);

  line-height: 1.15;
  letter-spacing: -0.035em;
}

.section-heading p {
  margin: 0;
  color: var(--color-text-muted);
}

.process-grid {
  display: grid;
  grid-template-columns:
    repeat(3, 1fr);

  gap: 18px;
}

.process-card {
  min-height: 230px;

  padding: 28px;

  border:
    1px solid var(--color-border);

  border-radius: var(--radius-md);
  background: #ffffff;
}

.process-card > span {
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 800;
}

.process-card h3 {
  margin: 42px 0 8px;
  font-size: 20px;
}

.process-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.guidance-section {
  padding: 0 0 88px;
}

.guidance-panel {
  display: grid;

  grid-template-columns:
    0.85fr
    1.15fr;

  gap: 60px;

  padding: 44px;

  border-radius: var(--radius-lg);

  background: #173f2e;
  color: #ffffff;
}

.guidance-panel .eyebrow {
  color: #9dd4b6;
}

.condition-list {
  display: grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap: 10px;
}

.condition-list div {
  padding: 17px;

  border:
    1px solid rgba(255, 255, 255, 0.15);

  border-radius: 12px;

  background:
    rgba(255, 255, 255, 0.06);
}

.condition-list strong,
.condition-list span {
  display: block;
}

.condition-list span {
  margin-top: 3px;
  color: #c8dbd1;
  font-size: 12px;
}

/* =========================================================
   Footer
========================================================= */
.site-footer {
  padding: 34px 0;

  border-top:
    1px solid var(--color-border);

  background: #ffffff;
}

.site-footer .content-shell {
  display: grid;

  grid-template-columns:
    auto
    1fr
    auto;

  align-items: center;
  gap: 20px;
}

.site-footer p,
.site-footer span {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

/* =========================================================
   Authentication
========================================================= */
.auth-page {
  min-height:
    calc(
      100vh -
      var(--header-height)
    );

  display: flex;
  align-items: center;

  padding: 64px 0;

  background:
    linear-gradient(
      115deg,
      #eff6f2,
      #f8faf9 58%
    );
}

.auth-layout {
  display: grid;

  grid-template-columns:
    1fr
    minmax(390px, 500px);

  align-items: center;

  gap:
    clamp(50px, 8vw, 110px);
}

.auth-intro h1 {
  font-size:
    clamp(38px, 4.8vw, 58px);
}

.feature-checks {
  display: grid;
  gap: 12px;

  padding: 0;
  margin: 28px 0 0;

  list-style: none;
}

.feature-checks li {
  position: relative;

  padding-left: 28px;

  color: #3e564a;
  font-size: 14px;
  font-weight: 650;
}

.feature-checks li::before {
  content: "✓";

  position: absolute;
  top: 0;
  left: 0;

  color: var(--color-primary);
  font-weight: 900;
}

.auth-card {
  padding:
    clamp(26px, 4vw, 40px);

  border-radius: var(--radius-lg);
}

/* =========================================================
   Forms
========================================================= */
.form-field {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.form-field label {
  font-size: 13px;
  font-weight: 750;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  min-height: 48px;

  padding: 11px 13px;

  border:
    1px solid #bdcbc2;

  border-radius: 10px;

  background: #ffffff;
  color: var(--color-text);

  outline: none;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

.form-field small,
.form-guidance {
  color: var(--color-text-muted);
  font-size: 11px;
}

.form-grid {
  display: grid;
  grid-template-columns:
    repeat(2, 1fr);
  gap: 12px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;

  transform: translateY(-50%);

  min-height: 34px;

  padding: 5px 8px;

  border: 0;
  border-radius: 7px;

  background: transparent;
  color: var(--color-primary);

  font-size: 11px;
  font-weight: 800;

  cursor: pointer;
}

.form-alert {
  padding: 11px 13px;
  margin: 14px 0;

  border: 1px solid;
  border-radius: 10px;

  font-size: 13px;
}

.form-alert[hidden] {
  display: none;
}

.alert-success {
  border-color: #a6d7be;
  background: #ecf8f2;
  color: #12633f;
}

.alert-error {
  border-color: #f1b4ae;
  background: #fff1f0;
  color: #8f1d14;
}

.alert-info {
  border-color: #b9d4ff;
  background: #eff6ff;
  color: #174ea6;
}

.auth-switch {
  margin: 22px 0 0;
  color: var(--color-text-muted);
  font-size: 13px;
  text-align: center;
}

.auth-switch a {
  font-weight: 750;
}

/* =========================================================
   Dashboard and result compatibility
========================================================= */
.dashboard-hero h1,
.header-text h1,
.history-header h2 {
  color: var(--color-text) !important;
  letter-spacing: -0.025em;
}

.dashboard-hero,
.page-shell > .header-text {
  padding-top: 44px;
}

.user-panel,
.stat-card,
.history-item,
.result-card {
  border-radius:
    var(--radius-md) !important;

  box-shadow:
    0 8px 28px
    rgba(20, 52, 37, 0.06) !important;
}

.quick-btn.primary,
.btn-primary,
.final-tag {
  background:
    var(--color-primary) !important;

  color: #ffffff !important;
}

.quick-btn,
.btn,
.delete-btn {
  border-radius: 10px !important;
}

.history-item:hover,
.stat-card:hover {
  transform: none !important;
}

.confidence-fill,
.conf-bar {
  background:
    var(--color-primary) !important;
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}

.history-pagination span {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.history-item[hidden] {
  display: none !important;
}

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 920px) {
  .nav-toggle {
    display: grid;
  }

  .primary-nav {
    position: absolute;

    top: calc(100% + 8px);
    left: 20px;
    right: 20px;

    display: none;
    align-items: stretch;

    padding: 10px;

    border:
      1px solid var(--color-border);

    border-radius: 14px;

    background: #ffffff;
    box-shadow: var(--shadow-card);
  }

  .site-header.nav-open .primary-nav {
    display: grid;
  }

  .primary-nav a {
    width: 100%;
  }

  .primary-nav .nav-cta {
    margin-left: 0;
  }

  .hero-grid,
  .auth-layout,
  .guidance-panel {
    grid-template-columns: 1fr;
  }

  .hero-section {
    padding-top: 58px;
  }

  .hero-copy {
    max-width: 720px;
  }

  .process-grid {
    grid-template-columns: 1fr;
  }

  .process-card {
    min-height: 0;
  }

  .process-card h3 {
    margin-top: 24px;
  }
}

@media (max-width: 600px) {
  .content-shell,
  .page-shell,
  .site-header__inner {
    width:
      min(
        calc(100% - 28px),
        var(--content-max)
      );
  }

  .site-brand__copy small {
    display: none;
  }

  .hero-section,
  .process-section,
  .auth-page {
    padding-block: 44px;
  }

  .hero-copy h1,
  .auth-intro h1 {
    font-size: 38px;
  }

  .hero-actions {
    display: grid;
  }

  .hero-actions .button {
    width: 100%;
  }

  .photo-guidance {
    grid-template-columns:
      66px
      1fr;
  }

  .photo-guidance img {
    width: 66px;
    height: 86px;
  }

  .upload-card,
  .auth-card {
    padding: 22px;
  }

  .upload-dropzone {
    min-height: 220px;
    padding: 24px 18px;
  }

  .upload-preview {
    grid-template-columns:
      62px
      minmax(0, 1fr);
  }

  .upload-preview img {
    width: 62px;
    height: 56px;
  }

  .upload-preview .button {
    width: 100%;
  }

  .preview-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .preview-actions .button {
    flex: 1;
  }

  .form-grid,
  .condition-list {
    grid-template-columns: 1fr;
  }

  .guidance-panel {
    padding: 28px 22px;
    gap: 28px;
  }

  .site-footer .content-shell {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration:
      0.01ms !important;

    animation-iteration-count:
      1 !important;

    transition-duration:
      0.01ms !important;
  }
}

/* =========================================================
   Evidence section
========================================================= */
.evidence-section {
  margin-top: 30px;
  padding-top: 30px;

  border-top:
    1px solid var(--color-border);
}

.evidence-heading {
  max-width: 680px;
  margin-bottom: 18px;
}

.evidence-heading h2 {
  margin: 5px 0 8px;

  font-size:
    clamp(24px, 3vw, 34px);
}

.evidence-heading p {
  color: var(--color-text-muted);
}

.evidence-flow {
  display: grid;

  grid-template-columns:
    repeat(3, 1fr);

  gap: 12px;
}

.evidence-flow figure {
  margin: 0;

  border:
    1px solid var(--color-border);

  background: #ffffff;
}

.evidence-flow img,
.evidence-placeholder {
  display: block;

  width: 100%;
  aspect-ratio: 4 / 3;

  object-fit: cover;
}

.evidence-placeholder {
  display: grid;
  place-items: center;

  padding: 20px;

  background: #f5f7f5;
  color: var(--color-text-muted);

  text-align: center;
}

.evidence-flow figcaption {
  display: grid;
  gap: 3px;
  padding: 13px;
}

.evidence-flow figcaption span {
  color: var(--color-text-muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .evidence-flow {
    grid-template-columns: 1fr;
  }

  .evidence-flow img,
  .evidence-placeholder {
    aspect-ratio: 16 / 10;
  }
}

/* =========================================================
   Phase 2A: public product foundation and homepage
========================================================= */
.site-header {
  transition: transform 240ms cubic-bezier(.22, 1, .36, 1), box-shadow 180ms ease;
  will-change: transform;
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.site-header__inner {
  width: min(calc(100% - 64px), 1180px);
}

.site-brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 11px;
}

.site-brand__copy strong {
  font-size: 16px;
  font-weight: 700;
}

.primary-nav {
  gap: 2px;
}

.primary-nav a {
  position: relative;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 8px;
  color: #46524c;
  font-size: 13px;
  font-weight: 600;
  transition: color 180ms ease, background-color 180ms ease;
}

.primary-nav a:hover,
.primary-nav a.is-active {
  background: transparent;
  color: var(--color-text);
}

.primary-nav a.is-active:not(.nav-cta)::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 3px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-primary);
}

.primary-nav .nav-cta {
  margin-left: 8px;
  padding-inline: 15px;
  background: var(--color-text);
}

.primary-nav .nav-cta:hover,
.primary-nav .nav-cta.is-active {
  background: #2b3630;
}

.home-page {
  background: var(--color-background);
}

.home-page .hero-section {
  position: relative;
  overflow: hidden;
  padding: 64px 0 72px;
  border-bottom: 1px solid var(--color-border);
  background:
    radial-gradient(circle at 92% 8%, rgba(23, 130, 85, .08), transparent 30%),
    linear-gradient(180deg, #fbfcfa 0%, #f3f6f2 100%);
}

.home-page .hero-grid {
  grid-template-columns: minmax(0, .9fr) minmax(430px, .78fr);
  align-items: start;
  gap: clamp(48px, 7vw, 88px);
}

.home-page .hero-copy {
  padding-top: 42px;
}

.home-page .eyebrow,
.home-page .step-label {
  color: #527063;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .075em;
}

.home-page .eyebrow::before {
  width: 18px;
  height: 1px;
  background: var(--color-primary);
}

.home-page .hero-copy h1 {
  max-width: 620px;
  margin: 20px 0 20px;
  color: var(--color-text);
  font-size: clamp(44px, 4.7vw, 62px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -.05em;
}

.home-page .hero-lead {
  max-width: 610px;
  color: #526059;
  font-size: 17px;
  line-height: 1.7;
}

.home-page .hero-actions {
  margin-top: 28px;
}

.home-page .button {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  transition: transform 160ms ease, background-color 160ms ease,
    border-color 160ms ease, box-shadow 160ms ease;
}

.home-page .button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.home-page .button:active:not(:disabled) {
  transform: translateY(0);
}

.home-page .button-secondary {
  border-color: #cfd7d2;
  background: rgba(255, 255, 255, .72);
}

.hero-capabilities {
  max-width: 610px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 38px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.hero-capabilities div {
  min-width: 0;
  padding: 15px 14px 15px 0;
}

.hero-capabilities div + div {
  padding-left: 14px;
  border-left: 1px solid var(--color-border);
}

.hero-capabilities strong,
.hero-capabilities span {
  display: block;
}

.hero-capabilities strong {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
}

.hero-capabilities span {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.home-page .trust-note {
  margin-top: 17px;
  color: #758079;
}

.home-page .upload-card {
  padding: 28px;
  border-color: #d5ddd8;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(29, 48, 38, .09), 0 2px 8px rgba(29, 48, 38, .04);
}

.home-page .card-heading {
  margin-bottom: 20px;
}

.home-page .card-heading h2 {
  margin: 7px 0 5px;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -.035em;
}

.home-page .card-heading p {
  font-size: 14px;
}

.home-page .photo-guidance {
  grid-template-columns: 68px 1fr;
  gap: 14px;
  padding: 13px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: #f7f9f6;
}

.home-page .photo-guidance img {
  width: 68px;
  height: 76px;
  border-radius: 7px;
}

.home-page .photo-guidance ul {
  margin-top: 5px;
  line-height: 1.55;
}

.home-page .upload-dropzone {
  min-height: 188px;
  padding: 23px;
  border-width: 1px;
  border-color: #aebdb4;
  border-radius: 10px;
  background: #fcfdfc;
}

.home-page .upload-dropzone:hover,
.home-page .upload-dropzone.is-dragging {
  border-color: var(--color-primary);
  background: #f0f7f3;
  box-shadow: inset 0 0 0 1px rgba(23, 130, 85, .08);
}

.home-page .upload-dropzone__icon {
  width: 34px;
  height: 34px;
  margin-bottom: 3px;
  border-radius: 9px;
  font-size: 20px;
}

.home-page .upload-dropzone strong {
  font-size: 15px;
}

.home-page .upload-choose-button {
  margin-top: 8px;
}

.home-page .upload-preview {
  grid-template-columns: 72px minmax(0, 1fr) auto;
  padding: 11px;
  border-radius: 9px;
  animation: preview-enter 180ms ease both;
}

.home-page .upload-preview img {
  width: 72px;
  height: 62px;
  border-radius: 7px;
}

.home-page #analyseButton {
  margin-top: 14px;
}

.home-page #analyseButton:disabled {
  border-color: #d8dfdb;
  background: #e7ebe8;
  color: #8b9690;
  opacity: 1;
}

.home-page .processing-note {
  max-width: 390px;
  margin-inline: auto;
  line-height: 1.5;
}

@keyframes preview-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-page .process-section {
  padding: 76px 0 68px;
  background: #fff;
}

.home-page .section-heading {
  max-width: 720px;
  margin-bottom: 38px;
}

.home-page .section-heading h2,
.home-page .guidance-panel h2 {
  margin-top: 11px;
  font-size: clamp(30px, 3.4vw, 40px);
  font-weight: 650;
  letter-spacing: -.04em;
}

.home-page .process-grid {
  position: relative;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.home-page .process-card {
  min-height: 0;
  padding: 28px 30px 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.home-page .process-card + .process-card {
  border-left: 1px solid var(--color-border);
}

.home-page .process-card > span {
  color: var(--color-primary);
  font-size: 12px;
}

.home-page .process-card h3 {
  margin: 28px 0 7px;
  font-size: 18px;
  font-weight: 650;
}

.home-page .guidance-section {
  padding: 68px 0 80px;
  background: #fff;
}

.home-page .guidance-panel {
  grid-template-columns: .85fr 1.15fr;
  gap: 56px;
  padding: 38px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
}

.home-page .guidance-panel .eyebrow {
  color: #527063;
}

.home-page .condition-list {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 20px;
}

.home-page .condition-list div {
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
}

.home-page .condition-list span {
  color: var(--color-text-muted);
}

.site-footer {
  padding: 30px 0;
  background: #f1f3f0;
}

.site-footer .site-footer__inner {
  grid-template-columns: 1fr auto auto;
  gap: 38px;
}

.site-footer__identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.site-footer__mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--color-text);
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 800;
}

.site-footer__identity div {
  display: grid;
  line-height: 1.25;
}

.site-footer__identity strong {
  font-size: 14px;
}

.site-footer__nav {
  display: flex;
  gap: 20px;
}

.site-footer__nav a {
  color: #4b5851;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.site-footer__nav a:hover {
  color: var(--color-primary);
}

@media (max-width: 920px) {
  .site-header__inner { width: min(calc(100% - 48px), 1180px); }
  .home-page .hero-grid { grid-template-columns: 1fr; gap: 42px; }
  .home-page .hero-copy { max-width: 720px; padding-top: 10px; }
  .home-page .upload-card { max-width: 680px; }
  .home-page .process-grid { grid-template-columns: 1fr; }
  .home-page .process-card + .process-card { border-left: 0; border-top: 1px solid var(--color-border); }
  .home-page .process-card h3 { margin-top: 15px; }
  .home-page .guidance-panel { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 600px) {
  .site-header__inner { width: min(calc(100% - 32px), 1180px); }
  .primary-nav { left: 16px; right: 16px; }
  .home-page .hero-section { padding: 42px 0 52px; }
  .home-page .hero-copy h1 { font-size: 38px; }
  .home-page .hero-lead { font-size: 15px; }
  .hero-capabilities { grid-template-columns: 1fr; }
  .hero-capabilities div { padding: 11px 0; }
  .hero-capabilities div + div { padding-left: 0; border-top: 1px solid var(--color-border); border-left: 0; }
  .home-page .upload-card { padding: 20px; }
  .home-page .photo-guidance { grid-template-columns: 60px 1fr; }
  .home-page .photo-guidance img { width: 60px; height: 72px; }
  .home-page .upload-dropzone { min-height: 186px; padding: 20px 15px; }
  .home-page .process-section { padding: 54px 0 46px; }
  .home-page .process-card { padding: 23px 0 25px; }
  .home-page .guidance-section { padding: 46px 0 58px; }
  .home-page .guidance-panel { padding: 30px 0; }
  .home-page .condition-list { grid-template-columns: 1fr; }
  .site-footer .site-footer__inner { grid-template-columns: 1fr; gap: 18px; }
  .site-footer__nav { flex-wrap: wrap; gap: 10px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}

/* =========================================================
   Phase 2A revision: introduction home and analysis workspace
========================================================= */
.home-hero {
  padding: 70px 0 76px;
  border-bottom: 1px solid var(--color-border);
  background:
    radial-gradient(circle at 82% 12%, rgba(23, 130, 85, .08), transparent 27%),
    linear-gradient(180deg, #fcfdfb 0%, #f4f7f3 100%);
}

.home-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .72fr);
  align-items: center;
  gap: clamp(52px, 7vw, 92px);
}

.home-hero__copy h1 {
  max-width: 660px;
  margin: 20px 0 20px;
  font-size: clamp(46px, 5vw, 64px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -.052em;
}

.home-hero__lead {
  max-width: 650px;
  margin: 0;
  color: #526059;
  font-size: 17px;
  line-height: 1.72;
}

.home-hero__visual {
  position: relative;
  max-width: 430px;
  margin: 0;
  justify-self: end;
  overflow: hidden;
  border: 1px solid #d2dad5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(29, 48, 38, .1);
}

.home-hero__visual img {
  width: 100%;
  height: clamp(300px, 34vw, 430px);
  max-height: 430px;
  object-fit: cover;
  object-position: center 42%;
}

.home-hero__visual figcaption {
  display: grid;
  gap: 2px;
  padding: 15px 17px 17px;
  border-top: 1px solid var(--color-border);
}

.home-hero__visual figcaption span {
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
}

.home-hero__visual figcaption strong {
  font-size: 14px;
  font-weight: 600;
}

.workflow-section,
.conditions-section,
.preparation-section {
  padding: 76px 0;
}

.workflow-section {
  background: #fff;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.workflow-step {
  overflow: hidden;
  border-top: 1px solid var(--color-border);
}

.workflow-step img {
  width: 100%;
  height: 180px;
  max-height: 180px;
  object-fit: cover;
  object-position: center 42%;
}

.workflow-step > div {
  padding: 18px 2px 0;
}

.workflow-step span {
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 750;
}

.workflow-step h3 {
  margin: 9px 0 6px;
  font-size: 18px;
  font-weight: 650;
}

.workflow-step p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.workflow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.workflow-link span {
  transition: transform 160ms ease;
}

.workflow-link:hover span {
  transform: translateX(3px);
}

.conditions-section {
  background: var(--color-background);
}

.section-heading--split {
  max-width: none;
  display: grid;
  grid-template-columns: 1fr minmax(320px, .7fr);
  align-items: end;
  gap: 48px;
}

.section-heading--split p {
  margin: 0 0 5px;
}

.conditions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px 28px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.condition-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--color-border);
}

.condition-item:nth-last-child(-n+2) {
  border-bottom: 0;
}

.condition-item img {
  width: 82px;
  height: 66px;
  border-radius: 8px;
  object-fit: cover;
}

.condition-item h3 {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 650;
}

.condition-item p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

.preparation-section {
  background: #fff;
}

.preparation-layout {
  display: grid;
  grid-template-columns: .8fr 1fr .8fr;
  gap: 40px;
  align-items: start;
}

.preparation-layout h2 {
  margin: 11px 0 7px;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -.035em;
}

.preparation-layout p {
  margin: 0;
  color: var(--color-text-muted);
}

.preparation-layout ul {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 4px 0 0;
  list-style: none;
}

.preparation-layout li {
  position: relative;
  padding-left: 18px;
  color: #46534c;
  font-size: 14px;
}

.preparation-layout li::before {
  content: "";
  position: absolute;
  top: .62em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
}

.responsible-note {
  padding: 18px;
  border-left: 3px solid var(--color-primary);
  background: #f1f6f2;
}

.responsible-note strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.responsible-note p {
  font-size: 13px;
}

[data-section-reveal].is-reveal-ready {
  opacity: 0;
  transform: translateY(14px);
}

[data-section-reveal].is-reveal-ready.is-revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 460ms ease, transform 460ms cubic-bezier(.22, 1, .36, 1);
}

[data-section-reveal].is-revealed [data-reveal-item] {
  animation: section-item-in 430ms ease both;
}

[data-section-reveal].is-revealed [data-reveal-item]:nth-child(2) { animation-delay: 70ms; }
[data-section-reveal].is-revealed [data-reveal-item]:nth-child(3) { animation-delay: 140ms; }

@keyframes section-item-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.analyse-main {
  min-height: calc(100vh - var(--header-height));
  padding: 60px 0 72px;
  background:
    radial-gradient(circle at 8% 12%, rgba(23, 130, 85, .06), transparent 24%),
    var(--color-background);
}

.analyse-layout {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(430px, .72fr);
  align-items: start;
  gap: clamp(52px, 7vw, 88px);
}

.analyse-intro {
  padding-top: 28px;
}

.analyse-intro h1 {
  max-width: 620px;
  margin: 18px 0 16px;
  font-size: clamp(38px, 4.5vw, 54px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -.047em;
}

.analyse-intro > p {
  max-width: 590px;
  color: var(--color-text-muted);
  font-size: 16px;
}

.analyse-guidance {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  max-width: 590px;
  padding: 18px 0;
  margin-top: 30px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.analyse-guidance img {
  width: 92px;
  height: 106px;
  border-radius: 9px;
  object-fit: cover;
}

.analyse-guidance strong {
  font-size: 14px;
}

.analyse-guidance ul {
  padding-left: 18px;
  margin: 6px 0 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

.analyse-responsibility {
  padding-left: 14px;
  margin-top: 20px;
  border-left: 2px solid var(--color-primary);
  font-size: 13px !important;
}

.analyse-upload {
  padding: 28px;
  border-radius: 14px;
}

.analyse-upload .card-heading h2 {
  font-size: 28px;
}

.analyse-upload .upload-dropzone {
  min-height: 250px;
  border-width: 1px;
  border-radius: 10px;
}

.analyse-upload #analyseButton {
  margin-top: 14px;
}

.analyse-upload #analyseButton:disabled {
  border-color: #d8dfdb;
  background: #e7ebe8;
  color: #8b9690;
  opacity: 1;
}

@media (max-width: 920px) {
  .home-hero { padding-top: 54px; }
  .home-hero__grid,
  .analyse-layout { grid-template-columns: 1fr; gap: 40px; }
  .home-hero__visual { width: 100%; max-width: 680px; justify-self: start; }
  .home-hero__visual img { height: 360px; }
  .workflow-grid { grid-template-columns: 1fr; gap: 28px; }
  .workflow-step { display: grid; grid-template-columns: 210px 1fr; gap: 20px; }
  .workflow-step img { height: 150px; }
  .workflow-step > div { padding-top: 15px; }
  .section-heading--split,
  .preparation-layout { grid-template-columns: 1fr; gap: 24px; }
  .analyse-intro { padding-top: 0; }
  .analyse-upload { max-width: 680px; width: 100%; }
}

@media (max-width: 600px) {
  .home-hero { padding: 42px 0 50px; }
  .home-hero__copy h1 { font-size: 39px; }
  .home-hero__lead { font-size: 15px; }
  .home-hero__visual img { height: 290px; }
  .workflow-section,
  .conditions-section,
  .preparation-section { padding: 54px 0; }
  .workflow-step { grid-template-columns: 1fr; gap: 0; }
  .workflow-step img { height: 165px; }
  .conditions-grid { grid-template-columns: 1fr; }
  .condition-item:nth-last-child(2) { border-bottom: 1px solid var(--color-border); }
  .condition-item { grid-template-columns: 72px 1fr; }
  .condition-item img { width: 72px; height: 60px; }
  .analyse-main { padding: 42px 0 54px; }
  .analyse-intro h1 { font-size: 36px; }
  .analyse-guidance { grid-template-columns: 72px 1fr; }
  .analyse-guidance img { width: 72px; height: 90px; }
  .analyse-upload { padding: 20px; }
  .analyse-upload .upload-dropzone { min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-section-reveal].is-reveal-ready,
  [data-section-reveal].is-reveal-ready.is-revealed {
    opacity: 1;
    transform: none;
    transition: none;
  }
  [data-section-reveal].is-revealed [data-reveal-item] { animation: none; }
}

/* Final scoped overrides: keep legacy Analyse styles isolated from redesigned pages. */
body.auth-page {
  min-height: 100vh;
  display: block;
  padding: 0;
  background: #f6f7f4;
}

body.auth-page .auth-main {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  align-items: center;
  padding: 56px 0 72px;
  background: #f6f7f4;
}

body.auth-page .auth-layout {
  width: min(calc(100% - 28px), 500px);
  display: block;
  margin-inline: auto;
}

body.auth-page .auth-intro { display: none; }

body.auth-page .site-footer {
  width: 100%;
  min-height: auto;
}

body.auth-page .site-footer__inner {
  width: min(calc(100% - 28px), var(--content-max));
}

/* =========================================================
   Senior public UI polish
========================================================= */
.section-context,
.hero-context,
.auth-context {
  margin: 0 0 10px;
  color: #587066;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.site-header {
  border-color: rgba(209, 218, 212, .9);
  box-shadow: 0 1px 0 rgba(23, 32, 28, .02);
}

.primary-nav a {
  border-radius: 7px;
  transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.primary-nav a:hover {
  background: #f0f3f0;
  color: #17201c;
}

.primary-nav a.is-active:not(.nav-cta) {
  background: #e9f2ed;
  color: #126b46;
}

.primary-nav a:focus-visible,
.site-brand:focus-visible,
.nav-toggle:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  box-shadow: none;
}

.primary-nav .nav-cta:hover,
.primary-nav .nav-cta.is-active {
  background: #27322c;
  color: #fff;
}

.home-page .home-hero {
  min-height: 0;
  padding: clamp(72px, 9vw, 118px) 0;
  border-bottom: 1px solid var(--color-border);
  background:
    radial-gradient(circle at 78% 20%, rgba(23,130,85,.07), transparent 28%),
    #f8f9f6;
}

.home-hero__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, .72fr);
  align-items: center;
  gap: clamp(48px, 7vw, 90px);
}

.home-page .home-hero__copy {
  max-width: 720px;
  margin: 0;
  text-align: left;
}

.home-page .home-hero__copy h1 {
  max-width: 690px;
  margin: 0 0 22px;
  font-size: clamp(48px, 5.3vw, 70px);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -.055em;
}

.home-page .home-hero__lead {
  max-width: 660px;
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  text-align: left;
}

.home-page .hero-actions {
  justify-content: flex-start;
  margin-top: 30px;
}

.home-page .hero-note {
  margin: 20px 0 0;
  text-align: left;
}

.hero-specs {
  overflow: hidden;
  border: 1px solid #d7dfda;
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 18px 44px rgba(27, 45, 36, .07);
}

.hero-specs div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 3px 12px;
  padding: 20px 22px;
}

.hero-specs div + div { border-top: 1px solid var(--color-border); }
.hero-specs span { grid-row: 1 / 3; color: var(--color-primary); font-size: 12px; font-weight: 750; }
.hero-specs strong { font-size: 15px; font-weight: 650; }
.hero-specs p { margin: 0; color: var(--color-text-muted); font-size: 13px; line-height: 1.5; }

.home-page .workflow-section,
.home-page .value-section,
.home-page .conditions-section,
.home-page .users-section,
.home-page .final-cta {
  padding: clamp(68px, 8vw, 96px) 0;
}

.home-page .workflow-section,
.home-page .users-section { background: #fff; }
.home-page .value-section { background: #f2f5f1; }
.home-page .conditions-section { background: #f8f9f6; }
.home-page .final-cta { background: #edf3ef; }

.home-page .section-heading { margin-bottom: 38px; }
.home-page .section-heading h2,
.home-page .users-layout h2,
.home-page .final-cta h2 {
  margin: 0;
  font-size: clamp(30px, 3.5vw, 43px);
  font-weight: 650;
  line-height: 1.14;
  letter-spacing: -.04em;
}

.home-page .section-heading > p:not(.section-context),
.home-page .section-heading--split > p {
  max-width: 580px;
  margin-top: 12px;
  color: var(--color-text-muted);
}

.home-page .workflow-grid {
  gap: 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.home-page .workflow-step {
  min-height: 0;
  padding: 26px 24px 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.home-page .workflow-step + .workflow-step { border-left: 1px solid var(--color-border); }
.home-page .workflow-step h3 { margin: 28px 0 7px; }

.home-page .value-grid article {
  border-color: #d6ded8;
  background: rgba(255,255,255,.72);
  box-shadow: none;
}

.home-page .condition-item {
  border-color: #d5ddd8;
  background: rgba(255,255,255,.62);
}

.home-page .final-cta__inner {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-page .final-cta .button-primary,
.home-page .final-cta .button-primary:visited {
  background: var(--color-primary);
  color: #fff;
}

.home-page .final-cta .button-primary:hover,
.home-page .final-cta .button-primary:focus-visible {
  background: var(--color-primary-hover);
  color: #fff;
}

.home-page .final-cta .button-primary:active { background: #0d5a3a; color: #fff; }
.home-page .final-cta .button-primary:disabled { background: #dce3df; color: #78847d; }

body.auth-page .auth-card {
  border-radius: 14px;
  box-shadow: 0 18px 52px rgba(23, 38, 30, .08);
}

body.auth-page .auth-context { margin-bottom: 8px; }

body.auth-page .password-field {
  position: relative;
  display: block;
}

body.auth-page .password-field input {
  min-height: 48px;
  padding-right: 76px;
}

body.auth-page .password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-width: 58px;
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #345246;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

body.auth-page .password-toggle:hover { background: #edf3ef; color: var(--color-primary-hover); }
body.auth-page .password-toggle:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; box-shadow: none; }

.dashboard-page { background: #f6f7f4; }
.dashboard-page .page-shell { padding-block: 48px 76px; }
.dashboard-page .dashboard-hero { padding-bottom: 34px; border-bottom: 1px solid var(--color-border); }
.dashboard-page .dashboard-hero h1 { margin-top: 0; font-weight: 650; }
.dashboard-page .stats-grid { margin: 26px 0 54px; }
.dashboard-page .stat-card { padding: 20px; border-radius: 11px; box-shadow: none; }
.dashboard-page .stat-card span { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }
.dashboard-page .history-header h2 { margin-top: 0; }
.dashboard-page .history-item { grid-template-columns: 132px minmax(0,1fr); gap: 20px; border-left-width: 2px; border-radius: 11px; box-shadow: none; }
.dashboard-page .image-box img { height: 118px; }
.dashboard-page .delete-btn {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #8e3b34;
  font-size: 12px;
  font-weight: 650;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.dashboard-page .delete-btn:hover { border-color: #ecd0cd; background: #fff5f4; color: #a83229; }
.dashboard-page .delete-btn:focus-visible { outline: 2px solid #b54138; outline-offset: 2px; box-shadow: none; }

.result-page { background: #f6f7f4; }
.result-page .page-shell { max-width: 1120px; padding-block: 48px 82px; }
.result-page .result-card { display: flex; flex-direction: column; }
.result-page .header-text { order: 0; max-width: 760px; margin-bottom: 22px; }
.result-page .header-text h1 { margin: 0 0 9px; font-size: clamp(36px, 5vw, 54px); font-weight: 650; }
.result-page .status-box { order: 1; margin-bottom: 16px; border-width: 1px; border-left-width: 3px; font-weight: 600; }
.result-page .actions { order: 2; margin: 0 0 28px; }
.result-page .grid-layout { order: 3; grid-template-columns: minmax(0,.82fr) minmax(0,1.18fr); gap: 20px; }
.result-page .panel { padding: 24px; border-color: #d7dfda; border-radius: 12px; box-shadow: 0 10px 32px rgba(25, 43, 34, .05); }
.result-page .panel h2 { color: var(--color-text-muted); font-size: 13px; font-weight: 650; }
.result-page .image-panel img { max-height: 360px; }
.result-page .info-label { margin-bottom: 6px; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }
.result-page .final-tag { color: var(--color-text); font-size: clamp(34px, 5vw, 52px); font-weight: 680; line-height: 1.05; }
.result-page .info-value { font-size: 30px; font-weight: 680; }
.result-page .conf-bar-wrap { height: 8px; }
.result-page .probability-row { margin-top: 12px; }
.result-page .recom-panel { order: 4; max-width: 880px; margin-top: 48px; padding: 30px 32px; border: 1px solid #d7dfda; border-left: 3px solid var(--color-primary); border-radius: 12px; box-shadow: none; }
.result-page .recom-panel h2 { margin: 0 0 18px; font-size: 26px; font-weight: 650; }
.result-page .recom-text { max-width: 760px; font-size: 15px; line-height: 1.8; }
.result-page .evidence-section { order: 5; margin-top: 48px; padding-top: 30px; border-top: 1px solid var(--color-border); }
.result-page .evidence-heading { margin-bottom: 18px; }
.result-page .evidence-heading h2 { margin: 0 0 6px; font-size: 22px; font-weight: 650; }
.result-page .evidence-flow { gap: 12px; }
.result-page .evidence-flow figure { padding: 8px; border-radius: 10px; box-shadow: none; }
.result-page .evidence-flow img,
.result-page .evidence-placeholder { max-height: 190px; aspect-ratio: 4 / 3; }
.result-page .analysis-waiting-copy { margin: 14px 0 0; color: var(--color-text-muted); font-size: 14px; text-align: center; }

.popup-overlay { background: rgba(20, 29, 24, .4); }
.popup-card { border: 1px solid var(--color-border); border-radius: 13px; box-shadow: 0 24px 72px rgba(17, 29, 22, .2); }
.popup-buttons .btn { min-height: 40px; border-radius: 8px; }

@media (max-width: 920px) {
  .home-hero__layout { grid-template-columns: 1fr; gap: 38px; }
  .hero-specs { max-width: 700px; }
  .home-page .workflow-step + .workflow-step { border-left: 0; border-top: 1px solid var(--color-border); }
  .result-page .grid-layout { grid-template-columns: 1fr; }
  .result-page .image-panel img { max-height: 420px; }
}

@media (max-width: 600px) {
  .home-page .home-hero { padding: 52px 0 60px; }
  .home-page .home-hero__copy h1 { font-size: 42px; }
  .home-page .home-hero__lead { font-size: 15px; }
  .hero-specs div { padding: 17px 18px; }
  .home-page .workflow-section,
  .home-page .value-section,
  .home-page .conditions-section,
  .home-page .users-section,
  .home-page .final-cta { padding: 58px 0; }
  .dashboard-page .dashboard-hero { align-items: flex-start; flex-direction: column; }
  .dashboard-page .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-page .history-item { grid-template-columns: 86px minmax(0,1fr); padding: 14px; }
  .dashboard-page .image-box img { height: 82px; }
  .dashboard-page .history-details__body { grid-template-columns: 1fr; }
  .result-page .panel { padding: 19px; }
  .result-page .actions { flex-direction: column; }
  .result-page .actions .btn { width: 100%; }
  .result-page .evidence-flow { grid-template-columns: 1fr; }
  .result-page .evidence-flow img,
  .result-page .evidence-placeholder { max-height: 230px; }
  .result-page .recom-panel { padding: 24px 20px; }
}

@media (max-width: 430px) {
  .home-page .home-hero__copy h1 { font-size: 38px; }
  .dashboard-page .stats-grid { grid-template-columns: 1fr; }
  .dashboard-page .history-item { grid-template-columns: 1fr; }
  .dashboard-page .image-box img { width: 100%; height: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  .primary-nav a,
  .password-toggle,
  .delete-btn,
  .hero-specs { transition: none !important; }
}

/* ==========================================================
   DurianCare product redesign — July 2026
   Scoped user-interface layer; analyse workspace selectors are
   intentionally left unchanged.
========================================================== */
:root {
  --dc-ink: #132019;
  --dc-muted: #5f6d64;
  --dc-forest: #0d3a29;
  --dc-forest-2: #15543b;
  --dc-leaf: #3b7a57;
  --dc-mint: #dceadf;
  --dc-cream: #f2eee5;
  --dc-stone: #e8e2d7;
  --dc-paper: #fffefa;
  --dc-line: rgba(19, 32, 25, .12);
  --dc-shadow: 0 24px 70px rgba(25, 45, 33, .12);
  --dc-radius: 24px;
}

html { scroll-behavior: smooth; }
body { color: var(--dc-ink); background: var(--dc-cream); }
.content-shell, .page-shell { width: min(1180px, calc(100% - 48px)); }
.section-context, .hero-context, .auth-context {
  margin: 0 0 14px;
  color: var(--dc-leaf);
  font-size: 13px;
  font-weight: 720;
  letter-spacing: .045em;
  text-transform: none;
}
.button, .btn {
  min-height: 48px;
  border-radius: 12px;
  font-weight: 690;
  letter-spacing: -.01em;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.button:hover, .btn:hover { transform: translateY(-2px); }
.button-primary, .btn-primary {
  border-color: var(--dc-forest);
  color: #fff;
  background: var(--dc-forest);
  box-shadow: 0 10px 24px rgba(13, 58, 41, .18);
}
.button-primary:hover, .btn-primary:hover { color: #fff; background: #082e20; box-shadow: 0 14px 30px rgba(13, 58, 41, .24); }
.button-secondary, .btn-secondary { border-color: var(--dc-line); color: var(--dc-ink); background: rgba(255,255,255,.7); }
.button:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid #88b99a;
  outline-offset: 3px;
}

/* Product navigation */
.site-header {
  top: 0;
  border-bottom: 1px solid rgba(19,32,25,.09);
  background: rgba(247, 244, 237, .88);
  box-shadow: 0 6px 28px rgba(24, 39, 30, .05);
  backdrop-filter: blur(18px) saturate(130%);
}
.site-header__inner { width: min(1240px, calc(100% - 48px)); min-height: 76px; }
.site-brand { gap: 11px; }
.site-brand__mark, .site-footer__mark {
  display: grid; width: 42px; height: 42px; place-items: center;
  border-radius: 13px; color: #fff; background: var(--dc-forest);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 8px 18px rgba(13,58,41,.16);
}
.site-brand__mark svg, .site-footer__mark svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.site-brand__copy strong { font-size: 16px; letter-spacing: -.025em; }
.site-brand__copy small { color: #718078; font-size: 11px; }
.primary-nav { gap: 5px; }
.primary-nav a { position: relative; padding: 10px 12px; color: #435148; border-radius: 8px; font-size: 14px; }
.primary-nav a:hover { color: var(--dc-forest); background: rgba(13,58,41,.06); }
.primary-nav a.is-active:not(.nav-cta)::after {
  position: absolute; right: 12px; bottom: 4px; left: 12px; height: 2px;
  border-radius: 2px; background: var(--dc-leaf); content: "";
}
.primary-nav .nav-cta { margin-left: 7px; padding: 11px 17px; color: #fff; background: var(--dc-forest); }
.primary-nav .nav-cta:hover { color: #fff; background: #082e20; }
.primary-nav .nav-signout { color: #744d47; }

/* Homepage */
.home-page { background: var(--dc-cream); }
.home-page .home-hero {
  position: relative; min-height: 690px; padding: 96px 0 104px; overflow: hidden;
  color: #f8f5ed;
  background:
    radial-gradient(circle at 82% 18%, rgba(102,157,117,.34), transparent 28%),
    linear-gradient(123deg, #09291e 0%, #103e2c 58%, #1e513a 100%);
}
.home-page .home-hero::before {
  position: absolute; inset: 0; opacity: .18; pointer-events: none; content: "";
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to right, transparent 5%, #000 75%);
}
.home-page .home-hero::after {
  position: absolute; right: -8%; bottom: -52%; width: 620px; height: 620px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 50%; content: "";
}
.home-hero__layout { position: relative; z-index: 1; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); gap: 90px; align-items: center; }
.home-page .hero-context { color: #a8d2b4; }
.home-page .home-hero__copy h1 {
  max-width: 760px; margin: 0; color: #fffdf7;
  font-size: clamp(55px, 6.2vw, 88px); font-weight: 620; line-height: .99; letter-spacing: -.062em;
}
.home-page .home-hero__lead { max-width: 660px; margin: 28px 0 0; color: #d3ded6; font-size: 18px; line-height: 1.7; }
.home-page .hero-actions { margin-top: 34px; }
.home-page .hero-actions .button-primary { border-color: #eef2e7; color: var(--dc-forest); background: #eef2e7; box-shadow: 0 14px 30px rgba(0,0,0,.16); }
.home-page .hero-actions .button-primary:hover { color: var(--dc-forest); background: #fff; }
.home-page .hero-actions .button-secondary { border-color: rgba(255,255,255,.26); color: #fff; background: rgba(255,255,255,.07); }
.home-page .hero-note { color: #aebdb4; }
.hero-visual {
  position: relative; padding: 22px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.17); border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.05));
  box-shadow: 0 36px 80px rgba(0,0,0,.27); backdrop-filter: blur(14px);
}
.hero-visual__top { display: flex; justify-content: space-between; align-items: center; color: #dce8df; font-size: 12px; }
.live-indicator { display: flex; align-items: center; gap: 7px; }
.live-indicator::before { width: 7px; height: 7px; border-radius: 50%; background: #9bc9a7; box-shadow: 0 0 0 5px rgba(155,201,167,.12); content: ""; }
.hero-leaf { position: relative; display: grid; min-height: 285px; place-items: center; margin: 18px 0; border-radius: 20px; background: rgba(5,28,19,.38); }
.hero-leaf svg { width: 220px; height: 220px; }
.leaf-shape { fill: rgba(123,177,138,.18); stroke: #a5d1b0; stroke-width: 2; }
.leaf-vein { fill: none; stroke: rgba(205,234,212,.65); stroke-width: 1.4; }
.scan-corner { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1.4; }
.hero-leaf > span { position: absolute; right: 15px; bottom: 14px; padding: 7px 9px; border-radius: 7px; color: #cce4d2; background: rgba(8,37,26,.78); font-size: 11px; }
.scan-line { position: absolute; top: 18%; left: 14%; width: 72%; height: 1px; background: linear-gradient(90deg, transparent, #bfe1c7, transparent); box-shadow: 0 0 12px #89c39a; animation: dcScan 4s ease-in-out infinite; }
@keyframes dcScan { 0%,100% { transform: translateY(0); opacity: .3; } 50% { transform: translateY(178px); opacity: 1; } }
.hero-readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero-readout > div { display: flex; gap: 9px; padding: 12px 10px; border-radius: 12px; background: rgba(255,255,255,.075); }
.hero-readout span { color: #91c3a0; font: 650 10px/1.4 monospace; }
.hero-readout p { margin: 0; }
.hero-readout strong, .hero-readout small { display: block; }
.hero-readout strong { color: #fff; font-size: 12px; }
.hero-readout small { margin-top: 3px; color: #9eb0a5; font-size: 9px; white-space: nowrap; }
.home-page .workflow-section { padding: 108px 0; background: var(--dc-paper); }
.home-page .workflow-section .content-shell { padding: 0; }
.home-page .section-heading h2, .home-page .users-layout h2, .home-page .final-cta h2 { letter-spacing: -.045em; }
.home-page .workflow-grid { margin-top: 50px; overflow: hidden; border: 1px solid var(--dc-line); border-radius: var(--dc-radius); background: #fff; box-shadow: 0 18px 48px rgba(32,55,40,.08); }
.home-page .workflow-step { min-height: 245px; padding: 30px 25px; }
.home-page .workflow-step .step-number { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: var(--dc-forest); background: var(--dc-mint); font-size: 12px; }
.home-page .value-section { padding: 108px 0; background: #dce9dc; }
.home-page .value-grid { margin-top: 48px; gap: 14px; }
.home-page .value-grid article { min-height: 210px; padding: 30px; border: 1px solid rgba(13,58,41,.11); border-radius: 20px; background: rgba(255,255,255,.6); box-shadow: none; }
.home-page .value-grid article::before { display: block; width: 32px; height: 3px; margin-bottom: 32px; border-radius: 3px; background: var(--dc-leaf); content: ""; }
.home-page .conditions-section { padding: 108px 0; background: #e7e0d5; }
.home-page .conditions-grid { gap: 12px; margin-top: 48px; }
.home-page .condition-item { min-height: 150px; padding: 28px; border: 1px solid rgba(19,32,25,.1); border-radius: 18px; background: rgba(255,254,250,.7); }
.condition-marker { width: 12px; height: 12px; border: 3px solid #b8735a; background: transparent; box-shadow: 0 0 0 5px rgba(184,115,90,.12); }
.condition-marker--healthy { border-color: var(--dc-leaf); box-shadow: 0 0 0 5px rgba(59,122,87,.12); }
.home-page .users-section { padding: 100px 0; background: #eef1e9; }
.home-page .users-layout { padding: 0; }
.home-page .users-layout ul { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-page .users-layout li { padding: 16px 18px; border: 1px solid var(--dc-line); border-radius: 12px; background: rgba(255,255,255,.72); }
.home-page .final-cta { position: relative; padding: 105px 0; overflow: hidden; color: #fff; background: #092d20; }
.home-page .final-cta::after { position: absolute; top: -170px; right: -100px; width: 500px; height: 500px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; content: ""; }
.home-page .final-cta .section-context { color: #9bc7a7; }
.home-page .final-cta h2 { color: #fff; font-size: clamp(40px,5vw,65px); }
.home-page .final-cta p { color: #cad7ce; }
.home-page .final-cta .button-primary { position: relative; z-index: 1; border-color: #fff; color: var(--dc-forest); background: #fff; }
.home-page .final-cta .button-primary:hover, .home-page .final-cta .button-primary:focus-visible { color: var(--dc-forest); background: #e7f0e8; }

/* Authentication */
.auth-page { background: #dce7dc; }
.auth-main {
  position: relative; min-height: calc(100vh - 76px); padding: 72px 0 84px; overflow: hidden;
  background: linear-gradient(116deg, #0b3224 0 48%, #e5eadf 48% 100%);
}
.auth-main::before { position: absolute; top: -260px; left: -180px; width: 620px; height: 620px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; content: ""; }
.auth-layout { grid-template-columns: minmax(0, 1fr) minmax(410px, .78fr); gap: 9vw; align-items: center; }
.auth-intro { max-width: 540px; color: #fff; }
.auth-intro .auth-context { color: #9bc9a7; }
.auth-intro h1 { margin: 0 0 24px; color: #fff; font-size: clamp(46px, 5vw, 70px); line-height: 1.02; letter-spacing: -.055em; }
.auth-intro > p:not(.auth-context) { color: #c9d7ce; font-size: 17px; line-height: 1.7; }
.feature-checks { margin-top: 34px; }
.feature-checks li { padding: 13px 0 13px 28px; border-bottom: 1px solid rgba(255,255,255,.1); color: #e0e8e2; }
.feature-checks li::before { color: #9bc9a7; }
.auth-pipeline { display: flex; align-items: center; gap: 12px; margin-top: 42px; color: #e4ede6; font-size: 12px; }
.auth-pipeline i { width: 34px; height: 1px; background: #6d9d7b; }
.auth-card { padding: 42px; border: 1px solid rgba(255,255,255,.72); border-radius: 26px; background: rgba(255,254,250,.95); box-shadow: 0 30px 80px rgba(8,37,25,.22); }
.auth-card .card-heading h1, .auth-card .card-heading h2 { color: var(--dc-ink); font-size: 32px; letter-spacing: -.04em; }
.auth-brand { display: none; }
.form-field input { height: 52px; border-color: #cbd3cc; border-radius: 11px; background: #fff; }
.form-field input:focus { border-color: var(--dc-leaf); box-shadow: 0 0 0 4px rgba(59,122,87,.12); }
.password-field { position: relative; }
.password-field input { padding-right: 74px; }
.password-toggle {
  position: absolute; top: 50%; right: 7px; min-width: 58px; min-height: 38px; padding: 0 10px;
  transform: translateY(-50%); border: 0; border-radius: 8px; color: var(--dc-forest); background: #edf2ed; font-weight: 700;
}
.password-toggle:hover { background: #dce9df; }
.password-toggle:focus-visible { outline: 3px solid #88b99a; outline-offset: 1px; }

/* Dashboard */
.dashboard-page { background: #ece8df; }
.dashboard-page .page-shell { padding: 58px 0 90px; }
.dashboard-page .dashboard-hero {
  position: relative; margin-bottom: 22px; padding: 42px; overflow: hidden;
  border-radius: 26px; color: #fff; background: linear-gradient(125deg, #0b3224, #1a543b);
  box-shadow: 0 20px 50px rgba(13,58,41,.16);
}
.dashboard-page .dashboard-hero::after { position: absolute; right: -75px; bottom: -180px; width: 350px; height: 350px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; content: ""; }
.dashboard-page .dashboard-hero h1 { color: #fff; font-size: clamp(34px,4vw,48px); letter-spacing: -.045em; }
.dashboard-page .dashboard-hero p { color: #cbd9d0; }
.dashboard-page .dashboard-hero .section-context { color: #9bc9a7; }
.dashboard-page .dashboard-hero .button { position: relative; z-index: 1; border-color: #fff; color: var(--dc-forest); background: #fff; }
.dashboard-page .stats-grid { gap: 12px; margin: 0 0 46px; }
.dashboard-page .stat-card { min-height: 155px; padding: 24px; border: 1px solid var(--dc-line); border-radius: 18px; background: var(--dc-paper); box-shadow: none; }
.dashboard-page .stat-card::before { width: 27px; height: 3px; margin-bottom: 24px; border-radius: 2px; background: #7da48a; content: ""; }
.dashboard-page .stat-card.warning::before { background: #c58d4a; }
.dashboard-page .stat-card strong { font-size: 33px; letter-spacing: -.04em; }
.dashboard-page .history-section { padding: 0; border: 0; background: transparent; box-shadow: none; }
.dashboard-page .history-header { margin-bottom: 20px; padding: 0 4px; }
.dashboard-page .history-header h2 { font-size: 34px; letter-spacing: -.04em; }
.dashboard-page .history-list { gap: 14px; }
.dashboard-page .history-item {
  position: relative; grid-template-columns: 150px minmax(0,1fr); gap: 24px; padding: 20px;
  border: 1px solid var(--dc-line); border-radius: 20px; background: var(--dc-paper);
  box-shadow: 0 8px 28px rgba(28,45,34,.06); transition: transform .2s ease, box-shadow .2s ease;
}
.dashboard-page .history-item:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(28,45,34,.1); }
.dashboard-page .image-box img { height: 135px; border-radius: 13px; }
.dashboard-page .history-filename { color: var(--dc-muted); font: 600 12px/1.4 monospace; }
.dashboard-page .meta-row { gap: 7px; }
.dashboard-page .meta-badge, .dashboard-page .quality-badge { min-height: 29px; padding: 6px 9px; border-radius: 7px; }
.dashboard-page .quality-badge.reliable { color: #185a3d; background: #dfeee3; }
.dashboard-page .history-details { margin-top: 16px; border: 1px solid var(--dc-line); border-radius: 12px; background: #f7f6f1; }
.dashboard-page .history-details summary { padding: 13px 15px; color: var(--dc-forest); font-weight: 680; cursor: pointer; }
.dashboard-page .history-details__body { padding: 0 15px 16px; }
.dashboard-page .item-actions { position: absolute; top: 15px; right: 15px; margin: 0; }
.dashboard-page .delete-btn {
  display: grid; width: 40px; height: 40px; padding: 0; place-items: center;
  border: 1px solid transparent; border-radius: 10px; color: #718078; background: transparent; font-size: 0;
}
.dashboard-page .delete-btn svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-page .delete-btn:hover, .dashboard-page .delete-btn:focus-visible { border-color: #e5c2bd; color: #a43f34; background: #fff0ed; }
.dashboard-page .history-pagination { margin-top: 24px; padding: 16px; border: 1px solid var(--dc-line); border-radius: 14px; background: rgba(255,255,255,.6); }
.dashboard-page .empty-state { padding: 70px 30px; border: 1px dashed #aeb9b0; border-radius: 22px; background: rgba(255,255,255,.55); }

/* Result report */
.result-page { background: #e9e5dc; }
.result-page .page-shell { max-width: 1040px; padding: 52px 0 78px; }
.result-page .result-card { display: flex; flex-direction: column; max-width: none; padding: 0; border: 0; background: transparent; box-shadow: none; }
.result-page .header-text { order: 1; max-width: 740px; margin-bottom: 28px; text-align: left; }
.result-page .header-text h1 { font-size: clamp(46px,6vw,72px); letter-spacing: -.055em; }
.result-page .header-text > p:last-child { max-width: 650px; color: var(--dc-muted); font-size: 17px; }
.result-page .status-box {
  order: 2; display: flex; align-items: center; gap: 10px; margin: 0 0 20px; padding: 15px 18px;
  border-width: 1px; border-radius: 12px; text-align: left; font-weight: 680;
}
.result-page .status-box::before { width: 9px; height: 9px; flex: 0 0 auto; border: 2px solid currentColor; border-radius: 50%; content: ""; }
.result-page .result-top-actions { order: 3; display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 34px; }
.result-page .grid-layout {
  order: 4;
  display: grid;
  grid-template-columns: minmax(280px,.88fr) minmax(0,1.12fr);
  align-items: start;
  grid-auto-rows: max-content;
  gap: 20px;
  margin: 0;
}
.result-page .panel {
  align-self: start;
  height: auto;
  min-height: 0;
  padding: 22px 24px;
  border: 1px solid var(--dc-line);
  border-radius: 18px;
  background: var(--dc-paper);
  box-shadow: 0 10px 30px rgba(25,44,32,.065);
}
.result-page .hidden-area { display: none !important; }
.result-page .panel h2 { margin: 0 0 16px; color: var(--dc-muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.result-page .image-panel img { width: 100%; height: auto; max-height: 330px; aspect-ratio: auto; border-radius: 12px; object-fit: contain; background: #edf0ea; }
.result-page .info-item { padding: 0 0 18px; border-bottom: 1px solid var(--dc-line); }
.result-page .info-item + .info-item { padding-top: 18px; }
.result-page .info-item:last-child { padding-bottom: 0; border-bottom: 0; }
.result-page .final-tag { min-height: 0; padding: 0; border: 0; border-radius: 0; color: var(--dc-forest) !important; background: transparent !important; box-shadow: none; font-size: clamp(46px,6vw,70px); font-weight: 650; letter-spacing: -.055em; }
.result-page .final-tag.low { color: #9a642b; }
.result-page .info-value { display: inline-block; margin-right: 10px; font-size: 34px; }
.result-page .conf-bar-wrap { height: 10px; margin-top: 12px; border-radius: 10px; background: #e4e8e2; }
.result-page .conf-bar { border-radius: 10px; background: linear-gradient(90deg, #2d6b4a, #69a77e); }
.result-page .prob-list { margin-top: 13px; }
.result-page .probability-row { margin-top: 15px; }
.result-page .probability-row > div { margin-bottom: 7px; }
.result-page .probability-row:first-child span::after { margin-left: 7px; padding: 3px 6px; border-radius: 5px; color: #1a5a3d; background: #dfeee3; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; content: "Highest"; }
.result-page progress { height: 9px; border-radius: 9px; }
.result-page progress::-webkit-progress-bar { border-radius: 9px; background: #e3e7e2; }
.result-page progress::-webkit-progress-value { border-radius: 9px; background: #4f8864; }
.result-page progress::-moz-progress-bar { border-radius: 9px; background: #4f8864; }
.result-page .recom-panel {
  order: 5; max-width: none; margin: 30px 0 0; padding: 32px 36px;
  border: 0; border-radius: 18px; color: #eef4ef; background: var(--dc-forest);
  box-shadow: 0 16px 40px rgba(13,58,41,.14);
}
.result-page .recom-panel .section-context { color: #9bc9a7; }
.result-page .recom-panel h2 { color: #fff; font-size: 30px; }
.result-page .recom-text { max-width: 900px; color: #d9e4dc; font-size: 16px; line-height: 1.85; }
.result-page .evidence-section { order: 6; margin-top: 44px; padding-top: 0; border: 0; }
.result-page .evidence-heading { max-width: 660px; }
.result-page .evidence-heading h2 { font-size: 28px; letter-spacing: -.035em; }
.result-page .evidence-flow { gap: 12px; }
.result-page .evidence-flow { align-items: start; }
.result-page .evidence-flow figure { padding: 9px; border: 1px solid var(--dc-line); border-radius: 15px; background: rgba(255,255,255,.68); }
.result-page .evidence-flow img, .result-page .evidence-placeholder { max-height: 210px; border-radius: 10px; }
.result-page .actions {
  order: 7; display: flex; justify-content: space-between; align-items: center; margin-top: 34px; padding-top: 24px;
  border-top: 1px solid var(--dc-line); color: var(--dc-muted); font-size: 13px;
}
.result-page .actions a { color: var(--dc-forest); font-weight: 720; }

.result-state-uncertain .status-box { border-color: #d7a45d; color: #744716; background: #fff2db; }
.result-state-uncertain .panel { border-color: #e2c18d; }
.result-state-uncertain .final-tag { color: #85551f !important; }
.result-state-uncertain .conf-bar { background: linear-gradient(90deg, #b67526, #dda54e) !important; }
.result-state-uncertain progress::-webkit-progress-value { background: #c48a38; }
.result-state-uncertain progress::-moz-progress-bar { background: #c48a38; }
.result-state-uncertain .probability-row:first-child span::after { color: #744716; background: #fff0d4; content: "Highest candidate"; }
.result-state-uncertain .recom-panel { border: 1px solid #d7a45d; color: #4e351d; background: #fff4df; box-shadow: none; }
.result-state-uncertain .recom-panel h2 { color: #684015; }
.result-state-uncertain .recom-text { color: #5f4932; }
.result-state-uncertain .result-top-actions .btn-primary { border-color: #a9671e; background: #a9671e; }
.result-state-invalid .status-box { border-color: #dfaaa3; color: #7f3028; background: #fff0ed; }

body.dashboard-page .dashboard-hero h1 { color: #fff !important; }
body.dashboard-page .dashboard-hero .section-context { color: #a9d4b5; }
body.dashboard-page .dashboard-hero > div > p:last-child { color: #d7e3da; }

.home-page .final-cta { border-bottom: 0; box-shadow: none; }
.home-page .site-footer { margin-top: -1px; border-top: 0; box-shadow: none; }

.site-footer { color: #cbd8cf; background: #081f17; }
.site-footer__inner { min-height: 150px; }
.site-footer a, .site-footer p, .site-footer__identity span { color: #9fb0a5; }
.site-footer__mark { width: 38px; height: 38px; background: #174b36; }
.site-footer__project { max-width: 390px; font-size: 11px; line-height: 1.6; text-align: right; }

@media (max-width: 1024px) {
  .home-hero__layout { gap: 48px; }
  .home-page .home-hero__copy h1 { font-size: 64px; }
  .auth-layout { gap: 6vw; }
  .auth-intro h1 { font-size: 52px; }
  .auth-card { padding: 34px; }
}
@media (max-width: 920px) {
  .home-page .home-hero { min-height: auto; padding: 74px 0 80px; }
  .home-hero__layout { grid-template-columns: 1fr; }
  .hero-visual { max-width: 650px; }
  .auth-main { background: linear-gradient(180deg, #0b3224 0 35%, #e5eadf 35% 100%); }
  .auth-layout { grid-template-columns: 1fr; gap: 45px; }
  .auth-intro { max-width: 680px; }
  .auth-intro h1 { font-size: 48px; }
  .auth-card { width: min(100%, 620px); justify-self: center; }
}
@media (max-width: 768px) {
  .content-shell, .page-shell, .site-header__inner { width: min(100% - 32px, 1180px); }
  .site-header__inner { min-height: 68px; }
  .nav-toggle { display: grid; }
  .primary-nav {
    top: calc(100% + 8px); right: 16px; left: 16px; gap: 3px; padding: 10px;
    border: 1px solid var(--dc-line); border-radius: 16px; background: #fffdf8; box-shadow: var(--dc-shadow);
  }
  .primary-nav a { min-height: 44px; padding: 12px 14px; }
  .primary-nav .nav-cta { margin: 4px 0 0; text-align: center; }
  .home-page .home-hero__copy h1 { font-size: 54px; }
  .home-page .section-heading--split { grid-template-columns: 1fr; gap: 14px; }
  .home-page .users-layout { grid-template-columns: 1fr; gap: 28px; }
  .home-page .final-cta__inner { align-items: flex-start; flex-direction: column; gap: 30px; }
  .dashboard-page .dashboard-hero { padding: 32px; }
  .dashboard-page .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-page .history-item { grid-template-columns: 120px minmax(0,1fr); }
  .result-page .grid-layout { grid-template-columns: 1fr; }
  .result-page .image-panel img { max-height: 420px; }
}
@media (max-width: 520px) {
  .content-shell, .page-shell, .site-header__inner { width: min(100% - 24px, 1180px); }
  .site-brand__copy small { display: none; }
  .home-page .home-hero { padding: 58px 0 64px; }
  .home-page .home-hero__copy h1 { font-size: 45px; }
  .home-page .home-hero__lead { font-size: 16px; }
  .home-page .hero-actions { display: grid; }
  .home-page .hero-actions .button { width: 100%; }
  .hero-visual { padding: 14px; border-radius: 21px; }
  .hero-leaf { min-height: 230px; }
  .hero-leaf svg { width: 180px; height: 180px; }
  .scan-line { display: none; }
  .hero-readout { grid-template-columns: 1fr; }
  .hero-readout > div { align-items: center; }
  .hero-readout small { font-size: 10px; }
  .home-page .workflow-section, .home-page .value-section, .home-page .conditions-section, .home-page .users-section, .home-page .final-cta { padding: 72px 0; }
  .home-page .value-grid, .home-page .conditions-grid, .home-page .users-layout ul { grid-template-columns: 1fr; }
  .auth-main { padding: 54px 0 65px; }
  .auth-intro h1 { font-size: 42px; }
  .auth-card { padding: 28px 20px; border-radius: 20px; }
  .dashboard-page .page-shell { padding-top: 28px; }
  .dashboard-page .dashboard-hero { padding: 27px 22px; }
  .dashboard-page .dashboard-hero .button { width: 100%; }
  .dashboard-page .stats-grid { grid-template-columns: 1fr; }
  .dashboard-page .history-header { align-items: flex-start; flex-direction: column; }
  .dashboard-page .history-item { grid-template-columns: 1fr; padding: 14px; }
  .dashboard-page .image-box img { width: 100%; height: 190px; }
  .dashboard-page .history-content { padding-right: 0; }
  .dashboard-page .item-actions { top: 207px; right: 18px; }
  .dashboard-page .history-details__body { grid-template-columns: 1fr; }
  .result-page .page-shell { padding-top: 40px; }
  .result-page .header-text h1 { font-size: 46px; }
  .result-page .result-top-actions { flex-direction: column; }
  .result-page .result-top-actions .btn { width: 100%; }
  .result-page .panel { padding: 20px; }
  .result-page .final-tag { font-size: 46px; }
  .result-page .recom-panel { padding: 28px 22px; }
  .result-page .evidence-flow { grid-template-columns: 1fr; }
  .result-page .actions { align-items: flex-start; flex-direction: column; gap: 13px; }
  .site-footer__project { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scan-line { animation: none; transform: translateY(85px); }
  .button, .btn, .history-item { transition: none; }
}
/* Print-friendly, ownership-protected analysis report */
.report-page{background:#edf4f0;color:#173c2e}.analysis-report{width:min(900px,calc(100% - 2rem));margin:2rem auto;background:#fff;border:1px solid #dbe7e0;border-radius:22px;padding:2rem;box-shadow:0 18px 50px rgba(26,65,50,.09)}.report-header{display:flex;justify-content:space-between;gap:1.5rem;border-bottom:2px solid #1b7d54;padding-bottom:1.3rem}.report-header h1{margin:.25rem 0}.report-brand{color:#17734d;font-weight:900;letter-spacing:.06em}.report-actions{display:flex;gap:.6rem;align-items:flex-start}.report-meta,.report-probabilities{display:grid;grid-template-columns:repeat(2,1fr);gap:.8rem;margin:1.3rem 0}.report-meta div,.report-probabilities div{padding:1rem;background:#f5f8f6;border-radius:12px}.report-meta span,.report-probabilities span{display:block;color:#65796f;font-size:.82rem}.report-image img{display:block;max-width:100%;max-height:360px;margin:auto;border-radius:14px}.report-state{padding:1rem 1.15rem;border-left:5px solid #23825a;background:#eff8f3;border-radius:10px}.report-state-uncertain{border-color:#bf8616;background:#fff8e8}.report-state-invalid{border-color:#b64b4b;background:#fff1f1}.report-confidence{display:flex;justify-content:space-between}.report-guidance{white-space:normal;line-height:1.7;padding:1.15rem;background:#f5f8f6;border-radius:12px}.report-disclaimer{margin-top:1.6rem;padding-top:1rem;border-top:1px solid #dfe8e3;color:#63776d;font-size:.88rem}
@media(max-width:650px){.report-header{display:block}.report-actions{margin-top:1rem;flex-wrap:wrap}.report-meta,.report-probabilities{grid-template-columns:1fr}.analysis-report{padding:1.2rem}}@media print{.report-page{background:#fff}.analysis-report{width:100%;margin:0;border:0;box-shadow:none;padding:0}.report-actions{display:none}.report-header{break-inside:avoid}.report-image img{max-height:280px}}

/* Focused dashboard probability layout correction */
.dashboard-page .history-details__body {
  grid-template-columns: minmax(230px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
}

.dashboard-page .probability-box,
.dashboard-page .recommendation {
  min-width: 0;
}

.dashboard-page .probability-box {
  max-width: 380px;
}

.dashboard-page .prob-row {
  display: grid;
  grid-template-columns: minmax(76px, max-content) minmax(86px, 1fr) max-content;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}

.dashboard-page .prob-label,
.dashboard-page .prob-value {
  line-height: 1.25;
  white-space: nowrap;
}

.dashboard-page .prob-value {
  min-width: 46px;
  text-align: right;
}

.dashboard-page .prob-bar {
  height: 7px;
  min-width: 74px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e5de;
}

.dashboard-page .prob-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #315f45, #76a978);
}

@media (max-width: 768px) {
  .dashboard-page .history-details__body {
    grid-template-columns: 1fr;
  }

  .dashboard-page .probability-box {
    max-width: none;
  }
}

@media (max-width: 430px) {
  .dashboard-page .prob-row {
    grid-template-columns: minmax(72px, max-content) minmax(68px, 1fr) max-content;
    gap: 8px;
  }

  .dashboard-page .prob-value {
    min-width: 42px;
  }
}

/* Focused visual polish pass */
.home-page .value-grid article::before {
  display: none;
  content: none;
}

.home-page .value-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border: 1px solid rgba(13, 58, 41, .1);
  border-radius: 12px;
  color: var(--dc-forest);
  background: rgba(220, 234, 223, .78);
}

.home-page .value-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.popup-card #lowConfTitle {
  text-align: center;
}

#lowConfPopup .dialog-status {
  margin-right: auto;
  margin-left: auto;
}

.result-page {
  background: #eef2ec;
}

.result-page .result-card {
  background: transparent;
}

.result-page .panel,
.result-page .evidence-flow figure,
.result-page .recom-panel {
  background: #fffdf8;
}

.result-page .panel,
.result-page .evidence-flow figure {
  border-color: rgba(19, 32, 25, .11);
  box-shadow: 0 10px 28px rgba(25, 44, 32, .055);
}

.result-page .image-panel img,
.result-page .evidence-flow img,
.result-page .evidence-placeholder {
  background: #f1f3ef;
}

.result-page .evidence-section {
  margin-top: 38px;
}

.result-page .recom-panel {
  color: var(--dc-ink);
  border: 1px solid rgba(19, 32, 25, .11);
  border-left: 3px solid var(--dc-forest);
  box-shadow: 0 12px 34px rgba(25, 44, 32, .06);
}

.result-page .recom-panel h2 {
  color: var(--dc-ink);
}

.result-page .recom-text {
  color: #37433c;
}

.result-page .result-disclaimer {
  order: 7;
  margin: 28px 0 0;
  color: var(--dc-muted);
  font-size: 13px;
}

.result-page .actions {
  display: none;
}

.result-state-uncertain .panel {
  border-color: rgba(151, 105, 40, .2);
}

.result-state-uncertain .grid-layout {
  align-items: start;
}

.result-state-uncertain .panel:not(.image-panel) {
  padding: 22px 24px;
}

.result-state-uncertain .panel h2 {
  margin-bottom: 15px;
  font-size: 12px;
}

.result-state-uncertain .info-item {
  padding-bottom: 14px;
}

.result-state-uncertain .info-item + .info-item {
  padding-top: 14px;
}

.result-state-uncertain .info-label {
  margin-bottom: 7px;
}

.result-state-uncertain .final-tag {
  font-size: clamp(32px, 3.5vw, 42px);
  line-height: 1.05;
}

.result-state-uncertain .info-value {
  font-size: 26px;
  line-height: 1.15;
}

.result-state-uncertain .conf-bar-wrap {
  height: 8px;
  margin-top: 8px;
}

.result-state-uncertain .prob-list {
  margin-top: 10px;
}

.result-state-uncertain .probability-row {
  margin-top: 10px;
}

.result-state-uncertain .probability-row > div {
  margin-bottom: 5px;
  font-size: 13px;
}

.result-state-uncertain progress {
  height: 8px;
}

.result-state-uncertain .recom-panel {
  color: #4e351d;
  background: #fff9ed;
}

.result-state-uncertain .recom-panel h2 {
  color: #684015;
}

.result-state-uncertain .recom-text {
  color: #5f4932;
}

@media (max-width: 520px) {
  .result-state-uncertain .final-tag {
    font-size: 34px;
  }

  .result-state-uncertain .panel:not(.image-panel) {
    padding: 18px;
  }

  .home-page .value-icon {
    margin-bottom: 22px;
  }
}

/* Result page sizing for laptop and smaller desktop screens */
@media (min-width: 769px) and (max-width: 1280px) {
  .result-page .page-shell {
    max-width: 980px;
    padding-top: 44px;
  }

  .result-page .header-text h1 {
    font-size: clamp(42px, 4.8vw, 58px);
  }

  .result-page .grid-layout {
    grid-template-columns: minmax(270px, .9fr) minmax(0, 1.1fr);
    gap: 18px;
  }

  .result-page .panel {
    padding: 20px 22px;
  }

  .result-page .image-panel img {
    max-height: 300px;
  }

  .result-page .recom-panel {
    padding: 30px 32px;
  }
}

/* Remove the large outer card shell from the Result page */
.result-page .result-card {
  display: flex;
  flex-direction: column;
  max-width: none;

  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;

  background: transparent !important;
  box-shadow: none !important;

  overflow: visible;
}

/* =========================================================
   Final Result Summary height correction
========================================================= */

/* Remove spacing inherited from the older Result page styles. */
.result-page .info-item + .info-item {
  margin-top: 0;
}

/* Compact the completed Result Summary on laptop and desktop. */
@media (min-width: 769px) {
  body.result-page.result-state-complete
  .grid-layout > .panel:not(.image-panel) {
    padding: 20px 22px;
  }

  body.result-page.result-state-complete
  .grid-layout > .panel:not(.image-panel) h2 {
    margin-bottom: 12px;
  }

  body.result-page.result-state-complete .info-item {
    padding-bottom: 13px;
  }

  body.result-page.result-state-complete
  .info-item + .info-item {
    padding-top: 13px;
  }

  body.result-page.result-state-complete .info-label {
    margin-bottom: 5px;
  }

  body.result-page.result-state-complete .final-tag {
    font-size: clamp(38px, 4vw, 52px);
    line-height: 1;
  }

  body.result-page.result-state-complete .info-value {
    font-size: 28px;
    line-height: 1.1;
  }

  body.result-page.result-state-complete .conf-bar-wrap {
    height: 8px;
    margin-top: 8px;
  }

  body.result-page.result-state-complete .prob-list {
    margin-top: 8px;
  }

  body.result-page.result-state-complete .probability-row {
    margin-top: 8px;
  }

  body.result-page.result-state-complete
  .probability-row > div {
    margin-bottom: 4px;
  }

  body.result-page.result-state-complete progress {
    height: 7px;
  }
}

/* =========================================================
   Final desktop Result cards alignment
   Equal card height with balanced Result Summary spacing.
========================================================= */
@media (min-width: 901px) {

  /* Keep both cards equal in height. */
  body.result-page.result-state-complete .grid-layout {
    align-items: stretch;
  }

  body.result-page.result-state-complete
  .grid-layout > .panel {
    align-self: stretch;
    height: 100%;
  }

  /* =======================================================
     Left card: Analysed image
  ======================================================= */
  body.result-page.result-state-complete .image-panel {
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
  }

  body.result-page.result-state-complete
  .image-panel h2 {
    margin: 0 0 14px;
    font-size: 11px;
    line-height: 1.3;
  }

  body.result-page.result-state-complete
  .image-panel img {
    width: 100%;
    height: 240px;
    max-height: 240px;

    object-fit: contain;
    object-position: center;

    border-radius: 12px;
  }

  /* =======================================================
     Right card: Result Summary
  ======================================================= */
  body.result-page.result-state-complete
  .grid-layout > .panel:not(.image-panel) {
    display: flex;
    flex-direction: column;
    padding: 20px 26px;
  }

  body.result-page.result-state-complete
  .grid-layout > .panel:not(.image-panel) > h2 {
    margin: 0 0 16px;
    font-size: 11px;
    line-height: 1.3;
  }

  /*
   * First row: condition and confidence.
   * Second row: probabilities centred inside remaining space.
   */
  body.result-page.result-state-complete #resultArea {
    flex: 1;
    min-height: 0;

    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      minmax(220px, 0.68fr);

    grid-template-rows:
      auto
      minmax(0, 1fr);

    column-gap: 36px;
    row-gap: 12px;

    align-items: start;
  }

  body.result-page.result-state-complete
  #resultArea > .info-item {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  body.result-page.result-state-complete
  #resultArea > .info-item + .info-item {
    margin-top: 0;
    padding-top: 0;
  }

  /* Align condition and confidence from the same top line. */
  body.result-page.result-state-complete
  #resultArea > .info-item:nth-child(1),
  body.result-page.result-state-complete
  #resultArea > .info-item:nth-child(2) {
    align-self: start;
  }

  /* Centre the probability section inside the lower space. */
  body.result-page.result-state-complete
  #resultArea > .info-item--probabilities {
    grid-column: 1 / -1;
    align-self: center;

    width: 100%;
    padding-top: 16px;

    border-top: 1px solid var(--dc-line);
  }

  body.result-page.result-state-complete .info-label {
    margin-bottom: 6px;
    margin-top:10px;
    font-size: 12px;
    line-height: 1.35;
  }

  body.result-page.result-state-complete .final-tag {
    font-size: clamp(36px, 3.5vw, 48px);
    line-height: 1;
    letter-spacing: -0.045em;
  }

  body.result-page.result-state-complete .info-value {
    margin: 0;

    font-size: 27px;
    line-height: 1.05;
  }

  body.result-page.result-state-complete .conf-bar-wrap {
    height: 7px;
    margin-top: 10px;
  }

  /* =======================================================
     Balanced 2 × 2 probability layout
  ======================================================= */
  body.result-page.result-state-complete .prob-list {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 14px 26px;
    margin-top: 10px;
  }

  body.result-page.result-state-complete
  .probability-row {
    min-width: 0;
    margin: 0;
  }

  body.result-page.result-state-complete
  .probability-row > div {
    align-items: center;
    gap: 8px;

    margin: 0 0 5px;

    font-size: 12px;
    line-height: 1.35;
  }

  body.result-page.result-state-complete progress {
    display: block;

    width: 100%;
    height: 6px;
  }

  body.result-page.result-state-complete
  .probability-row:first-child span::after {
    margin-left: 5px;
    padding: 2px 5px;

    font-size: 8px;
  }
}

/* =========================================================
   Final mobile navigation fix
========================================================= */

.site-header {
  overflow: visible;
}

.site-header__inner {
  position: relative;
  overflow: visible;
}

.site-header.nav-open {
  transform: none !important;
}

body.menu-open {
  overflow: auto !important;
}

@media (max-width: 920px) {
  .nav-toggle {
    position: relative;
    z-index: 1002;
    display: grid;
  }

  .primary-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 1001;

    display: none !important;
    align-items: stretch;
    gap: 3px;

    max-height: calc(100vh - 100px);
    padding: 10px;
    overflow-y: auto;

    border: 1px solid var(--color-border);
    border-radius: 14px;

    background: #ffffff;
    box-shadow:
      0 18px 45px rgba(20, 52, 37, 0.16);
  }

  .site-header.nav-open .primary-nav {
    display: grid !important;
  }

  .primary-nav a {
    width: 100%;
    min-height: 44px;
  }

  .primary-nav .nav-cta {
    margin-left: 0;
    text-align: center;
  }
}

@media (min-width: 921px) {
  .primary-nav {
    display: flex !important;
  }
}

/* =========================================================
   Final mobile authentication input fix
========================================================= */

body.auth-page .auth-main {
  position: relative;
  isolation: isolate;
}

body.auth-page .auth-main::before {
  z-index: 0;
  pointer-events: none !important;
}

body.auth-page .auth-layout {
  position: relative;
  z-index: 1;
}

body.auth-page .auth-card {
  position: relative;
  z-index: 1;
}

body.auth-page input {
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
}