:root {
  --green: #386641;       /* Garden */
  --green-dark: #2A4D31;
  --green-light: #EEF5DC; /* Apple tint */
  --bg: #FBF8EF;
  --sage: #A7C957;        /* Apple */
  --eucalyptus: #DCE6C4;
  --lavender: #F2C14E;    /* Sunflower */
  --lavender-light: #FDF3D6;
  --meadow: #6A994E;
  --terracotta: #BC6C4F;
  --card: #ffffff;
  --text: #2B3326;
  --muted: #5C6553;
  --line: #E2DDC8;
  --red: #A3553A;
  --red-light: #F8E6DE;
  --orange: #c25e00;
  --tabs-h: 78px;
  --top-h: 64px;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  font-size: 19px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}
body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--green); }
:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 2px; }

/* ---------- icons (inline SVG masks) ---------- */
.i { display: inline-block; width: 1.25em; height: 1.25em; flex: none; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.i-menu { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'><path d='M4 6h16M4 12h16M4 18h16'/></svg>"); }
.i-today { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><circle cx='12' cy='12' r='4.5'/><path d='M12 2v2.5M12 19.5V22M4.9 4.9l1.8 1.8M17.3 17.3l1.8 1.8M2 12h2.5M19.5 12H22M4.9 19.1l1.8-1.8M17.3 6.7l1.8-1.8'/></svg>"); }
.i-done { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><rect x='4.5' y='4' width='15' height='17.5' rx='2.5'/><path d='M9 4V2.5h6V4M8.5 13l2.5 2.5 4.5-5'/></svg>"); }
.i-garden { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22v-10'/><path d='M12 12C12 7.5 9 5 3.5 5c0 4.5 3 7 8.5 7z'/><path d='M12 10c0-3.5 2.5-6.5 8.5-6.5 0 4.5-3 6.5-8.5 6.5z'/><path d='M6 22h12'/></svg>"); }
.i-bell { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9a6 6 0 0 1 12 0c0 6.5 3 8.5 3 8.5H3S6 15.5 6 9z'/><path d='M10 21h4'/></svg>"); }
.i-map { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 4L3 6v14l6-2 6 2 6-2V4l-6 2-6-2z'/><path d='M9 4v14M15 6v14'/></svg>"); }
.i-back { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M15 18l-6-6 6-6'/></svg>"); }
.i-chev { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M9 6l6 6-6 6'/></svg>"); }
.i-tick { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>"); }
.i-plus { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'><path d='M12 5v14M5 12h14'/></svg>"); }
.i-cal { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='16' rx='2.5'/><path d='M3 10h18M8 3v4M16 3v4'/></svg>"); }
.i-pin { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22s7-7 7-12a7 7 0 0 0-14 0c0 5 7 12 7 12z'/><circle cx='12' cy='10' r='2.5'/></svg>"); }
.i-pencil { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20l4.5-1L19 8.5 15.5 5 5 15.5 4 20z'/><path d='M13.5 7l3.5 3.5'/></svg>"); }

/* ---------- loading & login ---------- */
.loading { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--muted); }
.loading-icon, .logo { width: 88px; height: 88px; border-radius: 22px; background: url("/icons/icon-192.png") center / cover; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 18px; }
.login-card { width: 100%; max-width: 440px; background: var(--card); border-radius: 22px; padding: 32px 24px; box-shadow: 0 6px 30px rgba(0,0,0,.08); text-align: center; }
.login-card .logo { margin: 0 auto 14px; }
.login-card h1 { font-size: 30px; margin-bottom: 8px; color: var(--green-dark); }
.login-card .form { text-align: left; margin-top: 18px; }
.code-input { font-size: 30px; letter-spacing: 6px; text-align: center; }

/* ---------- layout ---------- */
.app { min-height: 100vh; padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 16px); }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; background: var(--green-light); color: var(--green-dark); border-bottom: 2px solid var(--eucalyptus);
}
.topbar h1 { font-size: 26px; }
.menu-btn { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border: 2px solid var(--sage); border-radius: 12px; background: #fff; color: var(--green-dark); font-weight: 600; cursor: pointer; }
.demo-banner { background: var(--lavender-light); color: #5C4300; padding: 10px 16px; font-size: 16px; text-align: center; border-bottom: 1px solid var(--lavender); }
.view { max-width: 720px; margin: 0 auto; padding: 18px 16px; outline: none; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: #fff; border-top: 2px solid var(--line); box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 700; text-align: center; line-height: 1.1;
  border-top: 5px solid transparent;
}
.tabs a .i { width: 30px; height: 30px; }
.tabs a[aria-current="page"] { color: var(--green-dark); background: var(--green-light); border-top-color: var(--green); }
@media (min-width: 720px) {
  .tabs { left: 50%; transform: translateX(-50%); max-width: 720px; border-radius: 18px 18px 0 0; border: 2px solid var(--line); border-bottom: 0; }
  .tabs a { font-size: 16px; }
}

/* ---------- common bits ---------- */
.section-title { font-size: 22px; margin: 26px 0 12px; color: var(--green-dark); }
.hello { font-size: 26px; font-weight: 700; margin: 2px 0 6px; }
.hello span { display: block; font-size: 18px; font-weight: 500; color: var(--muted); }
.hint { color: var(--muted); font-size: 17px; margin: 6px 0 12px; }
.note { background: #F7F3E6; border-left: 4px solid var(--line); padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.big-text { font-size: 22px; font-weight: 600; }
.ok-text { display: flex; gap: 8px; align-items: flex-start; color: var(--green); font-weight: 600; margin: 12px 0 0; }
.danger-text { color: var(--red) !important; }
.optional { font-weight: 400; color: var(--muted); font-size: 16px; }
.emoji { font-size: 34px; line-height: 1; flex: none; width: 44px; text-align: center; }
.dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; border: 2px solid rgba(0,0,0,.15); flex: none; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); border: 1px solid #E8E3D1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 10px 20px; border-radius: 14px; border: 2px solid transparent;
  font-weight: 700; font-size: 19px; cursor: pointer; text-decoration: none; text-align: center; line-height: 1.2;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:active { background: var(--green-dark); }
.btn-light { background: #fff; color: var(--green-dark); border-color: var(--green); }
.btn-plain { background: transparent; color: var(--green-dark); }
.btn-danger { background: var(--red); color: #fff; }
.btn-done { background: var(--sage); color: #22301C; min-width: 116px; }
.btn-small { min-height: 46px; padding: 6px 14px; font-size: 17px; }
.btn-wide { width: 100%; margin-top: 12px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.btn-row .btn { flex: 1 1 140px; }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.link-btn { background: none; border: 0; color: var(--green); font-weight: 700; padding: 10px 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; }
.chip, .plant-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--green); background: #fff; color: var(--green-dark); font-weight: 600; cursor: pointer; margin: 0 6px 8px 0; font-size: 17px; }
.plant-chip span { font-size: 24px; }

/* ---------- tasks ---------- */
.task { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; }
.task.overdue { border-left: 7px solid var(--terracotta); }
.task-open { flex: 1 1 220px; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; text-align: left; cursor: pointer; min-height: 56px; }
.task-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.task-title { font-weight: 700; font-size: 20px; }
.task-title small { font-weight: 500; color: var(--muted); font-size: 16px; }
.task-meta { color: var(--muted); font-size: 16px; }
.task.overdue .task-meta { color: var(--red); font-weight: 600; }
.task-actions { display: flex; gap: 8px; margin-left: auto; }
.task.compact .task-title { font-size: 18px; }
.all-done { display: flex; align-items: center; gap: 14px; background: var(--green-light); border-color: var(--sage); }
.all-done p { margin: 0; font-size: 20px; font-weight: 600; color: var(--green-dark); }
.welcome h2 { font-size: 22px; color: var(--green-dark); margin-bottom: 6px; }
.welcome .btn { width: 100%; margin-top: 6px; }
.region-btn { justify-content: flex-start; text-align: left; min-height: 64px; }
.region-btn small { display: block; font-weight: 400; font-size: 16px; opacity: .8; }
.steps { padding-left: 24px; margin: 8px 0 12px; }
.steps li { margin-bottom: 6px; }

.history-item, .reminder-row { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; font: inherit; }
.reminder-row.overdue { border-left: 7px solid var(--terracotta); }
.reminder-row.overdue .task-meta { color: var(--red); font-weight: 600; }
.day-title { font-size: 18px; color: var(--muted); margin: 22px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.remind-help h2 { font-size: 21px; margin-bottom: 4px; }
.remind-help p { margin: 6px 0; }
.remind-help { margin-top: 14px; }

/* ---------- garden ---------- */
.bed { border-top: 8px solid var(--bed, var(--line)); }
.bed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.bed-head h2 { font-size: 22px; display: flex; align-items: center; }
.bed-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.plant-row { width: 100%; display: flex; align-items: center; gap: 12px; background: none; border: 0; border-top: 1px solid #EEE9DA; padding: 10px 2px; text-align: left; cursor: pointer; min-height: 64px; }
.plant-row .i-chev { color: var(--muted); }
.finished { margin-top: 18px; background: var(--card); border-radius: var(--radius); padding: 6px 16px; border: 1px solid #E8E3D1; }
.finished summary { font-weight: 700; padding: 12px 0; cursor: pointer; color: var(--muted); }

.empty { text-align: center; padding: 28px 12px; }
.empty-icon { font-size: 60px; }
.empty h3 { font-size: 24px; margin: 10px 0 8px; }
.empty p { color: var(--muted); max-width: 460px; margin: 0 auto 16px; }

/* ---------- sheets (pop-ups) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel { background: var(--bg); width: 100%; max-width: 640px; height: 100%; display: flex; flex-direction: column; }
@media (min-width: 720px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet-panel { height: auto; max-height: 92vh; border-radius: 22px; overflow: hidden; }
}
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: var(--top-h); background: var(--green-light); color: var(--green-dark); border-bottom: 2px solid var(--eucalyptus); flex: none; }
.sheet-head h2 { font-size: 22px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-btn { display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 0 14px 0 8px; border: 2px solid var(--sage); border-radius: 12px; background: #fff; color: var(--green-dark); font-weight: 700; cursor: pointer; flex: none; }
.sheet-body { padding: 18px 16px calc(28px + var(--safe-b)); overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }

.form { display: flex; flex-direction: column; }
.label { font-weight: 700; margin: 16px 0 8px; display: block; }
.input { width: 100%; min-height: 56px; padding: 12px 14px; border: 2px solid #B5AE96; border-radius: 12px; background: #fff; font-size: 19px; }
.input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(56,102,65,.25); }
textarea.input { min-height: 84px; resize: vertical; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { min-height: 52px; padding: 8px 16px; border-radius: 12px; border: 2px solid #B5AE96; background: #fff; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; text-align: left; }
.choice[aria-pressed="true"] { border-color: var(--green); background: var(--green-light); color: var(--green-dark); box-shadow: inset 0 0 0 2px var(--green); }
.choice[aria-pressed="true"]::before { content: ""; width: 20px; height: 20px; margin-right: 8px; background: currentColor; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>") center / contain no-repeat; }
.swatch { width: 52px; height: 52px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #B5AE96; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--text); }
.swatch[aria-pressed="true"]::before { display: none; }
.quick-dates { display: flex; flex-wrap: wrap; }

.plant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.plant-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; padding: 12px 8px; background: #fff; border: 2px solid #E2DDC8; border-radius: 16px; cursor: pointer; font-weight: 700; text-align: center; }
.plant-tile .emoji { font-size: 44px; width: auto; }
.badge { position: absolute; top: 6px; right: 6px; background: var(--lavender); color: #3D2E00; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.kind-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 110px; justify-content: center; background: #fff; border: 2px solid #E2DDC8; border-radius: 16px; font-weight: 700; cursor: pointer; }
.kind-tile span { font-size: 40px; }

.plant-hero { display: flex; gap: 14px; align-items: flex-start; background: #fff; border-radius: 16px; padding: 14px; border: 1px solid #E8E3D1; }
.plant-hero .emoji { font-size: 52px; width: 60px; }
.plant-hero b { font-size: 22px; display: block; }
.plant-hero span { display: block; color: var(--muted); }
.plant-hero .good-now { color: var(--green); font-weight: 700; margin-top: 2px; }
.plant-hero .tip { margin-top: 6px; }
.tip-box { background: var(--lavender-light); border-radius: 12px; padding: 12px 14px; }
.sub-title { font-size: 19px; margin: 18px 0 8px; }
.mini-list { list-style: none; padding: 0; margin: 0; background: #fff; border-radius: 12px; border: 1px solid #E8E3D1; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid #EEE9DA; }
.mini-list li:first-child { border-top: 0; }
.mini-list b { white-space: nowrap; color: var(--muted); font-weight: 600; }
.help dt { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--green-dark); font-size: 20px; }
.help dd { margin: 4px 0 0 34px; }
.help dd ul { margin: 6px 0 0; padding-left: 20px; }
.help dd li { margin-bottom: 6px; }
.help h3 { margin-top: 18px; }

/* ---------- map (garden photo) ---------- */
.i-camera { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 8.5A2 2 0 0 1 5 6.5h2.5L9 4h6l1.5 2.5H19a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/><circle cx='12' cy='13' r='3.8'/></svg>"); }
.view-map { position: fixed; top: var(--top-h); left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b)); max-width: none; padding: 0; }
.map-wrap { height: 100%; display: flex; flex-direction: column; }
.map-top { display: flex; gap: 8px; padding: 10px 10px 2px; background: var(--bg); align-items: flex-start; }
.map-top[hidden], .map-bottom[hidden] { display: none; }
.photo-tabs { flex: 1; display: flex; flex-wrap: wrap; }
.photo-tabs .chip[aria-pressed="true"] { background: var(--green); color: #fff; }
.chip-add { border-style: dashed; }
.map-canvas { flex: 1; min-height: 200px; background: var(--green-light); display: flex; align-items: center; justify-content: center; overflow: auto; padding: 8px; }
.photo-empty { max-width: 460px; }
.plan-stage { position: relative; flex: none; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.15); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.plan-stage.is-drawing { cursor: crosshair; outline: 4px solid var(--lavender); }
.plan-stage img, .plan-grid, .plan-stage svg, .plan-labels, .plan-dots { position: absolute; inset: 0; width: 100%; height: 100%; }
.plan-stage img { object-fit: fill; display: block; }
.plan-grid { background-color: #FBF8EF; background-image: linear-gradient(var(--eucalyptus) 1px, transparent 1px), linear-gradient(90deg, var(--eucalyptus) 1px, transparent 1px); background-size: 5% 6.6667%; }
.plan-stage svg polygon { fill-opacity: .45; stroke: #fff; stroke-width: 3; vector-effect: non-scaling-stroke; cursor: pointer; }
.plan-stage svg .draft polygon, .plan-stage svg .draft polyline { fill: var(--lavender); fill-opacity: .3; stroke: var(--lavender); stroke-width: 4; vector-effect: non-scaling-stroke; }
.plan-stage.is-drawing svg polygon:not(.draft *), .plan-stage.is-drawing .plan-label { pointer-events: none; opacity: .6; }
.plan-labels, .plan-dots { pointer-events: none; }
.plan-label { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; background: rgba(0,0,0,.55); color: #fff; border: 2px solid #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 16px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.plan-pin { background: var(--bed); color: #1d2b1f; }
.plan-pin::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #fff; margin-right: 6px; vertical-align: middle; }
.plan-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--lavender); border: 3px solid #333; }
.flash { animation: flash .8s ease-in-out 3; }
@keyframes flash { 50% { opacity: .2; } }
.map-bottom { padding: 10px 12px 12px; background: var(--bg); border-top: 2px solid var(--line); }
.map-bottom .btn-wide { margin-top: 0; }
.map-bottom .hint { margin: 10px 0 0; }
.map-bottom .btn-row { margin: 0; }
.map-instructions { margin: 0 0 10px; font-size: 18px; min-height: 2.9em; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + var(--safe-b) + 14px); z-index: 60;
  max-width: calc(100% - 32px); width: max-content; background: #fff; color: var(--text); border: 2px solid var(--sage); box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: 14px 20px; border-radius: 14px;
  font-size: 18px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.25); text-align: center;
}

/* ---------- plant help ---------- */
.btn-row .btn-help { flex-basis: 100%; }
.help-card { margin-top: 26px; }
.help-card h2 { font-size: 22px; color: var(--green-dark); margin: 0 0 4px; }
.help-card .btn { width: 100%; }
.problem-btn { justify-content: flex-start; text-align: left; min-height: 64px; gap: 12px; }
.problem-btn .emoji { font-size: 28px; flex: none; }
.problem-btn small { display: block; font-weight: 400; font-size: 16px; opacity: .8; }
.guide { margin: 16px 0; }
.guide dt { font-weight: 700; font-size: 20px; color: var(--green-dark); margin-top: 14px; }
.guide dd { margin: 4px 0 0; }
.guide ul { margin: 0; padding-left: 22px; }
.cause h3 { font-size: 20px; margin: 0 0 6px; color: var(--green-dark); }
.cause p { margin: 6px 0; }
.cause ul { margin: 4px 0 0; padding-left: 22px; }
.cause li { margin: 4px 0; }

/* ---------- what should I grow ---------- */
.step { font-weight: 700; color: var(--meadow); margin: 0 0 6px; }
.answer-btn[aria-pressed="true"], .plant-grid .plant-tile[aria-pressed="true"] { border-color: var(--green); background: var(--green-light); box-shadow: inset 0 0 0 2px var(--green); }
.plant-grid.small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.plant-grid.small .plant-tile { min-height: 96px; }
.plant-grid.small .plant-tile .emoji { font-size: 34px; }
.wizard-nav { margin-top: 18px; }
.suggest-head { display: flex; gap: 12px; align-items: center; }
.suggest-head .emoji { font-size: 40px; }
.suggest-head b { font-size: 21px; display: block; }
.suggest-head .good-now { display: block; color: var(--green); font-weight: 700; font-size: 16px; }
.why { margin: 10px 0 0; padding: 0; list-style: none; }
.why li { padding-left: 28px; position: relative; margin: 4px 0; }
.why.good li::before { content: '✓'; position: absolute; left: 4px; color: var(--meadow); font-weight: 800; }
.why.warn li::before { content: '!'; position: absolute; left: 8px; color: var(--terracotta); font-weight: 800; }
.suggest .btn-row { margin: 12px 0 0; }
.mini-list.unsuited li { flex-direction: column; gap: 2px; }
.mini-list.unsuited b { white-space: normal; color: var(--text, inherit); }
.mini-list.unsuited span { color: var(--muted); }

.pi { width: 1em; height: 1em; vertical-align: -0.12em; display: inline-block; }
.add-tile { border-style: dashed; border-color: var(--meadow); color: var(--green-dark); }
.today-add { margin-top: 14px; }
.add-chip { border-style: dashed; border-color: var(--meadow); }
.disclaimer { font-size: 15px; color: var(--muted); margin: 16px 0 4px; font-style: italic; }

/* ---------- Add a garden bed (guided steps) ---------- */
.wizard { position: fixed; inset: 0; z-index: 45; background: var(--bg); display: flex; flex-direction: column; }
.wizard[hidden] { display: none; }
.wiz-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); background: #fff; border-bottom: 2px solid var(--line); }
.wiz-head h2 { flex: 1; font-size: 22px; margin: 0; }
.wiz-count { color: var(--muted); font-size: 16px; font-weight: 600; white-space: nowrap; }
.wiz-body { flex: 1; min-height: 0; overflow: auto; padding: 14px; display: flex; flex-direction: column; }
.wiz-foot { padding: 12px 14px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 2px solid var(--line); max-height: 55vh; overflow: auto; }
.wiz-foot > *, .wiz-intro, .wiz-form { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
.wiz-intro { text-align: center; margin: auto; }
.wiz-tips { text-align: left; display: inline-block; font-size: 19px; line-height: 1.5; padding-left: 22px; }
.wiz-msg { margin: 0 auto 10px; font-size: 18px; }
.wiz-btns { margin-bottom: 8px; }
.wiz-canvas { flex: 1; min-height: 200px; display: flex; align-items: center; justify-content: center; }
.wiz-stage { position: relative; flex: none; border-radius: 10px; overflow: visible; box-shadow: 0 2px 10px rgba(0,0,0,.15); touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.wiz-stage img, .wiz-stage svg, .wiz-dots { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 10px; }
.wiz-stage img { object-fit: fill; display: block; }
.wiz-dots { pointer-events: none; }
.wiz-stage svg polygon, .wiz-stage svg polyline { fill: var(--lavender); fill-opacity: .28; stroke: var(--lavender); stroke-width: 4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.wiz-stage svg polyline { fill: none; }
.wiz-stage svg .faint { fill-opacity: .12; stroke: #fff; stroke-width: 2; stroke-dasharray: 6 5; }
.wiz-stage svg line { stroke: var(--terracotta); stroke-width: 4; vector-effect: non-scaling-stroke; stroke-dasharray: 10 6; }
.wiz-dot { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: flex; align-items: center; justify-content: center; pointer-events: auto; cursor: grab; touch-action: none; }
.wiz-dot span { width: 26px; height: 26px; border-radius: 50%; background: var(--lavender); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); font-size: 13px; font-weight: 800; color: var(--green-dark); display: flex; align-items: center; justify-content: center; }
.wiz-dot.cal span { background: var(--terracotta); color: #fff; }
.wiz-measure .label { margin-top: 4px; }
.measure-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.measure-row .input { flex: 1; max-width: 220px; font-size: 22px; }
.wiz-thumb { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; }
.sun-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sun-btn { flex-direction: column; justify-content: center; min-height: 78px; text-align: center; font-size: 18px; }
.sun-btn span { font-size: 28px; }
.sun-btn[aria-pressed="true"]::before { display: none; }

/* ---------- Garden bed screen ---------- */
.view-bed { max-width: 1500px; padding: 12px 14px 24px; }
.bed-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; }
.bed-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.bed-top .back-btn { text-decoration: none; }
.bed-title { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.bed-title h2 { margin: 0; font-size: 24px; }
.swatch-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.pill { background: var(--lavender-light); border-radius: 999px; padding: 4px 12px; font-size: 16px; font-weight: 600; }
.mode-tabs { display: flex; background: var(--eucalyptus); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.mode-tab { flex: 1; text-align: center; padding: 12px 8px; border-radius: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 16px; color: var(--green-dark); text-decoration: none; }
.mode-tab[aria-selected="true"] { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.empty-card { text-align: center; max-width: 560px; margin: 20px auto; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 44px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--green); }
.photo-layout { display: grid; gap: 14px; }
.photo-main { text-align: center; }
.photo-frame { position: relative; display: inline-block; max-width: 100%; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.15); vertical-align: top; }
.photo-frame img { display: block; max-width: 100%; max-height: 72vh; width: auto; height: auto; }
.photo-frame svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.photo-outline { fill: var(--lavender); fill-opacity: .18; stroke: var(--lavender); stroke-width: 3; stroke-linejoin: round; }
.photo-cal { stroke: var(--terracotta); stroke-width: 3; stroke-dasharray: 8 5; }
.photo-cal-text, .vis-label { fill: #fff; font-weight: 800; paint-order: stroke; stroke: rgba(0,0,0,.6); stroke-width: 4px; text-anchor: middle; font-family: inherit; }
.photo-side .btn-col { margin-top: 8px; }
.range { width: 100%; accent-color: var(--green); height: 36px; }
.range-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 15px; margin-bottom: 8px; }
@media (min-width: 900px) {
  .photo-layout { grid-template-columns: 1fr 320px; align-items: start; }
  .photo-frame img { max-height: calc(100vh - var(--top-h) - var(--tabs-h) - 160px); }
}

/* ---------- Plan workspace ---------- */
.plan-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.seg { display: inline-flex; border: 2px solid var(--green); border-radius: 12px; overflow: hidden; background: #fff; }
.seg button { min-height: 44px; min-width: 44px; padding: 4px 12px; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--green-dark); font-weight: 700; font-size: 16px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--green); color: #fff; }
.seg button:disabled { color: #B5AE96; cursor: default; }
.plan-toolbar .toggle { font-size: 16px; padding: 0 6px; }
.plan-main { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.plan-side { min-width: 0; }
.plan-canvas { position: relative; height: 58vh; min-height: 320px; border-radius: 14px; overflow: hidden; border: 2px solid var(--line);
  background: #FDFBF5 radial-gradient(circle, #E9E4D2 1px, transparent 1.2px) 0 0 / 22px 22px; }
.plan-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; display: block; font-family: inherit; }
.plan-bed { fill: #EFE3C8; }
.plan-bed.movable { cursor: move; }
.plan-edge { fill: none; stroke: #7A5C3E; stroke-width: 4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.pl-grid line { stroke: #B9A27E; vector-effect: non-scaling-stroke; }
.pl-grid .minor { stroke-width: .6; stroke-opacity: .45; }
.pl-grid .major { stroke-width: 1.2; stroke-opacity: .7; }
.plan-dim { fill: #5C4630; font-weight: 700; }
.plan-space { fill: none; stroke: var(--green); stroke-width: 1.2; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; opacity: .7; }
.plan-space.clash { stroke: var(--terracotta); stroke-width: 2; opacity: 1; fill: rgba(188,108,79,.08); }
.plan-item { cursor: grab; }
.plan-item .hit { fill: transparent; }
.plan-resize { cursor: ew-resize; }
.plan-resize circle { fill: #fff; stroke: var(--green); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.plan-resize path { fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sel-ring { fill: none; stroke: var(--lavender); stroke-width: 3; vector-effect: non-scaling-stroke; }
.pl-label { fill: var(--text); font-weight: 700; paint-order: stroke; stroke: #FDFBF5; stroke-width: 3px; pointer-events: none; }
.plan-vertex { fill: #fff; stroke: #7A5C3E; stroke-width: 3; vector-effect: non-scaling-stroke; cursor: move; }
.plan-vertex.sel { fill: var(--lavender); }
.plan-mid { fill: #7A5C3E; opacity: .55; cursor: copy; }
.plan-measure { stroke: var(--terracotta); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-dasharray: 8 4; }
.plan-measure-dot { fill: var(--terracotta); }
.plan-measure-bg { fill: #fff; stroke: var(--terracotta); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.plan-measure-text { fill: var(--terracotta); font-weight: 800; }
.plan-note { position: absolute; top: 10px; left: 10px; right: 10px; background: var(--lavender-light); border: 2px solid var(--lavender); border-radius: 10px; padding: 6px 12px; font-size: 16px; pointer-events: none; }
.plan-note[hidden] { display: none; }
.plan-scale { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 700; color: #5C4630; pointer-events: none; }
.plan-scale .bar { height: 8px; border: 2px solid #5C4630; border-top: 0; }
.plan-hint { position: absolute; right: 12px; bottom: 12px; max-width: 55%; text-align: right; font-size: 14px; color: var(--muted); pointer-events: none; }
.plan-card { margin-bottom: 10px; }
.plan-card h3 { margin: 0 0 8px; font-size: 19px; }
.size-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.size-row label { flex: 1 1 90px; font-weight: 700; font-size: 15px; }
.size-row .input { min-height: 48px; margin-top: 4px; }
.size-row .choice { min-height: 48px; padding: 6px 12px; }
.warn-text { color: var(--terracotta); font-weight: 700; }
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.plan-palette { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 150px; gap: 8px; overflow-x: auto; padding: 8px 0 4px; }
.palette-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: grab; touch-action: pan-x; user-select: none; -webkit-user-select: none; font-size: 16px; font-weight: 600; color: var(--text); }
.palette-item:hover { border-color: var(--green); }
.pi-emoji { font-size: 26px; line-height: 1; }
.pi-emoji img { width: 28px; height: 28px; }
.pi-size { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan-ghost { position: fixed; z-index: 70; font-size: 40px; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.plan-ghost img { width: 44px; height: 44px; }
@media (pointer: fine) {
  .plan-palette { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); grid-auto-columns: auto; max-height: 340px; overflow: auto; }
}
@media (min-width: 720px) {
  .plan-main { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .plan-canvas { height: calc(100vh - var(--top-h) - var(--tabs-h) - 190px); min-height: 440px; }
  .plan-side { max-height: calc(100vh - var(--top-h) - var(--tabs-h) - 190px); overflow: auto; }
}
@media (min-width: 1100px) {
  .plan-main { grid-template-columns: minmax(0, 1fr) 360px; }
}
.pill { white-space: nowrap; }
@media (max-width: 719px) {
  .bed-top { justify-content: space-between; }
  .bed-title { order: 3; flex-basis: 100%; }
  .bed-title h2 { font-size: 22px; }
}
