:root {
  --ink: #23302B;
  --accent: #2F6B4F;
  --gold: #B0722F;
  --paper: #FFFFFF;
  --soft: #EFF3EC;
  --line: #D6DED2;
  --muted: #59665E;
  --toxic: #843B31;
  --unknown: #775019;
  --heading-font: Georgia, 'Times New Roman', serif;
  --body-font: Arial, Helvetica, sans-serif;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { background: var(--soft); -webkit-text-size-adjust: 100%; scroll-padding-top: calc(80px + env(safe-area-inset-top, 0px)); }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.6 var(--body-font); overflow-wrap: anywhere; min-height: 100vh; min-height: 100svh; }
h1, h2, h3 { font-family: var(--heading-font); line-height: 1.25; font-weight: 700; }
h1 { font-size: 30px; letter-spacing: -.025em; }
h2 { font-size: 23px; margin: 0 0 14px; letter-spacing: -.015em; }
h3 { font-size: 20px; }
p { margin: 0 0 16px; }
a { color: var(--accent); text-underline-offset: .2em; }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a { min-height: 44px; display: inline-flex; align-items: center; }
svg { display: block; flex-shrink: 0; }
button, .button-link, input, select, textarea, summary { font: inherit; }
button, .button-link { min-height: 48px; max-width: 100%; display: inline-flex; align-items: center; justify-content: center; padding: 11px 18px; border: 1px solid var(--accent); border-radius: var(--radius); color: var(--paper); background: var(--accent); font-weight: 700; line-height: 1.45; text-align: center; white-space: normal; cursor: pointer; text-decoration: none; transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
button:disabled { background: var(--soft); color: var(--muted); border-color: var(--line); cursor: default; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
#app:focus { outline: none; }
.app-header, #app, .app-footer { width: 100%; max-width: 520px; margin-inline: auto; background: var(--paper); }
.app-header { padding: calc(14px + env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) 14px max(22px, env(safe-area-inset-left, 0px)); }
.brand { gap: 10px; min-height: 32px; font: 700 16px/1.3 var(--heading-font); text-decoration: none; color: var(--ink); }
.brand svg { color: var(--accent); width: 22px; height: 22px; }
/* The six destinations are also on Home; keep the original navigation keyboard accessible. */
#navigation { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#navigation:focus-within { position: relative; width: auto; height: auto; margin: 12px 0 0; clip-path: none; white-space: normal; display: grid; gap: 4px; }
#navigation a { border-radius: 8px; padding: 5px 8px; }
#navigation a[aria-current] { font-weight: 700; background: var(--soft); }
body:has(.screen-bar) .app-header { padding: 0; }
body:has(.screen-bar) .brand { position: absolute; width: 1px; height: 1px; min-height: 0; overflow: hidden; clip-path: inset(50%); }
body:has(.screen-bar) .brand:focus-visible { position: relative; width: auto; height: auto; min-height: 44px; clip-path: none; margin: 12px 22px; }
#app { padding: 0; }
.home-hero { position: relative; min-height: 286px; isolation: isolate; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; z-index: -2; }
.home-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgb(35 48 43 / .98), rgb(35 48 43 / .92) 28%, rgb(35 48 43 / .45) 65%, transparent); }
.hero-title { padding: 0 max(24px, env(safe-area-inset-right, 0px)) 25px max(24px, env(safe-area-inset-left, 0px)); min-height: 286px; display: flex; align-items: flex-end; }
.hero-title h1 { color: var(--paper); margin: 0; font-size: 36px; line-height: 1.12; max-width: 360px; text-wrap: balance; }
.home-content, .screen-content { padding: 24px max(22px, env(safe-area-inset-right, 0px)) 32px max(22px, env(safe-area-inset-left, 0px)); }
.home-content > p { color: var(--muted); margin-bottom: 24px; }
.tile-grid { display: grid; gap: 12px; margin: 20px 0 24px; }
.tile { display: flex; align-items: center; gap: 14px; min-height: 78px; padding: 19px 18px; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; background: var(--paper); text-decoration: none; box-shadow: 0 3px 12px rgb(35 48 43 / .035); transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease; }
.home-tiles { margin: 0; }
.home-tiles .tile { gap: 12px; padding: 18px 16px; }
.tile-icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; color: var(--accent); background: var(--soft); }
.tile-copy { min-width: 0; flex: 1; }
.tile h2 { font-size: 20px; margin-bottom: 5px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tile-arrow { color: var(--accent); flex: 0 0 16px; transform: rotate(180deg); }
.tile-arrow svg { width: 16px; height: 16px; }
.screen-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; min-height: 80px; padding: calc(12px + env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 3px 12px rgb(35 48 43 / .045); }
.screen-bar h1 { font-size: 23px; margin: 0; flex: 1; min-width: 0; text-wrap: balance; }
.back-link { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 12px; background: var(--soft); text-decoration: none; }
.screen-photo { display: block; width: 100%; height: 140px; object-fit: cover; object-position: center; }
.parent-link { min-height: 44px; margin: .5rem 0; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.parent-link::before { content: '\2039'; margin-right: 6px; font-size: 20px; line-height: 1; }
.screen-content > p:first-child { color: var(--muted); }
.card { margin: 22px 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 3px 14px rgb(35 48 43 / .025); }
.card > h2:first-child { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card > button, .card > .button-link { margin: 10px 8px 0 0; }
.move-card { color: var(--paper); background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 20px rgb(47 107 79 / .15); }
.move-card h2 { font: 700 14px/1.4 var(--body-font); font-variant-caps: all-small-caps; letter-spacing: .04em; margin-bottom: 14px; }
.move-card > p:first-of-type { font: 700 22px/1.3 var(--heading-font); letter-spacing: -.015em; }
.move-card a, .move-card summary { color: var(--paper); }
.move-card .button-link { color: var(--accent); border-color: var(--paper); background: var(--paper); }
.move-card :focus-visible { outline-color: var(--paper); }
.dont-card { border: 1px solid var(--gold); border-left-width: 4px; background: #FCF8F1; }
.dont-card h2 { color: var(--ink); }
.cause-card { padding: 22px 16px; border: none; box-shadow: none; background: var(--soft); }
.cause-card h2 { margin-inline: 6px; }
.cause-card > ol { counter-reset: causes; list-style: none; padding: 0; margin: 0; }
.cause-card > ol > li { position: relative; counter-increment: causes; padding: 16px 14px 16px 50px; margin: 9px 0; background: var(--paper); border-radius: 12px; }
.cause-card > ol > li::before { content: counter(causes); position: absolute; top: 16px; left: 14px; width: 26px; height: 26px; display: grid; place-items: center; color: var(--accent); background: var(--soft); border-radius: 50%; font-size: 14px; font-weight: 700; line-height: 1; }
.cause-card > p { margin: 16px 6px 0; }
.look-card { background: var(--soft); }
.answers { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.answers button { flex: 1 1 130px; color: var(--accent); background: var(--paper); border-color: var(--line); font-weight: 400; text-align: left; justify-content: flex-start; }
.answers button[aria-pressed="true"] { color: var(--paper); background: var(--accent); border-color: var(--accent); font-weight: 700; }
fieldset { min-width: 0; padding: 12px 0 0; margin: 20px 0 0; border: 0; border-top: 1px solid var(--line); }
legend { padding: 12px 0 0; font-weight: 700; }
form { display: grid; gap: 18px; padding: 22px; margin: 24px 0; background: var(--soft); border: 1px solid var(--line); border-radius: 16px; }
label { display: grid; gap: 7px; font-weight: 700; }
input, select, textarea { width: 100%; min-width: 0; min-height: 48px; padding: 11px 12px; border: 1px solid #869589; border-radius: 10px; color: var(--ink); background: var(--paper); font-weight: 400; line-height: 1.45; }
input::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 192px; resize: vertical; }
input[type="search"] { padding-inline: 16px; }
.secondary, time { font-size: 14px; color: var(--muted); }
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.filters button { border-radius: 999px; justify-content: center; padding-inline: 10px; font-size: 14px; font-weight: 700; min-width: 0; }
.plant-list { display: grid; gap: 12px; margin: 24px 0; }
.plant-row { display: grid; gap: 5px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; background: var(--paper); color: var(--ink); transition: border-color 150ms ease, background-color 150ms ease; }
.plant-row > strong { font-family: var(--heading-font); font-size: 20px; line-height: 1.3; }
.plant-row > em { color: var(--muted); font-size: 14px; }
.plant-row p { margin: 6px 0 0; }
.status-chip { display: inline-flex; align-items: center; justify-self: start; gap: 8px; padding: 4px 10px; margin-top: 6px; border: 1px solid currentColor; border-radius: 999px; font-size: 14px; font-weight: 700; line-height: 1.4; }
.status-chip::before { content: ''; display: inline-block; width: 9px; height: 9px; flex: 0 0 9px; background: currentColor; }
.toxic { color: var(--toxic); background: #FBF3EF; }
.toxic::before { transform: rotate(45deg); border-radius: 1px; }
.non-toxic { color: var(--accent); background: var(--soft); }
.non-toxic::before { border-radius: 50%; }
.unknown { color: var(--unknown); background: #FCF8F1; }
.unknown::before { width: 11px; height: 10px; flex-basis: 11px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
dl { margin: 0; }
.pet-profile dt { color: var(--accent); font-size: 12px; font-weight: 700; font-variant-caps: all-small-caps; letter-spacing: .04em; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pet-profile dt:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pet-profile dd { margin: 4px 0 0; font-size: 16px; line-height: 1.6; }
dl + p { margin-top: 20px; }
.table-scroll { margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; }
table { table-layout: fixed; border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 9px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
table th:first-child { width: 30%; }
thead th { background: var(--soft); color: var(--ink); overflow-wrap: normal; word-break: normal; }
tr:last-child > * { border-bottom: 0; }
li + li { margin-top: 10px; }
summary { display: list-item; padding: 12px 0; min-height: 48px; cursor: pointer; font-weight: 700; color: var(--accent); }
.root-check { border-top: 1px solid var(--line); margin-top: 18px; }
.root-check[open] > summary { margin-bottom: 10px; }
.checkpoints { position: relative; display: grid; gap: 8px; margin: 20px 0; }
.checkpoints::before { content: ''; position: absolute; left: 24px; top: 24px; bottom: 24px; width: 2px; background: var(--line); }
.checkpoint { position: relative; display: flex; align-items: flex-start; gap: 14px; min-height: 70px; padding: 12px 12px 12px 4px; border: 1px solid transparent; border-radius: 12px; font-weight: 400; }
.checkpoint input { position: relative; z-index: 1; flex: 0 0 24px; width: 24px; height: 24px; min-height: 24px; margin: 3px 8px 0; accent-color: var(--accent); cursor: pointer; box-shadow: 0 0 0 5px var(--paper); }
.checkpoint strong { display: block; font-size: 18px; margin-bottom: 4px; }
.checkpoint.current { background: var(--soft); border-color: var(--line); }
.checkpoint.current input { box-shadow: 0 0 0 5px var(--soft); }
.checkpoint:has(input:checked) strong { color: var(--accent); }
.checkpoint:has(input:disabled) { color: var(--muted); }
.checkpoint input:disabled { cursor: default; }
.log-entry { border-top: 3px solid var(--accent); }
.log-entry.is-ready { border-top-color: var(--gold); }
.log-entry > p:first-of-type { font-size: 18px; }
.log-entry > time { display: inline-block; padding: 3px 9px; margin-bottom: 10px; background: var(--soft); border-radius: 6px; font-variant-numeric: tabular-nums; }
.log-entry .ready-pill { display: inline-flex; border-radius: 999px; color: #68441C; background: #F7ECDD; border-color: var(--gold); font-size: 14px; }
button[data-action="delete-log"], button[data-action="remove-quarantine"], button[data-action="export"], button[data-action="clear-light"] { color: var(--accent); background: var(--paper); border-color: var(--line); }
.reading { padding: 16px; background: var(--soft); border-radius: 12px; }
.reading + .reading { margin-top: 12px; }
.reading p:last-child { margin-bottom: 0; }
.isolation { border-left: 4px solid var(--gold); background: #FCF8F1; }
button[data-action="emergency"] { width: 100%; background: var(--ink); border-color: var(--ink); }
dialog { width: min(calc(100% - 32px), 480px); max-height: 85vh; max-height: 85svh; overflow-y: auto; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: 0 20px 80px rgb(35 48 43 / .3); }
dialog h2 { font-size: 25px; }
dialog::backdrop { background: rgb(35 48 43 / .65); }
.app-footer { padding: 16px max(22px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(22px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--line); }
.app-footer a { font-size: 14px; color: var(--muted); }
@media (hover: hover) {
  button:not(:disabled):hover, .button-link:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
  .answers button:not([aria-pressed="true"]):hover { color: var(--accent); background: var(--soft); border-color: var(--accent); }
  .tile:hover, .plant-row:hover { background: #F8FAF6; border-color: var(--accent); box-shadow: 0 5px 18px rgb(35 48 43 / .07); }
  .back-link:hover { background: #E1E9DE; }
}
@media (min-width: 900px) {
  body { padding: 36px 0; background: var(--soft); }
  .app-header { border-radius: 22px 22px 0 0; }
  #app { box-shadow: 0 15px 50px rgb(35 48 43 / .08); }
  .app-footer { border-radius: 0 0 22px 22px; }
  .screen-bar { border-radius: 22px 22px 0 0; }
  .hero-title h1 { font-size: 40px; }
  .home-hero, .hero-title { min-height: 310px; }
  .move-card > p:first-of-type { font-size: 24px; }
}
@media (max-width: 359px) {
  .home-content, .screen-content { padding-inline: 16px; }
  .home-tiles .tile { padding-inline: 12px; gap: 10px; }
  .tile-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .tile h2 { font-size: 18px; }
  .card, form { padding: 18px; }
  .hero-title h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
