:root {
  color-scheme: light;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-soft: 0 5px 18px rgba(35, 55, 39, .06);
  --shadow-popover: 0 14px 36px rgba(25, 40, 30, .14);
  --text-measure: 68ch;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 18px;
  --bg: #f5f8f3;
  --surface: rgba(255, 255, 255, .94);
  --surface-raised: #f0f5ee;
  --surface-glass: rgba(250, 253, 248, .86);
  --hero-tint: #e7f0e2;
  --ink: #26372d;
  --muted: #6f7f73;
  --line: rgba(54, 91, 63, .15);
  --blue: #477a54;
  --cyan: #8ebc91;
  --pink: #e9a9a1;
  --green: #72a982;
  --gradient: linear-gradient(110deg, #477a54, #78aa83);
  --glow-one: rgba(118, 164, 111, .16);
  --glow-two: rgba(190, 218, 174, .22);
  --glow-three: rgba(237, 169, 161, .13);
  --sans: "DM Sans", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
  --dock-h: 80px;
}

* { box-sizing: border-box; }
.icon-library { width: 0; height: 0; position: absolute; overflow: hidden; }
.ui-icon { width: 1.15em; height: 1.15em; display: inline-block; flex: 0 0 auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
button .ui-icon { pointer-events: none; }
html { min-height: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 120px;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(ellipse at 5% 5%, var(--glow-one), transparent 37rem),
    radial-gradient(ellipse at 94% 19%, var(--glow-two), transparent 39rem),
    radial-gradient(ellipse at 77% 92%, var(--glow-three), transparent 34rem),
    var(--bg);
  transition: color .25s, background-color .25s;
}
body.dark-theme {
  color-scheme: dark;
  --blue: #9fcca7;
  --cyan: #c2e2c1;
  --green: #91be99;
  --bg: #151b17;
  --surface: #202821;
  --surface-raised: #29342c;
  --surface-glass: rgba(29, 38, 32, .9);
  --hero-tint: #26342a;
  --ink: #f1f5ef;
  --muted: #a8b7a9;
  --line: rgba(210, 231, 211, .13);
  --glow-one: rgba(67, 115, 72, .25);
  --glow-two: rgba(108, 128, 74, .14);
  --glow-three: rgba(79, 106, 74, .12);
  background:
    radial-gradient(ellipse at 14% 4%, var(--glow-one), transparent 38rem),
    radial-gradient(ellipse at 89% 28%, var(--glow-two), transparent 38rem),
    radial-gradient(ellipse at 77% 92%, var(--glow-three), transparent 34rem),
    var(--bg);
}
html:has(body.dark-theme) { background: #151b17; }
html:has(body.dark-theme[data-palette="lavender"]) { background: #181620; }
html:has(body.dark-theme[data-palette="rose"]) { background: #1d171a; }
html:has(body.dark-theme[data-palette="sand"]) { background: #1d1a15; }
a { color: inherit; text-decoration: none; }
button, input, select { color: inherit; font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.visually-hidden {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}
.shell { width: min(1240px, calc(100% - 44px)); margin-inline: auto; }

.topline {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 18px;
  color: #f7f9ff;
  background: var(--gradient);
  font-size: 10px;
  letter-spacing: .15em;
  text-align: center;
  text-transform: uppercase;
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 8;
  border-bottom: 1px solid var(--line);
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(1.3);
}
.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: -.07em; }
.brand-mark {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: var(--gradient);
  box-shadow: 0 7px 18px rgba(80, 125, 235, .25);
  font-size: 21px;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.botanist-header-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; margin-left: 4px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--blue) 24%, transparent); border-radius: 13px; color: #fff; background: var(--gradient); box-shadow: 0 5px 13px color-mix(in srgb, var(--blue) 18%, transparent); font-size: 11px; font-weight: 800; white-space: nowrap; transition: transform .2s, box-shadow .2s; }
.botanist-header-button:hover { transform: translateY(-2px); box-shadow: 0 8px 17px color-mix(in srgb, var(--blue) 26%, transparent); }
.botanist-header-button .ui-icon { width: 17px; height: 17px; }
.palette-select {
  width: auto;
  min-width: 124px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  border-color: transparent;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 5px 13px color-mix(in srgb, var(--blue) 18%, transparent);
  font-size: 11px;
  font-weight: 700;
}
.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  transition: transform .2s, border-color .2s;
}
.icon-button:hover { transform: translateY(-2px); border-color: var(--blue); }
.install-app-button { font-size: 20px; font-weight: 800; }
.install-app-button[hidden] { display: none; }
.collection-open { position: relative; }
.collection-open span { min-width: 16px; height: 16px; position: absolute; top: -5px; right: -5px; display: grid; place-items: center; padding: 0 4px; border-radius: 999px; color: #fff; background: var(--blue); font-size: 9px; font-weight: 800; }

.main-content { min-height: 70vh; padding-top: 32px; }
.page { animation: page-in .45s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.hero-card {
  min-height: 340px;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 30px;
  background: linear-gradient(125deg, var(--surface) 0%, var(--hero-tint) 100%);
  box-shadow: 0 24px 66px rgba(45, 83, 52, .12);
}
.hero-copy { align-self: center; padding: clamp(28px, 5vw, 66px); }
.hero-copy .eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.eyebrow { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); }
h1 { margin: 10px 0 14px; font-family: var(--serif); font-size: clamp(34px, 5vw, 57px); font-weight: 600; letter-spacing: -.045em; line-height: 1.08; }
h2 { margin-bottom: 10px; font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: -.025em; }
h3 { margin: 0; font-size: 15px; font-weight: 800; }
.gradient-text { color: transparent; background: var(--gradient); background-clip: text; -webkit-background-clip: text; }
.hero-copy > p { max-width: 510px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-art { min-height: 340px; position: relative; overflow: hidden; background: #e2eee0; }
.hero-art::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, rgba(27,38,68,.08), transparent 48%), linear-gradient(0deg, rgba(22,35,61,.32), transparent 38%); }
.hero-art img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.hero-art-label { position: absolute; z-index: 1; bottom: 20px; left: 23px; color: #fff; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.hero-orbit {
  width: 108px;
  height: 108px;
  position: absolute;
  z-index: 1;
  top: 24px;
  right: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .17);
  backdrop-filter: blur(10px);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.25;
  text-align: center;
  transform: rotate(8deg);
}
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 8px 19px rgba(81, 116, 231, .2);
  font-size: 12px;
  font-weight: 800;
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 11px 24px rgba(81, 116, 231, .28); filter: saturate(1.08); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.button.secondary { color: var(--blue); border: 1px solid rgba(87,121,245,.2); background: rgba(87,121,245,.09); box-shadow: none; }
.button.ghost { color: var(--muted); border: 1px solid var(--line); background: var(--surface); box-shadow: none; }
.button.small { min-height: 34px; padding-inline: 12px; border-radius: 10px; font-size: 10px; }
.button.full { width: 100%; }

.home-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.home-fact {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.home-fact > .ui-icon { width: 19px; height: 19px; color: var(--blue); }
.home-fact strong, .home-fact small { display: block; }
.home-fact strong { font-size: 13px; }
.home-fact small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.surface-card {
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 9px 25px rgba(48, 70, 130, .055);
}
.home-widget { min-height: 210px; padding: 22px; }
.widget-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.widget-head h2 { margin: 0; }
.muted { color: var(--muted); }
.challenge-badge { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--gradient); font-size: 17px; }
.challenge-badge .ui-icon { width: 18px; height: 18px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.field label { color: var(--muted); font-size: 10px; font-weight: 700; }
input, select {
  width: 100%;
  min-height: 41px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-raised);
  font-size: 11px;
}
input::placeholder { color: #98a2b6; }
input:focus, select:focus { border-color: var(--blue); outline: 2px solid rgba(87,121,245,.12); }
.status-message { min-height: 18px; margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 15px; }
.quick-link {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  transition: transform .2s, border-color .2s;
}
.quick-link:hover { transform: translateY(-3px); border-color: rgba(87,121,245,.5); }
.quick-link .quick-link-icon { width: 34px; height: 34px; display: grid; flex: 0 0 34px; place-items: center; border-radius: 11px; color: #fff; background: var(--gradient); }
.quick-link .quick-link-icon .ui-icon { width: 17px; height: 17px; }
.quick-link span:last-child { margin-left: auto; color: var(--blue); }
.button > .ui-icon { width: 16px; height: 16px; }
.button.secondary > .ui-icon, .button.ghost > .ui-icon { color: var(--blue); }

.page-title-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 12px 0 22px; }
.page-title-row h1 { margin-bottom: 8px; font-size: clamp(34px, 4vw, 48px); }
.catalog-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .7fr) minmax(180px, .7fr); align-items: end; gap: 10px; margin: 18px 0 16px; }
.search-wrap { min-width: 0; position: relative; grid-column: 1 / -1; }
.search-input { min-height: 45px; padding-left: 15px; border-radius: 13px; background: var(--surface); box-shadow: 0 4px 12px rgba(45, 83, 52, .04); }
.search-suggestion { position: absolute; z-index: 7; top: calc(100% + 6px); right: 0; left: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 12px 30px rgba(35, 55, 39, .15); }
.search-suggestion-option { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border: 0; color: var(--ink); background: transparent; text-align: left; }
.search-suggestion-option:hover, .search-suggestion-option:focus-visible { background: var(--surface-raised); }
.search-suggestion-title { overflow: hidden; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.search-suggestion-latin { overflow: hidden; color: var(--muted); font-family: var(--serif); font-size: 10px; font-style: italic; text-overflow: ellipsis; white-space: nowrap; }
.catalog-control, .catalog-sort-label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.catalog-control select, .catalog-sort-label select { min-height: 40px; width: 100%; border-radius: 12px; background: var(--surface); font-size: 10px; }
.care-filter-disclosure { margin: 0 0 13px; border-bottom: 1px solid var(--line); }
.care-filter-disclosure summary { min-height: 36px; position: relative; display: flex; align-items: center; gap: 8px; padding-left: 28px; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 700; list-style: none; }
.care-filter-disclosure summary::-webkit-details-marker { display: none; }
.care-filter-disclosure summary::before, .care-filter-disclosure summary::after { content: ""; position: absolute; top: 50%; left: 8px; background: var(--blue); transform: translateY(-50%); }
.care-filter-disclosure summary::before { width: 10px; height: 2px; }
.care-filter-disclosure summary::after { width: 2px; height: 10px; left: 12px; }
.care-filter-disclosure[open] summary::after { opacity: 0; }
.care-filter-disclosure summary span { margin-left: auto; font-size: 9px; font-weight: 500; }
.care-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 8px 0 12px; }
.care-filter-label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.care-filter-label select { min-height: 38px; width: 100%; border-radius: 11px; background: var(--surface); font-size: 10px; }
.catalogue-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.catalog-count { margin: 14px 0 13px; color: var(--muted); font-size: 11px; }
.flower-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.flower-grid[hidden] { display: none; }
.search-empty[hidden] { display: none; }
.search-empty { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 20px; color: var(--muted); text-align: center; animation: search-empty-appear .35s ease both; }
.search-empty strong { color: var(--ink); font-family: var(--serif); font-size: clamp(20px, 3vw, 26px); font-weight: 600; }
.search-empty strong .ui-icon { width: 22px; height: 22px; color: var(--blue); }
.search-empty span { max-width: 360px; font-size: 12px; line-height: 1.6; }
@keyframes search-empty-appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.flower-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(45, 83, 52, .07);
  transition: transform .25s, box-shadow .25s, border-color .25s;
  animation: card-in .38s ease both;
}
.flower-card:hover { transform: translateY(-5px); border-color: rgba(71,122,84,.4); box-shadow: 0 18px 38px rgba(45, 83, 52, .15); }
@keyframes card-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.flower-photo-wrap { height: 205px; position: relative; overflow: hidden; background: linear-gradient(135deg,#e7efe2,#e4f1e8 52%,#f9e7e4); }
.flower-photo { width: 100%; height: 100%; object-fit: cover; transition: transform .45s; }
.flower-card:hover .flower-photo { transform: scale(1.045); }
.flower-photo-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: color-mix(in srgb, var(--blue) 70%, var(--muted)); background: radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--surface) 92%, transparent), transparent 42%), linear-gradient(135deg, var(--surface-raised), var(--surface)); font-size: 10px; font-weight: 700; }
.flower-photo-placeholder[hidden] { display: none; }
.flower-photo-placeholder .ui-icon { width: 38px; height: 38px; }
.flower-photo-wrap::after { position: absolute; inset: 45% 0 0; content: ""; pointer-events: none; background: linear-gradient(0deg,rgba(12,20,36,.34),transparent); }
.flower-tag, .flower-number { position: absolute; z-index: 1; top: 11px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.36); border-radius: 999px; color: white; background: rgba(25,34,56,.45); backdrop-filter: blur(9px); font-size: 9px; font-weight: 700; }
.flower-tag { left: 11px; }
.flower-number { right: 11px; }
.favorite-button {
  width: 38px;
  height: 38px;
  position: absolute;
  z-index: 2;
  top: 48px;
  right: 11px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%;
  color: #fff;
  background: rgba(25,34,56,.45);
  backdrop-filter: blur(9px);
}
.favorite-button .ui-icon { width: 19px; height: 19px; }
.favorite-button.is-favorite { color: #d5527a; background: #fff; }
.plant-note-indicator {
  width: 34px;
  height: 34px;
  position: absolute;
  z-index: 2;
  top: 50px;
  right: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  color: #39794c;
  background: rgba(246, 252, 242, .96);
  box-shadow: 0 3px 10px rgba(23, 53, 31, .16);
  backdrop-filter: blur(9px);
}
.plant-note-indicator .ui-icon { width: 17px; height: 17px; }
body.dark-theme .plant-note-indicator { color: #c7efc6; background: rgba(34, 62, 42, .96); }
.photo-credit { max-width: calc(100% - 22px); position: absolute; z-index: 2; bottom: 9px; left: 11px; overflow: hidden; color: #fff; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.photo-credit:hover { text-decoration: underline; }
.flower-info { min-height: 116px; display: flex; flex-direction: column; padding: 14px; }
.flower-card-name { min-width: 0; }
.flower-card-name h3 { overflow: hidden; text-overflow: ellipsis; }
.flower-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.flower-title-row > span { font-size: 20px; }
.flower-latin { margin-top: 4px; color: var(--muted); font-family: var(--serif); font-size: 11px; font-style: italic; }
.taxonomy-line { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.plant-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.plant-tag { padding: 5px 8px; border-radius: 999px; color: #477a54; background: rgba(114,169,130,.12); font-size: 9px; font-weight: 700; }
.microclimate { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.microclimate-chip { min-height: 23px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-raised); font-size: 8px; line-height: 1.2; }
.microclimate-chip > .ui-icon { width: 13px; height: 13px; color: var(--blue); }
.plant-mark { width: 22px; height: 22px; display: block; flex: 0 0 auto; margin-top: 2px; color: var(--blue); }
body.dark-theme .microclimate-chip > .ui-icon, body.dark-theme .plant-mark { color: var(--cyan); }
body.dark-theme .button.secondary { color: var(--ink); border-color: color-mix(in srgb, var(--cyan) 30%, transparent); background: color-mix(in srgb, var(--cyan) 12%, var(--surface)); }
body.dark-theme .button.secondary > .ui-icon, body.dark-theme .button.ghost > .ui-icon { color: var(--cyan); }
.flower-description { display: -webkit-box; overflow: hidden; margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.botanical-meta { margin: 7px 0 0; color: var(--muted); font-size: 9px; }
.flower-card-actions { display: flex; gap: 7px; margin-top: auto; padding-top: 10px; }
.flower-card-actions .button { flex: 1; padding-inline: 8px; }
.collection-card .flower-info { min-height: 112px; }
.collection-toggle { white-space: nowrap; }
.collection-toggle.is-saved { color: #a43f62; background: rgba(191,87,114,.12); }
.collection-no-photo { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); background: var(--surface-raised); font-size: 54px; }
.collection-no-photo .ui-icon { width: 54px; height: 54px; color: var(--blue); }
.taxonomy-details { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 10px; }
.taxonomy-details summary { cursor: pointer; color: var(--blue); font-weight: 750; }
.taxonomy-details .flower-facts { margin-top: 10px; }
.detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.detail-action-button { min-width: 0; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface-raised); box-shadow: none; font-size: 11px; font-weight: 750; transition: border-color .2s, background .2s, transform .2s; }
.detail-action-button > span { min-width: 0; }
.favorite-detail-button { white-space: nowrap; }
.care-pdf-button { line-height: 1.35; }
.detail-action-button:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); background: color-mix(in srgb, var(--blue) 7%, var(--surface)); box-shadow: none; }
.detail-action-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 35%, transparent); outline-offset: 2px; }
.detail-action-button > .ui-icon { width: 17px; height: 17px; flex: 0 0 auto; color: var(--blue); }
.favorite-detail-button.is-favorite { border-color: color-mix(in srgb, #c45173 32%, var(--line)); color: #a43f62; background: color-mix(in srgb, #c45173 9%, var(--surface)); }
.favorite-detail-button.is-favorite > .ui-icon { color: #c45173; fill: color-mix(in srgb, #c45173 20%, transparent); }
.care-pdf-button:disabled { cursor: wait; opacity: .65; transform: none; }
.care-pdf-status { min-height: 1em; margin: 6px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.admin-panel { width: min(420px, calc(100% - 28px)); position: fixed; z-index: 30; top: 82px; right: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 70px rgba(15,25,48,.25); }
.admin-panel[hidden] { display: none; }
.admin-panel h2 { margin: 7px 35px 8px 0; font-family: var(--serif); font-size: 20px; }
.admin-panel > p { color: var(--muted); font-size: 10px; line-height: 1.55; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-status { min-height: 1em; margin-bottom: 0; }
.care-pdf-sheet { box-sizing: border-box; position: fixed; z-index: -1; top: 0; left: -10000px; width: 720px; min-height: 1018px; padding: 48px; color: #263329; background: #fff; font: 18px/1.65 Arial, sans-serif; }
.care-pdf-sheet > p:first-child { color: #477a54; font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.care-pdf-sheet > img { width: 100%; height: 310px; object-fit: cover; border-radius: 18px; background: #edf5ed; }
.care-pdf-sheet h1 { margin: 26px 0 6px; color: #315f3e; font: 700 38px/1.2 Georgia, serif; }
.care-pdf-sheet > p:nth-of-type(2) { color: #718072; font: italic 18px Georgia, serif; }
.care-pdf-sheet ul { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; padding: 0; list-style: none; }
.care-pdf-sheet li { padding: 8px 13px; border-radius: 20px; color: #477a54; background: #edf5ed; font-size: 15px; }
.care-pdf-sheet > p { margin: 18px 0; }
.care-pdf-sheet footer, .care-pdf-sheet small { display: block; margin-top: 36px; padding-top: 14px; border-top: 1px solid #dce6dc; color: #718072; font-size: 12px; }
.install-dialog { width: min(420px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: var(--surface); box-shadow: 0 30px 100px rgba(15,25,48,.34); }
.install-dialog::backdrop { background: rgba(18,28,50,.58); backdrop-filter: blur(5px); }
.install-card { position: relative; padding: 28px; }
.install-card h2 { margin: 10px 0; font-family: var(--serif); font-size: 23px; }
.install-instructions { margin: 0 0 17px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.empty-state { grid-column: 1/-1; padding: 42px 20px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; font-size: 13px; }
.catalog-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 24px 0 10px; color: var(--muted); font-size: 11px; }
.catalog-pagination[hidden] { display: none; }
.season-open-button { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.season-intro { max-width: 620px; margin: 0; font-size: 12px; line-height: 1.6; }
.season-tracker { padding: clamp(16px, 3vw, 28px); }
.season-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 180px); align-items: end; gap: 16px; }
.season-month-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.season-month {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
}
.season-month small { min-width: 18px; min-height: 18px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: var(--surface-raised); font-size: 9px; }
.season-month.is-selected { border-color: color-mix(in srgb, var(--blue) 48%, var(--line)); color: var(--blue); background: color-mix(in srgb, var(--blue) 9%, var(--surface)); }
.season-month.is-selected small { color: #fff; background: var(--blue); }
.season-year-label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.season-year-label select { min-height: 42px; background: var(--surface); }
.season-summary { margin: 17px 0; padding: 11px 13px; border-radius: 11px; color: var(--blue); background: var(--surface-raised); font-size: 12px; font-weight: 800; }
.season-tracker-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.season-panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.season-panel h2 { margin: 0; font-family: var(--sans); font-size: 14px; font-weight: 800; }
.season-panel > p:not(.season-empty) { min-height: 1.4em; margin: 5px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.season-panel input { min-height: 44px; background: var(--surface-raised); font-size: 12px; }
.season-search-results, .season-observation-list { display: grid; gap: 7px; margin-top: 10px; }
.season-search-result, .season-observation { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.season-observation-plant { min-width: 0; min-height: 38px; flex: 1 1 auto; display: flex; align-items: center; padding: 3px 5px; border: 0; border-radius: 7px; color: var(--ink); background: transparent; text-align: left; }
.season-observation-plant > span { min-width: 0; overflow: hidden; font-size: 11px; font-weight: 750; text-overflow: ellipsis; }
.season-observation-plant small { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-family: var(--serif); font-size: 10px; font-style: italic; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.season-add, .season-remove { min-height: 36px; flex: 0 0 auto; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--blue); background: var(--surface-raised); font-size: 10px; font-weight: 750; }
.season-add.is-recorded { border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); }
.season-remove { width: 36px; display: grid; place-items: center; padding: 0; color: var(--muted); }
.season-remove .ui-icon { width: 15px; height: 15px; }
.season-empty { margin: 0; padding: 13px 6px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.season-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

.feature-layout { display: grid; grid-template-columns: .9fr 1.1fr; align-items: stretch; gap: 16px; }
.picker-card { padding: clamp(20px, 3vw, 32px); }
.botanist-game { width: min(680px, 100%); margin: 0 auto; padding: clamp(18px, 3vw, 30px); }
.botanist-score { margin: 0 0 14px; color: var(--blue); font-size: 12px; font-weight: 800; text-align: center; }
.botanist-photo-wrap { width: min(100%, 520px); aspect-ratio: 4 / 3; overflow: hidden; margin: 0 auto 18px; border-radius: 18px; background: var(--surface-raised); }
.botanist-photo-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; animation: search-empty-appear .35s ease both; }
.botanist-photo-wrap img[hidden] { display: none; }
.botanist-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.botanist-answer { min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--surface); font-size: 12px; font-weight: 700; transition: transform .18s, border-color .18s, background .18s; }
.botanist-answer:not(:disabled):hover { transform: translateY(-2px); border-color: var(--blue); }
.botanist-answer:disabled { cursor: default; }
.botanist-answer.is-correct { border-color: #4e9b69; color: #287243; background: rgba(78,155,105,.13); }
.botanist-answer.is-incorrect { border-color: #cc5c65; color: #a93642; background: rgba(204,92,101,.13); }
.botanist-feedback { min-height: 20px; margin: 13px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.random-pick-card { width: min(900px, 100%); margin: 0 auto; padding: clamp(16px, 3vw, 28px); }
.random-pick-plant { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(18px, 3vw, 32px); align-items: center; margin-bottom: 20px; }
.random-pick-photo { min-height: 260px; position: relative; overflow: hidden; border-radius: 18px; background: var(--surface-raised); }
.random-pick-photo img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.random-pick-photo .flower-tag { position: absolute; top: 12px; left: 12px; }
.random-pick-placeholder { min-height: 260px; display: grid; place-items: center; color: var(--blue); }
.random-pick-placeholder .ui-icon { width: 54px; height: 54px; }
.random-pick-info h2 { margin: 8px 0 4px; font-family: var(--serif); font-size: clamp(26px, 4vw, 38px); }
.random-pick-description { margin: 14px 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.random-pick-info > .button { margin-top: 18px; }
.random-pick-card > #random-pick-again { display: flex; align-items: center; justify-content: center; gap: 8px; margin-inline: auto; }
.recommendation { overflow: hidden; }
.recommendation-cover { height: 300px; overflow: hidden; background: var(--surface-raised); }
.recommendation-cover img { width: 100%; height: 100%; object-fit: cover; }
.recommendation-copy { padding: 20px 23px 24px; }
.recommendation-copy p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.picker-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 15px; }
.picker-fields .field:last-child { grid-column: 1/-1; }
.picker-result { padding: 13px; border-radius: 12px; background: var(--surface-raised); }
.about-banner { padding: clamp(22px, 4vw, 38px); }
.about-banner h2 { font-size: 29px; }
.about-banner p { max-width: 900px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.about-banner .project-credit { color: var(--ink); font-weight: 700; }
.guide-howto { margin-top: 15px; padding: clamp(18px, 3vw, 28px); }
.guide-howto h2 { margin: 0; font-family: var(--serif); font-size: clamp(21px, 3vw, 26px); }
.guide-howto-intro { margin: 7px 0 15px; color: var(--muted); font-size: var(--text-sm); line-height: 1.65; }
.guide-howto-list { display: grid; gap: 8px; }
.guide-howto-item { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-raised); }
.guide-howto-item summary { min-height: 46px; position: relative; display: flex; align-items: center; padding: 10px 42px 10px 14px; color: var(--ink); cursor: pointer; font-size: var(--text-sm); font-weight: 700; list-style: none; }
.guide-howto-item summary::-webkit-details-marker { display: none; }
.guide-howto-item summary::after { position: absolute; right: 15px; color: var(--blue); content: "+"; font-size: 20px; font-weight: 500; line-height: 1; }
.guide-howto-item[open] summary::after { content: "−"; }
.guide-howto-item summary:focus-visible { z-index: 1; outline: 2px solid var(--blue); outline-offset: 2px; border-radius: var(--radius-sm); }
.guide-howto-item > p { margin: 0; padding: 0 14px 13px; color: var(--muted); font-size: var(--text-sm); line-height: 1.7; }
.guide-howto-storage { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-xs); line-height: 1.6; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 15px; }
.guide-card { padding: 20px; }
.guide-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 13px; color: #fff; background: var(--gradient); box-shadow: 0 6px 15px color-mix(in srgb, var(--blue) 18%, transparent); }
.guide-icon .ui-icon { width: 20px; height: 20px; }
.guide-card h3 { font-size: 13px; }
.guide-card p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.site-footer {
  position: relative;
  margin-top: 28px;
  padding: 17px 0 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}
.footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
}
.footer-brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.footer-brand .brand-mark { flex: 0 0 auto; }
.footer-brand strong { font-size: 15px; letter-spacing: -.02em; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 16px;
}
.footer-links button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  transition: color .18s, transform .18s;
}
.footer-links button:hover { transform: translateX(2px); color: var(--blue); }
.footer-bottom { padding-top: 9px; border-top: 1px solid var(--line); font-size: 9px; }

.flora-ai-widget {
  position: fixed;
  z-index: 20;
  right: max(24px, calc((100vw - 1340px) / 2));
  bottom: 116px;
  display: grid;
  justify-items: end;
  gap: 12px;
  font-family: var(--sans);
}
.flora-ai-toggle {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, var(--blue) 35%, transparent);
  border-radius: 999px;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--blue) 34%, transparent), inset 0 1px rgba(255,255,255,.25);
  font-size: 13px;
  font-weight: 800;
  transition: color .25s, background .25s, border-color .25s, transform .2s, box-shadow .2s;
}
.flora-ai-toggle:hover { transform: translateY(-3px); box-shadow: 0 16px 38px color-mix(in srgb, var(--blue) 40%, transparent); }
.flora-ai-toggle .ui-icon { width: 18px; height: 18px; }
.flora-ai-toggle-chat { opacity: .8; }
.flora-ai-toggle[aria-expanded="true"] .flora-ai-toggle-chat { display: none; }
.flora-ai-toggle[aria-expanded="true"] .flora-ai-toggle-text { display: none; }
.flora-ai-toggle[aria-expanded="true"] .flora-ai-toggle-spark { display: none; }
.flora-ai-toggle[aria-expanded="true"]::after { content: "Закрыть помощника"; }
body.dark-theme[data-palette="green"] .flora-ai-toggle { background: linear-gradient(110deg, #365f40, #527b5a); }
.flora-ai-panel {
  width: min(390px, calc(100vw - 32px));
  height: min(640px, calc(100dvh - 180px));
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--blue) 17%, var(--line));
  border-radius: 25px;
  background: linear-gradient(160deg, var(--surface), color-mix(in srgb, var(--surface) 88%, var(--surface-raised)));
  box-shadow: 0 24px 80px color-mix(in srgb, var(--ink) 18%, transparent), 0 4px 16px color-mix(in srgb, var(--ink) 7%, transparent);
  animation: flora-ai-enter .22s ease-out both;
}
.flora-ai-panel[hidden] { display: none; }
@keyframes flora-ai-enter { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.flora-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 17px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(115deg, color-mix(in srgb, var(--hero-tint) 75%, var(--surface)), var(--surface));
}
.flora-ai-brand { display: flex; align-items: center; gap: 11px; }
.flora-ai-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 14px;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 6px 15px color-mix(in srgb, var(--blue) 24%, transparent);
}
.flora-ai-mark .ui-icon { width: 19px; height: 19px; }
.flora-ai-brand > div { display: grid; gap: 4px; }
.flora-ai-brand strong { font-size: 13px; letter-spacing: -.02em; }
.flora-ai-presence { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.flora-ai-header-actions { display: flex; gap: 6px; }
.flora-ai-presence i { width: 7px; height: 7px; border-radius: 50%; background: #d3a54d; box-shadow: 0 0 0 3px color-mix(in srgb, #d3a54d 13%, transparent); }
.flora-ai-presence[data-state="ready"] i { background: #58a36a; box-shadow: 0 0 0 3px color-mix(in srgb, #58a36a 15%, transparent); }
.flora-ai-presence[data-state="offline"] i { background: #d27b63; box-shadow: 0 0 0 3px color-mix(in srgb, #d27b63 15%, transparent); }
.flora-ai-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface);
}
.flora-ai-close .ui-icon { width: 16px; height: 16px; }
.flora-ai-intro { padding: 16px 18px 6px; }
.flora-ai-eyebrow { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.flora-ai-intro p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.flora-ai-messages {
  min-height: 90px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow-y: auto;
  padding: 15px 16px 8px;
  overscroll-behavior: contain;
  scrollbar-color: color-mix(in srgb, var(--blue) 25%, transparent) transparent;
}
.flora-ai-message { max-width: 90%; display: flex; align-items: flex-end; gap: 8px; }
.flora-ai-message p { margin: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 16px 16px 16px 5px; background: var(--surface-raised); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.flora-ai-message-assistant { align-self: flex-start; }
.flora-ai-message-user { align-self: flex-end; }
.flora-ai-message-user p { border-color: transparent; border-radius: 16px 16px 5px 16px; color: #fff; background: var(--gradient); }
.flora-ai-avatar { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--hero-tint); }
.flora-ai-avatar .ui-icon { width: 14px; height: 14px; }
.flora-ai-typing p { display: inline-flex; align-items: center; gap: 4px; }
.flora-ai-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: flora-ai-dot 1s ease-in-out infinite; }
.flora-ai-typing i:nth-child(2) { animation-delay: .15s; }
.flora-ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes flora-ai-dot { 0%,60%,100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.flora-ai-suggestions { display: flex; flex-wrap: wrap; gap: 7px; padding: 9px 16px 12px; }
.flora-ai-suggestion { min-height: 31px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 10px; text-align: left; transition: border-color .16s, color .16s, background .16s; }
.flora-ai-suggestion:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); color: var(--blue); background: var(--surface-raised); }
.flora-ai-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 13px; padding: 7px 7px 7px 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-raised); }
.flora-ai-form:focus-within { border-color: color-mix(in srgb, var(--blue) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 9%, transparent); }
.flora-ai-form textarea { width: 100%; max-height: 105px; resize: none; padding: 7px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; line-height: 1.45; }
.flora-ai-form textarea::placeholder { color: var(--muted); }
.flora-ai-send { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; border: 0; border-radius: 12px; color: #fff; background: var(--gradient); transition: opacity .16s, transform .16s; }
.flora-ai-send:hover { transform: translateY(-1px); }
.flora-ai-send:disabled { cursor: wait; opacity: .48; }
.flora-ai-send .ui-icon { width: 17px; height: 17px; transform: rotate(-45deg); }
.flora-ai-footnote { margin: 8px 17px 12px; color: var(--muted); font-size: 9px; line-height: 1.45; text-align: center; }

.floating-companion {
  width: 44px;
  height: 44px;
  position: fixed;
  z-index: 6;
  right: max(24px, calc((100vw - 1340px) / 2));
  bottom: 118px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  color: white;
  background: var(--gradient);
  box-shadow: 0 9px 24px rgba(76,113,229,.26);
  animation: companion-float 3.3s ease-in-out infinite;
}
.floating-companion span { font-size: 22px; }
.floating-companion i { position: absolute; top: -6px; right: -3px; color: #f5a6c0; font-size: 15px; font-style: normal; }
@keyframes companion-float { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-9px) rotate(7deg); } }
.bottom-dock {
  width: min(610px, calc(100% - 28px));
  min-height: var(--dock-h);
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 14px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin: 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 23px;
  background: var(--surface-glass);
  box-shadow: 0 14px 45px rgba(31,47,91,.2);
  backdrop-filter: blur(22px) saturate(1.4);
}
.dock-tab {
  min-width: 0;
  position: relative;
  flex: 1 1 0;
  min-height: 50px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 5px 3px;
  border: 0;
  border-radius: 15px;
  color: var(--muted);
  background: transparent;
  transition: color .2s, background .2s, transform .2s;
}
.dock-tab:hover { transform: translateY(-2px); color: var(--blue); }
.dock-tab[aria-current="page"] { color: var(--blue); background: rgba(87,121,245,.1); }
.dock-icon { width: 22px; height: 22px; display: grid; place-items: center; }
.dock-icon .ui-icon { width: 19px; height: 19px; }
.dock-label { font-size: 9px; font-weight: 700; line-height: 1.15; text-align: center; }
.dock-count { min-width: 16px; height: 16px; position: absolute; top: 2px; left: calc(50% + 8px); display: grid; place-items: center; padding: 0 4px; border-radius: 999px; color: #fff; background: var(--blue); font-size: 9px; font-weight: 800; }

dialog#flower-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: min(88vh, 900px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(15,25,48,.34);
}
dialog#flower-dialog::backdrop { background: rgba(18,28,50,.58); backdrop-filter: blur(5px); }
.dialog-content { position: relative; padding: 24px; }
.dialog-close { width: 34px; height: 34px; position: absolute; z-index: 2; top: 13px; right: 13px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.6); border-radius: 50%; color: #fff; background: rgba(22,31,52,.55); }
.detail-photo { width: 100%; max-height: 300px; object-fit: cover; border-radius: 15px; }
.detail-no-photo { min-height: 155px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; border-radius: 15px; color: var(--muted); background: var(--surface-raised); font-size: 11px; text-align: center; }
.detail-no-photo .ui-icon { width: 34px; height: 34px; color: var(--blue); }
.detail-text { color: var(--muted); font-size: 12px; line-height: 1.8; }
.detail-section { margin-top: 18px; }
.detail-section h3 { margin: 0 0 8px; color: var(--ink); font-family: var(--sans); font-size: 13px; font-weight: 800; }
.detail-section .detail-text { margin: 0; }
.plant-notes {
  margin: 18px 0 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-raised);
}
.plant-notes-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--blue); }
.plant-notes-heading .ui-icon { width: 18px; height: 18px; }
.plant-notes-heading h3 { font-size: 13px; }
.plant-note-input {
  width: 100%;
  min-height: 108px;
  display: block;
  padding: 11px 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 12px;
  line-height: 1.6;
}
.plant-note-input::placeholder { color: var(--muted); }
.plant-notes-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; }
.plant-note-status { flex: 1 1 auto; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.plant-notes .plant-note-save { min-height: 38px; flex: 0 0 auto; }
.flower-facts { display: flex; flex-wrap: wrap; gap: 7px; }
.fact-chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-raised); font-size: 9px; }
.photo-credit-detail { color: var(--muted); font-size: 10px; line-height: 1.7; }
.photo-credit-detail a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.similar-plants { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.similar-plants h3 { margin-bottom: 10px; font-size: var(--text-sm); }
.similar-plants-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.similar-plant-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); background: var(--surface-raised); text-align: left; transition: border-color .18s, transform .18s; }
.similar-plant-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); }
.similar-plant-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface); }
.similar-plant-name, .similar-plant-latin { overflow: hidden; padding-inline: 8px; text-overflow: ellipsis; white-space: nowrap; }
.similar-plant-name { padding-top: 7px; font-size: var(--text-xs); font-weight: 700; }
.similar-plant-latin { padding-top: 2px; padding-bottom: 8px; color: var(--muted); font-family: var(--serif); font-size: 10px; font-style: italic; }
@media (max-width: 480px) {
  .similar-plants-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Stage 4: a clear search-first catalog, with the full filter set kept together. */
.catalog-toolbar { display: block; margin: 22px 0 10px; }
.catalog-toolbar .search-input { min-height: 54px; padding-inline: 18px; border-color: var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); font-size: var(--text-base); }
.catalog-filter-disclosure { margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); }
.catalog-filter-disclosure > summary { min-height: 48px; position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 42px; color: var(--ink); cursor: pointer; font-size: var(--text-sm); font-weight: 700; list-style: none; }
.catalog-filter-disclosure > summary::-webkit-details-marker { display: none; }
.catalog-filter-disclosure > summary::before { width: 9px; height: 9px; position: absolute; left: 18px; border-right: 1.5px solid var(--blue); border-bottom: 1.5px solid var(--blue); content: ""; transform: rotate(45deg) translateY(-2px); transition: transform .18s; }
.catalog-filter-disclosure[open] > summary::before { transform: rotate(225deg) translate(-2px, -1px); }
.catalog-filter-disclosure > summary span { margin-left: auto; color: var(--muted); font-size: var(--text-xs); font-weight: 500; }
.catalog-filter-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.catalog-filter-panel .catalog-control,
.catalog-filter-panel .catalog-sort-label,
.catalog-filter-panel .care-filter-label { min-width: 0; display: grid; align-content: start; gap: 6px; padding-top: 10px; color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
.catalog-filter-panel select { min-height: 44px; width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); background: var(--surface-raised); font-size: var(--text-sm); }
.catalog-filter-panel .catalogue-note { grid-column: 1 / -1; margin: 0; font-size: var(--text-xs); }
.flower-grid { gap: 20px; }
.flower-grid .flower-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); }
.flower-grid .flower-card:hover { border-color: color-mix(in srgb, var(--blue) 34%, var(--line)); box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.flower-grid .flower-photo-wrap { position: relative; overflow: hidden; border-radius: 0; }
.flower-grid .flower-photo-wrap::after { background: linear-gradient(0deg, rgba(12,20,36,.25), transparent 38%); }
.flower-grid .flower-number { display: none; }
.flower-grid .flower-info { min-height: 128px; display: flex; flex-direction: column; gap: 0; padding: 15px; }
.flower-grid .flower-card-name h3 { display: -webkit-box; overflow: hidden; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.flower-grid .flower-latin { margin-top: 5px; font-size: var(--text-xs); }
.flower-grid .taxonomy-line,
.flower-grid .microclimate,
.flower-grid .flower-description,
.flower-grid .botanical-meta { display: none; }
.flower-grid .plant-tags { gap: 6px; margin-top: 10px; }
.flower-grid .plant-tag:nth-child(n + 3) { display: none; }
.flower-grid .plant-tag { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-raised); font-size: var(--text-xs); font-weight: 600; }
.flower-grid .flower-card-actions { padding-top: 12px; }
.flower-grid .flower-card-actions .button { min-height: 38px; }
dialog#flower-dialog { border-radius: var(--radius-lg); }
.dialog-content { padding: clamp(18px, 3vw, 28px); }
.detail-photo { max-height: min(44vh, 380px); border-radius: var(--radius-md); object-fit: cover; }
.photo-credit-detail { margin-top: 8px; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface-raised); }
.detail-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-section h3 { margin-bottom: 8px; }
.detail-section [class*="warning"],
.detail-section [class*="toxic"],
.detail-section [data-safety="toxic"] { padding: 12px 14px; border: 1px solid color-mix(in srgb, #b47731 32%, var(--line)); border-radius: var(--radius-sm); color: var(--ink); background: color-mix(in srgb, #d6a34d 12%, var(--surface)); }

@media (max-width: 1000px) {
  .flower-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .shell { width: min(100% - 28px, 600px); }
  .topline { min-height: 31px; font-size: 8px; letter-spacing: .1em; }
  .header-inner { min-height: 63px; flex-wrap: wrap; justify-content: center; gap: 8px; padding-block: 8px; }
  .header-actions { width: 100%; justify-content: flex-end; gap: 5px; }
  .palette-select { width: 92px; min-width: 0; min-height: 40px; padding-inline: 7px; font-size: 10px; }
  .header-actions .icon-button { width: 38px; height: 40px; flex: 0 0 38px; border-radius: 11px; }
  .brand { gap: 6px; font-size: 14px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 18px; }
  .botanist-header-button { min-height: 40px; margin-left: auto; padding-inline: 11px; }
  .main-content { padding-top: 18px; }
  .hero-card { grid-template-columns: 1fr; border-radius: 21px; }
  .hero-copy { padding: 27px 23px; }
  .hero-art { min-height: 245px; }
  .hero-orbit { width: 86px; height: 86px; top: 16px; right: 16px; font-size: 12px; }
  h1 { font-size: clamp(34px, 9vw, 46px); }
  .home-facts { gap: 8px; margin-top: 10px; }
  .home-fact { align-items: flex-start; flex-direction: column; gap: 7px; padding: 12px; }
  .home-fact > .ui-icon { width: 17px; height: 17px; }
  .home-fact strong { font-size: 11px; }
  .home-fact small { font-size: 9px; }
  .feature-layout { grid-template-columns: 1fr; gap: 11px; margin-top: 11px; }
  .home-widget { min-height: auto; padding: 18px; }
  .quick-links { grid-template-columns: 1fr; gap: 8px; }
  .quick-link { min-height: 49px; }
  .page-title-row { align-items: flex-start; flex-direction: column; gap: 10px; margin: 7px 0 15px; }
  .page-title-row h1 { font-size: 37px; }
  .page-title-row > .button { align-self: flex-start; }
  .page-title-row > .season-open-button { width: 100%; }
  .catalog-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .flower-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .botanist-answers { gap: 8px; }
  .botanist-answer { min-height: 44px; padding: 9px 8px; font-size: 10px; }
  .flower-photo-wrap { height: auto; aspect-ratio: 4 / 3; }
  .flower-info { min-height: 0; padding: 13px; }
  .flower-info h3 { font-size: 13px; }
  .taxonomy-line { font-size: 8px; }
  .flower-card-actions { margin-top: 10px; }
  .flower-card-actions .button { padding-inline: 9px; }
  .guide-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .guide-card { padding: 15px; }
  .recommendation-cover { height: 230px; }
  .bottom-dock { bottom: 9px; min-height: 68px; padding: 6px; border-radius: 20px; }
  .dock-tab { min-height: 52px; padding: 6px 3px; }
  .dock-label { font-size: 9px; }
  .floating-companion { width: 38px; height: 38px; right: 18px; bottom: 91px; }
  .flora-ai-widget { right: 12px; bottom: 88px; gap: 9px; }
  .flora-ai-panel { width: min(390px, calc(100vw - 24px)); height: min(640px, calc(100dvh - 116px)); min-height: min(420px, calc(100dvh - 116px)); border-radius: 22px; }
  .flora-ai-toggle { min-height: 48px; gap: 8px; padding-inline: 15px; font-size: 12px; }
  .site-footer { margin-top: 24px; }
  .footer-main { align-items: flex-start; flex-direction: column; gap: 8px; }
  .footer-links { justify-content: flex-start; gap: 2px 14px; }
  body { padding-bottom: 98px; }
}
@media (max-width: 420px) {
  .catalog-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .care-filters { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .shell { width: calc(100% - 24px); }
  .flora-ai-widget { right: 10px; bottom: 84px; }
  .flora-ai-panel { height: min(620px, calc(100dvh - 106px)); min-height: min(380px, calc(100dvh - 106px)); }
  .header-inner { flex-wrap: wrap; justify-content: center; gap: 7px; padding-block: 8px; }
  .header-actions { width: 100%; justify-content: center; gap: 5px; }
  .botanist-header-button { margin-left: auto; }
  .palette-select { width: 92px; min-height: 40px; padding-inline: 6px; font-size: 10px; }
  .header-actions .icon-button { width: 38px; height: 40px; flex-basis: 38px; }
  .header-actions .ui-icon { width: 18px; height: 18px; }
  .random-pick-plant { grid-template-columns: 1fr; gap: 18px; }
  .random-pick-photo, .random-pick-placeholder { min-height: 0; aspect-ratio: 4 / 3; }
  .season-tracker { padding: 13px; }
  .season-toolbar { grid-template-columns: 1fr; gap: 10px; }
  .season-month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .season-month { min-height: 42px; padding-inline: 7px; font-size: 9px; }
  .season-tracker-columns { grid-template-columns: 1fr; gap: 10px; }
  .season-panel { padding: 13px; }
  .main-content { padding-top: 16px; }
  .hero-copy { padding: 23px 18px; }
  .hero-copy p { font-size: 12px; line-height: 1.7; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions .button { width: 100%; min-height: 46px; }
  .home-facts { grid-template-columns: 1fr; }
  .home-fact { align-items: center; flex-direction: row; }
  .home-fact strong { font-size: 12px; }
  .flower-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .flower-photo-wrap { aspect-ratio: 4 / 3; }
  .flower-info { min-height: 0; padding: 15px; }
  .flower-info h3 { font-size: 16px; }
  .flower-description { font-size: 12px; }
  .microclimate-chip { min-height: 30px; padding: 5px 8px; font-size: 10px; }
  .microclimate-chip > .ui-icon { width: 15px; height: 15px; }
  .flower-card-actions .button { min-height: 42px; font-size: 11px; }
  .guide-grid { grid-template-columns: 1fr; gap: 11px; }
  .guide-card { padding: 17px; }
  .guide-card h3 { font-size: 15px; }
  .guide-card p { font-size: 12px; }
  .catalog-control select, .catalog-sort-label select { min-height: 44px; }
  .plant-notes { padding: 12px; }
  .plant-notes-footer { align-items: stretch; flex-direction: column; }
  .plant-notes .plant-note-save { width: 100%; min-height: 44px; }
  .detail-actions { gap: 7px; }
  .detail-action-button { min-height: 44px; gap: 6px; padding-inline: 8px; font-size: 10px; }
  .botanist-game { padding: 14px; }
  .botanist-answers { grid-template-columns: 1fr; }
  .botanist-answer { min-height: 46px; font-size: 12px; }
  .footer-links button { min-height: 36px; }
  input, select { min-height: 44px; font-size: 14px; }
}
@media (max-width: 360px) {
  .header-actions { gap: 3px; }
  .palette-select { width: 76px; min-width: 0; font-size: 9px; }
  .header-actions .icon-button { width: 34px; height: 36px; flex-basis: 34px; }
  .header-actions .ui-icon { width: 17px; height: 17px; }
  .botanist-header-button { width: 34px; min-height: 36px; flex: 0 0 34px; margin-left: auto; padding: 0; }
  .botanist-header-button span { display: none; }
  .bottom-dock { width: calc(100% - 16px); padding-inline: 4px; }
  .dock-label { font-size: 8px; }
}
@media (max-width: 390px) {
  .shell { width: calc(100% - 22px); }
  .flower-photo-wrap { height: auto; aspect-ratio: 4 / 3; }
  .flower-card-actions .button { font-size: 9px; }
  .dock-label { font-size: 7px; }
  .guide-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Keep surfaces calm and let the photography carry the color. */
body.dark-theme {
  --line: rgba(210, 222, 245, .09);
  --surface-glass: rgba(23, 35, 27, .88);
}
.hero-card {
  border-color: var(--line);
  border-radius: 23px;
  box-shadow: 0 18px 48px rgba(25, 42, 82, .1);
}
.surface-card, .flower-card {
  box-shadow: 0 6px 20px rgba(30, 48, 88, .045);
}
.surface-card { border-radius: 16px; }
.flower-card { border-radius: 15px; }
.flower-card { border-radius: 19px; }
.button { border-radius: 10px; box-shadow: 0 5px 14px rgba(81, 116, 231, .15); }
.button:hover { box-shadow: 0 8px 18px rgba(81, 116, 231, .2); }
.button.secondary, .button.ghost { box-shadow: none; }
.quick-link { border-radius: 12px; }
.bottom-dock {
  border-color: var(--line);
  box-shadow: 0 10px 32px rgba(20, 31, 62, .16);
}
.flower-photo-wrap {
  aspect-ratio: 4 / 3;
  height: auto;
  background: linear-gradient(120deg, #e7efe2, #e4f1e8 45%, #f9e7e4);
}
.flower-photo { background: linear-gradient(120deg, #e7efe2, #e4f1e8); }
.flower-grid .flower-card:nth-child(6n + 1) .flower-photo-wrap { background-color: #f4e9de; }
.flower-grid .flower-card:nth-child(6n + 2) .flower-photo-wrap { background-color: #e8efdf; }
.flower-grid .flower-card:nth-child(6n + 3) .flower-photo-wrap { background-color: #f5e6e7; }
@media (max-width: 720px) {
  .flower-photo-wrap { height: auto; }
  .flower-grid { gap: 11px; }
  .flower-info { min-height: 0; padding: 12px; }
}

@media (min-width: 1200px) {
  .flower-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .flower-photo-wrap { aspect-ratio: 4 / 3; height: auto; }
}

@media (hover: none) {
  .flower-card:hover { transform: none; }
  .flower-card:hover .flower-photo { transform: none; }
}

body:not(.dark-theme)[data-palette="lavender"] {
  --bg: #f6f3fa;
  --surface-raised: #f0eaf7;
  --hero-tint: #eee7f6;
  --line: rgba(91, 70, 116, .16);
  --blue: #79619b;
  --cyan: #b59bcf;
  --green: #9b83b7;
  --gradient: linear-gradient(110deg, #79619b, #b18eae);
  --glow-one: rgba(174, 148, 205, .19);
  --glow-two: rgba(219, 190, 214, .2);
  --glow-three: rgba(190, 202, 227, .17);
}
body:not(.dark-theme)[data-palette="rose"] {
  --bg: #fbf4f3;
  --surface-raised: #f8eae8;
  --hero-tint: #f6e8e5;
  --line: rgba(127, 75, 75, .15);
  --blue: #a35f67;
  --cyan: #d39a9c;
  --green: #bc7b79;
  --gradient: linear-gradient(110deg, #a35f67, #d18d88);
  --glow-one: rgba(220, 156, 151, .19);
  --glow-two: rgba(245, 203, 189, .2);
  --glow-three: rgba(207, 182, 204, .15);
}
body:not(.dark-theme)[data-palette="sand"] {
  --bg: #f8f5ed;
  --surface-raised: #f3eee1;
  --hero-tint: #f0eadb;
  --line: rgba(105, 87, 56, .16);
  --blue: #8b7549;
  --cyan: #c2aa78;
  --green: #aa9260;
  --gradient: linear-gradient(110deg, #8b7549, #c1a36d);
  --glow-one: rgba(205, 178, 124, .2);
  --glow-two: rgba(229, 207, 163, .2);
  --glow-three: rgba(215, 188, 169, .15);
}
body.dark-theme[data-palette="lavender"] {
  --bg: #181620;
  --surface: #24212d;
  --surface-raised: #302b3a;
  --surface-glass: rgba(34, 30, 42, .92);
  --line: rgba(204, 184, 224, .15);
  --blue: #b6a0d1;
  --cyan: #c4adda;
  --green: #b6a0d1;
  --gradient: linear-gradient(110deg, #786291, #9879a7);
  --hero-tint: #30283a;
  --glow-one: rgba(126, 94, 158, .24);
  --glow-two: rgba(131, 93, 135, .16);
  --glow-three: rgba(74, 91, 132, .13);
}
body.dark-theme[data-palette="rose"] {
  --bg: #1d171a;
  --surface: #2a2024;
  --surface-raised: #382a2e;
  --surface-glass: rgba(41, 30, 34, .92);
  --line: rgba(229, 176, 174, .15);
  --blue: #e2a2a0;
  --cyan: #e9b2a9;
  --green: #d79791;
  --gradient: linear-gradient(110deg, #a25e68, #ca8584);
  --hero-tint: #382629;
  --glow-one: rgba(154, 76, 84, .24);
  --glow-two: rgba(155, 102, 76, .16);
  --glow-three: rgba(117, 72, 106, .13);
}
body.dark-theme[data-palette="sand"] {
  --bg: #1d1a15;
  --surface: #2a251d;
  --surface-raised: #393225;
  --surface-glass: rgba(41, 36, 27, .92);
  --line: rgba(224, 203, 153, .16);
  --blue: #d2b77e;
  --cyan: #dfc995;
  --green: #c3a871;
  --gradient: linear-gradient(110deg, #887047, #b29863);
  --hero-tint: #342f24;
  --glow-one: rgba(133, 105, 53, .22);
  --glow-two: rgba(127, 94, 51, .15);
  --glow-three: rgba(117, 81, 58, .12);
}

dialog.welcome-dialog {
  width: min(430px, calc(100% - 32px));
  max-height: min(88vh, 620px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 25px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(34, 49, 37, .28);
}
dialog.welcome-dialog::backdrop {
  background: rgba(29, 40, 32, .38);
  backdrop-filter: blur(5px);
}
.welcome-card {
  position: relative;
  padding: 31px clamp(22px, 6vw, 36px) 24px;
  text-align: center;
}
.welcome-close {
  width: 34px;
  height: 34px;
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-raised);
  font-size: 21px;
  line-height: 1;
}
.welcome-flower {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 18px;
  color: white;
  background: var(--gradient);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--blue) 22%, transparent);
  font-size: 29px;
}
.welcome-flower .ui-icon { width: 30px; height: 30px; }
.welcome-card .eyebrow { font-size: 9px; }
.welcome-card h2 { margin: 9px 0; font-size: clamp(24px, 6vw, 29px); }
.welcome-description { margin: 0 auto 21px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.welcome-label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 11px; font-weight: 700; text-align: left; }
.welcome-card input { min-height: 46px; margin-bottom: 12px; border-radius: 13px; background: var(--surface-raised); text-align: left; }
.welcome-card .button { min-height: 46px; }
.welcome-note { margin: 12px 0 0; color: var(--muted); font-size: 9px; }
dialog.welcome-dialog[open] { animation: welcome-in .25s ease both; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Shared visual-system refinements; palette variables above remain theme-controlled. */
body {
  line-height: 1.6;
  background: var(--bg);
}
body.dark-theme {
  --shadow-soft: 0 5px 18px rgba(0, 0, 0, .18);
  --shadow-popover: 0 14px 36px rgba(0, 0, 0, .3);
  background: var(--bg);
}
.shell { width: min(1200px, calc(100% - 48px)); }
.main-content { padding-top: var(--space-6); }
.page-title-row { margin-bottom: var(--space-5); }
.page-title-row p, .about-banner p, .detail-text, .random-pick-description {
  max-width: var(--text-measure);
  line-height: 1.75;
}
h1 { line-height: 1.12; }
h2 { line-height: 1.3; }
.surface-card, .flower-card, .home-fact, .quick-link {
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}
.flower-card:hover { box-shadow: var(--shadow-popover); }
.hero-card { box-shadow: var(--shadow-soft); }
.button, .icon-button, input, select, .catalog-control select,
.catalog-sort-label select, .care-filter-label select {
  border-radius: var(--radius-sm);
}
.button { min-height: 44px; font-size: var(--text-xs); }
.button.small { min-height: 38px; }
input, select { min-height: 44px; color: var(--ink); font-size: var(--text-sm); }
input::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 48%, transparent);
  outline-offset: 2px;
}
.flower-card, .surface-card { border-radius: var(--radius-md); }
.flower-info { gap: 2px; }
.plant-tag, .microclimate-chip { font-size: var(--text-xs); }
.catalog-count, .muted { line-height: 1.65; }
.about-banner p { max-width: min(100%, 76ch); }
.site-footer { margin-top: var(--space-7); }

@media (max-width: 720px) {
  .shell { width: min(100% - 32px, 600px); }
  .main-content { padding-top: var(--space-4); }
  .page-title-row { margin-bottom: var(--space-4); }
  .button { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Homepage: keep the invitation clear and supporting details quiet. */
.home-facts {
  grid-template-columns: repeat(3, max-content);
  justify-content: start;
  gap: 8px;
  margin-top: var(--space-4);
}
.home-fact {
  gap: 8px;
  padding: 8px 12px;
  border-color: transparent;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  box-shadow: none;
}
.home-fact > .ui-icon { width: 16px; height: 16px; opacity: .72; }
.home-fact strong { color: var(--muted); font-size: var(--text-xs); font-weight: 700; }

/* Clearer daily-plant framing and a persistent, easy-to-find comparison tray. */
.hero-art img { object-position: center 42%; }
.hero-art-label {
  max-width: calc(100% - 42px);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  background: rgba(17, 29, 22, .38);
  backdrop-filter: blur(8px);
  letter-spacing: .04em;
  text-transform: none;
}
.compare-select-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--blue);
  background: var(--surface-raised);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  transition: border-color .18s, background .18s, transform .18s;
}
.compare-select-button .ui-icon { width: 15px; height: 15px; }
.compare-select-button:hover { transform: translateY(-1px); border-color: var(--blue); }
.compare-select-button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
}
#compare-dock {
  width: min(640px, calc(100% - 28px));
  position: fixed;
  z-index: 11;
  right: 0;
  bottom: calc(var(--dock-h) + 28px);
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface-glass);
  box-shadow: var(--shadow-popover);
  backdrop-filter: blur(18px) saturate(1.25);
}
.compare-dock-copy { min-width: 0; }
.compare-dock-copy strong, .compare-dock-copy span { display: block; }
.compare-dock-copy strong { font-size: 12px; line-height: 1.4; }
.compare-dock-copy span { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.compare-dock .button { min-height: 38px; padding-inline: 11px; white-space: nowrap; }
.footer-main { justify-content: flex-start; padding-bottom: 0; }

@media (max-width: 520px) {
  #compare-dock { width: calc(100% - 20px); bottom: calc(var(--dock-h) + 26px); gap: 7px; padding: 9px; }
  .compare-dock-copy strong { font-size: 10px; }
  .compare-dock-copy span { font-size: 9px; }
  .compare-dock .button { min-height: 36px; padding-inline: 8px; font-size: 9px; }
  .compare-select-button { min-height: 38px; gap: 4px; padding-inline: 7px; font-size: 9px; }
}

.home-fact small { display: none; }
.collection-empty-action, .observations-empty-action { display: none; }
#collection-grid:has(.empty-state) + .collection-empty-action {
  display: flex;
  width: fit-content;
  margin: 16px auto 0;
}
.season-observation-list:has(.season-empty) + .observations-empty-action {
  display: inline-flex;
  margin-top: 10px;
  text-decoration: none;
}
.welcome-skip {
  min-height: 42px;
  display: block;
  margin: 8px auto 0;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
}
.welcome-skip:hover { color: var(--blue); background: var(--surface-raised); }

@media (max-width: 520px) {
  .home-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .home-fact { justify-content: center; padding: 8px 4px; }
  .home-fact > .ui-icon { display: none; }
  .home-fact strong { font-size: 10px; text-align: center; }
}

/* Stage 3: primary navigation, compact palette controls, and secondary links. */
.primary-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.primary-nav-link,
.more-menu > summary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.primary-nav-link:hover,
.more-menu > summary:hover,
.more-menu[open] > summary { color: var(--blue); background: var(--surface-raised); }
.primary-collection-link span {
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--surface-raised);
  font-size: 10px;
}
.more-menu { position: relative; }
.more-menu > summary { list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > summary::after { width: 6px; height: 6px; margin: -3px 0 0 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ""; transform: rotate(45deg); }
.more-menu[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
.more-menu-panel {
  min-width: 190px;
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}
.more-menu-panel button {
  min-height: 40px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: transparent;
  font-size: var(--text-sm);
  text-align: left;
}
.more-menu-panel button:hover { color: var(--blue); background: var(--surface-raised); }
.palette-swatches { display: flex; align-items: center; gap: 6px; margin-right: 3px; }
.palette-swatch {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
  transition: transform .18s, box-shadow .18s;
}
.palette-swatch:hover { transform: scale(1.12); }
.palette-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--blue); }
.palette-swatch-green { background: #72a982; }
.palette-swatch-lavender { background: #9b83b7; }
.palette-swatch-rose { background: #bc7b79; }
.palette-swatch-sand { background: #aa9260; }
.header-actions { flex: 0 0 auto; }
.bottom-dock { width: min(610px, calc(100% - 28px)); }
.footer-links { max-width: 700px; }
.footer-links button { font-size: var(--text-xs); }

@media (max-width: 900px) {
}
@media (max-width: 520px) {
  .header-inner { justify-content: center; gap: 7px; }
  .header-actions { width: 100%; justify-content: center; gap: 9px; }
  .palette-swatches { gap: 7px; margin-right: 2px; }
  .palette-swatch { width: 20px; height: 20px; flex-basis: 20px; }
}
@media (max-width: 360px) {
  .palette-swatches { gap: 5px; }
}

/* Keep secondary destinations and utilities in the header; the dock is the main five-item menu. */
.primary-nav { gap: 2px; }
.primary-nav-link, .more-menu > summary { padding-inline: 7px; font-size: 10px; }
.primary-collection-link { gap: 5px; }
.primary-collection-count {
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--surface-raised);
  font-size: 9px;
}
.bottom-dock { width: min(760px, calc(100% - 28px)); }
.dock-label { max-width: 100%; }

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; }
  .brand { order: 1; }
  .header-actions { order: 2; }
  .primary-nav {
    width: 100%;
    order: 3;
    justify-content: center;
    flex-wrap: wrap;
    padding-bottom: 7px;
  }
  .more-menu-panel { right: 0; }
}
@media (max-width: 520px) {
  .primary-nav { gap: 0; }
  .primary-nav-link, .more-menu > summary { min-height: 34px; padding-inline: 6px; font-size: 9px; }
  .bottom-dock { width: calc(100% - 16px); min-height: 76px; padding: 5px 3px; }
  .dock-tab { gap: 4px; padding-inline: 2px; }
  .dock-label { font-size: 8px; }
}
@media (max-width: 360px) {
  .primary-nav-link, .more-menu > summary { padding-inline: 4px; font-size: 8px; }
  .dock-label { font-size: 7px; }
}

/* Show the existing light and watering guidance on catalog cards. */
.flower-grid .microclimate {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.flower-grid .microclimate-chip {
  min-height: 26px;
  gap: 5px;
  padding: 4px 8px;
  font-size: 10px;
}
.flower-grid .microclimate-chip > .ui-icon {
  width: 14px;
  height: 14px;
}

/* Stage 5: comfortable touch targets, resilient layouts, and clear keyboard focus. */
:where(button, a, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 62%, white);
  outline-offset: 3px;
}

.flower-card,
.surface-card,
.icon-button,
.button,
.palette-swatch,
.primary-nav-link,
.dock-tab {
  transition-duration: .18s;
}

@media (max-width: 720px) {
  .catalog-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-title-row,
  .catalog-filter-panel,
  .season-tracker-columns,
  .feature-layout,
  .random-pick-plant { min-width: 0; }
  .page-title-row > *,
  .flower-card,
  .surface-card { min-width: 0; }
  .favorite-button { width: 44px; height: 44px; }
  .plant-note-indicator { width: 36px; height: 36px; }
  dialog#flower-dialog { max-height: calc(100dvh - 24px); }
}

@media (max-width: 480px) {
  .catalog-filter-panel { grid-template-columns: minmax(0, 1fr); }
  .catalog-filter-disclosure > summary { align-items: flex-start; flex-wrap: wrap; }
  .catalog-filter-disclosure > summary span { width: 100%; margin-left: 0; }
  .detail-actions { grid-template-columns: minmax(0, 1fr); }
  .detail-action-button { min-height: 46px; }
  .dialog-content { padding: 16px; }
  .flower-card-actions { flex-wrap: wrap; }
  .flower-card-actions .button { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Final polish: consistent, quiet feedback without changing page behavior. */
:where(.surface-card, .flower-card, .home-fact, .quick-link, .catalog-filter-disclosure) {
  border-color: var(--line);
}
:where(.button, .icon-button, .detail-action-button, .season-add, .season-remove):active {
  transform: translateY(1px);
}
:where(.button, .icon-button, .detail-action-button, .season-add, .season-remove):focus-visible {
  outline-color: color-mix(in srgb, var(--blue) 65%, white);
}
:where(.flower-latin, .taxonomy-line, .botanical-meta, .photo-credit-detail) {
  overflow-wrap: anywhere;
}
:where(.flower-description, .detail-text, .season-note, .about-banner p) {
  text-wrap: pretty;
}

@media (max-width: 520px) {
  .catalog-filter-disclosure > summary { min-height: 48px; }
  .flower-grid .flower-info { padding: 14px; }
  .flower-grid .flower-card-actions { gap: 8px; }
  .flower-grid .flower-card-actions .button { min-height: 42px; }
  .site-footer { padding-bottom: 18px; }
}

/* Refined footer and a readable photo credit on the daily-plant hero. */
.site-footer {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--hero-tint) 55%, var(--surface)));
  box-shadow: var(--shadow-soft);
}
.footer-main {
  align-items: flex-start;
  padding: 24px 28px 18px;
}
.footer-links {
  max-width: 720px;
  gap: 6px;
}
.footer-links button {
  min-height: 34px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: color .18s, background-color .18s;
}
.footer-links button:hover {
  transform: none;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 9%, var(--surface));
}
.footer-bottom {
  margin-inline: 28px;
  padding: 12px 0 17px;
  line-height: 1.65;
}
.hero-art-label {
  max-width: calc(100% - 46px);
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 10px;
  background: rgba(22, 35, 30, .58);
  backdrop-filter: blur(8px);
  font-size: 9px;
  letter-spacing: .02em;
  line-height: 1.45;
  text-transform: none;
  overflow-wrap: anywhere;
}
.hero-art-label:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 720px) {
  .footer-main { gap: 12px; padding: 20px 18px 14px; }
  .footer-links { justify-content: flex-start; gap: 4px; }
  .footer-links button { min-height: 38px; padding-inline: 9px; }
  .footer-bottom { margin-inline: 18px; padding-bottom: 15px; }
  .hero-art-label { max-width: calc(100% - 32px); bottom: 14px; left: 16px; }
}

/* A true side-by-side comparison: shared rows make differences easy to scan. */
dialog.compare-dialog {
  width: min(900px, calc(100% - 28px));
  max-width: 900px;
  max-height: min(90vh, 900px);
  max-height: min(90dvh, 900px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(15, 25, 48, .34);
}
dialog.compare-dialog::backdrop { background: rgba(18, 28, 50, .58); backdrop-filter: blur(5px); }
.compare-dialog-content { position: relative; max-height: min(90vh, 900px); max-height: min(90dvh, 900px); overflow: auto; padding: clamp(20px, 4vw, 34px); }
.compare-dialog-content > h2 { margin: 0 48px 20px 0; font-size: clamp(22px, 4vw, 30px); }
.compare-dialog-content > .dialog-close { position: absolute; top: 20px; right: 20px; color: var(--muted); border-color: var(--line); background: var(--surface-raised); }
.compare-plants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.compare-plant { min-width: 0; overflow: hidden; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
.compare-plant-image-wrap { aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface); }
.compare-plant-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.compare-plant-image-placeholder { width: 100%; height: 100%; display: grid; place-items: center; padding: 12px; color: var(--muted); background: var(--surface); font-size: var(--text-xs); text-align: center; }
.compare-plant-credit { min-height: 2.8em; overflow: hidden; margin: 9px 0 4px; color: var(--muted); font-size: 10px; line-height: 1.4; text-overflow: ellipsis; }
.compare-plant-credit a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.compare-plant h3 { overflow: hidden; font-size: clamp(13px, 2vw, 17px); text-overflow: ellipsis; white-space: nowrap; }
.compare-plant .flower-latin { overflow-wrap: anywhere; }
.compare-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.compare-table { width: 100%; min-width: 500px; border-collapse: collapse; font-size: var(--text-sm); }
.compare-table th, .compare-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare-table thead th { color: var(--muted); background: var(--surface-raised); font-size: var(--text-xs); font-weight: 700; }
.compare-table thead th:not(:first-child) { color: var(--blue); }
.compare-table tbody tr:last-child th, .compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-table tbody th { width: 26%; color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
.compare-table td { width: 37%; }
.compare-table td.is-different { color: var(--ink); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); font-weight: 700; }
@media (max-width: 520px) {
  dialog.compare-dialog { width: calc(100% - 20px); border-radius: var(--radius-lg); }
  .compare-dialog-content { padding: 16px; }
  .compare-plants { gap: 8px; }
  .compare-plant { padding: 7px; }
  .compare-plant-credit { min-height: 3em; font-size: 9px; }
  .compare-table th, .compare-table td { padding: 10px 9px; }
}

.recent-plants { margin: 12px 0 18px; }
.recent-plants[hidden] { display: none; }
.recent-plants-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.recent-plants-heading h2 { margin: 0; color: var(--muted); font-family: var(--sans); font-size: var(--text-sm); font-weight: 700; }
.recent-plants-clear { min-height: 32px; padding: 4px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted); background: var(--surface); font-size: var(--text-xs); }
.recent-plants-clear:hover { color: var(--blue); border-color: var(--blue); }
.recent-plants-list { display: flex; gap: 9px; overflow-x: auto; padding: 2px 1px 7px; }
.recent-plant { width: 118px; min-width: 118px; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--ink); background: var(--surface); text-align: left; transition: border-color .18s, transform .18s; }
.recent-plant:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); }
.recent-plant img, .recent-plant-placeholder { width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-sm); color: var(--blue); background: var(--surface-raised); object-fit: cover; }
.recent-plant-placeholder .ui-icon { width: 27px; height: 27px; }
.recent-plant-name { overflow: hidden; font-size: var(--text-xs); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .recent-plants { margin: 9px 0 14px; }
  .recent-plant { width: 102px; min-width: 102px; }
}

.collection-stat {
  margin: -7px 0 14px;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.6;
}
.collection-stat[hidden] { display: none; }

/* Этап 1: более ясная иерархия и равномерный ритм в карточке растения. */
dialog#flower-dialog {
  width: min(720px, calc(100% - 28px));
}
#flower-detail {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: stretch;
}
#flower-detail > .detail-photo,
#flower-detail > .detail-no-photo {
  order: 1;
  width: 100%;
  max-height: clamp(220px, 36vh, 390px);
  margin: 0;
  border-radius: var(--radius-md);
  object-fit: cover;
}
#flower-detail > .eyebrow { order: 5; margin: 0 !important; }
#flower-detail > #detail-name {
  order: 2;
  max-width: 26ch;
  margin: 0 !important;
  font-size: clamp(27px, 5vw, 36px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
#flower-detail > .flower-latin { order: 3; margin: 0; font-size: var(--text-sm); }
#flower-detail .detail-actions { display: contents; }
#flower-detail .detail-actions > :not(.favorite-detail-button) { order: 14; }
#flower-detail .favorite-detail-button {
  order: 6;
  align-self: flex-start;
  min-height: 48px;
  padding-inline: 20px;
  font-size: var(--text-sm);
}
#flower-detail > .detail-section {
  margin: 0;
  padding: 0;
  border: 0;
}
#flower-detail > .detail-section[aria-labelledby="detail-care-title"] { order: 7; }
#flower-detail > .detail-section[aria-labelledby="detail-description-title"] { order: 8; }
#flower-detail .detail-section h3 { margin-bottom: 10px; font-size: var(--text-lg); }
#flower-detail .detail-text { max-width: var(--text-measure); margin: 0; font-size: var(--text-sm); line-height: 1.75; }
#flower-detail > .plant-notes { order: 9; margin: 0; }
#flower-detail > .watering-card { order: 10; margin: 0; }
#flower-detail .care-pdf-button { order: 14; }
#flower-detail > .care-pdf-status { order: 15; margin: -16px 0 0; }
#flower-detail > .taxonomy-details { order: 16; max-width: var(--text-measure); margin: 0; padding-top: 14px; font-size: var(--text-xs); line-height: 1.6; }
#flower-detail .photo-credit-detail { font-size: var(--text-xs); line-height: 1.55; overflow-wrap: anywhere; }
#flower-detail > .similar-plants { order: 17; margin: 0; }
#flower-detail .similar-plants h3 { font-size: var(--text-lg); }
#flower-detail .detail-action-button { min-height: 44px; }

@media (max-width: 520px) {
  dialog#flower-dialog { width: calc(100% - 20px); }
  #flower-detail { gap: 20px; }
  #flower-detail > .detail-photo,
  #flower-detail > .detail-no-photo { max-height: 32vh; }
  #flower-detail > #detail-name { font-size: clamp(25px, 8vw, 32px); }
  #flower-detail .favorite-detail-button { width: 100%; justify-content: center; }
  #flower-detail > .detail-section { padding-top: 18px; }
}

/* Stage 2: keep care and plant information visible; fold personal and reference details. */
#flower-detail > .detail-disclosure,
#flower-detail > .taxonomy-details {
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
#flower-detail > .detail-notes { order: 9; }
#flower-detail > .detail-watering-disclosure { order: 10; }
#flower-detail > .taxonomy-details { order: 16; padding-top: 0; }
#flower-detail > .detail-disclosure > summary,
#flower-detail > .taxonomy-details > summary {
  min-height: 48px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px 42px 10px 15px;
  color: var(--blue);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 750;
  list-style: none;
}
#flower-detail > .detail-disclosure > summary::-webkit-details-marker,
#flower-detail > .taxonomy-details > summary::-webkit-details-marker { display: none; }
#flower-detail > .detail-disclosure > summary::after,
#flower-detail > .taxonomy-details > summary::after {
  width: 8px;
  height: 8px;
  position: absolute;
  right: 17px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease;
}
#flower-detail > .detail-disclosure[open] > summary::after,
#flower-detail > .taxonomy-details[open] > summary::after {
  transform: rotate(225deg) translate(-2px, -1px);
}
#flower-detail > .detail-notes > .plant-notes {
  margin: 0;
  padding: 14px 15px 15px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}
#flower-detail > .detail-watering-disclosure > .watering-card {
  margin: 0;
  padding: 14px 15px 15px;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
#flower-detail > .taxonomy-details > .flower-facts,
#flower-detail > .taxonomy-details > .photo-credit-detail {
  margin-right: 15px;
  margin-left: 15px;
}
#flower-detail > .taxonomy-details > .flower-facts { margin-top: 0; padding-top: 13px; }
#flower-detail > .taxonomy-details > .photo-credit-detail:last-child { margin-bottom: 15px; }
#flower-detail > .similar-plants { width: 100%; min-width: 0; }
#flower-detail .similar-plants-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
#flower-detail .similar-plant-card {
  width: 138px;
  min-width: 138px;
  flex: 0 0 138px;
  scroll-snap-align: start;
}
@media (max-width: 520px) {
  #flower-detail .similar-plant-card { width: 124px; min-width: 124px; flex-basis: 124px; }
}

/* Detail actions: one clear collection action, followed by compact accessible utilities. */
#flower-detail .detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  order: 6;
  margin: 0;
}
#flower-detail .detail-actions > :not(.favorite-detail-button) { order: 1; }
#flower-detail .favorite-detail-button {
  width: min(100%, 380px);
  min-height: 54px;
  flex: 1 1 100%;
  justify-content: center;
  padding-inline: 20px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
#flower-detail .detail-actions > :not(.favorite-detail-button) {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border-radius: var(--radius-sm);
}
#flower-detail .detail-actions > :not(.favorite-detail-button):not(.care-pdf-button) > span {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#flower-detail .detail-actions > :not(.favorite-detail-button) > .ui-icon { width: 19px; height: 19px; }
@media (max-width: 520px) {
  #flower-detail .detail-actions { gap: 7px; }
  #flower-detail .favorite-detail-button { min-height: 52px; }
}

/* Keep collection as a compact heart; make the PDF action explicit. */
#flower-detail .favorite-detail-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border-radius: 50%;
}
#flower-detail .care-pdf-button {
  width: auto;
  min-width: 0;
  min-height: 44px;
  flex: 1 1 auto;
  justify-content: center;
  gap: 9px;
  padding: 9px 14px;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}
#flower-detail .care-pdf-button > span {
  width: auto;
  height: auto;
  position: static;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}
@media (max-width: 520px) {
  #flower-detail .favorite-detail-button { min-height: 44px; }
  #flower-detail .care-pdf-button { flex: 1 1 calc(100% - 52px); padding-inline: 10px; }
}

#flower-detail .care-pdf-button {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
}

/* Keep the plant-detail actions in a stable, non-overlapping row. */
#flower-detail .detail-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 12px;
}
#flower-detail .detail-actions .favorite-detail-button {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
}
#flower-detail .detail-actions .care-pdf-button {
  width: auto;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  flex: 1 1 0;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  border-radius: var(--radius-sm);
}
@media (max-width: 520px) {
  #flower-detail .detail-actions {
    flex-direction: column;
    gap: 10px;
  }
  #flower-detail .detail-actions .favorite-detail-button,
  #flower-detail .detail-actions .care-pdf-button {
    width: 100%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    flex: 0 0 48px;
    border-radius: var(--radius-sm);
  }
  #flower-detail .detail-actions .favorite-detail-button > span.visually-hidden {
    width: auto;
    height: auto;
    position: static;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: nowrap;
  }
}

/* Mobile layout: keep navigation compact and make the catalog easy to scan. */
@media (max-width: 720px) {
  .header-inner {
    min-height: 64px;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 10px;
    padding-block: 9px;
  }
  .brand { order: 1; flex: 0 0 auto; }
  .primary-nav { display: none; }
  .header-actions {
    width: auto;
    order: 2;
    justify-content: flex-end;
    gap: 6px;
  }
  .main-content { padding-top: 16px; }
  .bottom-dock {
    bottom: max(8px, env(safe-area-inset-bottom));
    min-height: 70px;
    padding: 5px;
    border-radius: 20px;
  }
  .dock-tab { min-height: 54px; }
  .dock-tab[aria-current="page"] { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); }
  .dock-label { font-size: 9px; }
  .flora-ai-widget {
    right: 12px;
    bottom: calc(78px + max(20px, env(safe-area-inset-bottom)));
  }
  body { padding-bottom: 112px; }
}

@media (max-width: 520px) {
  .topline { display: none; }
  .shell { width: calc(100% - 28px); }
  .brand { gap: 7px; font-size: 14px; }
  .brand-mark { width: 32px; height: 32px; }
  .palette-swatches { gap: 4px; margin-right: 1px; }
  .palette-swatch { width: 17px; height: 17px; flex-basis: 17px; }
  .header-actions .icon-button { width: 36px; height: 38px; flex-basis: 36px; }
  .hero-card { border-radius: 20px; }
  .hero-copy { padding: 24px 20px; }
  .hero-copy .eyebrow { font-size: 9px; }
  .hero-copy > p { font-size: 13px; line-height: 1.65; }
  .hero-art { min-height: 210px; }
  .hero-orbit { width: 78px; height: 78px; font-size: 11px; }
  .hero-actions { gap: 8px; margin-top: 17px; }
  .hero-actions .button { min-height: 44px; }
  .home-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .home-fact { justify-content: center; padding: 9px 5px; }
  .home-fact strong { font-size: 10px; }
  .flower-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .flower-grid .flower-info { min-height: 0; gap: 0; padding: 11px; }
  .flower-grid .flower-card-name h3 { font-size: 13px; }
  .flower-grid .flower-latin { font-size: 10px; }
  .flower-grid .plant-tags { gap: 4px; margin-top: 8px; }
  .flower-grid .plant-tag { padding: 4px 7px; font-size: 9px; }
  .flower-grid .plant-tag:nth-child(n + 2) { display: none; }
  .flower-grid .microclimate { gap: 4px; margin-top: 8px; }
  .flower-grid .microclimate-chip { min-height: 24px; padding: 4px 6px; font-size: 9px; }
  .flower-grid .flower-card-actions { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 6px; padding-top: 10px; }
  .flower-grid .flower-card-actions .button { min-width: 0; min-height: 40px; padding-inline: 5px; font-size: 10px; }
  .flower-grid .flower-card-actions .compare-select-button { width: 40px; min-height: 40px; padding: 0; gap: 0; font-size: 0; }
  .flower-grid .flower-card-actions .compare-select-button .ui-icon { width: 17px; height: 17px; }
  .flora-ai-widget { right: 10px; }
  .flora-ai-panel {
    width: min(420px, calc(100vw - 20px));
    height: min(620px, calc(100dvh - 150px));
    min-height: min(380px, calc(100dvh - 150px));
    border-radius: 20px;
  }
  .flora-ai-toggle { min-height: 46px; }
  .site-footer { margin-bottom: 8px; }
}

@media (max-width: 360px) {
  .shell { width: calc(100% - 24px); }
  .brand { gap: 5px; font-size: 12px; }
  .brand-mark { width: 29px; height: 29px; }
  .header-inner { gap: 4px; }
  .header-actions { gap: 4px; }
  .palette-swatches { gap: 3px; }
  .palette-swatch { width: 12px; height: 12px; flex-basis: 12px; }
  .header-actions .icon-button { width: 33px; height: 36px; flex-basis: 33px; }
  .dock-tab { padding-inline: 1px; }
  .dock-label { font-size: 8px; }
  .flower-grid .flower-info { padding: 9px; }
  .flower-grid .flower-card-name h3 { font-size: 12px; }
  .flower-grid .microclimate-chip { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
}
