/* Hallmark · checked: 2026-10-27 · genre: modern-minimal (inferred: app screen + editorial guides)
 * floor: fixed 4, 15, 19, 27 (scripted), 33, 38i, 63, 34, 39a, 40, 48, 50, 67, 27 (iteration), 24a (dock) · structural: printed (58, 44c, 59, 77)
 * waive 1 · the system face is the iOS-native voice of a PWA that lives on the home screen
 * waive 12 · spring easing is the house motion: dock, sheets and the tile morph copy iOS physics
 * waive 75 · tab labels at 10.5px match the iOS tab bar's 10pt
 * built: the project · redesign: polish · v2.0.0 */
/* iOS layering: content is plain grouped cards; Liquid Glass is reserved for the
   one floating dock (.dock) that content scrolls beneath — Apple's HIG
   says not to put glass in the content layer. */
:root {
  --bg:#f2f2f7; --surface:#fff; --surface-2:#f2f2f7; --offset:rgb(120 120 128 / .12);
  --divider:rgb(60 60 67 / .18); --border:rgb(60 60 67 / .29);
  --text:#1c1c1e; --muted:rgb(60 60 67 / .82); --faint:rgb(60 60 67 / .74);
  --primary:#1c7633; --primary-hover:#17642b; --on-primary:#fff;
  --primary-subtle:rgb(52 199 89 / .12); --primary-highlight:rgb(52 199 89 / .18);
  --accent:#b25000; --accent-highlight:rgb(255 149 0 / .14);
  --error:#d70015; --error-highlight:rgb(255 59 48 / .12); --on-error:#fff;
  --success:#1c7633; --success-highlight:rgb(52 199 89 / .16);
  --on-photo:#fff; --scrim:rgb(0 0 0 / .28); --scrim-sheet:rgb(0 0 0 / .35); --scrim-check:rgb(0 0 0 / .18);
  --shadow-check:0 1px 4px rgb(0 0 0 / .35); --shadow-ctx:0 24px 60px rgb(0 0 0 / .35);

  --glass:rgb(255 255 255 / .62);
  --glass-rim:linear-gradient(135deg, rgb(255 255 255 / .95), rgb(255 255 255 / .25) 35%, rgb(255 255 255 / .08) 60%, rgb(255 255 255 / .7));
  --glass-blur:blur(20px) saturate(180%);
  --glass-shadow:0 8px 32px rgb(0 0 0 / .14), 0 1px 3px rgb(0 0 0 / .08);
  --lens:rgb(120 120 128 / .16); --lens-lifted:rgb(255 255 255 / .28);
  --mask:#000; /* opaque in a mask: shows what is under it */
  /* The dark band just inside the edge is where glass is thickest. */
  --lens-lifted-shadow:0 6px 18px rgb(0 0 0 / .18), 0 0 0 .5px rgb(0 0 0 / .08),
    inset 0 0 7px rgb(0 0 0 / .28), inset 0 1.5px 1px rgb(255 255 255 / .6), inset 0 -1.5px 1px rgb(255 255 255 / .25);

  --r-md:.75rem; --r-lg:1rem; --r-xl:1.375rem; --r-2xl:1.625rem; --r-full:9999px;
  --t:240ms cubic-bezier(.2,.9,.3,1.2);
  --s1:.25rem; --s2:.5rem; --s3:.75rem; --s4:1rem; --s5:1.25rem; --s6:1.5rem;
  --s8:2rem; --s10:2.5rem; --s12:3rem; --s16:4rem;
  --t-xs:.8125rem; --t-sm:.9375rem; --t-base:1.0625rem; --t-lg:1.375rem;
  --t-xl:clamp(2.125rem,1.8rem + 1.4vw,2.75rem);
  --display:-apple-system,BlinkMacSystemFont,"SF Pro Display",system-ui,sans-serif;
  --body:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#000; --surface:#1c1c1e; --surface-2:#2c2c2e; --offset:rgb(120 120 128 / .24);
    --divider:rgb(84 84 88 / .55); --border:rgb(84 84 88 / .65);
    --text:#fff; --muted:rgb(235 235 245 / .65); --faint:rgb(235 235 245 / .55);
    --primary:#30d158; --primary-hover:#4ade72; --on-primary:#04210d;
    --primary-subtle:rgb(48 209 88 / .14); --primary-highlight:rgb(48 209 88 / .2);
    --accent:#ffb340; --accent-highlight:rgb(255 159 10 / .16);
    --error:#ff6961; --error-highlight:rgb(255 69 58 / .18); --on-error:#2a0604;
    --success:#30d158; --success-highlight:rgb(48 209 88 / .18);
    --glass:rgb(44 44 46 / .6);
    --glass-rim:linear-gradient(135deg, rgb(255 255 255 / .4), rgb(255 255 255 / .08) 35%, rgb(255 255 255 / .03) 60%, rgb(255 255 255 / .22));
    --glass-shadow:0 8px 32px rgb(0 0 0 / .5), 0 1px 3px rgb(0 0 0 / .3);
    --lens:rgb(255 255 255 / .12); --lens-lifted:rgb(255 255 255 / .07);
  }
}
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html, body { overflow-x:clip; }
html { -webkit-font-smoothing:antialiased; -webkit-tap-highlight-color:transparent; }
body {
  min-height:100dvh; font-family:var(--body); font-size:var(--t-base);
  color:var(--text); background:var(--bg); line-height:1.45; letter-spacing:-.01em;
}
img { display:block; max-width:100%; height:auto; }
button { cursor:pointer; background:none; border:none; font:inherit; color:inherit; }
input { font:inherit; color:inherit; }
h1,h2,h3,.plant-name { text-wrap:balance; line-height:1.15; overflow-wrap:break-word; min-width:0; }
p,li { text-wrap:pretty; }
:focus-visible { outline:2px solid var(--primary); outline-offset:3px; border-radius:var(--r-md); }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } }

main { max-width:760px; margin:0 auto; padding:var(--s10) var(--s6); }
.hero { text-align:center; margin-bottom:var(--s8); }
/* .hero p would otherwise win on specificity and turn the wordmark grey. */
.hero .wordmark {
  font-family:var(--display); font-size:var(--t-xs); font-weight:600; letter-spacing:.12em;
  text-transform:uppercase; color:var(--primary); margin-bottom:var(--s3);
}
.wordmark a { color:inherit; text-decoration:none; }
.hero h1 { font-family:var(--display); font-size:var(--t-xl); font-weight:700; letter-spacing:-.025em; margin-bottom:var(--s3); }
.hero p { font-size:var(--t-sm); color:var(--muted); max-width:52ch; margin:0 auto; }

/* Opacity only: a transform here would make the fixed bar inside position against
   the screen instead of the viewport while the animation runs. */
.screen { display:none; }
.screen.active { display:block; animation:fade .3s ease-out; }
@keyframes fade { from{opacity:0} to{opacity:1} }

.dropzone {
  background:var(--surface); border-radius:var(--r-2xl);
  padding:var(--s12) var(--s6); text-align:center; cursor:pointer; position:relative;
  transition:transform var(--t), box-shadow var(--t);
}
/* Not on :focus-visible: box-shadow is transitioned, and a focus ring must not fade in. */
.dropzone:hover,.dropzone.dragging { box-shadow:0 0 0 3px var(--primary-highlight); }
.dropzone:active { transform:scale(.98); }
.dropzone input[type=file] { position:absolute; inset:0; opacity:0; cursor:pointer; }
.dz-icon {
  width:64px; height:64px; margin:0 auto var(--s4); border-radius:var(--r-full);
  background:var(--primary-subtle); color:var(--primary);
  display:flex; align-items:center; justify-content:center;
}
.dropzone h2 { font-size:var(--t-lg); font-weight:600; letter-spacing:-.02em; margin-bottom:var(--s2); }
.dropzone p { font-size:var(--t-sm); color:var(--muted); }
.dz-hint { margin-top:var(--s4); font-size:var(--t-xs); color:var(--faint); }

/* The one way out of the upload screen for someone who does not need identifying. */
.sideways {
  margin-top:var(--s5); text-align:center;
  font-size:var(--t-sm); color:var(--muted);
}
.sideways a { color:var(--primary); text-decoration:none; font-weight:600; }
.sideways a:hover { text-decoration:underline; }

.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:var(--s2);
  min-height:48px; padding:var(--s3) var(--s6); border-radius:var(--r-full);
  font-size:var(--t-base); font-weight:600; text-decoration:none; cursor:pointer;
  transition:transform var(--t), background var(--t);
}
.btn:active { transform:scale(.95); }
.btn-primary { background:var(--primary); color:var(--on-primary); }
.btn-primary:hover { background:var(--primary-hover); }
.btn-primary:disabled { opacity:.6; cursor:not-allowed; transform:none; }
.btn-ghost { background:var(--offset); color:var(--text); }

/* ---- the floating glass dock: tab bar + camera button ---- */
.dock {
  position:fixed; z-index:10; left:50%; transform:translateX(-50%);
  bottom:calc(var(--s4) + env(safe-area-inset-bottom));
  width:min(calc(100% - 2 * var(--s4)), 400px);
  display:flex; align-items:center; gap:var(--s3);
  view-transition-name:dock;
}
.tabbar, .fab {
  position:relative; isolation:isolate; border-radius:var(--r-full);
  background:var(--glass);
  -webkit-backdrop-filter:var(--glass-blur); backdrop-filter:var(--glass-blur);
  box-shadow:var(--glass-shadow);
}
/* Specular rim: a 1px gradient ring, brightest top-left and bottom-right. */
.tabbar::before, .fab::before, .lens-body::before {
  content:""; position:absolute; inset:0; z-index:3; pointer-events:none;
  border-radius:inherit; padding:1px; background:var(--glass-rim);
  -webkit-mask:linear-gradient(var(--mask) 0 0) content-box, linear-gradient(var(--mask) 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude;
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  .tabbar, .fab { background:var(--surface); }
}

.tabbar {
  flex:1; padding:var(--s1); transition:transform .45s cubic-bezier(.34,1.45,.5,1);
  touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none;
}
.tabs { display:grid; grid-template-columns:repeat(3,1fr); }
.tab {
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:7px 0 6px; font-size:.65625rem; font-weight:600; letter-spacing:0; color:var(--text);
}
.tab svg { display:block; }

/* The drop. Its body holds a copy of the tabs, tinted, three tabs wide. The
   tabs underneath are masked out where it sits (--lx, --lw from dock.js; --ls
   is how much it has grown), so its copy is the only thing seen through it.
   The two are registered so the hole can spring along with the drop. */
@property --lx { syntax:"<length>"; inherits:true; initial-value:0px; }
@property --ls { syntax:"<number>"; inherits:true; initial-value:1; }
.tabs {
  --lw:0px;
  --hl:calc(var(--lx) + var(--lw) * (1 - var(--ls)) / 2);
  --hr:calc(var(--lx) + var(--lw) * (1 + var(--ls)) / 2);
  -webkit-mask:linear-gradient(to right, var(--mask) var(--hl), transparent var(--hl), transparent var(--hr), var(--mask) var(--hr));
  mask:linear-gradient(to right, var(--mask) var(--hl), transparent var(--hl), transparent var(--hr), var(--mask) var(--hr));
  transition:--lx .5s cubic-bezier(.34,1.45,.5,1), --ls .3s cubic-bezier(.34,1.45,.5,1);
}
.lens {
  position:absolute; z-index:2; top:var(--s1); bottom:var(--s1); left:var(--s1);
  width:calc((100% - 2 * var(--s1)) / 3); pointer-events:none;
  transition:transform .5s cubic-bezier(.34,1.45,.5,1);
}
.lens-body {
  position:absolute; inset:0; border-radius:var(--r-full); overflow:hidden;
  background:var(--lens); transition:transform .3s cubic-bezier(.34,1.45,.5,1), background .3s, box-shadow .3s;
}
.lens-body::before { opacity:0; transition:opacity .3s; }
.lens-tabs {
  position:absolute; top:0; left:0; width:300%; height:100%;
  display:grid; grid-template-columns:repeat(3,1fr);
  transition:transform .5s cubic-bezier(.34,1.45,.5,1), transform-origin .5s cubic-bezier(.34,1.45,.5,1);
}
.lens-rim {
  opacity:0; --zoom:1.3; filter:blur(.8px);
  transition:transform .5s cubic-bezier(.34,1.45,.5,1), transform-origin .5s cubic-bezier(.34,1.45,.5,1), opacity .3s;
}
.lens-tabs .tab { color:var(--primary); }
/* Pressed: the whole bar swells a little, the drop lifts into clear glass and
   magnifies what it holds — gently in the middle, hard and smeared at the rim. */
.tabbar.lifted { transform:scale(1.045); }
.tabbar.pulse { animation:breathe .42s cubic-bezier(.34,1.45,.5,1); }
@keyframes breathe { 0%{transform:scale(1)} 40%{transform:scale(1.06)} 100%{transform:scale(1)} }
.tabbar.lifted .tabs { --ls:1.22; }
.tabbar.lifted .lens-tabs:not(.lens-rim) {
  -webkit-mask:radial-gradient(closest-side, var(--mask) 52%, transparent 88%);
  mask:radial-gradient(closest-side, var(--mask) 52%, transparent 88%);
}
.tabbar.lifted .lens-rim {
  opacity:1;
  -webkit-mask:radial-gradient(closest-side, transparent 50%, var(--mask) 86%);
  mask:radial-gradient(closest-side, transparent 50%, var(--mask) 86%);
}
.tabbar.lifted .lens-body {
  transform:scale(1.22); background:var(--lens-lifted); box-shadow:var(--lens-lifted-shadow);
}
.tabbar.lifted .lens-body::before { opacity:1; }
/* Real glass bends and smears whatever sits under its rim. A ring that blurs
   what is behind it (the tinted copy), fading out toward the centre. */
.lens-edge {
  position:absolute; inset:0; border-radius:inherit; pointer-events:none; opacity:0;
  -webkit-backdrop-filter:blur(3px) saturate(160%); backdrop-filter:blur(3px) saturate(160%);
  -webkit-mask:radial-gradient(closest-side, transparent 50%, var(--mask) 100%);
  mask:radial-gradient(closest-side, transparent 50%, var(--mask) 100%);
  transition:opacity .3s;
}
.tabbar.lifted .lens-edge { opacity:1; }
.tabbar.dragging .lens, .tabbar.dragging .lens-tabs { transition:opacity .3s; }
.tabbar.dragging .tabs { transition:--ls .3s cubic-bezier(.34,1.45,.5,1); }

.dock.still .lens, .dock.still .lens-tabs, .dock.still .tabs, .dock.still .tabbar { transition:none; }

/* ---- icon gestures, played once per tap ---- */
.tab svg *, .fab svg * { transform-box:fill-box; }
/* Leaf: a gust, swaying from the stalk and settling. */
.tab.play .i-leaf { transform-origin:0% 100%; animation:sway .7s ease-out; }
@keyframes sway {
  0%{transform:rotate(0)} 18%{transform:rotate(-16deg)} 38%{transform:rotate(11deg)}
  58%{transform:rotate(-6deg)} 78%{transform:rotate(3deg)} 100%{transform:rotate(0)}
}
/* Grid: the four squares pop in one after another, like photos landing. */
.tab.play .i-sq { transform-origin:50% 50%; animation:pop .45s cubic-bezier(.34,1.6,.5,1) backwards; }
.tab.play .i-sq:nth-child(2) { animation-delay:.06s; }
.tab.play .i-sq:nth-child(3) { animation-delay:.12s; }
.tab.play .i-sq:nth-child(4) { animation-delay:.18s; }
@keyframes pop { 0%{transform:scale(.3)} 100%{transform:scale(1)} }
/* Book: the pages fold in to the spine and open again. */
.tab.play .i-page-l { transform-origin:100% 50%; animation:fold .6s cubic-bezier(.34,1.4,.5,1); }
.tab.play .i-page-r { transform-origin:0% 50%; animation:fold .6s cubic-bezier(.34,1.4,.5,1) .05s; }
@keyframes fold { 0%{transform:scaleX(1)} 35%{transform:scaleX(.15)} 100%{transform:scaleX(1)} }
/* Camera: the shutter closes to a point and snaps open. */
.fab.play .i-shutter { transform-origin:50% 50%; animation:shutter .45s cubic-bezier(.34,1.5,.5,1); }
@keyframes shutter { 0%{transform:scale(1)} 30%{transform:scale(0)} 100%{transform:scale(1)} }

.fab {
  flex-shrink:0; width:58px; height:58px; display:grid; place-items:center; cursor:pointer;
  color:var(--on-primary); background:color-mix(in srgb, var(--primary) 88%, transparent);
  transition:transform var(--t);
}
.fab:active { transform:scale(.92); }

/* Primary on top, full width — the usual iOS sheet order. */
.preview-actions { display:flex; flex-direction:column-reverse; gap:var(--s2); width:min(100%, 340px); }

.preview { display:flex; flex-direction:column; align-items:center; gap:var(--s6); }
.preview img {
  border-radius:var(--r-2xl); max-height:min(60vh, 520px); width:auto; background:var(--offset);
}

.loading { text-align:center; padding:var(--s16) var(--s6); }
.leaf { color:var(--primary); animation:spin 2s ease-in-out infinite; margin:0 auto var(--s6); }
@keyframes spin {
  0%{transform:rotate(0) scale(1);opacity:.7} 50%{transform:rotate(180deg) scale(1.1);opacity:1}
  100%{transform:rotate(360deg) scale(1);opacity:.7}
}
.loading p { font-size:var(--t-lg); font-weight:600; color:var(--muted); }

.card { background:var(--surface); border-radius:var(--r-2xl); overflow:hidden; }
.card-head { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
.card-photo { background:var(--offset); min-height:220px; }
.card-photo img { width:100%; height:100%; object-fit:cover; }
.card-id { padding:var(--s6); display:flex; flex-direction:column; justify-content:center; gap:var(--s2); }
.plant-name { font-family:var(--display); font-size:var(--t-lg); font-weight:700; letter-spacing:-.02em; }
.plant-sci { font-style:italic; color:var(--primary); font-size:var(--t-sm); }
.plant-family { font-size:var(--t-xs); color:var(--faint); }
.tags { display:flex; flex-wrap:wrap; gap:var(--s2); margin-top:var(--s1); }

.sections { padding:var(--s6); display:flex; flex-direction:column; gap:var(--s6); }
.section-title { font-size:var(--t-sm); font-weight:600; color:var(--muted); margin-bottom:var(--s2); }
.tag {
  display:inline-flex; align-items:center; gap:var(--s1); padding:var(--s1) var(--s3);
  border-radius:var(--r-full); font-size:var(--t-xs); font-weight:600;
}
.tag-high { background:var(--success-highlight); color:var(--success); }
.tag-medium { background:var(--accent-highlight); color:var(--accent); }
.tag-low { background:var(--error-highlight); color:var(--error); }
.tag-neutral { background:var(--offset); color:var(--muted); }

.prose { font-size:var(--t-sm); color:var(--muted); }
.prose + .prose { margin-top:var(--s2); }

.care { display:grid; grid-template-columns:repeat(2,1fr); gap:var(--s3); }
.care-item, .alt, .safety-item { border-radius:var(--r-lg); background:var(--surface-2); padding:var(--s4); }
/* Inside a card they are rows under a hairline, not a second layer of cards. */
.card :is(.care-item, .alt, .safety-item) { background:none; border-radius:0; padding:var(--s3) 0 0; border-top:.5px solid var(--divider); }
/* The care-guide index puts these straight on the page background, not in a card. */
.care > a.care-item { display:block; background:var(--surface); color:inherit; text-decoration:none; transition:transform var(--t); }
.care > a.care-item:active { transform:scale(.97); }
.care-label {
  display:flex; align-items:center; gap:var(--s2);
  font-size:var(--t-sm); font-weight:600; color:var(--primary); margin-bottom:var(--s2);
}
.care-item p { font-size:var(--t-sm); }

.alt + .alt { margin-top:var(--s3); }
.alt-head { display:flex; align-items:center; gap:var(--s3); flex-wrap:wrap; margin-bottom:var(--s2); }
.alt-name { font-weight:600; font-size:var(--t-sm); }
.alt-sci { font-style:italic; color:var(--muted); font-size:var(--t-sm); }
.alt p { font-size:var(--t-sm); }
.alt p b { color:var(--muted); font-weight:500; }

.facts { list-style:none; display:flex; flex-direction:column; gap:var(--s2); }
.facts li { position:relative; padding-left:var(--s5); font-size:var(--t-sm); }
.facts li::before { content:""; position:absolute; left:0; top:.55em; width:6px; height:6px; border-radius:var(--r-full); background:var(--primary); }

.safety { display:flex; flex-wrap:wrap; gap:var(--s3); }
.safety-item { flex:1 1 180px; }
.safety-item .care-label { color:var(--faint); }
.safety-note { font-size:var(--t-sm); color:var(--muted); margin-bottom:var(--s3); }

.note {
  display:flex; gap:var(--s3); padding:var(--s4); border-radius:var(--r-lg);
  background:var(--accent-highlight); font-size:var(--t-sm);
}
.note.bad { background:var(--error-highlight); }
.note svg { flex-shrink:0; margin-top:2px; }
.note b { display:block; margin-bottom:var(--s1); }
.note ul { margin:var(--s2) 0 0 var(--s4); }

.history-head { display:flex; align-items:baseline; gap:var(--s4); margin-bottom:var(--s3); }
.history-head h2 { flex:1; }
.link-btn { color:var(--primary); font-size:var(--t-base); font-weight:600; }
.history-head h2 { font-family:var(--display); font-size:var(--t-lg); font-weight:700; letter-spacing:-.02em; }
.history-head p { font-size:var(--t-sm); color:var(--muted); }
.history-empty { font-size:var(--t-sm); color:var(--muted); padding:var(--s8) 0; text-align:center; }
/* Photos-style grid: square crops, hairline gaps, newest first. */
.history-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:2px; border-radius:var(--r-lg); overflow:hidden; }
.tile {
  position:relative; display:block; aspect-ratio:1; background:var(--offset);
  -webkit-touch-callout:none; user-select:none; -webkit-user-select:none;
}
.tile-check {
  position:absolute; right:6px; bottom:6px; width:23px; height:23px; border-radius:50%;
  border:1.5px solid var(--on-photo); color:var(--on-photo); background:var(--scrim-check); box-shadow:var(--shadow-check);
  display:none; place-items:center;
}
.tile-check svg { display:none; }
.selecting .tile-check { display:grid; }
.tile.selected img { opacity:.6; }
.tile.selected .tile-check { background:var(--primary); }
.tile.selected .tile-check svg { display:block; }
.tile img { width:100%; height:100%; object-fit:cover; }
.tile:active img { opacity:.7; }
/* The card's own hero is the destination of the open animation; hide the page
   hero above History so the grid starts at the top like an album. */
body:has(#screenHistory.active) :is(.hero, footer) { display:none; }
/* The footer normally keeps the last row clear of the floating bar; here it is gone. */
#screenHistory { padding-bottom:calc(var(--s8) + 64px + env(safe-area-inset-bottom)); }

/* Tile ↔ card photo. Both snapshots fill the moving box and crop, so the square
   and the wide photo meet without stretching. */
::view-transition-group(photo) { animation-duration:.38s; animation-timing-function:cubic-bezier(.2,.9,.3,1); }
::view-transition-old(photo), ::view-transition-new(photo) { height:100%; object-fit:cover; overflow:clip; }
/* Moving between pages (home ↔ guides) crossfades like moving between screens,
   instead of cutting in a single frame; the dock, named on both, stays put. */
@view-transition { navigation:auto; }

/* The old screen stays opaque and the new one fades in over it. The default
   crossfade has both half-transparent mid-way, which reads as the screen dimming. */
::view-transition-old(root) { animation:none; }
::view-transition-new(root) { animation:vt-in .25s ease-out both; }
@keyframes vt-in { from{opacity:0} }

/* Pulling a card back to the grid: horizontal swipes are ours, vertical ones
   still scroll; the photo itself is all ours. Everything but the card fades. */
html:has(#screenResults.from-history.active) { touch-action:pan-y; }
#screenResults.from-history .card-photo { touch-action:none; }
#results .card { transform-origin:50% 150px; will-change:transform; }
.pulling body { overflow:hidden; }
:is(.hero, footer) { opacity:calc(1 - var(--pull, 0)); }
.screen.active.instant { animation:none; }

/* ---- deleting from history ---- */
.btn-danger { background:var(--error); color:var(--on-error); }
.btn-danger:disabled { opacity:.4; cursor:not-allowed; transform:none; }
.select-bar {
  position:fixed; z-index:10; left:50%; transform:translateX(-50%);
  bottom:calc(var(--s4) + env(safe-area-inset-bottom)); display:none;
}
.select-bar .btn { min-width:180px; box-shadow:var(--glass-shadow); }
.selecting .select-bar { display:block; }
.selecting .dock { display:none; }

.danger-row {
  display:none; align-items:center; justify-content:center; gap:var(--s2); width:100%;
  margin-top:var(--s4); padding:var(--s4); border-radius:var(--r-2xl);
  background:var(--surface); color:var(--error); font-weight:600;
}
#screenResults.from-history .danger-row { display:flex; }

.ctx { position:fixed; inset:0; z-index:50; -webkit-touch-callout:none; user-select:none; -webkit-user-select:none; }
.ctx-backdrop {
  position:absolute; inset:0; background:var(--scrim);
  -webkit-backdrop-filter:blur(22px) saturate(140%); backdrop-filter:blur(22px) saturate(140%);
}
.ctx-preview {
  position:fixed; object-fit:cover; border-radius:var(--r-xl); transform-origin:0 0;
  box-shadow:var(--shadow-ctx);
}
.ctx-menu {
  position:fixed; width:min(250px, 72vw); border-radius:var(--r-xl); overflow:hidden; transform-origin:50% 0;
  background:var(--glass); -webkit-backdrop-filter:var(--glass-blur); backdrop-filter:var(--glass-blur);
  box-shadow:var(--glass-shadow);
}
.ctx-menu button {
  display:flex; align-items:center; justify-content:space-between; width:100%;
  padding:var(--s3) var(--s4); font-size:var(--t-base); text-align:left;
}
.ctx-menu button + button { border-top:.5px solid var(--divider); }
.ctx-menu button:active { background:var(--offset); }
.danger { color:var(--error); }

.sheet { position:fixed; inset:0; z-index:60; }
.sheet-backdrop { position:absolute; inset:0; background:var(--scrim-sheet); animation:fade .2s ease-out; }
.sheet-panel {
  position:absolute; left:var(--s2); right:var(--s2); bottom:calc(var(--s2) + env(safe-area-inset-bottom));
  max-width:440px; margin:0 auto; display:flex; flex-direction:column; gap:var(--s2);
  animation:sheet-up .32s cubic-bezier(.2,.9,.3,1);
}
.sheet.closing .sheet-backdrop, .sheet.closing .sheet-panel { opacity:0; transition:opacity .2s; }
@keyframes sheet-up { from { transform:translateY(110%); } }
.sheet-group, .sheet-cancel { background:var(--surface); border-radius:var(--r-xl); overflow:hidden; }
.sheet-group p { padding:var(--s4); font-size:var(--t-xs); color:var(--muted); text-align:center; }
.sheet-group button, .sheet-cancel {
  display:block; width:100%; padding:var(--s4); font-size:var(--t-base); text-align:center;
}
.sheet-group button { border-top:.5px solid var(--divider); }
.sheet-cancel { font-weight:600; color:var(--primary); }

.errorbox {
  background:var(--surface); border-radius:var(--r-2xl); padding:var(--s8); text-align:center;
  display:flex; flex-direction:column; align-items:center; gap:var(--s3);
}
.errorbox h3 { font-size:var(--t-lg); letter-spacing:-.02em; color:var(--error); }
.errorbox p { font-size:var(--t-sm); color:var(--muted); max-width:44ch; }

footer {
  /* Bottom padding leaves room for the floating bar, so the page can scroll clear of it. */
  text-align:center; max-width:760px; margin:0 auto;
  padding:var(--s6) var(--s6) calc(var(--s8) + 80px + env(safe-area-inset-bottom));
  font-size:var(--t-xs); color:var(--faint);
}
footer p + p { margin-top:var(--s2); }
footer a { color:inherit; }

/* On a guide, the way to check the plant sits right under its photo. */
.photo-check {
  position:relative; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:var(--s2);
  padding:var(--s4) var(--s6); border-bottom:.5px solid var(--divider);
  color:var(--primary); font-size:var(--t-sm); font-weight:600; text-decoration:none;
  transition:background var(--t);
}
.photo-check:hover { background:var(--primary-subtle); }
.photo-check:active { background:var(--primary-highlight); }
/* The input covers the row, as on the home dropzone, so a tap lands on it
   directly. It keeps keyboard focus; the row draws the ring, inset because
   the card clips anything outside it. */
.photo-check input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.photo-check input:focus-visible { outline:none; }
.photo-check:has(input:focus-visible) { outline:2px solid var(--primary); outline-offset:-3px; }

/* The way from a care guide back to identifying. */
.signup { margin-top:var(--s8); display:flex; flex-direction:column; align-items:center; gap:var(--s3); text-align:center; }
.signup h2 { font-family:var(--display); font-size:var(--t-lg); font-weight:700; letter-spacing:-.02em; }
.signup p { font-size:var(--t-sm); color:var(--muted); max-width:44ch; }

@media (max-width:640px) {
  main { padding:var(--s6) var(--s4); }
  .card-head { grid-template-columns:1fr; }
  /* A fixed height, not max-height: the img inside is height:100%, which only
     resolves against a definite height — under max-height a tall photo spills out. */
  .card-photo { height:300px; }
  .care { grid-template-columns:1fr; }
  /* Edge to edge on a phone, like the Photos library. */
  .history-grid { margin:0 calc(-1 * var(--s4)); border-radius:0; }
  .history-head { padding:0 var(--s1); }
}
