/* Greenhand Gardens Care Guide web app. Colors mirror Theme.swift / CareArea.swift (light, then dark). */
:root {
  color-scheme: light dark;
  --forest: #1F3D2E; --forest-light: #3F6A4E; --forest-fill: #1F3D2E;
  --cream: #FAF6EA; --card: #FFFDF7; --gold: #C0983D; --gold-deep: #9C7623; --rust: #8B4A2E;
  --sage: #5C7A5E; --sage-fill: #DCE5DC; --ink: #2B2B24; --ink-soft: #5A5A4E; --line: #E4DCC6; --water: #2F6F9F;
  --lawn: #3E8E2F; --landscape: #9C4A8F; --irrigation: #2C78C0; --trouble: #D2602A; --pests: #C23B32; --health: #6B52B5; --aftercare: #B8841C; --home: #56687A; --pool: #0B8A94;
  --spring: #C95A8C; --summer: #D7961A; --fall: #C3602A; --winter: #3F78B0;
  --serif: "New York", ui-serif, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  --radius: 18px;
  --tabbar-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --forest: #9FD3B0; --forest-light: #70AA7E; --forest-fill: #2E5A41;
    --cream: #121511; --card: #1C211C; --gold: #D9B458; --gold-deep: #B8933A; --rust: #C97B5A;
    --sage: #8FAE91; --sage-fill: #25332A; --ink: #EDEADF; --ink-soft: #A7A598; --line: #2E342C; --water: #7FB6E0;
    --lawn: #7FCB66; --landscape: #D891CF; --irrigation: #7DB8EE; --trouble: #F0956A; --pests: #F07A70; --health: #B4A2F0; --aftercare: #E2B655; --home: #A3B3C4; --pool: #5FD4DA;
    --spring: #E79BBE; --summer: #F0C25A; --fall: #EE9A66; --winter: #8FBDE8;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.45 var(--sans);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--forest); text-decoration: none; }
a:hover { text-decoration: underline; }
a.card:hover, a.row:hover, a.area-tile:hover, a.feature-tile:hover, a.tab:hover, a.btn:hover, .website-card:hover, a:has(.website-card):hover { text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; line-height: 1.2; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .6em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--water); outline-offset: 2px; }

/* MARK: Shell */
.topbar {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(40px, max-content) 1fr minmax(40px, max-content); align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; min-height: 48px;
  background: color-mix(in srgb, var(--cream) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar-title { font-weight: 600; font-size: .95rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-actions { display: flex; justify-content: flex-end; gap: 6px; }
.topbar-actions .icon-btn, .back { background: none; border: 0; color: var(--forest); font-weight: 600; padding: 6px 8px; border-radius: 10px; cursor: pointer; font-size: 1rem; }
.back { justify-self: start; font-size: 1.05rem; }
.icon-btn { font-size: 1.15rem !important; }
.topbar-spacer { display: block; }
.page { max-width: 680px; margin: 0 auto; padding: 12px 16px 28px; display: flex; flex-direction: column; gap: 20px; }
.loading { text-align: center; padding: 60px 0; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.tab { flex: 1; min-width: 0; max-width: 136px; white-space: nowrap; height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-soft); font-size: .66rem; font-weight: 600; letter-spacing: -.01em; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--lawn); }
.tab.on svg { fill: color-mix(in srgb, currentColor 22%, transparent); }

/* MARK: Text */
.soft { color: var(--ink-soft); }
.caption { font-size: .8rem; }
.strong { font-weight: 600; }
.card-title { font-weight: 600; font-size: 1rem; color: var(--ink); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); }
.section-header h2 { color: var(--forest); }
.section-header p { margin: 2px 0 0; font-size: .92rem; }
.eyebrow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .92; }

/* MARK: Layout */
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-flex { display: flex; align-items: center; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.wrap { display: flex; flex-wrap: wrap; gap: 6px; }
hr, .divider { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* MARK: Cards & rows */
.card {
  display: block; background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--radius); padding: 16px; box-shadow: 0 3px 6px rgb(0 0 0 / .04); color: var(--ink);
}
.card.tight { padding: 12px; }
.accent-card { border-left: 5px solid var(--tint); border-color: color-mix(in srgb, var(--tint) 25%, transparent); border-left-color: var(--tint); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px; width: 100%; text-align: left; cursor: pointer; }
button.row { border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chev { color: var(--ink-soft); font-size: 1.4rem; line-height: 1; font-weight: 300; }

/* "Keep reading" related-guides panel: set apart from the guide above it */
.related { margin-top: 16px; background: var(--sage-fill); border-radius: var(--radius); padding: 14px 14px 4px; }
.related + .related { margin-top: 0; }
.related .label { color: var(--sage); letter-spacing: .08em; }
.related h2 { margin: 2px 0 6px; }
.related-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink); border-top: 1px solid color-mix(in srgb, var(--sage) 25%, transparent); }
.related-row:hover { text-decoration: none; }
.related-row .card-title { flex: 1; min-width: 0; font-size: .97rem; }
.badge {
  flex: none; width: var(--size); height: var(--size); border-radius: calc(var(--size) * .28);
  display: inline-flex; align-items: center; justify-content: center; font-size: calc(var(--size) * .48);
  background: color-mix(in srgb, var(--tint) 16%, transparent);
}
.ico { font-style: normal; line-height: 1; }
.pill { display: inline-block; font-size: .76rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--tint) 12%, transparent); color: var(--tint); }
.pill.filled { background: var(--tint); color: #fff; }

.callout { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--tint) 10%, transparent); font-size: .94rem; }
.callout > .ico { font-size: 1.25rem; width: 24px; text-align: center; }
.callout-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--tint); margin-bottom: 2px; }

/* MARK: Art, banners, tiles */
.art { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.art .blob { position: absolute; border-radius: 50%; background: rgb(255 255 255 / .12); }
.art .b1 { width: 130%; aspect-ratio: 1; right: -70%; bottom: -80%; }
.art .b2 { width: 45%; aspect-ratio: 1; left: -15%; top: -25%; background: rgb(255 255 255 / .08); }
.art .art-symbol { position: absolute; right: calc(var(--sym) * .4); top: 42%; transform: translateY(-50%); font-size: var(--sym); filter: drop-shadow(0 3px 6px rgb(0 0 0 / .18)); }
.art .accent { position: absolute; opacity: .55; font-size: calc(var(--sym) * .3); }
.art .a0 { left: 56%; top: 12%; transform: rotate(-12deg); }
.art .a1 { right: 4%; top: 6%; transform: rotate(10deg); font-size: calc(var(--sym) * .26); }
.art .a2 { left: 70%; top: 2%; transform: rotate(18deg); font-size: calc(var(--sym) * .22); }
.banner, .website-card { position: relative; border-radius: 20px; overflow: hidden; color: #fff; display: flex; align-items: flex-end; }
.website-card { height: 150px; border-radius: 16px; }
.banner-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 45%, rgb(0 0 0 / .45)); }
.banner-text { position: relative; padding: 16px; text-shadow: 0 1px 4px rgb(0 0 0 / .3); max-width: 78%; }
.banner-text h1, .banner-text h2 { color: #fff; font-size: 1.4rem; }
.banner-text p { margin: 4px 0 0; opacity: .94; font-size: .94rem; }
.area-tile { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid color-mix(in srgb, var(--tint) 35%, transparent); box-shadow: 0 4px 8px color-mix(in srgb, var(--tint) 12%, transparent); color: var(--ink); }
.area-tile-art { position: relative; height: 78px; }
.area-tile-text { padding: 12px; display: flex; flex-direction: column; gap: 3px; }
.feature-tile { display: flex; align-items: center; gap: 10px; padding: 12px; min-height: 60px; border-radius: 16px; background: color-mix(in srgb, var(--tint) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tint) 25%, transparent); font-weight: 600; font-size: .92rem; color: var(--ink); text-align: left; cursor: pointer; width: 100%; }
.feature-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--tint); display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }

/* MARK: Progress, sources, lists */
.stage-bar { display: flex; gap: 4px; }
.stage-bar .seg { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.stage-bar .fill { display: block; height: 100%; background: var(--tint); border-radius: 3px; }
.sources { display: flex; flex-direction: column; gap: 8px; font-size: .84rem; }
.source a { word-break: break-word; }
.bullets, .steps { margin: 0; padding-left: 1.25em; display: flex; flex-direction: column; gap: 6px; }
.bullets li::marker { color: var(--lawn); }
.steps li::marker { color: var(--forest); font-weight: 700; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 28px 8px; }
.empty-icon { width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 34px; background: color-mix(in srgb, var(--lawn) 14%, transparent); }
.empty h2 { color: var(--forest); }
details.card > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
details.card > summary::after { content: "+"; color: var(--ink-soft); font-weight: 400; font-size: 1.2rem; line-height: 1; }
details.card[open] > summary::after { content: "–"; }
details.card[open] > summary { margin-bottom: 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--lawn); flex: none; }
.check.done .check-title { text-decoration: line-through; color: var(--ink-soft); }

/* MARK: Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border-radius: 14px; border: 0; font-weight: 600; font-size: .95rem; cursor: pointer; text-align: center; }
.btn-primary, .btn-forest { background: var(--forest-fill); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-forest { background: var(--forest-fill); } }
.btn-gold { background: var(--gold-deep); color: #fff; }
.btn-plain { background: color-mix(in srgb, var(--forest) 10%, transparent); color: var(--forest); }
.btn-danger { background: color-mix(in srgb, var(--rust) 14%, transparent); color: var(--rust); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-row > * { flex: 1 1 140px; }
.btn-row > a > .btn { width: 100%; }
.btn.small { padding: 8px 12px; font-size: .85rem; border-radius: 10px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--forest); font-weight: 600; cursor: pointer; font-size: .95rem; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
input[type=text], input[type=number], input[type=date], input[type=search], input[type=email], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
}
input[type=date] { min-height: 46px; }
textarea { resize: vertical; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / .2); transition: transform .2s; }
.toggle input:checked { background: var(--lawn); }
.toggle input:checked::after { transform: translateX(20px); }
.segmented { display: flex; background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 10px; padding: 2px; gap: 2px; overflow-x: auto; }
.segmented button { flex: 1; border: 0; background: none; padding: 7px 10px; border-radius: 8px; font-size: .86rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.segmented button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.chip.on { background: var(--forest-fill); border-color: var(--forest-fill); color: #fff; }

/* MARK: Sheets & toast */
.sheet-overlay { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .4); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: var(--cream); width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; animation: rise .25s ease-out; outline: none; }
@media (min-width: 700px) { .sheet-overlay { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: .5; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); transform: translate(-50%, 20px); background: var(--ink); color: var(--cream); padding: 10px 16px; border-radius: 12px; font-size: .9rem; opacity: 0; pointer-events: none; transition: all .25s; z-index: 60; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.install-card { display: flex; flex-direction: column; gap: 12px; border-color: color-mix(in srgb, var(--lawn) 40%, transparent); }
.logo-plate { display: inline-block; background: #FAF6EA; border-radius: 14px; padding: 8px; }
.logo-plate img { height: 46px; display: block; }

@media (max-width: 360px) { .grid2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* A card that is also a stack keeps the stack gap. */
.card.stack, .card.stack-lg { display: flex; }

/* MARK: Readable color text (WCAG AA 4.5:1)
   The bright area and season colors work as fills and accents, but not as small text or behind white text.
   Light mode darkens them where they carry text; dark mode puts dark text on the light fills. */
:root .pill, :root .callout-label, :root .stat-label, :root .tab.on { color: color-mix(in srgb, var(--tint, var(--lawn)) 62%, #000); }
:root .pill.filled, :root .month-chip.on { background: color-mix(in srgb, var(--tint) 62%, #000); border-color: transparent; color: #fff; }
:root .btn-gold { background: color-mix(in srgb, var(--gold-deep) 75%, #000); }
@media (prefers-color-scheme: dark) {
  :root .pill, :root .callout-label, :root .stat-label { color: var(--tint); }
  :root .tab.on { color: var(--lawn); }
  :root .pill.filled, :root .month-chip.on { background: var(--tint); color: #121511; }
  :root .btn-gold { background: var(--gold); color: #121511; }
  :root .add-plus { color: #121511; }
}

/* Grass picker (GrassViews.swift) */
.grass-bar { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.grass-change { color: var(--lawn); font-weight: 600; margin-left: auto; }
.grass-choice { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--card); border: 2px solid var(--line); border-radius: 18px; }
.grass-choice.on { border-color: var(--lawn); }
.grass-choice .row-text { display: flex; flex-direction: column; gap: 3px; }
.grass-check { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink-soft); display: grid; place-items: center; color: #fff; font-weight: 700; }
.grass-choice.on .grass-check { background: var(--lawn); border-color: var(--lawn); }
.grass-toggle, .grass-link { color: var(--lawn); padding: 4px 0; }
/* Watering picker: same look as the grass picker, in the irrigation color. */
.grass-choice.water.on { border-color: var(--irrigation); }
.grass-choice.water.on .grass-check { background: var(--irrigation); border-color: var(--irrigation); }
.grass-change.water, .grass-link.water { color: var(--irrigation); }
.grass-choice.tree.on { border-color: var(--landscape); }
.grass-choice.tree.on .grass-check { background: var(--landscape); border-color: var(--landscape); }
.grass-change.tree { color: var(--landscape); }
.trees-card { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
