:root {
  --ink: #24332b;
  --ink-soft: #5d6a62;
  --paper: #f5f0e5;
  --panel: #fffdf7;
  --leaf: #48634f;
  --leaf-deep: #2f4939;
  --sage: #dfe6d6;
  --sage-soft: #edf1e8;
  --clay: #b86746;
  --gold: #d8ad63;
  --line: #ded9cc;
  --shadow: 0 14px 40px rgba(49, 57, 44, 0.09);
  --radius: 18px;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(84, 91, 78, 0.16);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border: 1px solid #bfc8b5; border-radius: 50%; padding: 5px; background: #eef1e6; fill: none; stroke: var(--leaf); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand span { display: grid; }
.brand strong { font-family: "Newsreader", Georgia, serif; font-size: 20px; line-height: 1.05; letter-spacing: .01em; }
.brand small { margin-top: 3px; color: var(--ink-soft); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.save-state { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 12px; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: #6e8c62; box-shadow: 0 0 0 3px rgba(110, 140, 98, .13); }

.button { min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 999px; font-weight: 700; font-size: 13px; transition: transform .16s ease, background .16s ease, border .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-ghost { border-color: #ccd0c4; background: rgba(255,255,255,.42); }
.button-primary { color: white; background: var(--leaf-deep); box-shadow: 0 8px 20px rgba(47,73,57,.18); }
.button-primary:hover { background: #243d2e; }
.button-full { width: 100%; }

.app-shell { display: grid; grid-template-columns: minmax(370px, 1.15fr) minmax(340px, 1fr) minmax(330px, .95fr); min-height: calc(100vh - 76px); }
.panel { min-width: 0; padding: 28px 24px 44px; border-right: 1px solid var(--line); }
.panel:last-child { border-right: 0; }
.plants-panel { background: rgba(255,255,255,.24); }
.plan-panel { background: #ede8dc; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.panel-heading h1, .panel-heading h2, .modal-header h2 { margin: 2px 0 0; font-family: "Newsreader", Georgia, serif; font-size: clamp(27px, 2.1vw, 35px); font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.eyebrow { margin: 0; color: var(--clay); font-size: 10px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.52); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.project-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-height: 440px; margin-bottom: 20px; overflow: hidden; opacity: 1; transition: max-height .25s ease, opacity .2s ease, margin .25s ease; }
.project-details.is-collapsed { max-height: 0; margin-bottom: 0; opacity: 0; }
.field { display: grid; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field > span { color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; border: 1px solid #d8d4c8; border-radius: 10px; outline: none; background: rgba(255,255,255,.62); padding: 10px 11px; font-size: 13px; transition: border .16s ease, box-shadow .16s ease; }
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .search-wrap:focus-within { border-color: #91a18c; box-shadow: 0 0 0 3px rgba(94,119,93,.11); }

.map-card { overflow: hidden; border: 1px solid #d6d4ca; border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-bottom: 1px solid #e7e2d7; }
.segmented { display: inline-flex; max-width: 100%; padding: 3px; overflow-x: auto; border-radius: 10px; background: #ebe9e1; }
.segment { min-height: 32px; padding: 6px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.segment.is-active { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(41,53,44,.08); }
.segment-remove.is-active { color: #874f45; background: #fff8f5; }
.bed-light-picker { display: flex; align-items: center; gap: 7px; padding: 9px 12px; overflow-x: auto; border-bottom: 1px solid #e7e2d7; background: #faf8f1; }
.bed-light-picker > span { margin-right: 3px; color: var(--ink-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.bed-light-option { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 9px; border: 1px solid #d8d4c8; border-radius: 999px; color: var(--ink-soft); background: white; font-size: 11px; font-weight: 700; white-space: nowrap; }
.bed-light-option.is-active { color: var(--ink); border-color: #748876; box-shadow: 0 0 0 2px rgba(94,119,93,.10); }
.bed-light-option i { width: 13px; height: 13px; flex: 0 0 13px; border: 1px solid rgba(47,73,57,.18); border-radius: 50%; }
.sun-swatch { background: #e9c85f; }
.part-shade-swatch { background: #9fbd8d; }
.shade-swatch { background: #5f7f6b; }
.map-size-controls { display: flex; align-items: end; gap: 7px; }
.map-size-controls label { display: grid; grid-template-columns: 43px 18px; align-items: center; gap: 3px; color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.map-size-controls label span { grid-column: 1 / -1; }
.map-size-controls input { width: 43px; min-height: 30px; padding: 4px 5px; border: 1px solid #ddd9cd; border-radius: 8px; background: white; font-size: 11px; }
.map-size-controls small { font-size: 9px; }
.map-stage { max-width: 100%; padding: 13px 14px 10px; overflow: auto; background: #f7f5ee; }
.orientation-label { margin: 6px 0 2px; color: #8b8d83; font-size: 9px; font-weight: 700; letter-spacing: .09em; text-align: center; text-transform: uppercase; }
.orientation-back { margin-top: 0; }
.bed-grid { display: grid; grid-template-columns: repeat(var(--grid-cols, 12), 1fr); width: 100%; min-width: var(--grid-min-width, 0); aspect-ratio: var(--grid-ratio, 1.5); touch-action: none; user-select: none; border-top: 1px solid #dfded6; border-left: 1px solid #dfded6; }
.grid-cell { position: relative; min-width: 0; padding: 0; border: 0; border-right: 1px solid #dfded6; border-bottom: 1px solid #dfded6; background: rgba(255,255,255,.34); transition: background .1s ease; }
.grid-cell::after { content: ""; position: absolute; inset: 12%; border-radius: 38% 62% 46% 54% / 58% 45% 55% 42%; background: transparent; }
.grid-cell.is-bed { background: #dfe5d5; }
.grid-cell.is-bed::after { background: rgba(98,121,86,.10); }
.grid-cell.is-bed[data-light="Full sun"] { background: #f2dda0; }
.grid-cell.is-bed[data-light="Full sun"]::after { background: rgba(190,143,33,.13); }
.grid-cell.is-bed[data-light="Part shade"] { background: #bfd2ae; }
.grid-cell.is-bed[data-light="Part shade"]::after { background: rgba(77,116,65,.12); }
.grid-cell.is-bed[data-light="Shade"] { background: #799783; }
.grid-cell.is-bed[data-light="Shade"]::after { background: rgba(32,68,45,.16); }
.map-label { position: absolute; z-index: 4; top: 50%; left: 50%; width: max-content; max-width: 150px; padding: 3px 6px; overflow: hidden; border: 1px solid rgba(47,73,57,.28); border-radius: 5px; color: #25382b; background: rgba(255,253,247,.94); box-shadow: 0 2px 7px rgba(42,58,47,.14); font-size: 10px; font-weight: 800; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; transform: translate(-50%, -50%); pointer-events: none; }
.grid-cell.has-plant::before { content: attr(data-short); position: absolute; inset: 13%; z-index: 2; display: grid; place-items: center; overflow: hidden; border: 2px solid rgba(255,255,255,.76); border-radius: 50%; color: white; background: var(--plant-color, #54725a); box-shadow: 0 3px 8px rgba(42,58,47,.2); font-size: clamp(6px, .65vw, 10px); font-weight: 800; text-transform: uppercase; }
.map-footer { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 9px 13px; color: var(--ink-soft); border-top: 1px solid #e5e0d5; font-size: 11px; }
.map-footer > span:first-child { white-space: nowrap; }
.one-foot-key { color: #6b766d; white-space: nowrap; }
.map-hint { flex: 1; text-align: center; }
.text-button { padding: 3px; border: 0; background: transparent; color: var(--leaf-deep); font-size: 11px; font-weight: 800; text-decoration: underline; text-decoration-color: rgba(47,73,57,.26); text-underline-offset: 3px; }
.preset-row { display: flex; align-items: center; gap: 7px; padding: 10px 13px 13px; overflow-x: auto; border-top: 1px solid #e5e0d5; }
.preset-row > span { margin-right: auto; color: var(--ink-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }
.preset { padding: 6px 8px; border: 1px solid #d8d6ca; border-radius: 999px; background: white; color: var(--ink-soft); font-size: 10px; font-weight: 600; white-space: nowrap; }
.site-summary { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.summary-chip { padding: 6px 9px; border: 1px solid #d8d6cb; border-radius: 999px; background: rgba(255,255,255,.38); color: var(--ink-soft); font-size: 10px; font-weight: 700; }

.plants-heading { align-items: center; }
.compare-button { min-height: 36px; padding: 7px 10px 7px 12px; border: 1px solid #c8ccbf; border-radius: 999px; background: transparent; font-size: 11px; font-weight: 800; }
.compare-button span { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 4px; border-radius: 50%; color: white; background: var(--leaf); }
.compare-button:disabled { opacity: .45; cursor: default; }
.search-wrap { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid #d6d3c7; border-radius: 12px; background: rgba(255,255,255,.65); }
.search-wrap svg { width: 17px; height: 17px; fill: none; stroke: #7c837b; stroke-width: 1.8; }
.search-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; }
.filter-scroll { display: flex; gap: 7px; margin: 13px 0; overflow-x: auto; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid #d7d5ca; border-radius: 999px; background: rgba(255,255,255,.48); color: var(--ink-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }
.filter-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--layer-color); }
.filter-chip.is-active { border-color: var(--leaf); color: white; background: var(--leaf-deep); }
.more-filters { border-top: 1px solid #dcd8ce; border-bottom: 1px solid #dcd8ce; }
.more-filters summary { padding: 10px 1px; color: var(--ink-soft); cursor: pointer; font-size: 11px; font-weight: 700; list-style: none; }
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters summary::after { content: "+"; float: right; font-size: 17px; font-weight: 400; }
.more-filters[open] summary::after { content: "−"; }
.more-filters summary span { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 4px; padding: 0 5px; border-radius: 999px; color: white; background: var(--clay); font-size: 9px; }
.more-filters summary span:empty { display: none; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 3px 0 12px; }
.results-row { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 8px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.plant-list { display: grid; gap: 9px; }
.plant-card { position: relative; display: grid; grid-template-columns: 58px 1fr auto; gap: 11px; min-width: 0; padding: 11px; border: 1px solid #dedbd0; border-radius: 14px; background: rgba(255,253,247,.78); transition: border .16s ease, transform .16s ease, box-shadow .16s ease; }
.plant-card:hover { transform: translateY(-1px); border-color: #b8c1b2; box-shadow: 0 8px 20px rgba(47,59,49,.07); }
.plant-swatch { position: relative; display: grid; place-items: end center; width: 58px; height: 64px; overflow: hidden; border-radius: 11px; background: var(--swatch-bg); }
.plant-swatch::before { content: ""; position: absolute; left: 50%; bottom: 12px; width: 3px; height: 31px; border-radius: 2px; background: #536950; transform: translateX(-50%); }
.plant-swatch i, .plant-swatch i::before, .plant-swatch i::after { position: absolute; display: block; width: 22px; height: 14px; border-radius: 70% 30% 70% 30%; background: var(--swatch); content: ""; }
.plant-swatch i { left: 16px; bottom: 28px; transform: rotate(-18deg); }
.plant-swatch i::before { left: -9px; top: 10px; transform: rotate(55deg); }
.plant-swatch i::after { left: 12px; top: -11px; transform: rotate(50deg); }
.plant-swatch span { z-index: 2; width: 100%; padding: 4px; color: #324235; background: rgba(255,255,255,.7); font-size: 8px; font-weight: 800; text-align: center; text-transform: uppercase; }
.plant-info { min-width: 0; }
.plant-info h3 { margin: 0; overflow: hidden; font-family: "Newsreader", Georgia, serif; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.plant-info em { display: block; margin-top: 1px; overflow: hidden; color: var(--ink-soft); font-family: Georgia, serif; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.plant-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.meta-pill { padding: 3px 5px; border-radius: 4px; color: #5c675e; background: #ecefe7; font-size: 8px; font-weight: 700; }
.meta-origin { color: #765d4f; background: #f1e6db; }
.meta-origin.is-native { color: #36583f; background: #dfeade; }
.plant-actions { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; }
.compare-check { display: flex; align-items: center; gap: 4px; color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.compare-check input { accent-color: var(--leaf); }
.add-plant { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; color: white; background: var(--leaf); font-size: 19px; line-height: 1; }
.add-plant.is-added { color: var(--leaf-deep); background: var(--sage); font-size: 14px; }
.no-results { padding: 34px 18px; border: 1px dashed #ccc9bd; border-radius: 14px; color: var(--ink-soft); text-align: center; }
.no-results strong { display: block; margin-bottom: 4px; font-family: "Newsreader", Georgia, serif; color: var(--ink); font-size: 20px; }

.plan-empty { min-height: 430px; display: grid; place-content: center; justify-items: center; text-align: center; }
.plan-empty h3 { margin: 19px 0 4px; font-family: "Newsreader", Georgia, serif; font-size: 24px; }
.plan-empty p { max-width: 250px; margin: 0 0 19px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.empty-illustration { position: relative; width: 180px; height: 90px; border-bottom: 1px solid #b5b5a8; }
.empty-illustration i { position: absolute; bottom: 0; width: 32px; height: 32px; border-radius: 60% 40% 55% 45%; background: #aebaa1; transform-origin: bottom; }
.empty-illustration i:nth-child(1) { left: 3px; height: 67px; background: #798d73; }
.empty-illustration i:nth-child(2) { left: 38px; width: 45px; height: 48px; background: #91a384; }
.empty-illustration i:nth-child(3) { left: 79px; width: 28px; height: 28px; background: #c68b73; }
.empty-illustration i:nth-child(4) { left: 108px; width: 38px; height: 41px; background: #9baa8b; }
.empty-illustration i:nth-child(5) { left: 145px; width: 31px; height: 20px; background: #71866c; }
.is-hidden { display: none !important; }
.preview-card, .coverage-card { margin-bottom: 13px; border: 1px solid #d5d0c5; border-radius: 16px; background: rgba(255,253,247,.72); box-shadow: 0 7px 22px rgba(47,55,45,.05); }
.preview-card { overflow: hidden; }
.preview-title { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px 8px; }
.preview-title > div { display: grid; }
.preview-title span { font-size: 11px; font-weight: 800; }
.preview-title small { margin-top: 2px; color: var(--ink-soft); font-size: 8px; }
.layer-scene { position: relative; min-height: 210px; overflow: hidden; border-top: 1px solid #e1ddd2; background: linear-gradient(#e8eee6 0 45%, #d9d3bf 45% 48%, #cbbd98 48% 100%); }
.layer-scene::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px); background-size: 28px 28px; }
.scene-plant { --scene-size: 50px; position: absolute; z-index: var(--z); left: var(--x); bottom: var(--y); display: grid; place-items: center; width: var(--scene-size); height: var(--scene-size); border: 2px solid rgba(255,255,255,.7); border-radius: 50% 45% 55% 42%; color: white; background: var(--plant-color); box-shadow: 0 5px 10px rgba(44,59,45,.18); transform: translateX(-50%) rotate(var(--rot)); font-size: 8px; font-weight: 800; text-align: center; }
.scene-plant span { max-width: 90%; transform: rotate(calc(-1 * var(--rot))); }
.scene-vine { border-radius: 50% 10%; }
.coverage-card { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 13px; }
.coverage-card strong { font-family: "Newsreader", Georgia, serif; font-size: 17px; }
.coverage-card small { grid-column: 1 / -1; color: var(--ink-soft); font-size: 9px; line-height: 1.4; }
.coverage-meter { align-self: center; width: 82px; height: 7px; overflow: hidden; border-radius: 999px; background: #ddd9ce; }
.coverage-meter i { display: block; height: 100%; border-radius: inherit; background: var(--leaf); }
.plan-groups { display: grid; gap: 9px; }
.plan-group { overflow: hidden; border: 1px solid #d5d0c5; border-radius: 13px; background: rgba(255,253,247,.72); }
.plan-group-title { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border-bottom: 1px solid #e0dcd1; color: var(--ink-soft); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.plan-group-title i { width: 8px; height: 8px; border-radius: 50%; background: var(--layer-color); }
.plan-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; min-height: 47px; padding: 7px 9px 7px 11px; border-bottom: 1px solid #ebe7dc; }
.plan-item:last-child { border-bottom: 0; }
.plan-item-name { min-width: 0; }
.plan-item-name strong { display: block; overflow: hidden; font-family: "Newsreader", Georgia, serif; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.plan-item-name small { color: var(--ink-soft); font-size: 8px; }
.quantity { display: flex; align-items: center; gap: 3px; padding: 2px; border: 1px solid #d6d2c6; border-radius: 999px; background: white; }
.quantity button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; font-weight: 700; }
.quantity span { min-width: 17px; font-size: 10px; font-weight: 800; text-align: center; }
.remove-plant { min-height: 30px; padding: 5px 8px; border: 1px solid #d9c5be; border-radius: 8px; background: #fffaf7; color: #8c594e; font-size: 10px; font-weight: 800; }
.plan-notes { margin: 13px 0; }

.modal { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 20px; border: 0; background: transparent; }
.modal::backdrop { background: rgba(33,42,35,.66); backdrop-filter: blur(5px); }
.modal-card { width: min(850px, 100%); max-height: calc(100vh - 40px); margin: auto; overflow: auto; border: 0; border-radius: 22px; background: var(--paper); box-shadow: 0 28px 90px rgba(23,33,25,.3); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); background: var(--paper); }
.close-modal { font-size: 24px; }
.compare-table-wrap { padding: 18px 22px 25px; overflow-x: auto; }
.designs-card { width: min(680px, 100%); }
.designs-body { padding: 18px 22px 24px; }
.device-note { margin: 0 0 15px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.connect-device { margin-bottom: 10px; }
.design-list { display: grid; gap: 9px; margin-bottom: 16px; }
.design-empty { padding: 30px 18px; border: 1px dashed #ccc9bd; border-radius: 14px; color: var(--ink-soft); text-align: center; font-size: 12px; }
.design-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid #d8d4c9; border-radius: 13px; background: rgba(255,253,247,.78); }
.design-row.is-active { border-color: #82947f; box-shadow: inset 3px 0 0 var(--leaf); }
.design-info { min-width: 0; }
.design-info strong { display: block; overflow: hidden; font-family: "Newsreader", Georgia, serif; font-size: 17px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.design-info small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 9px; }
.design-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.design-action { min-height: 31px; padding: 6px 9px; border: 1px solid #d0cec3; border-radius: 8px; color: var(--leaf-deep); background: white; font-size: 10px; font-weight: 800; }
.design-action-danger { color: #985d51; }
.compare-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: 11px; border-bottom: 1px solid #ddd8cd; text-align: left; vertical-align: top; font-size: 11px; }
.compare-table th:first-child, .compare-table td:first-child { width: 120px; color: var(--ink-soft); font-weight: 700; }
.compare-table thead th:not(:first-child) { font-family: "Newsreader", Georgia, serif; color: var(--ink); font-size: 17px; }
.compare-add { margin-top: 7px; padding: 6px 10px; border: 0; border-radius: 999px; color: white; background: var(--leaf); font-size: 9px; font-weight: 800; }
.client-card { background: #fbf7ed; }
.client-cover { position: relative; padding: 42px 45px 34px; color: white; background: var(--leaf-deep); }
.client-cover::after { content: ""; position: absolute; right: 40px; bottom: -1px; width: 160px; height: 74px; opacity: .27; background: radial-gradient(ellipse at bottom, transparent 30%, white 32% 34%, transparent 36%) 0 0/42px 74px repeat-x; }
.client-cover .close-client { position: absolute; top: 17px; right: 17px; color: white; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.1); font-size: 22px; }
.client-cover > p { margin: 0 0 13px; color: #cfdcc9; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.client-cover h2 { max-width: 560px; margin: 0; font-family: "Newsreader", Georgia, serif; font-size: clamp(35px, 7vw, 58px); line-height: .98; }
.client-cover #clientPreviewMeta { margin-top: 15px; color: #d7e0d2; font-size: 11px; }
.client-body { padding: 28px 45px 36px; }
.client-intro { max-width: 680px; margin: 0 0 24px; color: #4e5e53; font-family: "Newsreader", Georgia, serif; font-size: 19px; line-height: 1.5; }
.client-layer { margin-top: 20px; }
.client-layer h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 7px; font-family: "Newsreader", Georgia, serif; font-size: 22px; }
.client-layer h3 i { width: 10px; height: 10px; border-radius: 50%; background: var(--layer-color); }
.client-plant-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.client-plant { padding: 11px 12px; border: 1px solid #ded8ca; border-radius: 12px; background: white; }
.client-plant strong { display: block; font-family: "Newsreader", Georgia, serif; font-size: 16px; }
.client-plant span { color: var(--ink-soft); font-size: 9px; }
.client-site-note { margin-top: 25px; padding: 17px; border-left: 3px solid var(--clay); background: #eee8d9; color: #4d594f; font-size: 12px; line-height: 1.55; }
.client-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 45px; border-top: 1px solid var(--line); color: var(--ink-soft); font-family: "Newsreader", Georgia, serif; font-size: 13px; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 24px; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 999px; color: white; background: #24372b; box-shadow: 0 9px 30px rgba(24,37,28,.26); opacity: 0; transform: translate(-50%, 15px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; font-size: 11px; font-weight: 700; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.mobile-tabs { display: none; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: minmax(370px, 1.05fr) minmax(320px, .95fr); }
  .plan-panel { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .plan-content { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 18px; }
  .preview-card { grid-row: span 3; }
  .plan-groups, .plan-notes, .button-full { grid-column: 2; }
}

@media (max-width: 760px) {
  body { padding-bottom: 66px; }
  .topbar { min-height: 64px; padding: 9px 14px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand strong { font-size: 18px; }
  .brand small { font-size: 8px; }
  .save-state { display: none; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .button { padding-inline: 9px; }
  .button-ghost { min-height: 35px; padding: 7px 11px; font-size: 11px; }
  .mobile-tabs { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; background: #2f4939; box-shadow: 0 15px 34px rgba(30,46,35,.34); }
  .mobile-tab { min-height: 42px; border: 0; border-radius: 999px; color: #dce5d9; background: transparent; font-size: 11px; font-weight: 800; }
  .mobile-tab span { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 3px; border-radius: 50%; background: rgba(255,255,255,.16); font-size: 9px; }
  .mobile-tab.is-active { color: var(--ink); background: var(--paper); }
  .app-shell { display: block; min-height: calc(100vh - 64px); }
  .panel { display: none; min-height: calc(100vh - 130px); padding: 23px 16px 35px; border: 0; }
  .panel.is-mobile-active { display: block; }
  .panel-heading { margin-bottom: 17px; }
  .panel-heading h1, .panel-heading h2 { font-size: 30px; }
  .project-details { gap: 9px; }
  .project-details .field { grid-column: 1 / -1; }
  .project-details .field:nth-child(4), .project-details .field:nth-child(5) { grid-column: auto; }
  .map-toolbar { align-items: flex-start; }
  .segmented { flex: 1; }
  .segment { flex: 1; padding-inline: 5px; }
  .map-size-controls { width: 100%; justify-content: flex-end; }
  .map-toolbar { flex-wrap: wrap; }
  .grid-cell.has-plant::before { font-size: 7px; }
  .map-hint { display: none; }
  .preset-row > span { display: none; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .plan-content { display: block; }
  .plan-groups, .plan-notes, .button-full { grid-column: auto; }
  .modal { padding: 0; }
  .modal-card { max-height: 100vh; min-height: 100vh; border-radius: 0; }
  .client-cover { padding: 58px 23px 27px; }
  .client-body { padding: 23px; }
  .client-plant-grid { grid-template-columns: 1fr; }
  .client-footer { align-items: stretch; flex-direction: column; padding: 16px 23px 25px; }
}

@media (max-width: 500px) {
  #newProjectBtn { display: none; }
  .topbar-actions { margin-left: auto; }
  .topbar-actions .button { white-space: nowrap; }
}

@media print {
  body * { visibility: hidden; }
  #clientModal, #clientModal * { visibility: visible; }
  #clientModal { position: absolute; inset: 0; display: block; padding: 0; }
  #clientModal::backdrop, .close-client, .client-footer button { display: none; }
  .client-card { width: 100%; max-height: none; overflow: visible; box-shadow: none; }
  .client-footer { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
