/* Bloom: an Apple-style look (large titles, grouped lists, soft cards) in the logo's forest greens.
   Icons are Google's Material Symbols Rounded (class .ms, the icon name is the text). */
:root {
  color-scheme: light;
  --bg: #f1f5ef; --card: #fff; --field: #f2f5f0;
  --ink: #142319; --ink-2: #56645b; --ink-3: #8b978f;
  --sep: rgba(20, 35, 25, .1); --fill: rgba(31, 122, 76, .09); --fill-2: rgba(20, 35, 25, .055);
  --forest: #1c4a33; --tint: #1f7a4c; --tint-soft: #e1f1e6; --leaf: #74b14e; --leaf-soft: #edf6e3;
  --wood: #a86f3b; --wood-soft: #f6ebdf; --sun: #e9a52a; --sun-soft: #fdf2d9;
  --blue: #2a7bd0; --blue-soft: #e2eefb; --teal: #17968a; --teal-soft: #ddf3f0;
  --purple: #8457c4; --purple-soft: #efe7fa; --red: #d5443c; --red-soft: #fce7e5; --grey: #8b978f;
  --r-lg: 22px; --r: 16px; --r-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 50, 30, .05), 0 8px 24px rgba(20, 60, 35, .07);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --tabbar: 62px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.4 var(--font); letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--tabbar) + 28px + env(safe-area-inset-bottom));
}
a { color: var(--tint); text-decoration: none; }
h1, h2, h3 { letter-spacing: -.02em; }
p { margin: 6px 0; }
main { max-width: 680px; margin: 0 auto; padding: env(safe-area-inset-top) 16px 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 15px; }
.tiny { font-size: 13px; }
.right { text-align: right; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.center { text-align: center; }

/* ---- Icons ---- */
.ms {
  font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal;
  direction: ltr; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; user-select: none;
  font-variation-settings: "FILL" 0, "wght" 450, "GRAD" 0, "opsz" 24; vertical-align: middle; flex: none;
}
.ms.fill { font-variation-settings: "FILL" 1, "wght" 450, "GRAD" 0, "opsz" 24; }
.tile {
  width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: var(--tint); flex: none;
}
.tile .ms { font-size: 21px; font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.tile.lg { width: 44px; height: 44px; border-radius: 13px; }
.t-green { background: var(--tint); } .t-leaf { background: var(--leaf); } .t-blue { background: var(--blue); }
.t-teal { background: var(--teal); } .t-wood { background: var(--wood); } .t-sun { background: var(--sun); }
.t-red { background: var(--red); } .t-purple { background: var(--purple); } .t-grey { background: var(--grey); }
.t-forest { background: var(--forest); }

/* ---- Top bar and large title ---- */
.topbar {
  position: sticky; top: 0; z-index: 15; margin: 0 -16px; padding: calc(env(safe-area-inset-top) + 6px) 12px 6px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 48px;
  transition: background .2s, box-shadow .2s;
}
body.scrolled .topbar { background: rgba(241, 245, 239, .86); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 .5px 0 var(--sep); }
.topbar .tb-title { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 55vw; }
body.scrolled .topbar .tb-title { opacity: 1; }
.topbar .tb-end { justify-self: end; display: flex; gap: 8px; align-items: center; }
.back { display: inline-flex; align-items: center; font-size: 17px; color: var(--tint); margin-left: -6px; min-height: 40px; }
.back .ms { font-size: 30px; margin-right: -4px; }
.large { font-size: 34px; line-height: 1.12; font-weight: 700; margin: 2px 0 2px; letter-spacing: -.025em; }
.subtitle { color: var(--ink-2); font-size: 15px; margin: 0 0 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--card); color: var(--tint);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); cursor: pointer;
}
.icon-btn.tint { background: var(--tint); color: #fff; }

/* ---- Section titles, cards, grouped lists ---- */
.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 4px 10px; }
.sec h2 { font-size: 22px; font-weight: 700; margin: 0; }
.sec a, .sec .faint { font-size: 15px; }
.card { background: var(--card); border-radius: var(--r-lg); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h3 { font-size: 17px; margin: 0 0 6px; }
.list { background: var(--card); border-radius: var(--r-lg); margin: 12px 0; box-shadow: var(--shadow); overflow: hidden; }
.cell { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 56px; color: var(--ink); position: relative; }
.cell + .cell::before, .cell + details > summary::before, details + .cell::before {
  content: ""; position: absolute; top: 0; left: 64px; right: 0; height: .5px; background: var(--sep);
}
.cell.plain + .cell.plain::before { left: 16px; }
.cell-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cell-title { font-weight: 500; overflow-wrap: anywhere; }
.cell-sub { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.cell-end { color: var(--ink-2); font-size: 15px; text-align: right; flex: none; max-width: 45%; }
.chev { color: var(--ink-3); font-size: 22px; }
a.cell:active, button.cell:active { background: var(--fill-2); }
.thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--leaf-soft); flex: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--tint); }
.thumb .ms { font-size: 24px; }
.empty { text-align: center; padding: 28px 18px; color: var(--ink-2); }
.empty .ms { font-size: 44px; color: var(--leaf); display: block; margin: 0 auto 8px; }

/* Long text: clamp to a few lines with a More button (app.js adds it). */
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.clamp.open { display: block; -webkit-line-clamp: unset; }
.more-btn { border: 0; background: none; color: var(--tint); font: inherit; font-weight: 600; padding: 2px 0; cursor: pointer; }

/* Facts: label above value, so long values use the full width. */
.facts { display: grid; gap: 12px; margin: 4px 0; }
.facts.two { grid-template-columns: 1fr 1fr; }
.fact.wide { grid-column: 1 / -1; }
.fact .k { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .02em; }
.fact .v { display: block; overflow-wrap: anywhere; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 10px 18px;
  border-radius: 14px; border: 0; background: var(--fill); color: var(--tint); font: inherit; font-weight: 600;
  cursor: pointer; text-align: center; transition: transform .12s, filter .12s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--tint); color: #fff; box-shadow: 0 4px 14px rgba(31, 122, 76, .28); }
.btn.white { background: var(--card); box-shadow: var(--shadow); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.sm { min-height: 36px; padding: 6px 14px; border-radius: 999px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .ms { font-size: 21px; }
.btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
form.inline { display: inline; }
.linkish { all: unset; color: var(--tint); cursor: pointer; }

/* Quick actions on the dashboard and plant page: round icon over a short label. */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 4px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); font-size: 12.5px;
  font-weight: 500; text-align: center; background: none; border: 0; font-family: inherit; cursor: pointer; padding: 0; }
.action .tile { width: 54px; height: 54px; border-radius: 17px; box-shadow: 0 6px 16px rgba(20, 60, 35, .14); }
.action .tile .ms { font-size: 26px; }
.action:active .tile { transform: scale(.94); }

/* ---- Forms ---- */
label.f { display: block; margin: 12px 0; }
label.f > span:first-child { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  margin: 0 0 5px 2px; text-transform: uppercase; letter-spacing: .02em; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 13px; border: 1.5px solid transparent;
  background: var(--field); color: var(--ink); font: inherit; letter-spacing: inherit; outline: none; transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--tint); background: #fff; }
select { appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238b978f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
textarea { min-height: 96px; resize: vertical; }
input[type=search] { padding-left: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath d='M10 3a7 7 0 015.6 11.2l4.6 4.6-1.4 1.4-4.6-4.6A7 7 0 1110 3zm0 2a5 5 0 100 10 5 5 0 000-10z' fill='%238b978f'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center; background-color: var(--card); box-shadow: var(--shadow); }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; accent-color: var(--tint); flex: none; margin: 0; }
label.check { display: flex; align-items: center; gap: 12px; padding: 9px 0; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.form-card { background: var(--card); border-radius: var(--r-lg); padding: 4px 16px; margin: 12px 0; box-shadow: var(--shadow); }
.form-card > label.f:first-child, .form-card > :first-child { margin-top: 14px; }
.form-card > :last-child { margin-bottom: 16px; }

/* Collapsible groups: a list cell that opens. */
details.group { background: var(--card); border-radius: var(--r-lg); margin: 12px 0; box-shadow: var(--shadow); overflow: hidden; }
details.group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 13px 16px; font-weight: 600; min-height: 56px; }
details.group > summary::-webkit-details-marker, .task > summary::-webkit-details-marker { display: none; }
details.group > summary .chev { margin-left: auto; transition: transform .2s; }
details.group[open] > summary .chev { transform: rotate(90deg); }
details.group > .inner { padding: 0 16px 16px; }

/* ---- Messages ---- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); margin: 10px 0;
  background: var(--tint-soft); color: var(--forest); font-size: 15px; font-weight: 500; transition: opacity .4s, transform .4s; }
.flash .ms { font-size: 21px; }
.flash.err { background: var(--red-soft); color: #9c2a23; }
.flash.warn { background: var(--sun-soft); color: #7a5410; }
.flash.gone { opacity: 0; transform: translateY(-10px); }
.toasts { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 12px; right: 12px; z-index: 40; max-width: 560px;
  margin: 0 auto; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toasts .flash { pointer-events: auto; margin: 0; box-shadow: 0 10px 30px rgba(20, 60, 35, .18); background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: var(--ink); animation: toast-in .35s cubic-bezier(.2, .9, .3, 1); }
.toasts .flash > .ms:first-child { color: var(--tint); }
.toasts .flash.err > .ms:first-child { color: var(--red); }
.toasts .flash .linkish { color: var(--ink-3); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px); } }
.note-ai { display: flex; gap: 12px; align-items: flex-start; }

/* ---- Badges, chips, segmented control ---- */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px;
  font-weight: 600; background: var(--fill-2); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.badge.healthy, .badge.ok { background: var(--tint-soft); color: var(--tint); }
.badge.attention, .badge.p2 { background: var(--sun-soft); color: #9a6a0d; }
.badge.sick, .badge.p1, .badge.bad { background: var(--red-soft); color: var(--red); }
.badge.ai { background: var(--blue-soft); color: var(--blue); }
.badge.you { background: var(--wood-soft); color: var(--wood); }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.code { font: 600 12px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink-3); letter-spacing: .04em; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--card); color: var(--ink); font-size: 15px;
  font-weight: 500; box-shadow: var(--shadow); border: 0; font-family: inherit; cursor: pointer; }
.chip.on { background: var(--tint); color: #fff; }
.seg { display: flex; background: var(--fill-2); border-radius: 11px; padding: 2px; margin: 10px 0 12px; }
.seg a { flex: 1; text-align: center; padding: 7px 8px; border-radius: 9px; color: var(--ink); font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg a .ms { font-size: 19px; }
.seg a.on { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); font-weight: 600; }

/* ---- Dashboard ---- */
.hello { display: flex; align-items: center; gap: 14px; margin: 8px 0 4px; }
.hello img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 6px 18px rgba(28, 74, 51, .25); flex: none; }
.date-line { font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.weather { display: flex; align-items: center; gap: 14px; }
.weather .big { font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.stat { background: var(--card); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow); color: var(--ink);
  display: flex; flex-direction: column; gap: 6px; }
.stat b { font-size: 30px; line-height: 1; font-weight: 700; letter-spacing: -.03em; }
.stat span.l { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat .tile { width: 32px; height: 32px; border-radius: 9px; }
.stat.warn b { color: var(--sun); }
.all-good { display: flex; align-items: center; gap: 14px; }
.all-good .tile { width: 48px; height: 48px; border-radius: 50%; }
.strip { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip img { width: 104px; height: 104px; object-fit: cover; border-radius: 18px; display: block; box-shadow: var(--shadow); }

/* ---- Plants grid ---- */
.plants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .plants { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plant { position: relative; background: var(--card); border-radius: var(--r-lg); overflow: hidden; color: var(--ink);
  display: block; box-shadow: var(--shadow); }
.plant .pic { aspect-ratio: 1; background: linear-gradient(145deg, var(--leaf-soft), var(--tint-soft)); display: flex;
  align-items: center; justify-content: center; color: var(--leaf); }
.plant .pic .ms { font-size: 48px; }
.plant .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plant .info { padding: 10px 12px 12px; display: block; color: inherit; }
.plant .name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plant .next { font-size: 13px; color: var(--ink-2); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.plant .pick { position: absolute; top: 9px; left: 9px; width: 26px; height: 26px; appearance: none; -webkit-appearance: none;
  border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .18); cursor: pointer; padding: 0; min-height: 0; }
.plant .pick:checked { background: var(--tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2l-4.2-4.2L3.4 13.4 9 19 21 7l-1.4-1.4z' fill='%23fff'/%3E%3C/svg%3E") center/14px no-repeat; }
.plant .hdot { position: absolute; top: 10px; right: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--grey); flex: none; }
.dot.healthy { background: var(--leaf); } .dot.attention { background: var(--sun); } .dot.sick { background: var(--red); }
.hdot.dot { width: 12px; height: 12px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }

/* ---- Tasks (Reminders style: tap the circle to finish) ---- */
.tasks { background: var(--card); border-radius: var(--r-lg); margin: 12px 0; box-shadow: var(--shadow); overflow: hidden; }
.tasks-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 4px; font-weight: 700; font-size: 17px; }
.tasks-h .n { margin-left: auto; color: var(--ink-3); font-weight: 600; font-size: 15px; }
.task { position: relative; }
.task + .task::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; height: .5px; background: var(--sep); }
.task > summary { list-style: none; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px 12px 16px; cursor: pointer; }
.task .tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink-3); background: none; flex: none;
  margin-top: 1px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: transparent; padding: 0; }
.task .tick:hover, .task .tick:focus-visible { border-color: var(--tint); color: var(--tint); }
.task .tick.done { background: var(--tint); border-color: var(--tint); color: #fff; }
.task .tick .ms { font-size: 18px; font-variation-settings: "FILL" 0, "wght" 700, "GRAD" 0, "opsz" 20; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; display: block; }
.task-action { display: block; color: var(--ink); overflow-wrap: anywhere; }
.task-meta { display: block; font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.task .thumb { width: 40px; height: 40px; border-radius: 11px; }
.task-body { padding: 0 16px 16px 56px; }
.task-body .facts { margin-bottom: 12px; }
.task-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.task-tools select { width: auto; min-height: 36px; padding: 6px 34px 6px 12px; border-radius: 999px; font-size: 15px; }

/* ---- Photos and timeline ---- */
.hero { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--r-lg); display: block; box-shadow: var(--shadow); }
.hero-wrap { position: relative; margin: 6px 0 14px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; display: block; }
.photos figcaption { font-size: 12px; color: var(--ink-2); text-align: center; margin-top: 3px; }
.photo-pick { margin: 12px 0; }
.photo-pick > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px 2px; text-transform: uppercase; letter-spacing: .02em; }
.photo-pick label.btn { position: relative; }
.photo-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-pick .hero { margin-top: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 11px 0; align-items: flex-start; }
.timeline li + li { border-top: .5px solid var(--sep); }
.timeline .when { flex: none; width: 54px; font-size: 13px; color: var(--ink-2); padding-top: 2px; }
.timeline .tile { width: 30px; height: 30px; border-radius: 9px; }
.timeline .tile .ms { font-size: 18px; }

/* ---- Calendar, insights, tables ---- */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 4px 0; }
.cal td { text-align: center; padding: 1px; }
.cal a { display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; border-radius: 12px; color: var(--ink); min-height: 46px; font-weight: 500; }
.cal .out a { color: var(--ink-3); opacity: .55; }
.cal .today a { color: var(--red); font-weight: 700; }
.cal .sel a { background: var(--tint); color: #fff; }
.cal .sel .dot { background: #fff !important; }
.dots { display: flex; gap: 3px; justify-content: center; height: 6px; margin-top: 3px; }
.dots .dot { width: 5px; height: 5px; }
.dot.d-water { background: var(--blue); } .dot.d-feed { background: var(--leaf); } .dot.d-task { background: var(--sun); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--fill-2); }
.bar i { display: block; height: 100%; }
.bar .water { background: var(--blue); } .bar .feed { background: var(--leaf); } .bar .other { background: var(--ink-3); }
table.plain { width: 100%; border-collapse: collapse; font-size: 15px; }
table.plain th, table.plain td { text-align: left; padding: 9px 4px; border-top: .5px solid var(--sep); vertical-align: top; }
table.plain th { color: var(--ink-2); font-weight: 600; font-size: 13px; border-top: 0; }
svg.spark { width: 100%; height: 64px; display: block; }
svg.spark polyline { fill: none; stroke: var(--tint); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Assistant chat ---- */
.chat { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 20px; background: var(--card); overflow-wrap: anywhere; box-shadow: var(--shadow); font-size: 16px; }
.msg.user { align-self: flex-end; background: var(--tint); color: #fff; border-bottom-right-radius: 6px; box-shadow: none; }
.msg.assistant { border-bottom-left-radius: 6px; }
.msg ul { margin: 4px 0; padding-left: 20px; }
.msg p { margin: 4px 0; }
.ask { position: sticky; bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom)); padding: 10px 0; display: flex; gap: 8px; }
.ask input { border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }
.ask .icon-btn { width: 48px; height: 48px; }
.suggest { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.suggest .chip { text-align: left; white-space: normal; }

/* ---- Bulk bar and waiting overlay ---- */
.bulkbar { position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom)); z-index: 16;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: var(--r-lg); padding: 12px; box-shadow: 0 10px 40px rgba(20, 60, 35, .22); }
.bulkbar .inner { max-width: 660px; margin: 0 auto; }
.bulkbar select, .bulkbar input { min-height: 42px; }
.busy { position: fixed; inset: 0; background: rgba(241, 245, 239, .9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--forest); display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center;
  text-align: center; padding: 24px; z-index: 50; font-weight: 600; font-size: 17px; }
.busy::before { content: ""; width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--tint-soft);
  border-top-color: var(--tint); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Tab bar ---- */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 6px 4px env(safe-area-inset-bottom);
  background: rgba(250, 252, 249, .86); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 -.5px 0 var(--sep); }
nav.tabs a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-3);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0; padding-top: 2px; }
nav.tabs .ms { font-size: 27px; transition: transform .15s; }
nav.tabs a.on { color: var(--tint); }
nav.tabs a.on .ms { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
nav.tabs a:active .ms { transform: scale(.88); }

/* ---- Garden map ---- */
.map-wrap { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 8px; margin: 12px 0; }
svg.map { width: 100%; height: auto; display: block; touch-action: manipulation; }
svg.map text { font-family: var(--font); fill: var(--ink-3); font-size: 21px; }
svg.map .lbl { fill: var(--ink-2); font-weight: 700; font-size: 26px; letter-spacing: .04em; }
svg.map .wall { fill: url(#hatch); stroke: #9aa39d; }
svg.map .home { fill: #fbfcfa; stroke: var(--ink-3); stroke-width: 1.5; }
svg.map .porch { fill: url(#tiles); }
svg.map .hall { fill: #f4eef4; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 8 6; }
svg.map .lane { fill: #eceeea; }
svg.map .thing { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.zone { cursor: pointer; stroke: var(--forest); stroke-width: 1.2; stroke-opacity: .35; fill-opacity: .62; transition: fill-opacity .15s, stroke-width .15s; outline: none; }
.zone:hover { fill-opacity: .8; }
.zone.on { stroke: var(--forest); stroke-width: 4; stroke-opacity: 1; fill-opacity: .9; }
.l-full { fill: #f6c453; background: #f6c453; } .l-part { fill: #c6dc7c; background: #c6dc7c; }
.l-bright { fill: #92cfae; background: #92cfae; } .l-shade { fill: #4f9a72; background: #4f9a72; }
.tile.l-shade { color: #fff !important; }
.pin { cursor: pointer; }
.pin circle { fill: #fff; stroke: var(--forest); stroke-width: 2; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); }
.pin text { fill: var(--forest) !important; font-weight: 700; font-size: 24px !important; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pin.on circle { fill: var(--tint); stroke: #fff; stroke-width: 2.5; }
.pin.on text { fill: #fff !important; }
.pin .count { fill: var(--tint); stroke: #fff; stroke-width: 2; }
.pin .count-t { fill: #fff !important; font-size: 17px !important; font-weight: 700; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); padding: 8px 6px 4px; }
.map-legend i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; margin-right: 5px; vertical-align: -2px; }
.place-chosen { display: flex; gap: 12px; align-items: center; padding: 10px 4px 2px; }
.place-chosen .tile { border-radius: 50%; }
.place-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.place-list .chip { font-size: 13px; padding: 6px 11px; box-shadow: none; background: var(--field); }
.place-list .chip.on { background: var(--tint); color: #fff; }

/* Bottom sheet (map place details) */
.sheet-back { position: fixed; inset: 0; background: rgba(15, 30, 20, .25); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--card); border-radius: 26px 26px 0 0;
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 78vh; overflow-y: auto; box-shadow: 0 -10px 40px rgba(0, 0, 0, .15);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .9, .3, 1); max-width: 680px; margin: 0 auto; }
.sheet.open { transform: none; }
.sheet.open + .sheet-back, .sheet-back.open { opacity: 1; pointer-events: auto; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 2px auto 12px; }
.sheet h2 { font-size: 24px; margin: 0; }

/* ---- Login and the opening animation ---- */
.login { max-width: 380px; margin: 14vh auto 0; text-align: center; }
.brand { display: block; width: 132px; height: 132px; margin: 0 auto 16px; border-radius: 30px; box-shadow: 0 16px 40px rgba(28, 74, 51, .3); }
#splash { display: none; }
html.splash #splash { display: flex; position: fixed; inset: 0; z-index: 100; align-items: center; justify-content: center;
  background: var(--bg); animation: splash-out .5s ease-in 1s forwards; }
#splash img { width: 116px; height: 116px; border-radius: 27px; box-shadow: 0 16px 44px rgba(28, 74, 51, .35);
  animation: splash-logo 1.5s cubic-bezier(.45, 0, .2, 1) forwards; }
html.splash main { animation: page-in .55s cubic-bezier(.2, .8, .3, 1) 1s both; }
@keyframes splash-logo {
  0% { transform: scale(.6); opacity: 0; }
  28% { transform: scale(1.04); opacity: 1; }
  40% { transform: scale(1); }
  66% { transform: scale(1); border-radius: 27px; }
  100% { transform: scale(10); opacity: 0; border-radius: 8px; }
}
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
@keyframes page-in { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #splash img, html.splash main { animation: none; }
  html.splash #splash { animation: splash-out .3s ease-in .4s forwards; }
  .sheet, .zone, .btn, .flash { transition: none; }
}
