@font-face {
  font-family: 'Faruma';
  src: url('fonts/Faruma.ttf') format('truetype');
  font-display: swap;
}

:root {
  --ink: #0b120c;
  --ink-soft: #111b13;
  --lime: #9cd560;
  --lime-soft: #c9ee9e;
  --lime-wash: rgba(156, 213, 96, 0.22);
  --cream: #f2eee4;
  --paper: #faf9f4;
  --white: #ffffff;
  --muted: #5c665c;
  --muted-strong: #4a544a;
  --line: rgba(11, 18, 12, 0.14);
  --line-soft: rgba(11, 18, 12, 0.08);
  --shadow: 0 18px 50px rgba(15, 35, 21, 0.14);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --shell: min(1240px, calc(100% - 40px));
  --dv: 'Faruma', 'MV Boli', serif;
  --heading: 'Varela Round', 'Nunito Sans', system-ui, sans-serif;
  --body: 'Nunito Sans', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--lime-soft); color: var(--ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: rgba(11, 18, 12, 0.28); border-radius: 999px; border: 2px solid var(--cream); }
::-webkit-scrollbar-thumb:hover { background: rgba(11, 18, 12, 0.45); }
* { scrollbar-color: rgba(11, 18, 12, 0.28) var(--cream); scrollbar-width: thin; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-color: rgba(11, 18, 12, 0.35); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--ink); }

h1, h2, h3 { margin: 0; font-family: var(--heading); font-weight: 400; letter-spacing: -0.03em; line-height: 1.04; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.015em; }
p { margin: 0; }
.measure { max-width: 66ch; }

.dv { font-family: var(--dv); direction: rtl; unicode-bidi: isolate; font-size: 1.12em; line-height: 1.7; }
.linkbtn { background: none; border: 0; padding: 0 0 0 10px; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(11, 18, 12, 0.35); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
.linkbtn:hover { text-decoration-color: var(--ink); }
.sci { font-style: italic; }
.num { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 12px; }

.shell { width: var(--shell); margin-inline: auto; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0 14px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 12px; font-family: var(--heading); font-size: 1.2rem; letter-spacing: -0.02em; }
.brand small { font-family: var(--body); font-size: 0.85rem; color: var(--muted); letter-spacing: 0; }
.top nav { display: flex; gap: 18px; font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--muted-strong); }
.top nav a:hover { color: var(--ink); }

/* The shelf: the one band that breaks the shell. 27 plates the owner photographed, butted edge to edge. */
.shelf { margin: 0 0 8px; }
.shelf-band { position: relative; width: 100vw; margin-left: calc(50% - 50vw); border-bottom: 1px solid var(--line); background: #a5a9a0; }
.shelf-band::before, .shelf-band::after { content: ''; position: absolute; top: 0; bottom: 1px; width: 56px; z-index: 3; pointer-events: none; }
.shelf-band::before { left: 0; background: linear-gradient(to right, var(--paper), rgba(250, 249, 244, 0)); }
.shelf-band::after { right: 0; background: linear-gradient(to left, var(--paper), rgba(250, 249, 244, 0)); }
.shelf-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.shelf-scroll::-webkit-scrollbar { display: none; }
.shelf-track { display: flex; width: max-content; }
.plate-w {
  flex: 0 0 auto; width: 150px; height: 200px; padding: 0; border: 0; border-radius: 0; position: relative; overflow: hidden;
  background: var(--tone, #a5a9a0); box-shadow: inset -1px 0 0 rgba(11, 18, 12, 0.10); color: var(--paper); cursor: pointer;
}
.plate-w img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.plate-w::after { content: ''; position: absolute; inset: 0; background: rgba(11, 18, 12, var(--veil, 0.10)); pointer-events: none; transition: background 180ms var(--ease-out); }
.plate-w .mark { position: absolute; top: 8px; left: 8px; width: 30px; height: 9px; padding: 4px 5px; box-sizing: content-box; z-index: 2; color: var(--ink); background: rgba(250, 249, 244, 0.94); border-radius: 2px; }
.plate-w .mark line, .plate-w .mark circle { stroke-width: 2.4; }
.plate-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 26px 10px 9px; text-align: left;
  background: linear-gradient(to top, rgba(11, 18, 12, 0.86), rgba(11, 18, 12, 0.52) 62%, rgba(11, 18, 12, 0));
  font-family: var(--heading); font-size: 0.9rem; letter-spacing: -0.015em; line-height: 1.15;
  opacity: 0; transform: translateY(6px); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.plate-w:hover .plate-cap, .plate-w:focus-visible .plate-cap { opacity: 1; transform: none; }
.plate-w:hover::after, .plate-w:focus-visible::after { background: rgba(11, 18, 12, 0); }
.plate-w:focus-visible { outline-offset: -3px; }
.shelf-rule { position: absolute; left: 0; bottom: -1px; height: 1px; width: 30%; background: rgba(11, 18, 12, 0.6); z-index: 4; pointer-events: none; transition: left 80ms linear; }
.shelf-cap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 20px; padding-top: 10px; }
.shelf-cap h2 { font-size: 1.2rem; letter-spacing: -0.015em; }
.shelf-cap p { font-size: 0.9rem; color: var(--muted-strong); }
.shelf-cap .linkbtn { padding: 0; font-size: inherit; }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.95fr); gap: 48px;
  padding: 26px 0 32px; align-items: start;
}
h1 { font-size: clamp(2.2rem, 4.1vw, 3.5rem); }
.hero-lede { margin-top: 16px; font-size: 1rem; color: var(--muted-strong); }
.hero-lede strong { color: var(--ink); font-weight: 700; }

.legend { margin-top: 18px; border-top: 1px solid var(--line); }
.legend-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--line-soft);
  background: none; border-inline: 0; border-top: 0; width: 100%; text-align: left; color: inherit;
  transition: background 180ms var(--ease-out);
}
.legend-row:hover { background: var(--cream); }
.legend-row[aria-pressed="true"] { background: var(--lime-wash); }
.legend-row .mark { width: 56px; height: 16px; }
.legend-row b { font-weight: 700; display: block; }
.legend-row span { display: block; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.legend-row .count { font-family: var(--heading); font-size: 1.45rem; letter-spacing: -0.02em; min-width: 3ch; text-align: right; }

/* Marks: state drawn by stroke pattern, never hue alone */
.mark { display: inline-block; width: 40px; height: 12px; vertical-align: middle; overflow: visible; }
.mark line, .mark circle, .mark path { stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }
.mark-verify line { stroke-dasharray: 5 4; }
.mark-banned line.x { stroke-width: 2.4; }
.mark-special line { stroke-width: 1.8; }

/* Tray */
.tray {
  position: sticky; top: 20px;
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 35, 21, 0.07); padding: 22px 22px 18px;
}
.tray-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tray-head h2 { font-size: 1.2rem; }
.tray-head .num { font-family: var(--heading); font-size: 1.2rem; color: var(--muted-strong); }
.tray table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 0.9rem; }
.tray th { text-align: left; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 0 6px 8px 0; border-bottom: 1px solid var(--line); }
.tray td { padding: 8px 6px 8px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tray td.pl { width: 40px; padding-right: 12px; }
.tray td.pl .idx { display: block; font-size: 0.75rem; color: var(--muted); line-height: 1; margin-bottom: 4px; }
.tray .thumb.sm { width: 28px; height: 28px; box-shadow: inset 0 0 0 1px var(--line-soft); }
.tray td.act { width: 32px; text-align: right; padding-right: 0; }
.tray input[type="number"] { width: 6ch; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.tray input[type="number"]:focus { border-color: var(--ink); }
.tray select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); max-width: 11ch; }
.tray table.ghost thead { display: none; }
.tray tr.empty td { padding: 16px 0 10px; color: var(--muted-strong); font-size: 0.95rem; border-bottom: 0; max-width: 34ch; }
.addbtn.remove { min-width: 36px; padding: 4px 9px; }
.addbtn.remove svg { display: block; width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.tray-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tray-row { animation: rise 420ms var(--ease-out); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tray-row { animation: none; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font-weight: 700; font-size: 0.95rem; transition: transform 180ms var(--ease-out), background 180ms var(--ease-out), color 180ms var(--ease-out);
}
.btn:hover { background: var(--ink-soft); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.btn.primary:hover { background: var(--lime-soft); border-color: var(--lime-soft); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--cream); }
.btn[disabled], .btn.primary[disabled] { background: var(--paper); border-color: var(--line); color: var(--muted-strong); cursor: not-allowed; transform: none; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }

/* Toolbar */
.workbench { padding: 8px 0 72px; }
.toolbar { display: grid; gap: 14px; padding: 18px 0 10px; border-top: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 5; }
.search { position: relative; }
.search input {
  width: 100%; min-height: 50px; padding: 12px 16px 12px 46px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--white); font-size: 1rem;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--ink); }
.search input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 12px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--muted-strong); fill: none; stroke-width: 2; }
.search kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
kbd { font: inherit; font-size: 0.75rem; color: var(--muted-strong); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; background: var(--paper); line-height: 1.4; }
.search input:focus ~ kbd { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips .label { font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.chip {
  min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white);
  font-size: 0.9rem; transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { color: inherit; opacity: 0.6; margin-left: 4px; }
.status { font-size: 0.9rem; color: var(--muted-strong); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Table */
.tablewrap { overflow-x: auto; margin-top: 6px; }
table.species { width: 100%; border-collapse: collapse; }
table.species th {
  text-align: left; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  padding: 12px 10px 10px 0; border-bottom: 1px solid var(--ink); white-space: nowrap;
}
table.species td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 0.95rem; }
table.species tr.sp:hover td { background: var(--cream); }
table.species tr.picked td { background: var(--lime-wash); }
table.species td.platecell { width: 60px; padding-right: 16px; }
.thumbopen { padding: 0; border: 0; background: none; display: block; line-height: 0; cursor: pointer; }
.thumb { display: block; width: 44px; height: 44px; object-fit: cover; object-position: 50% 42%; border-radius: 2px; background: var(--tone, var(--cream)); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 160ms var(--ease-out); }
.thumb-empty { box-shadow: inset 0 0 0 1px var(--line-soft); }
@media (hover: hover) { .thumbopen:hover .thumb { box-shadow: inset 0 0 0 1px var(--ink); } }
.rowopen { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; text-align: left; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.18em; text-decoration-thickness: 1px; transition: text-decoration-color 160ms var(--ease-out); }
.rowopen:hover, .rowopen:focus-visible { text-decoration-color: rgba(11, 18, 12, 0.45); }
table.species td.common { font-weight: 700; min-width: 16ch; max-width: 26ch; }
table.species td.common small { display: block; font-weight: 400; color: var(--muted); font-size: 0.85rem; }
table.species td.sci { min-width: 18ch; }
table.species td.sci small { display: block; font-style: normal; color: var(--muted); font-size: 0.85rem; }
table.species td.dvcell { min-width: 12ch; max-width: 20ch; color: var(--muted-strong); font-size: 0.95rem; }
table.species td.fam { color: var(--muted-strong); font-size: 0.95rem; }
table.species td.cls { white-space: nowrap; }
table.species td.cls .mark { margin-right: 8px; }
table.species td.cls .word { font-size: 0.9rem; }
table.species td.src { font-size: 0.85rem; color: var(--muted); max-width: 18ch; line-height: 1.7; }
.preflag { display: inline-block; margin-left: 6px; font-size: 0.75rem; color: var(--muted-strong); border-bottom: 1px dotted var(--line); cursor: help; white-space: nowrap; }
table.species td.src abbr { text-decoration: none; border-bottom: 1px dotted var(--line); cursor: help; }
table.species td.add { text-align: right; white-space: nowrap; }
.addbtn {
  min-width: 44px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white);
  font-size: 0.85rem; font-weight: 700; transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.addbtn:hover { border-color: var(--ink); }
.addbtn:active { transform: scale(0.96); transition-duration: 90ms; }
.addbtn[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); }
.addbtn[aria-pressed="true"]:hover { background: var(--lime-soft); }
.empty-rows td, p.empty-rows { text-align: center; color: var(--muted); padding: 40px 0; grid-column: 1 / -1; }
table.species tr.cursor td { box-shadow: inset 3px 0 0 var(--ink); }
.more { display: flex; justify-content: center; padding: 18px 0 0; }

/* Sections */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 40px; align-items: start; }
.section-head p { color: var(--muted-strong); font-size: 1rem; }
.steps { list-style: none; margin: 36px 0 0; padding: 0; counter-reset: step; display: grid; gap: 0; }
.steps li {
  counter-increment: step; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 20px; padding: 22px 0; border-top: 1px solid var(--line-soft);
}
.steps li::before {
  content: counter(step); font-family: var(--heading); font-size: 2.4rem; line-height: 1; letter-spacing: -0.03em; color: var(--ink);
}
.steps h3 { margin-bottom: 6px; }
.steps p { color: var(--muted-strong); max-width: 68ch; }
.steps .docs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.doc { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-size: 0.9rem; }
.doc svg { width: 14px; height: 14px; stroke: var(--ink); fill: none; stroke-width: 2; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px 40px; margin-top: 36px; }
.cols h3 { margin-bottom: 10px; }
.cols ul { margin: 0; padding-left: 18px; color: var(--muted-strong); }
.cols li { margin: 6px 0; }
.cols li b { color: var(--ink); font-weight: 700; }

.sources ol { margin: 30px 0 0; padding-left: 22px; color: var(--muted-strong); font-size: 0.95rem; columns: 2; column-gap: 40px; }
.sources li { margin: 0 0 10px; break-inside: avoid; overflow-wrap: anywhere; }
.sources li b { color: var(--ink); font-weight: 700; }
.credits { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 24px; }
.credits h3 { margin-bottom: 10px; }
.credits p { color: var(--muted-strong); }
.credits details { margin-top: 12px; }
.credits summary { cursor: pointer; font-weight: 700; }
.credits ol { margin: 12px 0 0; padding-left: 22px; font-size: 0.85rem; color: var(--muted-strong); columns: 2; column-gap: 40px; }
.credits li { break-inside: avoid; margin: 0 0 4px; overflow-wrap: anywhere; }
.credit { display: block; font-size: 0.75rem; color: var(--muted); }
.credit a { color: inherit; }

footer { padding: 34px 0 48px; border-top: 1px solid var(--line); color: var(--muted-strong); font-size: 0.9rem; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer .dv { direction: rtl; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: 0.95rem;
  transition: opacity 220ms var(--ease-out), transform 320ms var(--ease-out); pointer-events: none; z-index: 30;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.mobile-bar { display: none; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 28px; }
  .plateview { width: min(560px, 100%); }
  .tray { position: static; }
  .section-head { grid-template-columns: 1fr; gap: 16px; }
  .sources ol { columns: 1; }
}

@media (max-width: 720px) {
  :root { --shell: min(1240px, calc(100% - 28px)); }
  .top nav { display: none; }
  .toolbar { position: static; }
  .search-row { grid-template-columns: 1fr; }
  .plateview { margin: auto 0 0; width: 100%; height: min(92dvh, 100%); max-height: min(92dvh, 100%); border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -18px 50px rgba(15, 35, 21, 0.16); }
  .plateview .pv-photo img { max-height: 48dvh; }
  .plate-w { width: 105px; height: 140px; }
  .plate-w .mark { top: 8px; left: 8px; width: 26px; }
  .search kbd { display: none; }
  .pv-close { min-width: 44px; min-height: 44px; }
  .credits ol { columns: 1; }
  .tablewrap { overflow: visible; }
  table.species thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.species tr.sp { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "plate common add" "plate sci add" "dv dv dv" "meta meta meta" "cls src src"; gap: 2px 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
  table.species tr.sp:hover td, table.species tr.picked td { background: transparent; }
  table.species tr.picked { background: var(--lime-wash); margin-inline: -10px; padding-inline: 10px; border-radius: 12px; }
  table.species td { display: block; padding: 0 !important; border: 0; max-width: none; }
  table.species td.platecell { grid-area: plate; width: auto; align-self: start; }
  table.species td.platecell .thumb { width: 56px; height: 56px; }
  table.species td.common { grid-area: common; }
  table.species td.sci { grid-area: sci; }
  table.species td.dvcell { grid-area: dv; text-align: left; }
  table.species td.fam { grid-area: meta; }
  table.species td.cls { grid-area: cls; margin-top: 6px; }
  table.species td.src { grid-area: src; margin-top: 6px; text-align: right; white-space: normal; }
  table.species td.add { grid-area: add; align-self: start; }
  .mobile-bar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20;
    justify-content: space-between; align-items: center; gap: 10px;
    background: var(--ink); color: var(--paper); padding: 10px 12px 10px 18px; border-radius: 999px; box-shadow: var(--shadow);
  }
  .mobile-bar .btn { min-height: 38px; }
  body { padding-bottom: 76px; }
  .steps li { grid-template-columns: 48px 1fr; gap: 12px; }
  .steps li::before { font-size: 1.8rem; }
}

@media print {
  .top nav, .toolbar, .tray-actions, .addbtn, .mobile-bar, .toast, .more { display: none !important; }
  .tray { box-shadow: none; position: static; }
  body { background: #fff; font-size: 11px; }
  .section { padding: 24px 0; }
  table.species tr.picked td { background: var(--lime-wash); }
  .thumb, .lens, .shelf, .plateview, .safety .mark { display: none !important; }
}

/* Plate drawer */
.plateview {
  margin: 0 0 0 auto; width: min(560px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; padding: 0; border: 0;
  border-left: 1px solid var(--line); background: var(--paper); color: var(--ink); box-shadow: -24px 0 60px rgba(15, 35, 21, 0.16);
}
.plateview::backdrop { background: rgba(11, 18, 12, 0.38); }
.plateview[open] { animation: pv-in 260ms var(--ease-out); }
.plateview[open]::backdrop { animation: pv-fade 200ms var(--ease-out); }
@keyframes pv-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes pv-fade { from { opacity: 0; } to { opacity: 1; } }
.pv-scroll { height: 100%; overflow-y: auto; padding: 20px 24px 0; display: flex; flex-direction: column; }
.pv-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; }
.pv-close { min-width: 36px; min-height: 36px; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: var(--white); display: inline-flex; align-items: center; justify-content: center; }
.pv-close:hover { border-color: var(--ink); }
.pv-close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.pv-photo { margin-top: 16px; }
.pv-photo .mount { display: block; padding: 8px; background: var(--cream); box-shadow: inset 0 0 0 1px var(--line); }
.pv-photo img { display: block; width: auto; max-width: 100%; height: auto; max-height: 56dvh; margin: 0 auto; background: var(--tone, var(--cream)); }
.pv-photo .noplate { min-height: 200px; }
.plateview .credit { text-align: right; margin-top: 6px; }
.pv-names { margin-top: 18px; }
.pv-names h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
.pv-sci { margin-top: 6px; font-size: 1rem; }
.pv-sci .auth { font-size: 0.85rem; color: var(--muted); }
.pv-alt { margin-top: 2px; font-size: 0.85rem; color: var(--muted); }
.pv-dv { margin-top: 4px; font-size: 0.95rem; color: var(--muted-strong); }
.plate-facts { margin: 18px 0 0; }
.plate-facts > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.plate-facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding-top: 3px; }
.plate-facts dd { margin: 0; font-size: 0.95rem; }
.plate-facts dd.cls .mark { margin-right: 8px; }
.plate-facts dd.srcs { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted-strong); }
.plate-facts dd.srcs b { color: var(--ink); }
.pv-hint { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.95rem; color: var(--muted-strong); }
.pv-pre { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pv-pre .lab { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 6px; }
.pv-pre p { font-size: 0.95rem; margin-top: 6px; }
.pv-pre .kind { font-size: 0.85rem; color: var(--muted-strong); }
.pv-pre a { overflow-wrap: anywhere; }
.pv-note { margin-top: 12px; font-size: 0.9rem; color: var(--muted-strong); }
.pv-foot { position: sticky; bottom: 0; margin-top: auto; background: var(--paper); border-top: 1px solid var(--line); padding: 14px 0 20px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pv-nav { display: flex; gap: 8px; }
.pv-nav .btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pv-nav .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.plateview.turning .pv-photo, .plateview.turning .pv-names { opacity: 0; transition: opacity 90ms var(--ease-out); }
.pv-photo, .pv-names { transition: opacity 180ms var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  .plateview[open], .plateview[open]::backdrop { animation: none; }
  .pv-photo, .pv-names { transition: none; }
  .plate-cap, .plate-w::after, .shelf-rule { transition: none; }
  .lens { transition: none; }
}

/* Hover lens: pointer fine only, fires from the thumbnail after 260ms, never from the row */
.lens { position: absolute; z-index: 25; width: 200px; padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 35, 21, 0.07); opacity: 0; transform: scale(0.96); transform-origin: top left; pointer-events: none; transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out); }
.lens.show { opacity: 1; transform: none; }
.lens img { display: block; width: 188px; height: 250px; object-fit: cover; border-radius: 8px; background: var(--tone, var(--cream)); }
.lens .credit { padding: 7px 4px 2px; font-size: 0.85rem; color: var(--muted); line-height: 1.4; }

/* Tray safety line: refused classes never reach Makudi unnoticed */
.safety { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--ink); display: grid; gap: 6px; }
.safety span { display: flex; align-items: center; gap: 10px; }
.safety .mark { flex: 0 0 auto; }
.safety b { font-weight: 700; }
.tray tr.starter td { padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 0.9rem; }
.tray tr.starter td.pl { padding-top: 8px; }
.tray tr.starter .addbtn { min-height: 32px; padding: 2px 10px; }
.tray tr.empty td { padding-bottom: 8px; }
