@font-face {
  font-family: Plant;
  src: url("fonts/Vera.ttf");
}
@font-face {
  font-family: Plant;
  src: url("fonts/VeraBd.ttf");
  font-weight: 700;
}
:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #fff;
  --ink: #202426;
  --muted: #555b60;
  --line: #cbd0cf;
  --red: #b8002f;
  --soft: #f9e9ed;
  --botanical: #225b3d;
  --photo-bg: #f1f3ee;
}
body.dark {
  color-scheme: dark;
  --bg: #1b1e20;
  --surface: #24292c;
  --ink: #edf1ef;
  --muted: #b9c3be;
  --line: #58625d;
  --red: #ff8fab;
  --soft: #3c2630;
  --botanical: #a0d7b3;
  --photo-bg: #1b221e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.6 Plant,
    system-ui,
    sans-serif;
}
body.has-selection { padding-bottom: 6rem; }
a {
  color: var(--red);
  text-underline-offset: 3px;
}
button,
input,
select {
  font: inherit;
}
button,
input,
select {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 0.6rem 0.75rem;
}
button {
  cursor: pointer;
}
button:hover {
  border-color: var(--red);
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--red);
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
body.dark .primary { color: #24151b; }
.primary:hover { filter: brightness(0.94); }
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  max-width: 1440px;
  margin: auto;
  padding: 1rem 2rem;
}
nav button {
  margin-left: auto;
}
.heading {
  max-width: 1440px;
  margin: auto;
  padding: 1.5rem 2rem 1rem;
  border-top: 6px solid var(--red);
}
h1 {
  font:
    700 clamp(2rem, 4vw, 2.8rem) / 1.15 Georgia,
    serif;
  margin: 0.2rem 0 0.75rem;
}
.heading > p { margin: 0.5rem 0; }
.heading .eyebrow { margin-bottom: 0.75rem; }
nav a[aria-current="page"] { font-weight: 700; }
h2,
h3 {
  font-family: Georgia, serif;
}
.eyebrow {
  color: var(--red);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.credit,
.meta {
  color: var(--muted);
  font-size: 0.85rem;
}
.notice {
  background: var(--soft);
  border-left: 4px solid var(--red);
  padding: 0.65rem 1rem;
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 0 2rem;
}
.searchbar,
.exportbar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
}
.searchbar > label:first-child {
  flex: 1;
  min-width: 230px;
}
label > input,
label > select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
}
.layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}
aside {
  min-width: 0;
}
aside details {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.65rem;
}
summary {
  cursor: pointer;
  font-weight: 700;
}
fieldset {
  border: 0;
  border-bottom: 1px solid var(--line);
  margin: 0.6rem 0;
  padding: 0.7rem 0;
}
legend {
  font-weight: 700;
}
fieldset label {
  display: block;
  padding: 0.2rem 0;
}
.options {
  max-height: 190px;
  overflow: auto;
}
.options label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.options input {
  width: 18px;
  height: 18px;
}
.resultbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
#plants.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
  gap: 1rem;
}
.card {
  display: flex;
  flex-direction: column;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-width: 0;
}
.card.is-selected { border-color: var(--botanical); }
.card h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 0.6rem 0;
}
.card h2 a { color: var(--botanical); text-decoration: none; }
.card h2 a:hover { text-decoration: underline; }
.card > p { margin: 0.15rem 0; }
.card .common-name { font-size: 0.95rem; }
.plant-photo-link { display: block; background: var(--photo-bg); border-radius: 3px; }
.card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: contain;
}
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.profile-link { font-size: 0.85rem; padding: 0.4rem 0; }
.select-plant {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}
.select-plant.is-selected { color: var(--botanical); }
.select-plant input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 20px;
  accent-color: var(--botanical);
}
.card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  font-size: 0.9rem;
}
.card dt {
  font-weight: 700;
}
.card dd {
  margin: 0;
}
.table-wrap {
  overflow: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  min-width: 850px;
  background: var(--surface);
  font-size: 0.85rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--line);
  padding: 0.6rem;
}
th {
  background: var(--soft);
}
.basket {
  margin: 1.25rem 0 1.75rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 4px;
  scroll-margin-top: 1rem;
}
.basket-heading, .selection-actions, .download-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.selection-actions { justify-content: start; margin: 0.5rem 0; }
.download-actions { flex: 0 1 auto; }
.download-actions .primary { min-width: min(290px, 100%); }
.basket h2 {
  margin: 0;
  font-size: 1.45rem;
}
.basket #selection { margin: 0.25rem 0 0; font-variant-numeric: tabular-nums; }
.selection-actions button { font-size: 0.85rem; }
.selection-help { margin: 0.75rem 0; color: var(--muted); font-size: 0.85rem; }
.exportbar > label {
  flex: 1;
  min-width: min(240px, 100%);
  font-size: 0.85rem;
}
.exportbar .primary { flex: 1; min-width: min(270px, 100%); }
.complete-downloads { margin-top: 0.75rem; font-size: 0.8rem; color: var(--muted); }
#export-options { font-size: 0.85rem; }
#export-options > summary { font-weight: 400; padding: 0.25rem 0; }
#export-options .exportbar { margin-top: 0.75rem; }
.basket #progress:empty, .basket #reconcile:empty { display: none; }
.selection-shortcut {
  position: fixed;
  z-index: 5;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(540px, calc(100% - 2rem));
  padding: 0.65rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 20px #0002;
  font-size: 0.85rem;
}
.selection-shortcut > span { font-weight: 700; font-variant-numeric: tabular-nums; }
.selection-shortcut .primary { font-size: 0.85rem; }
.basket p {
  overflow-wrap: anywhere;
}
#error {
  padding: 1rem;
  border: 2px solid var(--red);
}
dialog {
  max-width: 1100px;
  width: calc(100% - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
}
.dialog-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.dialog-toolbar button { min-height: 44px; }
.dialog-toolbar button span { margin-left: 0.5rem; font-size: 1.1rem; }
#detail-body { padding: 1.5rem; }
dialog::backdrop {
  background: #0008;
}
dialog h2 {
  color: var(--botanical);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.2;
  font-style: italic;
  font-weight: 400;
  margin: 0.25rem 0 0.5rem;
}
.profile-heading .eyebrow { margin: 0; font-size: 0.75rem; }
.profile-common { margin: 0; font-size: 1.05rem; }
.profile-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 1.5rem; margin: 1rem 0 1.5rem; }
.profile-selection a { font-size: 0.85rem; }
.profile-overview { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.5rem; }
.profile-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-content: start; }
.profile-gallery figure { min-width: 0; margin: 0; }
.profile-gallery figure:only-child { grid-column: 1 / -1; }
.profile-gallery img { width: 100%; height: 250px; max-height: none; object-fit: contain; display: block; background: var(--photo-bg); border-radius: 3px; }
.profile-gallery figcaption { color: var(--muted); font-size: 0.75rem; margin-top: 0.5rem; overflow-wrap: anywhere; }
.profile-gallery .photo-credit { font-size: inherit; margin: 0.25rem 0 0; line-height: 1.5; }
.profile-basics { padding: 1rem; background: var(--photo-bg); border-radius: 4px; }
.profile-basics h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.profile-basics dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 0; }
.profile-basics dt { font-size: 0.75rem; margin: 0; color: var(--muted); }
.profile-basics dd { font-size: 0.85rem; margin-top: 0.2rem; overflow-wrap: anywhere; }
.unknown-value { color: var(--muted); font-style: italic; }
.profile-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
.profile-notes, .profile-references { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 0.5rem; min-width: 0; }
.profile-notes h3, .profile-references h3 { font-size: 1.25rem; margin: 0.5rem 0 1rem; }
.profile-notes dl { margin: 0; font-size: 0.9rem; }
.profile-notes dt { font-size: 0.8rem; color: var(--muted); }
.profile-notes dl > div:first-child dt { margin-top: 0; }
.profile-care { grid-column: 1 / -1; }
.profile-references section { display: inline-block; vertical-align: top; width: 49%; padding-right: 1rem; }
.profile-references h4 { margin: 0.75rem 0; font-size: 0.9rem; }
.profile-references p, .profile-references details { font-size: 0.85rem; }
.profile-references details { padding: 0.75rem 0; }
.profile-reviewed { border-top: 1px solid var(--line); padding-top: 1rem; margin: 1rem 0 0; }
dialog dt {
  font-weight: 700;
  margin-top: 0.8rem;
}
dialog dd {
  margin: 0.2rem 0 0;
}
dialog a {
  overflow-wrap: anywhere;
}
dialog img {
  max-width: 100%;
  max-height: 240px;
}
footer {
  max-width: 1440px;
  margin: auto;
  padding: 1.5rem 2rem;
  color: var(--muted);
}
.skip {
  position: absolute;
  top: -80px;
}
.skip:focus {
  top: 5px;
  left: 5px;
  z-index: 3;
  background: var(--surface);
  padding: 1rem;
}
@media (max-width: 760px) {
  main {
    padding: 0 1rem;
  }
  .heading {
    padding: 1.5rem 1rem;
  }
  nav {
    padding: 1rem;
    gap: 0.9rem;
  }
  .layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .searchbar > label {
    width: 100%;
    min-width: 0;
  }
  .searchbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .searchbar > label:first-child { grid-column: 1 / -1; min-width: 0; }
  .basket {
    padding: 1rem;
  }
  .resultbar {
    align-items: start;
  }
  #plants.cards {
    grid-template-columns: 1fr;
  }
  #filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
  }
  .exportbar > label {
    width: 100%;
  }
  .credit {
    font-size: 0.8rem;
  }
  .profile-overview { grid-template-columns: 1fr; }
  .profile-basics { order: -1; }
  .profile-sections { grid-template-columns: 1fr; }
  .profile-references section { display: block; width: 100%; padding-right: 0; }
  #detail-body { padding: 1rem; }
  .dialog-toolbar { padding: 0.5rem 1rem; }
}
@media (max-width: 460px) {
  .selection-shortcut { width: calc(100% - 1rem); gap: 0.5rem; bottom: 0.5rem; }
  .selection-shortcut .primary { padding: 0.6rem; font-size: 0.75rem; }
  .profile-gallery { grid-template-columns: 1fr; }
  .profile-gallery img { height: 240px; }
}
@media print {
  nav,
  .searchbar,
  aside,
  .basket,
  .selection-shortcut,
  footer,
  button {
    display: none;
  }
  .layout {
    display: block;
  }
  body {
    background: white;
    color: black;
  }
}
