/* styles.css — ThatcherGarden design system
   Rebuilt on the shared Thatcher family tokens (see DESIGN_SYSTEM.md /
   ThatcherEdu's src/styles/main.css for the canonical source). ThatcherFood
   owns green as its brand colour (by request — non-negotiable), so Garden's
   accent is a separate, more muted pastel duo: sage green paired with a
   warm clay brown, for a softer "forest" feel rather than a leafy green
   that would compete with Food. The deep "forest" tone carries the
   photographic hero/page-head banners that give this app its outdoors,
   editorial feel. Single pass — no stacked eras.
*/

:root {
  /* --- Palette --- */
  --green: #8FA97E;
  --green-soft: #EEF2E9;
  --clay: #B98A5E;
  --clay-soft: #F5E9DD;
  --coral: #E8615A;
  --coral-soft: #FDE9E7;
  --orange: #F5A536;
  --orange-soft: #FEF1DD;

  --forest: #14231A;
  --forest-2: #203327;

  --paper: #F7F8F3;
  --card: #FFFFFF;
  --ink: #1E241C;
  --ink-soft: #6B7568;
  --border: #E4E7DE;
  --hairline: rgba(30, 36, 28, 0.1);

  /* --- Type --- */
  --font-display: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;

  /* --- Depth --- */
  --shadow-sm: 0 2px 6px rgba(20, 35, 22, 0.07);
  --shadow-md: 0 6px 18px rgba(20, 35, 22, 0.11);
  --shadow-lg: 0 12px 32px rgba(20, 35, 22, 0.16);
  --shadow-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;
}

/* --- Reset & base --- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--paper);
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}

::selection { background: var(--green-soft); }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
  border-radius: 6px;
}

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

.ui-icon { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

/* --- App shell --- */
#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  min-height: 100dvh;
  background: var(--paper);
  position: relative;
}

.screen {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 calc(88px + env(safe-area-inset-bottom));
}

/* --- Hero (Home) & page-head (every other screen) --- */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 220px;
  background: var(--forest);
  padding: calc(34px + env(safe-area-inset-top)) 20px 42px;
  color: #fff;
  overflow: hidden;
}
.hero-photo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.hero-shade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(10, 20, 11, 0.78) 0%, rgba(12, 24, 13, 0.35) 58%, rgba(12, 24, 13, 0.06) 100%), linear-gradient(0deg, rgba(10, 20, 10, 0.3), transparent 55%);
}
.hero > * { position: relative; z-index: 2; }
.hero .eyebrow { color: var(--green-soft); }
.hero h1 { font-size: 29px; letter-spacing: -0.02em; margin: 12px 0 6px; color: #fff; }
.hero p { margin: 0; color: #E4E8DF; font-size: 13px; max-width: 380px; }
.hero-actions { position: absolute; top: calc(20px + env(safe-area-inset-top)); right: 18px; z-index: 3; display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.1); color: #fff;
  border-radius: var(--radius-sm); backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(8, 16, 9, 0.22);
  transition: transform 0.15s ease;
}
.icon-btn:hover, .icon-btn:active { transform: translateY(-1px); }
.vision-link {
  position: absolute; left: 20px; bottom: 19px; z-index: 3;
  display: flex; align-items: center; gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.24); background: rgba(14, 26, 14, 0.42); color: #fff;
  border-radius: var(--radius-pill); padding: 7px 12px; font-size: 11px; font-weight: 700;
  backdrop-filter: blur(10px);
}

.page-head {
  position: relative;
  min-height: 150px;
  background: var(--forest);
  background-image: linear-gradient(145deg, var(--forest), var(--forest-2));
  color: #fff;
  padding: calc(24px + env(safe-area-inset-top)) 18px 26px;
  overflow: hidden;
}
.page-head::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 85% 8%, rgba(169, 188, 129, 0.13), transparent 42%);
}
.page-head > * { position: relative; z-index: 1; }
.page-head h1 { font-size: 26px; letter-spacing: -0.02em; margin: 12px 0 4px; }
.page-head p { margin: 0; font-size: 12px; color: #D6DFCF; max-width: 100%; }
.head-back {
  border: 0; background: rgba(255, 255, 255, 0.14); color: #fff;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: grid; place-items: center; margin-bottom: 12px;
}
.eyebrow { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.overline { display: block; font-size: 10px; line-height: 1.3; letter-spacing: 0.11em; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; }

/* --- Content wrapper --- */
.content { padding: 0 16px 24px; }
.home-content { margin-top: -48px; position: relative; z-index: 2; }
.flat-content { margin-top: 0; padding-top: 4px; }
.task-detail { margin-top: 0; padding: 20px 16px 24px; }
.area-content { margin-top: 0; padding: 18px 16px 24px; }
.vision-content { margin-top: 0; padding: 26px 16px 24px; }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 22px 2px 12px; }
.section-head h2 { font-size: 19px; letter-spacing: -0.015em; }
.section-head p { margin: 3px 0 0; color: var(--ink-soft); font-size: 12px; }
.section-head:first-child { margin-top: 20px; }
.link-btn { border: 0; background: none; color: var(--green); font-weight: 800; font-size: 12px; padding: 4px; }

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.card.wide { grid-column: 1 / -1; }

.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 6px; }
.metric { min-height: 118px; }
.metric .label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; color: var(--ink-soft); }
.metric strong { display: block; font-size: 22px; font-weight: 800; margin: 9px 0 2px; letter-spacing: -0.02em; }
.metric small { color: var(--ink-soft); font-size: 10px; }
.metric-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--green-soft); color: var(--green);
  display: grid; place-items: center; margin-bottom: 9px;
}
.metric-icon .ui-icon { width: 18px; height: 18px; }

.quiet-card { text-align: center; padding: 22px; color: var(--ink-soft); font-size: 12px; }

/* --- Progress --- */
.progress { height: 7px; background: var(--border); border-radius: var(--radius-pill); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--clay)); transition: width 0.4s ease; }
.progress-row { display: flex; justify-content: space-between; font-size: 12px; margin-top: 12px; }

.ring {
  --p: 0; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--border) 0);
}
.ring::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--card); }
.ring span { position: relative; z-index: 1; font-size: 10px; font-weight: 800; }

/* --- Buttons --- */
.primary {
  border: 0; border-radius: var(--radius-pill); padding: 13px 20px;
  font-family: var(--font-display); font-weight: 800; font-size: 0.95rem;
  background: linear-gradient(135deg, var(--green), var(--clay)); color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.primary:hover, .primary:active { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.primary:disabled { opacity: 0.65; transform: none; }
.secondary {
  border: 2px solid var(--border); background: transparent; color: var(--ink);
  border-radius: var(--radius-pill); padding: 11px 18px;
  font-family: var(--font-display); font-weight: 800; font-size: 0.95rem;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.secondary:hover { border-color: var(--green); transform: translateY(-1px); }
.danger-link { display: block; margin: 18px auto 0; border: 0; background: none; color: var(--coral); font-size: 12px; font-weight: 700; padding: 10px; }

.fab {
  position: fixed; right: max(18px, calc((100vw - 480px) / 2 + 18px)); bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 15; width: 54px; height: 54px; border: 0; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--green), var(--clay)); color: #fff;
  display: grid; place-items: center; box-shadow: var(--shadow-lg);
  transition: transform 0.15s ease;
}
.fab:hover, .fab:active { transform: translateY(-2px); }
.fab .ui-icon { width: 22px; height: 22px; }

/* --- Lists --- */
.list { display: grid; gap: 9px; }
.list-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 13px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.list-card .grow { flex: 1; min-width: 0; }
.list-card h3 { font-size: 14px; font-weight: 700; margin: 0 0 3px; }
.list-card p { font-size: 11px; color: var(--ink-soft); margin: 0; }

button.list-card { width: 100%; text-align: left; border: 1px solid var(--border); color: inherit; }
.chevron { flex: none; font-size: 20px; color: var(--ink-soft); }

.area-icon {
  width: 44px; height: 44px; flex: none; border-radius: var(--radius-sm);
  background: var(--green-soft); color: var(--green); display: grid; place-items: center;
}
.area-icon .ui-icon { width: 21px; height: 21px; }

.check {
  appearance: none; width: 23px; height: 23px; flex: none; border: 1.5px solid var(--border);
  border-radius: 8px; position: relative;
}
.check:checked { background: var(--green); border-color: var(--green); }
.check:checked::after { content: '✓'; color: #fff; position: absolute; left: 5px; top: 1px; font-size: 13px; font-weight: 700; }

.task-row { min-height: 62px; }
.task-main { border: 0; background: none; text-align: left; padding: 0; min-width: 0; }
.task-main h3 { white-space: normal; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-todo { background: var(--border); }
.status-in_progress { background: var(--orange); }
.status-completed { background: var(--green); }

.watering-row { align-items: center; }
.water-action {
  min-width: 92px; flex: none; border: 0; border-radius: var(--radius-sm);
  background: var(--green); color: #fff; padding: 11px 10px; font-size: 11px; font-weight: 800;
}
.water-action:disabled { background: var(--border); color: var(--ink-soft); }
.overdue { color: var(--coral); }

.project-card { width: 100%; border: 0; text-align: left; display: flex; align-items: center; gap: 12px; }
.project-icon {
  width: 45px; height: 45px; flex: none; border-radius: var(--radius-sm);
  background: var(--green-soft); color: var(--green); display: grid; place-items: center;
}
.project-icon .ui-icon { width: 22px; height: 22px; }
.project-card h3 { margin: 0 0 4px; font-size: 13px; }
.project-card p { font-size: 11px; color: var(--ink-soft); margin: 0; }
.project-card .progress { height: 4px; margin-top: 8px; }

/* --- Garden hub destinations --- */
.garden-hub { padding-top: 4px; }
.garden-destination {
  width: 100%; display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center;
  text-align: left; border: 0; border-bottom: 1px solid var(--hairline); background: transparent;
  padding: 16px 2px; color: var(--ink);
}
.destination-icon { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.garden-destination b { display: block; font-size: 16px; letter-spacing: -0.01em; }
.garden-destination small { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

.journal-feature { overflow: hidden; border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--hairline); box-shadow: var(--shadow-sm); }
.journal-feature > img, .journal-feature > .photo-placeholder { width: 100%; height: 200px; object-fit: cover; }
.journal-feature > div:last-child { padding: 16px; }
.journal-feature h2 { font-size: 19px; margin: 6px 0; }
.journal-feature p { font-size: 12px; line-height: 1.6; color: var(--ink-soft); margin: 0; }

/* --- Area progress grid (Home) --- */
.area-progress-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.area-progress { border: 0; text-align: left; padding: 13px; display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; background: var(--card); }
.area-progress .area-mini-icon { width: 28px; height: 28px; border-radius: 9px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.area-progress .ui-icon { width: 15px; height: 15px; }
.area-progress b { font-size: 10px; grid-column: 2; }
.area-progress strong { font-size: 10px; color: var(--green); grid-column: 3; }
.area-progress .progress { grid-column: 1 / -1; margin-top: 2px; height: 4px; }

.focus-grid { margin-top: 24px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 20px 0; }
.focus-card, .weather-card { background: transparent; border: 0; box-shadow: none; padding: 0 2px; min-height: 100px; }
.focus-card h3, .weather-card h3 { font-size: 14px; line-height: 1.4; margin: 14px 0 0; }
.weather-card > div { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.weather-card > div .ui-icon { color: var(--orange); }
.weather-card > div h3 { margin: 0; }
.weather-card p { font-size: 11px; color: var(--ink-soft); line-height: 1.5; margin: 8px 0 0; }

.next-job-card { padding: 18px; box-shadow: 0 14px 36px rgba(20, 35, 22, 0.09); }
.next-job-top { display: flex; gap: 12px; align-items: flex-start; }
.next-job-top > div { min-width: 0; }
.next-job-card h2 { font-size: 19px; line-height: 1.2; letter-spacing: -0.02em; margin: 5px 0 4px; }
.next-job-card p { font-size: 12px; color: var(--ink-soft); margin: 0; line-height: 1.4; }
.next-action { width: 100%; margin-top: 16px; min-height: 46px; }
.choose-job { width: 100%; border: 0; margin-top: 4px; color: var(--green); background: none; font-size: 12px; font-weight: 700; }

.weekend-card { display: grid; grid-template-columns: 1fr 64px; align-items: center; padding: 18px; }
.weekend-card strong { display: block; font-size: 21px; margin: 6px 0 2px; }
.weekend-card p { font-size: 11px; color: var(--ink-soft); margin: 0; }
.weekend-card > .progress { grid-column: 1 / -1; margin-top: 14px; }

/* --- Filters, pills, badges --- */
.filter-row { display: flex; gap: 7px; overflow-x: auto; padding: 1px 0 10px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter {
  border: 1px solid var(--border); background: var(--card); color: var(--ink-soft);
  padding: 8px 13px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; white-space: nowrap;
}
.filter.active { background: var(--forest); color: #fff; border-color: var(--forest); }

.pill { display: inline-flex; align-items: center; border-radius: var(--radius-pill); padding: 5px 10px; font-size: 10px; font-weight: 800; background: var(--green-soft); color: #3E6E30; }
.pill.urgent { background: var(--coral-soft); color: #9A4937; }

.safe { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; color: #3E6E30; }
.mini-badge { font-size: 10px; letter-spacing: 0.05em; background: var(--border); color: var(--ink-soft); border-radius: var(--radius-pill); padding: 4px 8px; font-weight: 700; }
.mini-badge.caution { background: var(--orange-soft); color: #8A5A0F; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* --- Plants --- */
.plant-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.plant-card { border-radius: var(--radius-lg); overflow: hidden; }
.refined-plant {
  display: block; width: 100%; padding: 0; text-align: left; color: inherit;
  background: var(--card); border: 1px solid var(--hairline); box-shadow: var(--shadow-sm);
}
.refined-plant > img, .refined-plant > .photo-placeholder { width: 100%; height: 130px; object-fit: cover; }
.plant-body { padding: 13px; }
.plant-body h3 { font: 700 15px var(--font-display); margin: 3px 0 4px; }
.plant-body p { font-size: 11px; color: var(--ink-soft); margin: 0; line-height: 1.5; }

/* --- Journal --- */
.journal-timeline { border-left: 1px solid var(--border); margin-left: 8px; padding-left: 17px; display: grid; gap: 11px; }
.journal-card { position: relative; }
.timeline-dot { position: absolute; width: 9px; height: 9px; background: var(--green); border: 2px solid var(--paper); border-radius: 50%; left: -22px; top: 20px; }
.journal-card h3 { font-size: 14px; margin: 8px 0 5px; }
.journal-card p { font-size: 11px; line-height: 1.6; color: var(--ink-soft); margin: 0; }
.journal-meta { display: flex; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--hairline); margin-top: 12px; padding-top: 10px; }
.journal-meta span { font-size: 10px; color: var(--ink-soft); }

.journal-gallery { display: grid; gap: 20px; }
.journal-entry { overflow: hidden; border-bottom: 1px solid var(--hairline); padding-bottom: 20px; }
.journal-entry > img, .journal-entry > .photo-placeholder { height: 220px; width: 100%; object-fit: cover; border-radius: var(--radius-lg); }
.journal-entry > div:last-child { padding-top: 14px; }
.journal-entry h3 { font-size: 18px; margin: 8px 0 6px; }
.journal-entry p { font-size: 12px; line-height: 1.6; color: var(--ink-soft); }

/* --- Budget / shopping --- */
.budget-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 4px; }
.budget-grid .card span { font-size: 9px; letter-spacing: 0.09em; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; }
.budget-grid .card strong { display: block; font-size: 20px; margin-top: 7px; }
.accent-budget { background: linear-gradient(135deg, var(--forest), var(--forest-2)); color: #fff; grid-column: 1 / -1; }
.accent-budget span { color: var(--green-soft) !important; }

.shopping-row { align-items: center; }
.shopping-row .grow { min-width: 0; }
.purchase-state { width: 24px; height: 24px; flex: none; border: 1.5px solid var(--border); border-radius: 8px; display: grid; place-items: center; color: #fff; }
.purchase-state.purchased { background: var(--green); border-color: var(--green); }
.purchase-state .ui-icon { width: 14px; height: 14px; }
.purchase-state.large { width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green); border-color: var(--border); }
.purchase-state.large.purchased { background: var(--green); color: #fff; }
.purchase-state.large .ui-icon { width: 21px; height: 21px; }

.purchase-summary { display: flex; align-items: center; gap: 14px; }
.purchase-summary > div { min-width: 0; }
.purchase-summary strong { display: block; font-size: 24px; margin: 5px 0 2px; }
.purchase-summary p { font-size: 11px; color: var(--ink-soft); margin: 0; }

.price { text-align: right; flex: none; }
.price b { display: block; font-size: 12px; }
.price small { font-size: 9px; color: var(--ink-soft); }

.purchase-context { background: var(--green-soft); border-radius: var(--radius-md); padding: 13px; }
.purchase-context strong { display: block; margin-top: 5px; font-size: 16px; }

/* --- Mode row (garden mode / task status control) --- */
.mode-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mode { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-sm); padding: 11px; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.mode.active { background: var(--forest); border-color: var(--forest); color: #fff; }

.task-status-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; background: var(--border); padding: 4px; border-radius: var(--radius-md); margin-bottom: 14px; }
.task-status-control button { border: 0; background: transparent; border-radius: 10px; padding: 10px 4px; font-size: 10px; font-weight: 700; color: var(--ink-soft); }
.task-status-control button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

/* --- Detail cards --- */
.detail-card { padding: 18px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
.detail-grid span, .detail-notes span { display: block; font-size: 10px; letter-spacing: 0.09em; color: var(--ink-soft); text-transform: uppercase; font-weight: 700; }
.detail-grid b { display: block; font-size: 12px; margin-top: 5px; text-transform: capitalize; }
.detail-notes { border-top: 1px solid var(--hairline); margin-top: 18px; padding-top: 14px; }
.detail-notes p { font-size: 12px; line-height: 1.6; margin: 6px 0 0; }
.task-primary-actions { display: grid; gap: 8px; margin-top: 18px; }
.task-primary-actions button { min-height: 46px; }

/* --- Status board (area view) --- */
.status-board { display: grid; gap: 13px; }
.status-board section { display: grid; gap: 7px; }
.board-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 800; }
.status-board section > small { color: var(--ink-soft); padding: 8px 2px; font-size: 11px; }

/* --- Area / plant photos --- */
.area-photo, .plant-detail-photo { height: 260px; background: var(--forest); position: relative; }
.area-photo img, .plant-detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.area-photo > .photo-placeholder, .plant-detail-photo > .photo-placeholder { height: 100%; }
.area-progress-overlay {
  position: absolute; left: 16px; right: 16px; bottom: 16px; padding: 14px;
  border-radius: var(--radius-md); background: rgba(20, 34, 20, 0.78); backdrop-filter: blur(16px); color: #fff;
}
.area-progress-overlay span { font-size: 10px; letter-spacing: 0.1em; }
.area-progress-overlay strong { display: block; font-size: 22px; margin: 5px 0; }
.area-progress-overlay .progress { background: rgba(255, 255, 255, 0.22); }
.area-progress-overlay .progress i { background: var(--green-soft); }

.photo-button { width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 46px; }
.photo-button .ui-icon { width: 17px; height: 17px; }
.photo-placeholder {
  display: grid; place-items: center; align-content: center; gap: 8px;
  background: linear-gradient(145deg, var(--green-soft), var(--paper)); color: var(--ink-soft);
  min-height: 140px;
}
.photo-placeholder .ui-icon { width: 24px; height: 24px; }
.photo-placeholder span { font-size: 12px; font-weight: 700; }

.idea-copy { font-size: 15px; line-height: 1.6; color: #3E4B3B; border-left: 2px solid var(--green); padding-left: 15px; }
.form-note, .optional { font-size: 11px; color: var(--ink-soft); }
.optional { font-weight: 400; margin-left: 4px; }

.area-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.area-counts span { background: var(--green-soft); color: #3E6E30; border-radius: var(--radius-sm); padding: 10px 6px; text-align: center; font-size: 10px; font-weight: 700; }

/* --- Vision --- */
.vision-photo { height: 320px; background: var(--forest); }
.vision-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 48%; }
.vision-lead { font-size: 19px; line-height: 1.45; letter-spacing: -0.02em; margin: 0; color: var(--ink); }
.vision-content > p:not(.vision-lead) { font-size: 12px; line-height: 1.7; color: var(--ink-soft); }
.vision-principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.vision-principles .card { display: flex; align-items: center; gap: 10px; padding: 13px; }
.vision-principles span { color: var(--green); }
.vision-principles b { font-size: 11px; line-height: 1.4; }

/* --- Season / care --- */
.season-card { border-left: 4px solid var(--green); }
.season-title { display: flex; justify-content: space-between; }
.season-card h3 { font-size: 16px; }
.season-card .month { font-size: 10px; color: var(--ink-soft); }
.season-card ul { padding-left: 18px; font-size: 12px; line-height: 1.9; margin-bottom: 0; }
.current-season { border-left-color: var(--coral) !important; }

.season-focus { padding: 4px 0 8px; }
.season-focus ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hairline); }
.season-focus li { padding: 14px 2px; border-bottom: 1px solid var(--hairline); font-size: 13px; }

.annual-plan { border-top: 1px solid var(--hairline); margin-top: 16px; }
.annual-plan summary { list-style: none; padding: 17px 2px; font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; cursor: pointer; }
.annual-plan summary::-webkit-details-marker { display: none; }
.annual-plan section { padding: 16px 0; border-top: 1px solid var(--hairline); }
.annual-plan section h3 { margin: 0; font-size: 15px; }
.annual-plan section small { color: var(--ink-soft); }
.annual-plan section ul { padding-left: 18px; font-size: 12px; line-height: 1.9; }

/* --- Device status (settings) --- */
.device-status { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 8px; }
.device-status div { background: var(--card); padding: 12px; }
.device-status span { display: block; font-size: 9px; letter-spacing: 0.08em; color: var(--ink-soft); text-transform: uppercase; }
.device-status b { display: block; font-size: 12px; margin-top: 5px; }

/* --- Bottom nav --- */
.bottom-nav {
  /* ticket TG-2: was position:sticky, which depends on #app's computed
     height being accurate. iOS Safari standalone-PWA mode has a known
     100dvh miscomputation quirk that can make #app render taller than the
     true visible screen, leaving the sticky nav resting above the real
     bottom edge with a gap below it. ThatcherHQ's .tabbar and ThatcherFood's
     .bottom-nav already use position:fixed for this exact element with no
     such report - fixed anchors straight to the real viewport regardless
     of any ancestor's height, so it isn't affected by the dvh quirk.
     Matching that already-proven pattern here. Using left:50%/translateX
     instead of left:0/right:0 so it stays centered at #app's own
     max-width:480px on the (rare) in-between viewport widths between
     phone and the 860px desktop breakpoint, rather than stretching edge
     to edge wider than the panel above it - same centering math as
     #app's own max-width+margin:0 auto. */
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 20;
  background: var(--card); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(20, 35, 22, 0.06);
}
.nav-btn {
  border: 0; background: none; color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-family: var(--font-display); font-weight: 700; font-size: 10px; padding: 4px;
  border-radius: var(--radius-md);
}
.nav-btn .nav-icon { height: 22px; display: grid; place-items: center; }
.nav-btn.active { color: var(--green); font-weight: 800; background: var(--green-soft); }

/* --- Modal --- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(16, 24, 16, 0.52); display: flex; align-items: flex-end; justify-content: center; }
.modal { width: min(100%, 600px); background: var(--paper); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 12px 18px calc(24px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; }
.handle { width: 42px; height: 5px; background: var(--border); border-radius: 5px; margin: 0 auto 18px; }
.modal h2 { font-size: 21px; margin: 0 0 18px; }
.form-grid { display: grid; gap: 13px; }
.field label { display: block; font-size: 11px; font-weight: 700; margin: 0 0 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 2px solid var(--border); background: var(--card); border-radius: var(--radius-sm);
  padding: 12px; outline: none; font-family: var(--font-body); font-size: 0.95rem;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); }
.field input[type=date] { min-height: 44px; }
.field textarea { resize: vertical; min-height: 78px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-fields { align-items: center; }
.check-fields label { font-size: 11px; padding: 10px; background: var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; gap: 6px; }
.modal-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 9px; margin-top: 17px; }
.modal button:disabled { opacity: 0.65; }

.import-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.import-summary div { background: var(--border); border-radius: var(--radius-md); padding: 14px; text-align: center; }
.import-summary strong { display: block; font-size: 21px; }
.import-summary span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.import-warning { font-size: 11px; line-height: 1.6; color: #7A665D; background: var(--orange-soft); padding: 12px; border-radius: var(--radius-sm); }

.settings-list button { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; padding: 15px 3px; display: flex; justify-content: space-between; font-weight: 700; color: var(--ink); }

/* --- Empty state --- */
.empty { text-align: center; padding: 40px 18px; color: var(--ink-soft); }
.empty b { display: block; color: var(--ink); margin: 10px 0; }

/* --- Toast --- */
#toast {
  position: fixed; z-index: 100; left: 50%; bottom: 100px; transform: translate(-50%, 20px);
  background: var(--forest); color: #fff; padding: 10px 16px; border-radius: var(--radius-pill);
  font-size: 12px; opacity: 0; pointer-events: none; transition: 0.25s;
  display: flex; align-items: center; gap: 14px; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { border: 0; background: none; color: var(--green-soft); font-size: 11px; font-weight: 800; padding: 2px; }

/* --- Desktop / larger-viewport layout ---
   Below 860px, ThatcherGarden is a full-bleed mobile app with a bottom
   tab bar. Above it, the same components recompose into a floating
   panel with a left sidebar nav, matching the shared family pattern. */
@media (min-width: 860px) {
  body {
    background: linear-gradient(135deg, var(--green-soft), var(--clay-soft));
    padding: 32px 16px;
  }
  #app {
    flex-direction: row;
    align-items: stretch;
    max-width: 1040px;
    min-height: auto;
    height: calc(100dvh - 64px);
    max-height: 780px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
  }
  .screen { flex: 1; min-width: 0; }
  .hero { border-radius: 0; }
  .bottom-nav {
    order: -1;
    position: static;
    left: auto; transform: none; max-width: none;
    grid-template-columns: none;
    flex-direction: column;
    align-items: stretch;
    width: 210px;
    flex-shrink: 0;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 28px 14px;
    gap: 4px;
    box-shadow: none;
  }
  .nav-btn { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 13px; padding: 12px 14px; }
  .nav-btn .nav-icon { height: auto; }
  .content, .task-detail, .area-content, .vision-content { max-width: 640px; margin: 0 auto; }
  .home-content { max-width: 640px; margin: -48px auto 0; }
  .fab { right: calc(50% - 520px + 18px); }
}

@media (min-width: 1200px) {
  #app { max-width: 1120px; }
}
