    :root {
      color-scheme: light;
      --ink: #24352f;
      --muted: #747d72;
      --green: #4d7563;
      --green-dark: #294d41;
      --pale: #e8eee6;
      --paper: #f5f1e7;
      --white: #fff;
      --line: #e5dfd1;
      --shadow: 0 20px 55px rgba(54, 65, 48, .09);
    }

    * { box-sizing: border-box; }

    html {
      scrollbar-width: none;
    }

    html::-webkit-scrollbar {
      display: none;
    }

    body {
      margin: 0;
      min-width: 320px;
      min-height: 100vh;
      background: var(--paper);
      color: var(--ink);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      -webkit-font-smoothing: antialiased;
    }

    button, input { font: inherit; }
    button { cursor: pointer; }

    .launch-screen {
      position: fixed;
      z-index: 20;
      inset: 0;
      display: grid;
      place-items: center;
      overflow: hidden;
      background:
        radial-gradient(ellipse at 50% 42%, rgba(220, 234, 213, .78), transparent 34%),
        var(--paper);
      opacity: 1;
      transition: opacity .32s ease, visibility .32s ease;
    }

    .launch-screen::before,
    .launch-screen::after {
      position: absolute;
      width: min(82vw, 430px);
      aspect-ratio: 1;
      border: 1px solid rgba(77, 117, 99, .08);
      border-radius: 50%;
      content: "";
      pointer-events: none;
    }

    .launch-screen::after {
      width: min(64vw, 330px);
      border-color: rgba(77, 117, 99, .1);
    }

    .launch-screen.is-leaving {
      visibility: hidden;
      opacity: 0;
    }

    .launch-screen[hidden] { display: none; }

    .launch-content {
      position: relative;
      z-index: 1;
      display: grid;
      justify-items: center;
      text-align: center;
    }

    .launch-mark {
      display: block;
      width: 88px;
      height: 88px;
      filter: drop-shadow(0 12px 20px rgba(34, 73, 52, .2));
      animation: launch-breathe 1.6s ease-in-out infinite;
    }

    .launch-name {
      margin: 20px 0 0;
      color: var(--green-dark);
      font-size: 25px;
      font-weight: 800;
      letter-spacing: -1px;
    }

    .launch-name span { color: #9b7049; font-weight: 650; }

    .launch-message {
      margin: 7px 0 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.5;
    }

    .launch-loader {
      width: 126px;
      height: 4px;
      overflow: hidden;
      margin-top: 25px;
      border-radius: 999px;
      background: rgba(77, 117, 99, .14);
    }

    .launch-loader span {
      display: block;
      width: 44%;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #7a9c78, #315c46);
      animation: launch-progress 1.15s ease-in-out infinite;
    }

    @keyframes launch-breathe {
      0%, 100% { transform: translateY(0) scale(1); }
      50% { transform: translateY(-5px) scale(1.035); }
    }

    @keyframes launch-progress {
      from { transform: translateX(-115%); }
      to { transform: translateX(245%); }
    }

    @media (prefers-reduced-motion: reduce) {
      .launch-mark, .launch-loader span { animation: none; }
      .launch-loader span { width: 72%; }
      .launch-screen { transition-duration: .01ms; }
    }

    .app {
      width: min(100%, 480px);
      min-height: 100vh;
      margin: 0 auto;
      padding: 22px 22px 34px;
    }

    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 30px;
    }

    .brand {
      display: flex;
      align-items: center;
      flex: 0 0 auto;
      gap: 11px;
    }

    .brand-mark {
      display: grid;
      width: 42px;
      height: 42px;
      overflow: hidden;
      place-items: center;
      border-radius: 15px;
      background: #244b3a;
      box-shadow: 0 6px 15px rgba(41, 77, 65, .2), 0 1px 2px rgba(41, 77, 65, .12);
    }

    .brand-mark img { display: block; width: 100%; height: 100%; }

    .brand-name {
      color: var(--green-dark);
      font-size: 19px;
      font-weight: 800;
      letter-spacing: -.7px;
    }

    .brand-name span {
      color: #9b7049;
      font-weight: 650;
    }

    .topbar-actions {
      display: flex;
      align-items: center;
      gap: 4px;
      margin-left: auto;
      padding: 4px;
      border: 1px solid rgba(229, 223, 209, .8);
      border-radius: 15px;
      background: rgba(255, 255, 255, .67);
      box-shadow: 0 4px 14px rgba(54, 65, 48, .035);
    }

    .topbar-link {
      display: inline-flex;
      min-height: 38px;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 8px 12px;
      border: 1px solid transparent;
      border-radius: 11px;
      color: #53665a;
      font-size: 12px;
      font-weight: 700;
      text-decoration: none;
      transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
    }

    .topbar-link svg {
      width: 16px;
      height: 16px;
      fill: none;
      stroke: currentColor;
      stroke-linecap: round;
      stroke-linejoin: round;
      stroke-width: 1.6;
      opacity: .8;
    }

    .topbar-link:hover {
      transform: translateY(-1px);
      border-color: #e8eee5;
      background: white;
      box-shadow: 0 3px 8px rgba(41, 77, 65, .06);
      color: var(--green-dark);
    }

    .help-button {
      display: grid;
      width: 32px;
      height: 32px;
      flex: 0 0 auto;
      place-items: center;
      border: 1px solid rgba(229, 223, 209, .9);
      border-radius: 10px;
      background: rgba(255, 255, 255, .86);
      box-shadow: 0 4px 12px rgba(35, 57, 41, .05);
      color: var(--green-dark);
      font-size: 13px;
      font-weight: 750;
      transition: background .18s ease, border-color .18s ease, transform .18s ease;
    }

    .help-button:hover {
      transform: translateY(-1px);
      border-color: #cbd9c9;
      background: white;
    }

    .settings-button {
      display: grid;
      width: 40px;
      height: 40px;
      flex: 0 0 auto;
      place-items: center;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
      color: var(--green-dark);
      transition: color .18s ease, transform .18s ease;
    }

    .settings-button svg {
      width: 23px;
      height: 23px;
      fill: none;
      stroke: currentColor;
      stroke-linecap: round;
      stroke-linejoin: round;
      stroke-width: 1.65;
    }

    .settings-button:hover {
      border: 0;
      background: transparent;
      box-shadow: none;
      color: #315c46;
    }

    .settings-button:active {
      border: 0;
      background: transparent;
      box-shadow: none;
      transform: scale(.94);
    }

    .settings-button:focus-visible {
      outline: 2px solid #85b790;
      outline-offset: 3px;
      background: transparent;
      box-shadow: none;
    }

    .theme-button {
      display: grid;
      width: 36px;
      height: 36px;
      flex: 0 0 auto;
      place-items: center;
      border: 1px solid rgba(229, 223, 209, .9);
      border-radius: 11px;
      background: rgba(255, 255, 255, .86);
      box-shadow: 0 4px 12px rgba(35, 57, 41, .05);
      color: var(--green-dark);
      transition: background .18s ease, border-color .18s ease, transform .18s ease;
    }

    .theme-button svg {
      width: 17px;
      height: 17px;
      fill: none;
      stroke: currentColor;
      stroke-linecap: round;
      stroke-linejoin: round;
      stroke-width: 1.6;
    }

    .theme-button:hover {
      transform: translateY(-1px);
      border-color: #cbd9c9;
      background: white;
    }

    .settings-theme-toggle {
      width: auto;
      min-width: 0;
      height: 32px;
      justify-content: center;
      gap: 8px;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
      color: var(--muted);
      font-size: 9px;
      font-weight: 800;
      letter-spacing: .8px;
    }

    .theme-switch-track {
      position: relative;
      display: block;
      width: 42px;
      height: 24px;
      flex: 0 0 auto;
      border: 1px solid #d6ded5;
      border-radius: 999px;
      background: #e6ebe4;
      transition: background .22s ease, border-color .22s ease;
    }

    .theme-switch-thumb {
      position: absolute;
      top: 2px;
      left: 2px;
      display: grid;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 1px 3px rgba(34, 57, 39, .2);
      transition: transform .24s ease, background .22s ease;
    }

    html[data-theme="dark"] .theme-switch-thumb { transform: translateX(18px); }
    html[data-theme="dark"] .theme-switch-track { border-color: #56805e; background: #47764f; }
    html[data-theme="dark"] .theme-switch-label { color: #c1dec5; }

    .settings-theme-toggle:hover {
      border-color: transparent;
      background: transparent;
      box-shadow: none;
      color: var(--green-dark);
      transform: none;
    }
    .settings-theme-toggle:active { transform: scale(.97); }

    .theme-button:focus-visible {
      outline: 3px solid #85b790;
      outline-offset: 2px;
    }

    .app-footer {
      display: grid;
      gap: 17px;
      margin-top: 26px;
      padding: 22px 0 4px;
      border-top: 1px solid var(--line);
    }

    .app-footer-brand {
      display: flex;
      align-items: center;
      gap: 11px;
    }

    .app-footer-brand img {
      display: block;
      width: 42px;
      height: 42px;
      border-radius: 13px;
    }

    .app-footer-brand div { display: grid; gap: 3px; }
    .app-footer-brand strong { color: var(--green-dark); font-size: 15px; }
    .app-footer-brand span { color: var(--muted); font-size: 10px; }

    .app-footer-note,
    .app-footer-copyright {
      margin: 0;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.5;
    }

    .app-footer-copyright {
      padding-top: 11px;
      border-top: 1px solid var(--line);
      font-size: 9px;
    }

    .eyebrow {
      margin: 0 0 9px;
      color: var(--green);
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 1.5px;
      text-transform: uppercase;
    }

    h1 {
      margin: 0;
      font-size: clamp(31px, 9vw, 39px);
      line-height: 1.08;
      letter-spacing: -1.8px;
    }

    .intro {
      max-width: 345px;
      margin: 11px 0 22px;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.55;
    }

    .scan-card {
      overflow: hidden;
      padding: 14px;
      border: 1px solid rgba(230, 233, 223, .9);
      border-radius: 25px;
      background: var(--white);
      box-shadow: var(--shadow);
    }

    .photo-stage {
      position: relative;
      display: grid;
      min-height: 285px;
      overflow: hidden;
      place-items: center;
      border-radius: 17px;
      background:
        radial-gradient(ellipse at 50% 34%, rgba(255,255,255,.82), transparent 62%),
        linear-gradient(145deg, #e8efe2, #dce8d7);
    }

    .photo-stage::before,
    .photo-stage::after {
      position: absolute;
      z-index: 1;
      width: 25px;
      height: 25px;
      content: "";
      pointer-events: none;
    }

    .photo-stage::before {
      top: 16px;
      left: 16px;
      border-top: 2px solid rgba(47, 112, 72, .55);
      border-left: 2px solid rgba(47, 112, 72, .55);
      border-radius: 7px 0 0;
    }

    .photo-stage::after {
      right: 16px;
      bottom: 16px;
      border-right: 2px solid rgba(47, 112, 72, .55);
      border-bottom: 2px solid rgba(47, 112, 72, .55);
      border-radius: 0 0 7px;
    }

    .stage-image {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .stage-empty {
      display: grid;
      justify-items: center;
      gap: 11px;
      padding: 24px;
      text-align: center;
    }

    .leaf-art {
      display: grid;
      width: 76px;
      height: 76px;
      place-items: center;
      border: 1px solid rgba(47, 112, 72, .12);
      border-radius: 26px;
      background: rgba(255, 255, 255, .72);
      font-size: 36px;
    }

    .stage-title {
      margin: 0;
      font-size: 15px;
      font-weight: 700;
    }

    .stage-hint {
      margin: -5px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }

    .stage-badge {
      position: absolute;
      z-index: 2;
      bottom: 12px;
      left: 12px;
      display: none;
      padding: 7px 10px;
      border: 1px solid rgba(255,255,255,.6);
      border-radius: 20px;
      background: rgba(255,255,255,.88);
      color: var(--green-dark);
      font-size: 11px;
      font-weight: 700;
      backdrop-filter: blur(8px);
    }

    .stage-badge.visible { display: block; }

    .scan-overlay {
      position: absolute;
      z-index: 3;
      inset: 0;
      overflow: hidden;
      pointer-events: none;
      background: linear-gradient(145deg, rgba(7, 29, 21, .3), rgba(11, 42, 28, .16));
      backdrop-filter: saturate(1.18);
    }

    .scan-overlay[hidden] { display: none; }

    .photo-stage.is-scanning .stage-image {
      animation: scan-image-breathe 3.2s ease-in-out infinite alternate;
    }

    .scan-wash {
      position: absolute;
      inset: 0;
      background:
        radial-gradient(ellipse at 50% 46%, rgba(162, 255, 197, .13), transparent 55%),
        linear-gradient(180deg, transparent 55%, rgba(4, 20, 13, .2));
    }

    .scan-frame {
      position: absolute;
      inset: 10%;
      display: grid;
      grid-template: 1fr 1fr / 1fr 1fr;
      opacity: .9;
    }

    .scan-frame span { width: 20px; height: 20px; border-color: rgba(220, 255, 232, .88); }
    .scan-frame span:nth-child(1) { align-self: start; justify-self: start; border-top: 1.5px solid; border-left: 1.5px solid; border-radius: 6px 0 0; }
    .scan-frame span:nth-child(2) { align-self: start; justify-self: end; border-top: 1.5px solid; border-right: 1.5px solid; border-radius: 0 6px 0 0; }
    .scan-frame span:nth-child(3) { align-self: end; justify-self: start; border-bottom: 1.5px solid; border-left: 1.5px solid; border-radius: 0 0 0 6px; }
    .scan-frame span:nth-child(4) { align-self: end; justify-self: end; border-right: 1.5px solid; border-bottom: 1.5px solid; border-radius: 0 0 6px; }

    .scan-sweep {
      position: absolute;
      z-index: 1;
      right: 7%;
      left: 7%;
      top: 0;
      height: 2px;
      border-radius: 999px;
      background: linear-gradient(90deg, transparent, #b9ffd1 12%, #f2fff5 50%, #9effbf 88%, transparent);
      box-shadow: 0 0 8px 2px rgba(131, 255, 177, .7), 0 0 28px 8px rgba(96, 235, 144, .36);
      animation: scan-sweep 2.4s cubic-bezier(.45, 0, .55, 1) infinite alternate;
    }

    @keyframes scan-sweep {
      from { top: 8%; }
      to { top: 88%; }
    }

    @keyframes scan-image-breathe {
      from { transform: scale(1); }
      to { transform: scale(1.045); }
    }

    .scan-reticle {
      position: absolute;
      top: 50%;
      left: 50%;
      display: grid;
      width: 66px;
      height: 66px;
      place-items: center;
      transform: translate(-50%, -50%);
      border: 1px solid rgba(232, 255, 239, .48);
      border-radius: 22px;
      background: rgba(215, 255, 228, .1);
      box-shadow: 0 0 0 7px rgba(202, 255, 220, .07), inset 0 0 18px rgba(225, 255, 234, .12);
      color: #e6ffe9;
      animation: scan-reticle-pulse 2.2s ease-in-out infinite;
      backdrop-filter: blur(3px);
    }

    .scan-reticle svg {
      width: 36px;
      height: 36px;
      fill: rgba(213, 255, 220, .24);
      stroke: currentColor;
      stroke-linecap: round;
      stroke-linejoin: round;
      stroke-width: 1.5;
      filter: drop-shadow(0 1px 5px rgba(0, 0, 0, .3));
    }

    @keyframes scan-reticle-pulse {
      0%, 100% { opacity: .72; box-shadow: 0 0 0 5px rgba(202, 255, 220, .05), inset 0 0 18px rgba(225, 255, 234, .1); }
      50% { opacity: 1; box-shadow: 0 0 0 10px rgba(202, 255, 220, .12), inset 0 0 22px rgba(225, 255, 234, .2); }
    }

    .scan-label {
      position: absolute;
      z-index: 2;
      bottom: 14px;
      left: 50%;
      display: inline-flex;
      align-items: center;
      gap: 9px;
      min-width: 190px;
      padding: 9px 13px;
      transform: translateX(-50%);
      border: 1px solid rgba(223, 255, 233, .24);
      border-radius: 15px;
      background: rgba(9, 29, 20, .72);
      box-shadow: 0 8px 25px rgba(0, 0, 0, .18);
      color: #eaf8ed;
      backdrop-filter: blur(12px);
      white-space: nowrap;
    }

    .scan-label-icon {
      display: grid;
      width: 28px;
      height: 28px;
      flex: 0 0 auto;
      place-items: center;
      border-radius: 9px;
      background: rgba(140, 235, 168, .17);
      color: #afffc2;
      font-size: 15px;
    }

    .scan-label-copy { display: grid; gap: 2px; margin-right: auto; }
    .scan-label-copy strong { font-size: 11px; font-weight: 700; letter-spacing: .01em; }
    .scan-label-copy small { color: rgba(229, 246, 232, .72); font-size: 9px; }

    .scan-dots {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      margin-left: 5px;
    }

    .scan-dots i {
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: #a7ffc0;
      animation: scan-dot-wave 1.25s ease-in-out infinite;
    }

    .scan-dots i:nth-child(2) { animation-delay: .16s; }
    .scan-dots i:nth-child(3) { animation-delay: .32s; }

    @keyframes scan-dot-wave {
      0%, 70%, 100% { opacity: .25; transform: translateY(0); }
      35% { opacity: 1; transform: translateY(-2.5px); }
    }

    @media (prefers-reduced-motion: reduce) {
      .scan-sweep {
        top: 48%;
        animation: none;
      }

      .scan-dots i, .scan-reticle, .photo-stage.is-scanning .stage-image {
        animation: none;
        opacity: .85;
        transform: none;
      }
    }

    .actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 14px;
    }

    .action-button {
      display: flex;
      min-height: 50px;
      align-items: center;
      justify-content: center;
      gap: 8px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--white);
      color: var(--ink);
      font-size: 13px;
      font-weight: 700;
      transition: transform .15s ease, background .15s ease;
    }

    .action-button:active, .scan-button:active { transform: scale(.98); }
    .action-button.primary {
      border-color: var(--green);
      background: var(--green);
      color: var(--white);
    }

    .action-button:disabled {
      cursor: not-allowed;
      opacity: .48;
    }

    .scan-button {
      width: 100%;
      min-height: 54px;
      margin-top: 11px;
      border: 0;
      border-radius: 15px;
      background: var(--green-dark);
      color: white;
      font-size: 14px;
      font-weight: 750;
      transition: transform .15s ease, opacity .15s ease;
    }

    .scan-button:disabled {
      cursor: not-allowed;
      opacity: .4;
    }

    .scan-button .button-icon { margin-right: 7px; }

    .result {
      display: none;
      margin-top: 15px;
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 17px;
      background: #fbfcf8;
    }

    .result.visible { display: block; }

    .screening-notice {
      display: none;
      padding: 14px 15px;
      border: 1px solid #f0dfb8;
      border-radius: 14px;
      background: #fff8e9;
      color: #775c27;
      font-size: 12px;
      line-height: 1.55;
    }

    .screening-notice.visible { display: block; }
    .screening-notice strong { display: block; margin-bottom: 4px; color: #594319; }
    .screening-notice.not-plant { border-color: var(--line); background: #f5f7f3; color: #5d6b61; }
    .screening-notice.not-plant strong { color: var(--ink); }
    .plant-assessment[hidden] { display: none; }

    .consent {
      display: flex;
      align-items: flex-start;
      margin: 14px 2px 0;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #f7f9f4;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.5;
    }

    .consent strong { color: var(--ink); }

    .evaluation-optin {
      display: flex;
      align-items: flex-start;
      gap: 9px;
      margin: 12px 2px 0;
      color: #58665a;
      font-size: 11px;
      line-height: 1.5;
    }

    .evaluation-optin input {
      width: 16px;
      height: 16px;
      flex: 0 0 auto;
      margin: 1px 0 0;
      accent-color: var(--green);
    }

    .eval-label-group {
      display: grid;
      gap: 6px;
      margin: 10px 2px 0 27px;
    }

    .eval-label-group[hidden] { display: none; }

    .eval-label-group label {
      color: var(--ink);
      font-size: 11px;
      font-weight: 700;
    }

    .eval-label-group select {
      width: 100%;
      min-height: 42px;
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: 11px;
      background: var(--white);
      color: var(--ink);
      font-size: 12px;
    }

    .eval-label-help {
      margin: 0;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.45;
    }

    .analysis-status {
      display: none;
      margin: 12px 2px 0;
      color: var(--green-dark);
      font-size: 12px;
      line-height: 1.5;
    }

    .analysis-status.visible { display: block; }
    .analysis-status.error { color: #a13d32; }

    .result-plant {
      margin: 0;
      font-size: 19px;
      line-height: 1.3;
    }

    .result-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin: 10px 0 0;
    }

    .result-pill {
      padding: 5px 9px;
      border-radius: 20px;
      background: var(--pale);
      color: var(--green-dark);
      font-size: 10px;
      font-weight: 750;
    }

    .result-pill.warning {
      background: #fff0dc;
      color: #805324;
    }

    .result-pill.danger {
      background: #fae7e4;
      color: #973d34;
    }

    .evaluation-outcome {
      display: none;
      margin-top: 12px;
      padding: 10px 11px;
      border-radius: 11px;
      background: var(--pale);
      color: var(--green-dark);
      font-size: 11px;
      font-weight: 700;
      line-height: 1.5;
    }

    .evaluation-outcome.visible { display: block; }
    .evaluation-outcome.incorrect { background: #fae7e4; color: #973d34; }

    .result-section {
      margin-top: 15px;
      padding-top: 13px;
      border-top: 1px solid var(--line);
    }

    .result-section h3 {
      margin: 0 0 7px;
      font-size: 12px;
    }

    .result-section p {
      color: #58665a;
      font-size: 12px;
      line-height: 1.55;
    }

    .result-section ul,
    .result-section ol {
      display: grid;
      gap: 8px;
      margin: 0;
      padding-left: 19px;
      color: #58665a;
      font-size: 12px;
      line-height: 1.55;
    }

    .care-item strong { color: var(--ink); }

    .result-heading {
      display: flex;
      align-items: flex-start;
      gap: 11px;
    }

    .result-icon {
      display: grid;
      width: 35px;
      height: 35px;
      flex: 0 0 auto;
      place-items: center;
      border-radius: 12px;
      background: var(--pale);
      font-size: 17px;
    }

    .result h2 {
      margin: 0 0 4px;
      font-size: 19px;
    }

    .result p {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }

    .disclaimer {
      display: flex;
      gap: 9px;
      margin: 17px 3px 0;
      color: #788478;
      font-size: 11px;
      line-height: 1.5;
    }

    .disclaimer strong { color: #536253; }
    .disclaimer-icon { flex: 0 0 auto; }

    .tips {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 22px;
    }

    .tip {
      padding: 13px;
      border: 1px solid rgba(230, 233, 223, .8);
      border-radius: 15px;
      background: rgba(255,255,255,.62);
    }

    .tip-icon { font-size: 17px; }
    .tip h3 { margin: 8px 0 4px; font-size: 12px; }
    .tip p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }

    .evaluation-card {
      margin-top: 20px;
      padding: 17px;
      border: 1px solid var(--line);
      border-radius: 20px;
      background: var(--white);
      box-shadow: var(--shadow);
    }

    .evaluation-card h2 {
      margin: 0;
      font-size: 17px;
      letter-spacing: -.3px;
    }

    .evaluation-description {
      margin: 7px 0 0;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.55;
    }

    .evaluation-stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-top: 14px;
    }

    .evaluation-stat {
      min-width: 0;
      padding: 10px 8px;
      border-radius: 12px;
      background: #f5f7f1;
    }

    .evaluation-stat strong {
      display: block;
      overflow-wrap: anywhere;
      font-size: 17px;
    }

    .evaluation-stat span {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 9px;
      line-height: 1.35;
    }

    .evaluation-model {
      margin: 10px 0 0;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.45;
    }

    .evaluation-breakdown {
      display: grid;
      gap: 7px;
      margin: 12px 0 0;
      padding: 0;
      list-style: none;
    }

    .evaluation-breakdown li {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      color: #58665a;
      font-size: 10px;
      line-height: 1.4;
    }

    .evaluation-breakdown strong { color: var(--ink); white-space: nowrap; }

    .evaluation-status {
      min-height: 16px;
      margin: 9px 0 0;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.45;
    }

    .evaluation-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 9px;
    }

    .evaluation-actions button {
      min-height: 40px;
      padding: 7px;
      border: 1px solid var(--line);
      border-radius: 11px;
      background: white;
      color: var(--ink);
      font-size: 10px;
      font-weight: 700;
    }

    .evaluation-actions button:disabled {
      cursor: not-allowed;
      opacity: .45;
    }

    .settings-dialog {
      position: fixed;
      inset: 0;
      width: 100vw;
      max-width: none;
      height: 100vh;
      height: 100dvh;
      max-height: 100vh;
      max-height: 100dvh;
      overflow-y: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      margin: 0;
      padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
      border: 0;
      border-radius: 0;
      background: var(--white);
      color: var(--ink);
      box-shadow: none;
    }

    .settings-dialog[open] { animation: settings-drawer-in .28s cubic-bezier(.2, .75, .25, 1) both; }
    .settings-dialog[open].is-closing { animation: settings-drawer-out .28s cubic-bezier(.55, 0, .8, .35) both; }
    .settings-dialog::backdrop {
      background: rgba(15, 29, 20, .52);
      animation: settings-backdrop-in .22s ease-out both;
    }
    .settings-dialog.is-closing::backdrop { animation: settings-backdrop-out .28s ease-in both; }

    @keyframes settings-drawer-in {
      from { transform: translateX(100%); }
      to { transform: translateX(0); }
    }

    @keyframes settings-backdrop-in {
      from { background: rgba(15, 29, 20, 0); }
      to { background: rgba(15, 29, 20, .52); }
    }

    @keyframes settings-drawer-out {
      from { transform: translateX(0); }
      to { transform: translateX(100%); }
    }

    @keyframes settings-backdrop-out {
      from { background: rgba(15, 29, 20, .52); }
      to { background: rgba(15, 29, 20, 0); }
    }

    .settings-dialog-header,
    .settings-history-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .settings-eyebrow {
      margin: 0 0 5px;
      color: var(--green);
      font-size: 9px;
      font-weight: 800;
      letter-spacing: 1.1px;
    }

    .settings-dialog h2 {
      margin: 0;
      font-size: 22px;
      letter-spacing: -.5px;
    }

    .settings-dialog-header form { display: flex; }

    .settings-close {
      display: grid;
      width: 36px;
      height: 36px;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 11px;
      background: var(--white);
      color: var(--muted);
      font-size: 23px;
      line-height: 1;
    }

    .settings-appearance {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: 22px;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
    }

    .settings-dialog h3 {
      margin: 0;
      font-size: 13px;
    }

    .settings-appearance p,
    .settings-history-heading p,
    .settings-help-row p {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.45;
    }

    .settings-help-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-top: 16px;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
    }

    .settings-history { margin-top: 20px; }
    .settings-history-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 0 0 auto;
    }

    .settings-history-count {
      display: grid;
      min-width: 28px;
      height: 28px;
      flex: 0 0 auto;
      place-items: center;
      border-radius: 999px;
      background: var(--pale);
      color: var(--green-dark);
      font-size: 11px;
      font-weight: 800;
    }

    .history-confirm-dialog {
      width: min(360px, calc(100vw - 32px));
      max-width: none;
      padding: 22px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: var(--white);
      color: var(--ink);
      box-shadow: 0 18px 60px rgba(13, 27, 18, .24);
      font: inherit;
    }

    .history-confirm-dialog::backdrop { background: rgba(15, 29, 20, .58); }
    .history-confirm-dialog h2 { margin: 0; font-size: 18px; }
    .history-confirm-dialog p { margin: 10px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
    .history-confirm-actions { display: flex; justify-content: flex-end; gap: 9px; }
    .history-confirm-actions button {
      min-width: 80px;
      min-height: 42px;
      padding: 8px 14px;
      border: 1px solid var(--line);
      border-radius: 10px;
      font: inherit;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
    }

    .history-confirm-cancel { background: transparent; color: var(--ink); }
    .history-confirm-ok { border-color: #a13d32 !important; background: #a13d32; color: #fff; }
    .history-confirm-actions button:focus-visible { outline: 3px solid #85b790; outline-offset: 2px; }

    .recent-scan-status {
      min-height: 0;
      margin: 0;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.45;
    }

    .recent-scan-status:not(:empty) { margin-top: 8px; }
    .recent-scan-status.error { color: #a13d32; }
    .recent-scan-list { display: grid; gap: 8px; margin-top: 10px; }
    .recent-scan-list:empty { display: none; }
    .recent-scan-list { color: var(--muted); font-size: 11px; line-height: 1.5; }

    .recent-scan {
      padding: 11px;
      border: 1px solid var(--line);
      border-radius: 13px;
      background: var(--white);
    }

    .recent-scan-layout {
      display: flex;
      align-items: flex-start;
      gap: 10px;
    }

    .recent-scan-delete {
      display: grid;
      width: 32px;
      height: 32px;
      flex: 0 0 auto;
      place-items: center;
      padding: 0;
      border: 0;
      border-radius: 8px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
    }

    .recent-scan-delete:hover { background: #faeeec; color: #a13d32; }
    .recent-scan-delete:disabled { cursor: wait; opacity: .5; }
    .recent-scan-delete svg {
      width: 17px;
      height: 17px;
      fill: none;
      stroke: currentColor;
      stroke-linecap: round;
      stroke-linejoin: round;
      stroke-width: 1.6;
    }

    .recent-scan-image {
      width: 58px;
      height: 58px;
      flex: 0 0 auto;
      border-radius: 9px;
      object-fit: cover;
      background: var(--pale);
    }

    .recent-scan-content { min-width: 0; flex: 1; }

    .recent-scan-heading {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      color: var(--ink);
      font-size: 11px;
      line-height: 1.4;
    }

    .recent-scan-heading > :last-child { text-align: right; }
    .recent-scan-unassessed { display: grid; justify-content: start; gap: 2px; }
    .recent-scan-unassessed > :last-child { text-align: left; }
    .recent-scan p {
      margin: 5px 0 0;
      color: var(--muted);
      font-size: 9px;
      line-height: 1.5;
      overflow-wrap: anywhere;
    }

    .recent-scan details { margin-top: 7px; }
    .recent-scan summary {
      width: fit-content;
      color: var(--green-dark);
      font-size: 10px;
      font-weight: 700;
      cursor: pointer;
    }

    .recent-scan details section { margin-top: 9px; }
    .recent-scan details h4 { margin: 0 0 3px; font-size: 10px; }
    .recent-scan details p,
    .recent-scan details ul {
      margin-top: 3px;
      color: var(--muted);
      font-size: 10px;
    }

    .recent-scan details ul { padding-left: 17px; }

    @media (max-width: 560px) {
      .settings-dialog {
        padding-right: max(18px, env(safe-area-inset-right));
        padding-left: max(18px, env(safe-area-inset-left));
      }

      .settings-dialog .help-button { width: 40px; height: 40px; border-radius: 12px; }
    }

    @media (prefers-reduced-motion: reduce) {
      .settings-dialog[open],
      .settings-dialog[open].is-closing,
      .settings-dialog::backdrop { animation: none; }
    }

    .settings-button:focus-visible,
    .settings-close:focus-visible,
    .settings-theme-toggle:focus-visible,
    .recent-scan-delete:focus-visible,
    .recent-scan summary:focus-visible {
      outline: 3px solid #85b790;
      outline-offset: 2px;
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      clip-path: inset(50%);
    }

    html { scroll-behavior: smooth; }

    body {
      background:
        radial-gradient(ellipse at 82% 0%, rgba(222, 230, 207, .66), transparent 34rem),
        var(--paper);
    }

    .app {
      width: min(480px, 100%);
      min-height: auto;
      padding: 22px 22px 34px;
    }

    .topbar {
      min-height: 0;
      margin-bottom: 16px;
    }

    .hero {
      position: relative;
      display: grid;
      min-height: 0;
      grid-template-columns: minmax(0, 1fr) 107px;
      align-items: center;
      overflow: hidden;
      padding: 25px 22px;
      border: 1px solid rgba(255,255,255,.5);
      border-radius: 22px;
      background:
        radial-gradient(circle at 88% 18%, rgba(214, 205, 166, .2), transparent 19rem),
        url("../img/hero-farm.svg") center bottom / cover no-repeat,
        linear-gradient(115deg, #263f36 0%, #36594a 62%, #55725a 100%);
      box-shadow: 0 24px 60px rgba(39, 61, 48, .17);
      color: white;
    }

    .hero::after {
      position: absolute;
      right: -85px;
      bottom: -180px;
      width: 390px;
      height: 390px;
      border: 1px solid rgba(255,255,255,.09);
      border-radius: 50%;
      content: "";
      pointer-events: none;
    }

    .hero-copy { position: relative; z-index: 1; }

    .hero .eyebrow {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 12px;
      font-size: 9px;
      color: #d7d2a9;
    }

    .hero .eyebrow::before {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #d5a176;
      box-shadow: 0 0 0 4px rgba(213, 161, 118, .16);
      content: "";
    }

    .hero h1 {
      max-width: 280px;
      color: white;
      font-size: clamp(35px, 9.5vw, 44px);
      line-height: 1.02;
      letter-spacing: -2px;
    }

    .hero-accent { color: #e4bd91; }

    .hero .intro {
      max-width: 310px;
      margin: 11px 0 0;
      color: rgba(244, 249, 242, .76);
      font-size: 12px;
    }

    .hero-art {
      position: relative;
      z-index: 1;
      display: grid;
      width: 107px;
      height: 111px;
      justify-self: center;
      place-items: center;
      opacity: .58;
      transform: scale(.75);
    }

    .hero-orbit {
      position: absolute;
      width: 100px;
      height: 100px;
      border: 1px solid rgba(227, 245, 214, .18);
      border-radius: 50%;
      box-shadow: 0 0 0 17px rgba(227, 245, 214, .035), 0 0 0 35px rgba(227, 245, 214, .025);
    }

    .hero-leaf {
      position: relative;
      display: grid;
      width: 67px;
      height: 67px;
      place-items: center;
      color: #bfe3cd;
      transform: rotate(-8deg);
    }

    .hero-leaf svg { display: block; width: 52%; height: 52%; }

    .hero-note {
      position: absolute;
      right: -9px;
      bottom: 0;
      padding: 7px 9px;
      border: 1px solid rgba(255,255,255,.3);
      border-radius: 14px;
      background: rgba(245, 250, 239, .95);
      box-shadow: 0 10px 25px rgba(9, 29, 17, .18);
      color: var(--green-dark);
      font-size: 8px;
      font-weight: 800;
      transform: rotate(2deg);
    }

    .scan-layout {
      display: grid;
      grid-template-columns: minmax(0, 1.55fr) minmax(275px, .75fr);
      align-items: start;
      gap: 20px;
      margin-top: 24px;
      scroll-margin-top: 20px;
    }

    .scan-card {
      padding: 20px;
      border-color: rgba(226, 233, 223, .95);
      border-radius: 26px;
      box-shadow: 0 15px 42px rgba(35, 57, 41, .07);
    }

    .photo-stage {
      min-height: 350px;
      border: 1px dashed rgba(70, 111, 78, .24);
      border-radius: 20px;
      background:
        radial-gradient(ellipse at 50% 34%, rgba(255,255,255,.94), transparent 58%),
        linear-gradient(145deg, #edf3e8, #e1ecdd);
      transition: background .2s ease, border-color .2s ease;
    }

    .photo-stage:hover {
      border-color: rgba(47, 112, 72, .46);
      background:
        radial-gradient(ellipse at 50% 34%, rgba(255,255,255,.96), transparent 58%),
        linear-gradient(145deg, #eaf3e4, #dcebd8);
    }

    .photo-stage::before,
    .photo-stage::after {
      width: 29px;
      height: 29px;
    }

    .photo-stage::before { top: 20px; left: 20px; }
    .photo-stage::after { right: 20px; bottom: 20px; }

    .stage-empty { gap: 14px; }

    .leaf-art {
      width: 88px;
      height: 88px;
      border-color: rgba(47, 112, 72, .1);
      border-radius: 30px;
      box-shadow: 0 10px 28px rgba(31, 73, 43, .08);
      font-size: 42px;
    }

    .stage-title { font-size: 16px; }
    .stage-hint { max-width: 270px; font-size: 12px; }

    .actions { gap: 12px; margin-top: 16px; }

    .action-button {
      min-height: 52px;
      border-radius: 14px;
      transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
    }

    .action-button:hover:not(:disabled) {
      border-color: #b7c9b8;
      box-shadow: 0 6px 16px rgba(32, 77, 52, .08);
      transform: translateY(-1px);
    }

    .action-button.primary:hover:not(:disabled) {
      border-color: #397c52;
      background: #397c52;
    }

    .scan-button {
      min-height: 56px;
      margin-top: 14px;
      border-radius: 15px;
      background: linear-gradient(100deg, #214b34, #2d6542);
      box-shadow: 0 7px 17px rgba(32, 77, 52, .17);
      transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
    }

    .scan-button:hover:not(:disabled) {
      box-shadow: 0 10px 22px rgba(32, 77, 52, .23);
      transform: translateY(-1px);
    }

    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    a:focus-visible {
      outline: 3px solid rgba(70, 135, 80, .35);
      outline-offset: 3px;
    }

    .consent,
    .evaluation-optin {
      padding: 11px 12px;
      border: 1px solid #edf0e9;
      border-radius: 13px;
      background: #fafbf8;
    }

    .evaluation-optin { margin-top: 8px; }

    .result {
      margin-top: 18px;
      padding: 20px;
      border-color: #e5ebe2;
      border-radius: 19px;
    }

    .result-section {
      margin-top: 18px;
      padding-top: 16px;
    }

    .result-section h3 { font-size: 13px; }
    .result-section ul, .result-section ol { font-size: 12px; }

    .guide-panel {
      position: sticky;
      top: 18px;
      display: grid;
      gap: 14px;
    }

    .guide-card {
      padding: 22px;
      border: 1px solid rgba(226, 233, 223, .95);
      border-radius: 24px;
      background: rgba(255,255,255,.88);
      box-shadow: 0 14px 36px rgba(35, 57, 41, .055);
    }

    .guide-kicker {
      margin: 0 0 8px;
      color: var(--green);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 1.4px;
      text-transform: uppercase;
    }

    .guide-card h2 {
      margin: 0;
      font-size: 20px;
      letter-spacing: -.6px;
    }

    .guide-subtitle {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.55;
    }

    .workflow-list {
      display: grid;
      gap: 18px;
      margin: 21px 0 0;
      padding: 0;
      list-style: none;
    }

    .workflow-step {
      display: grid;
      grid-template-columns: 35px minmax(0, 1fr);
      align-items: start;
      gap: 11px;
    }

    .workflow-number {
      display: grid;
      width: 35px;
      height: 35px;
      place-items: center;
      border-radius: 12px;
      background: var(--pale);
      color: var(--green-dark);
      font-size: 11px;
      font-weight: 800;
    }

    .workflow-step h3 {
      margin: 2px 0 4px;
      font-size: 12px;
    }

    .workflow-step p {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.5;
    }

    .tips {
      grid-template-columns: 1fr;
      gap: 0;
      margin-top: 18px;
      border-top: 1px solid var(--line);
    }

    .tip {
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr);
      column-gap: 10px;
      padding: 14px 0 0;
      border: 0;
      border-radius: 0;
      background: transparent;
    }

    .tip-icon { grid-row: span 2; }
    .tip h3 { margin: 0 0 4px; font-size: 11px; }
    .tip p { font-size: 10px; }

    .privacy-note {
      display: flex;
      gap: 11px;
      align-items: flex-start;
      padding: 15px 17px;
      border: 1px solid rgba(217, 231, 211, .9);
      border-radius: 17px;
      background: linear-gradient(120deg, #edf4e9, #f8faf5);
      color: #556b59;
      font-size: 11px;
      line-height: 1.55;
    }

    .privacy-icon {
      display: grid;
      width: 28px;
      height: 28px;
      flex: 0 0 auto;
      place-items: center;
      border-radius: 9px;
      background: white;
      color: var(--green);
      font-size: 13px;
      font-weight: 800;
    }

    .privacy-note strong { color: var(--green-dark); }

    .disclaimer {
      max-width: 800px;
      margin: 18px auto 0;
      padding: 0 4px;
      font-size: 11px;
    }

    .evaluation-card {
      margin-top: 26px;
      padding: 24px;
      border-radius: 24px;
      scroll-margin-top: 24px;
    }

    .evaluation-card h2 { font-size: 20px; }
    .evaluation-description { max-width: 730px; font-size: 12px; }
    .evaluation-stat { padding: 14px; border-radius: 14px; }
    .evaluation-stat strong { font-size: 20px; }
    .evaluation-stat span { font-size: 10px; }
    .evaluation-actions button { min-height: 44px; font-size: 11px; }

    @media (min-width: 900px) {
      body { display: block; padding: 0; }
      .app {
        width: min(1120px, calc(100% - 48px));
        min-height: 100vh;
        padding: 26px 0 56px;
      }
      .topbar { min-height: 54px; margin-bottom: 30px; }
      .topbar-actions { gap: 10px; }
      .hero {
        min-height: 265px;
        grid-template-columns: minmax(0, 1fr) 270px;
        padding: 36px 48px;
        border-radius: 30px;
      }
      .hero .eyebrow { margin-bottom: 15px; font-size: 11px; }
      .hero h1 {
        max-width: 690px;
        font-size: clamp(38px, 5vw, 58px);
        letter-spacing: -2.7px;
      }
      .hero .intro { max-width: 490px; margin-top: 15px; font-size: 14px; }
      .hero-art {
        width: 205px;
        height: 190px;
        opacity: 1;
        transform: none;
      }
      .hero-orbit {
        width: 176px;
        height: 176px;
        box-shadow: 0 0 0 17px rgba(227, 245, 214, .035), 0 0 0 35px rgba(227, 245, 214, .025);
      }
      .hero-leaf {
        width: 112px;
        height: 112px;
      }
      .hero-note {
        right: -22px;
        bottom: 8px;
        padding: 9px 13px;
        font-size: 10px;
      }
      .scan-layout {
        grid-template-columns: minmax(0, 1.55fr) minmax(275px, .75fr);
        gap: 20px;
        margin-top: 24px;
      }
      .scan-card { padding: 20px; border-radius: 26px; }
      .photo-stage { min-height: 350px; border-radius: 20px; }
      .photo-stage::before { top: 20px; left: 20px; }
      .photo-stage::after { right: 20px; bottom: 20px; }
      .leaf-art { width: 88px; height: 88px; border-radius: 30px; font-size: 42px; }
      .stage-title { font-size: 16px; }
      .actions { gap: 12px; margin-top: 16px; }
      .action-button { min-height: 52px; border-radius: 14px; font-size: 13px; }
      .consent, .evaluation-optin { padding: 11px 12px; font-size: 11px; }
      .scan-button { min-height: 56px; border-radius: 15px; font-size: 14px; }
      .result { padding: 20px; border-radius: 19px; }
      .guide-panel {
        position: sticky;
        top: 18px;
        grid-template-columns: 1fr;
        gap: 14px;
      }
      .guide-card { padding: 22px; border-radius: 24px; }
      .guide-card h2 { font-size: 20px; }
      .workflow-list { gap: 18px; margin-top: 21px; }
      .tips { grid-template-columns: 1fr; margin-top: 18px; }
      .tip { padding-top: 14px; }
      .privacy-note { padding: 15px 17px; font-size: 11px; }
      .disclaimer { margin-top: 18px; font-size: 11px; }
      .evaluation-card { margin-top: 26px; padding: 24px; border-radius: 24px; }
    }

    @media (max-width: 899px) {
      .app { width: min(100% - 36px, 680px); padding-top: 18px; }
      .topbar { margin-bottom: 22px; }
      .hero {
        min-height: 0;
        grid-template-columns: minmax(0, 1fr) 155px;
        padding: 30px;
        border-radius: 25px;
      }
      .hero-art { width: 145px; height: 150px; }
      .hero-orbit { width: 128px; height: 128px; }
      .hero-leaf { width: 84px; height: 84px; border-radius: 27px; font-size: 42px; }
      .hero-note { right: -9px; bottom: 0; }
      .scan-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
      .guide-panel { position: static; grid-template-columns: 1fr 1fr; align-items: stretch; }
      .guide-card { padding: 19px; }
      .privacy-note { align-self: stretch; }
      .tips { margin-top: 15px; }
      .tip { padding-top: 12px; }
    }

    @media (max-width: 560px) {
      .app {
        width: 100%;
        padding: 13px 14px calc(104px + env(safe-area-inset-bottom));
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
      }
      .topbar {
        display: flex;
        min-height: 48px;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 16px;
      }
      .brand { gap: 9px; }
      .brand-name { font-size: 18px; }
      .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
      .topbar-actions {
        position: fixed;
        z-index: 10;
        right: max(14px, env(safe-area-inset-right));
        bottom: calc(9px + env(safe-area-inset-bottom));
        left: max(14px, env(safe-area-inset-left));
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: auto;
        margin: 0;
        padding: 7px;
        border: 1px solid rgba(218, 227, 215, .95);
        border-radius: 20px;
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 8px 28px rgba(35, 57, 41, .16);
        backdrop-filter: blur(16px);
      }
      .topbar-link {
        display: flex;
        min-height: 54px;
        flex-direction: column;
        gap: 4px;
        padding: 7px 10px;
        border-radius: 13px;
        font-size: 11px;
      }
      .topbar-link:hover { transform: none; box-shadow: none; }
      .topbar-link svg { width: 17px; height: 17px; }
      .help-button { width: 36px; height: 36px; border-radius: 10px; }
      .hero { display: block; padding: 25px 22px; border-radius: 22px; }
      .hero .eyebrow { margin-bottom: 12px; font-size: 9px; }
      .hero h1 { max-width: 380px; font-size: clamp(36px, 10vw, 46px); letter-spacing: -2px; }
      .hero .intro { max-width: 340px; margin-top: 11px; font-size: 12px; }
      .hero-art {
        position: absolute;
        right: 9px;
        bottom: -31px;
        width: 107px;
        height: 111px;
        opacity: .58;
        transform: scale(.75);
        transform-origin: center;
      }
      .hero-orbit { width: 100px; height: 100px; }
      .hero-leaf { width: 67px; height: 67px; }
      .hero-note { display: none; }
      .scan-layout { margin-top: 15px; gap: 12px; }
      .scan-card { padding: 12px; border-radius: 21px; }
      .photo-stage { min-height: 270px; border-radius: 16px; }
      .photo-stage::before { top: 13px; left: 13px; }
      .photo-stage::after { right: 13px; bottom: 13px; }
      .leaf-art { width: 70px; height: 70px; border-radius: 23px; font-size: 34px; }
      .stage-title { font-size: 14px; }
      .actions { gap: 8px; margin-top: 11px; }
      .action-button { min-height: 48px; gap: 6px; border-radius: 12px; font-size: 11px; }
      .consent, .evaluation-optin { padding: 9px; font-size: 11px; }
      .scan-button { min-height: 51px; font-size: 12px; }
      .eval-label-group label { font-size: 12px; }
      .eval-label-help { font-size: 11px; }
      .result { padding: 14px; border-radius: 15px; }
      .result h2 { font-size: 17px; }
      .guide-panel { grid-template-columns: 1fr; gap: 10px; }
      .guide-card { padding: 17px; border-radius: 19px; }
      .guide-card h2 { font-size: 18px; }
      .workflow-list { gap: 13px; margin-top: 16px; }
      .privacy-note { padding: 12px; font-size: 10px; }
      .disclaimer { margin-top: 14px; font-size: 10px; }
      .evaluation-card { margin-top: 18px; padding: 17px; border-radius: 19px; }
      .evaluation-card h2 { font-size: 18px; }
      .evaluation-stats { gap: 6px; }
      .evaluation-stat { padding: 10px 7px; }
      .evaluation-stat strong { font-size: 17px; }
      .evaluation-stat span { font-size: 10px; }
      .evaluation-actions button { min-height: 44px; font-size: 10px; }
    }

    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      *, *::before, *::after { transition-duration: .01ms !important; }
    }

    html[data-theme="dark"] {
      color-scheme: dark;
      --ink: #e7eee8;
      --muted: #a7b5aa;
      --green: #5b8b68;
      --green-dark: #c0dec5;
      --pale: #2b4033;
      --paper: #131d18;
      --white: #1d2922;
      --line: #36453a;
      --shadow: 0 20px 55px rgba(0, 0, 0, .22);
    }

    html[data-theme="dark"] body {
      background:
        radial-gradient(ellipse at 82% 0%, rgba(68, 96, 70, .2), transparent 34rem),
        var(--paper);
    }

    html[data-theme="dark"] .launch-screen {
      background:
        radial-gradient(ellipse at 50% 42%, rgba(64, 97, 70, .28), transparent 34%),
        var(--paper);
    }

    html[data-theme="dark"] .launch-name span,
    html[data-theme="dark"] .brand-name span { color: #d3b184; }

    html[data-theme="dark"] .topbar-actions {
      border-color: var(--line);
      background: rgba(29, 41, 34, .82);
      box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
    }

    html[data-theme="dark"] .topbar-link { color: #b7c8ba; }
    html[data-theme="dark"] .topbar-link:hover {
      border-color: #43584a;
      background: #293a30;
      color: #e2eee4;
    }

    html[data-theme="dark"] .help-button,
    html[data-theme="dark"] .theme-button {
      border-color: var(--line);
      background: #202e26;
      color: #d4e4d7;
      box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    }

    html[data-theme="dark"] .help-button:hover,
    html[data-theme="dark"] .theme-button:hover { border-color: #506756; background: #2a3a30; }

    html[data-theme="dark"] .settings-button { background: transparent; color: #c1dec5; }
    html[data-theme="dark"] .settings-button:hover { background: transparent; color: #e2eee4; }

    html[data-theme="dark"] .app-footer { border-color: var(--line); }
    html[data-theme="dark"] .app-footer-copyright { border-color: var(--line); }

    html[data-theme="dark"] .photo-stage {
      border-color: #425747;
      background:
        radial-gradient(ellipse at 50% 34%, rgba(75, 99, 76, .35), transparent 58%),
        linear-gradient(145deg, #26382c, #1d2e24);
    }

    html[data-theme="dark"] .photo-stage:hover {
      border-color: #66836a;
      background:
        radial-gradient(ellipse at 50% 34%, rgba(82, 111, 84, .42), transparent 58%),
        linear-gradient(145deg, #2b4030, #213329);
    }

    html[data-theme="dark"] .leaf-art {
      border-color: rgba(125, 165, 129, .2);
      background: rgba(34, 52, 40, .9);
    }

    html[data-theme="dark"] .stage-badge {
      border-color: rgba(170, 197, 172, .3);
      background: rgba(29, 43, 34, .9);
      color: #d9e8db;
    }

    html[data-theme="dark"] .action-button { border-color: var(--line); }
    html[data-theme="dark"] .action-button.primary {
      border-color: #5b8b68;
      background: #5b8b68;
      color: #fff;
    }

    html[data-theme="dark"] .scan-button { background: #3c694a; color: #fff; }
    html[data-theme="dark"] .scan-button:disabled { background: #304c38; }
    html[data-theme="dark"] .result { background: #19251e; }

    html[data-theme="dark"] .screening-notice {
      border-color: #66583b;
      background: #352f21;
      color: #e5d6ad;
    }

    html[data-theme="dark"] .screening-notice strong { color: #f0dfb8; }
    html[data-theme="dark"] .screening-notice.not-plant {
      border-color: var(--line);
      background: #202d25;
      color: #bdc9be;
    }

    html[data-theme="dark"] .screening-notice.not-plant strong { color: var(--ink); }
    html[data-theme="dark"] .consent { border-color: var(--line); background: #202d25; }
    html[data-theme="dark"] .evaluation-optin {
      border-color: #3b5040;
      background: #202d25;
      color: #c1cec3;
    }

    html[data-theme="dark"] .evaluation-optin strong { color: #e7eee8; }
    html[data-theme="dark"] .evaluation-optin input { accent-color: #83b68d; }

    html[data-theme="dark"] .evaluation-optin,
    html[data-theme="dark"] .result-section p,
    html[data-theme="dark"] .result-section ul,
    html[data-theme="dark"] .result-section ol,
    html[data-theme="dark"] .evaluation-breakdown li { color: #b8c5ba; }
    html[data-theme="dark"] .consent strong,
    html[data-theme="dark"] .care-item strong { color: var(--ink); }

    html[data-theme="dark"] .eval-label-group select {
      border-color: var(--line);
      background: #202d25;
      color: var(--ink);
    }

    html[data-theme="dark"] .analysis-status.error { color: #f09b8e; }

    html[data-theme="dark"] .result-pill.warning,
    html[data-theme="dark"] .evaluation-outcome.incorrect {
      background: #46351f;
      color: #f0c98e;
    }

    html[data-theme="dark"] .result-pill.danger {
      background: #482b2a;
      color: #f1aaa1;
    }

    html[data-theme="dark"] .disclaimer { color: #a8b6aa; }
    html[data-theme="dark"] .disclaimer strong { color: #d3e0d4; }

    html[data-theme="dark"] .tip {
      border-color: rgba(119, 147, 120, .18);
      background: rgba(31, 45, 36, .86);
    }

    html[data-theme="dark"] .guide-card {
      border-color: var(--line);
      background: rgba(29, 41, 34, .94);
      box-shadow: 0 14px 36px rgba(0, 0, 0, .18);
    }

    html[data-theme="dark"] .workflow-number {
      background: #2b4033;
      color: #b7d4bb;
    }

    html[data-theme="dark"] .evaluation-card {
      border-color: var(--line);
      background: var(--white);
      box-shadow: 0 15px 40px rgba(0, 0, 0, .18);
    }

    html[data-theme="dark"] .evaluation-stat { background: #27372c; }
    html[data-theme="dark"] .evaluation-actions button {
      border-color: var(--line);
      background: #202d25;
      color: var(--ink);
    }

    html[data-theme="dark"] .settings-dialog {
      border-color: var(--line);
      background: #1d2922;
      color: var(--ink);
    }

    html[data-theme="dark"] .settings-close,
    html[data-theme="dark"] .recent-scan {
      border-color: var(--line);
      background: #202d25;
      color: var(--ink);
    }

    html[data-theme="dark"] .settings-appearance { border: 0; background: transparent; }
    html[data-theme="dark"] .settings-theme-toggle {
      border: 0;
      background: transparent;
      box-shadow: none;
      color: #a7b5aa;
    }
    html[data-theme="dark"] .settings-theme-toggle:hover {
      border: 0;
      background: transparent;
      box-shadow: none;
      color: #fff;
    }

    html[data-theme="dark"] .recent-scan-image { background: #26352c; }
    html[data-theme="dark"] .recent-scan-delete:hover { background: #452c2a; color: #f0aaa0; }
    html[data-theme="dark"] .settings-history-count { background: #2b4033; color: #c0dec5; }
    html[data-theme="dark"] .history-confirm-dialog { border-color: var(--line); background: #1d2922; color: var(--ink); }
    html[data-theme="dark"] .history-confirm-cancel { border-color: var(--line); color: var(--ink); }
    html[data-theme="dark"] .recent-scan summary { color: #a6d0ac; }
    html[data-theme="dark"] .recent-scan-status.error { color: #f09b8e; }

    html[data-theme="dark"] .hero-note { background: rgba(30, 43, 34, .96); color: #d6e6d6; }

    html[data-theme="dark"] .privacy-note {
      border-color: #3d5845;
      background: linear-gradient(120deg, #26392b, #202f25);
      color: #c0d0c0;
    }

    html[data-theme="dark"] .privacy-note strong { color: #e1ece1; }
    html[data-theme="dark"] .privacy-icon { background: #304634; color: #b9d7bd; }
