/* Garden. One screen, full width: status in the top bar, the chart in the middle, controls on
   the right. Display type Bricolage Grotesque, interface type Inter (both self-hosted). */

@font-face { font-family: "Bricolage Grotesque"; src: url("/static/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; }

/* ================================================================== tokens */
:root {
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f2f1ea;
  --surface: #ffffff;
  --surface-2: #f7f6f1;
  --surface-3: #eeece4;
  --ink: #102017;
  --ink-2: #39463d;
  --muted: #6b766e;
  --line: rgba(16, 32, 23, .08);
  --line-strong: rgba(16, 32, 23, .15);
  --brand: #14a05a;
  --brand-strong: #0d7c45;
  --brand-soft: #e3f4e9;
  --forest: #0e3a29;
  --forest-2: #145a3d;
  --lime: #c6f36d;
  --leaf: #2f8f5b;
  --leaf-fill: #d9f1e2;
  --ok: #1fb35f;
  --warn: #e39a06;
  --bad: #e5483f;
  --ok-soft: #e4f5ea;
  --warn-soft: #fcf0d6;
  --bad-soft: #fde6e4;
  --warn-ink: #8a5600;
  --bad-ink: #b42318;
  --s-temp: #f47230;
  --s-rain: #257de0;
  --s-water: #00b894;
  --r: 18px;
  --shadow: 0 1px 2px rgba(16, 32, 23, .05), 0 8px 24px -14px rgba(16, 32, 23, .22);
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 40%, transparent);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gap: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f0c;
    --surface: #121915;
    --surface-2: #171f1a;
    --surface-3: #1d2721;
    --ink: #e9f0eb;
    --ink-2: #c2ccc5;
    --muted: #8b978e;
    --line: rgba(255, 255, 255, .07);
    --line-strong: rgba(255, 255, 255, .13);
    --brand: #34c77b;
    --brand-strong: #5ad895;
    --brand-soft: #143222;
    --leaf: #6fd39a;
    --leaf-fill: #183a28;
    --ok: #34c77b;
    --warn: #f5b53b;
    --bad: #ff6b61;
    --ok-soft: #12291c;
    --warn-soft: #2b2212;
    --bad-soft: #321716;
    --warn-ink: #f7c76a;
    --bad-ink: #ff9a92;
    --s-temp: #e76624;
    --s-rain: #338ced;
    --s-water: #00a888;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* ================================================================== base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font: 14.5px/1.5 var(--sans); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11"; }
a { color: var(--brand-strong); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
p { margin: 0; }
code { font-size: .86em; background: var(--surface-3); padding: .1em .35em; border-radius: 6px; }
.muted { color: var(--muted); font-weight: 450; }
.hidden { display: none !important; }
.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* ================================================================== top bar */
.topbar { display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 var(--gap); }
.logo { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 800;
  font-size: 1.2rem; letter-spacing: -.03em; color: var(--ink); text-decoration: none; flex: none; }
.logo .mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--lime);
  background: linear-gradient(150deg, var(--forest-2), var(--forest)); transform: rotate(-6deg); transition: transform .3s var(--ease); }
.logo:hover .mark { transform: rotate(6deg); }
.logo .mark svg { width: 17px; height: 17px; stroke-width: 2.3; }
.topbar-mid { flex: 1; min-width: 0; display: flex; justify-content: center; }
.nav { display: flex; align-items: center; gap: 2px; flex: none; }
.nav a { display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .8rem; border-radius: 999px; color: var(--muted);
  text-decoration: none; font-weight: 600; font-size: .88rem; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--bg); background: var(--ink); }
.nav a svg { width: 16px; height: 16px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-left: 4px;
  font-family: var(--display); font-weight: 800; font-size: .9rem; text-transform: uppercase;
  background: linear-gradient(140deg, #ffd25a, #ff8a5c); color: #4a1d0c !important; text-decoration: none; padding: 0 !important; }

.nav a.avatar { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; }
.nav a.avatar:hover { background: linear-gradient(140deg, #ffd25a, #ff8a5c); filter: brightness(1.05); }

/* Status pills */
.pills { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.pill { display: inline-flex; align-items: center; gap: .4rem; height: 32px; padding: 0 .75rem 0 .6rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: .82rem; white-space: nowrap; cursor: default; }
.pill svg { width: 15px; height: 15px; color: var(--ok); }
.pill .n { color: var(--muted); font-weight: 550; }
.pill b { font-weight: 650; }
.pill.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.pill.warn svg, .pill.warn b { color: var(--warn-ink); }
.pill.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 45%, transparent); animation: alarm 1.6s ease-in-out infinite; }
.pill.bad svg, .pill.bad b { color: var(--bad-ink); }
.pill.is-watering { background: color-mix(in srgb, var(--s-water) 12%, var(--surface)); border-color: color-mix(in srgb, var(--s-water) 40%, transparent); }
.pill.is-watering svg { color: var(--s-water); animation: bob 1.2s ease-in-out infinite; }
@keyframes alarm { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 18%, transparent); } }
@keyframes bob { 50% { transform: translateY(2px); } }

/* ================================================================== cockpit layout */
.cockpit { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); padding: 0 var(--gap) var(--gap); }
@media (min-width: 1000px) and (min-height: 620px) {
  .cockpit-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  .cockpit { flex: 1; min-height: 0; }
  .cockpit > * { min-height: 0; }
  .side { overflow-y: auto; scrollbar-width: thin; }
}
@media (max-width: 999px), (max-height: 619px) {
  .cockpit { grid-template-columns: 1fr; }
  .chart-wrap { height: 62vh; min-height: 320px; flex: none !important; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 8px; }
  .topbar-mid { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .nav a span { display: none; }
  .pills { flex-wrap: wrap; overflow: visible; }
  .pill { height: 28px; font-size: .78rem; padding: 0 .6rem 0 .5rem; }
  .chart-head .kpis { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .chart-wrap { height: 420px; min-height: 0; }
  .tools { margin-left: 0; }
}
.side { display: flex; flex-direction: column; gap: var(--gap); }
.side > * { flex: none; }

/* ================================================================== chart panel */
.chart-panel { display: flex; flex-direction: column; padding: 14px 16px 10px; min-width: 0; }
.chart-head { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.chart-head .ttl h1 { font-size: 1.35rem; }
.chart-head .ttl p { color: var(--muted); font-size: .8rem; }
.kpis { display: flex; gap: 6px; flex-wrap: wrap; }
.kpi { display: flex; flex-direction: column; justify-content: center; padding: 5px 12px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--line); min-width: 84px; }
.kpi span { display: inline-flex; align-items: center; gap: .3rem; font-size: .68rem; font-weight: 650; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.kpi span svg { width: 12px; height: 12px; }
.kpi b { font-family: var(--display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi b small { font-size: .78rem; color: var(--muted); font-weight: 600; margin-left: 1px; letter-spacing: 0; }
.kpi b em { font-family: var(--sans); font-style: normal; font-size: .72rem; color: var(--muted); font-weight: 550; margin-left: .35rem; letter-spacing: 0; }
.k-temp svg { color: var(--s-temp); } .k-rain svg { color: var(--s-rain); } .k-water svg { color: var(--s-water); } .k-next svg { color: var(--brand); }
.tools { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.legend { display: flex; gap: 4px; }
.lg { position: relative; display: inline-flex; align-items: center; gap: .4rem; height: 32px; padding: 0 .7rem 0 .55rem; margin: 0;
  border-radius: 999px; border: 1px solid var(--line-strong); cursor: pointer; user-select: none; font-weight: 600; font-size: .8rem; }
.lg input { position: absolute; opacity: 0; pointer-events: none; }
.lg .sw { width: 16px; height: 4px; border-radius: 4px; background: var(--c); }
.lg:has(input:checked) { background: color-mix(in srgb, var(--c) 10%, var(--surface)); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.lg:has(input:not(:checked)) { color: var(--muted); opacity: .7; }
.lg:has(input:not(:checked)) .sw { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); height: 8px; width: 8px; border-radius: 50%; }
.lg:has(input:focus-visible) { box-shadow: var(--focus); }
.series-temp { --c: var(--s-temp); } .series-rain { --c: var(--s-rain); } .series-water { --c: var(--s-water); }
.chart-wrap { position: relative; flex: 1; min-height: 260px; margin-top: 8px; }
.chart-wrap svg.chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; touch-action: pan-y; }
.chart text { font-family: var(--sans); font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--line-strong); stroke-dasharray: 2 5; }
.chart .xgrid line { stroke: var(--line); }
.chart text.major { fill: var(--ink-2); font-weight: 700; }
.chart .unit text { font-weight: 650; }
.chart .future { fill: color-mix(in srgb, var(--muted) 7%, transparent); }
.chart .now-line { stroke: var(--ink); stroke-width: 1.5; }
.chart .now-pill rect { fill: var(--ink); }
.chart .now-pill text { fill: var(--bg); font-weight: 700; }
.chart .hover-band { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.chart .hover-line { stroke: var(--ink); stroke-opacity: .35; stroke-dasharray: 3 4; }
.chart .pt { stroke-width: 2.5; fill: var(--surface); }
.chart .hl { stroke-width: 3; fill: var(--surface); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.chart-foot { display: flex; gap: .4rem 1.1rem; flex-wrap: wrap; font-size: .74rem; color: var(--ink-2); margin-top: 4px; align-items: center; }
.chart-foot .legend { margin-right: .4rem; }
.chart-foot > span { display: inline-flex; align-items: center; gap: .4rem; }
.chart-foot .solid, .chart-foot .dash { width: 18px; height: 0; border-top: 2.5px solid var(--muted); }
.chart-foot .dash { border-top-style: dashed; }
.ctip { position: absolute; top: 0; left: 0; z-index: 5; width: 240px; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 14px; box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .35); font-size: .82rem; }
.ctip.on { opacity: 1; }
.ctip .t { font-family: var(--display); font-weight: 700; font-size: 1rem; }
.ctip .tag { display: inline-block; margin-top: 3px; font-size: .64rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
  padding: .1rem .4rem; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.ctip .tag.f { background: color-mix(in srgb, var(--s-rain) 14%, var(--surface)); color: var(--s-rain); }
.ctip .row { display: flex; align-items: center; gap: .55rem; margin-top: .45rem; }
.ctip .row i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.ctip .row span { flex: 1; color: var(--ink-2); }
.ctip .row b { font-variant-numeric: tabular-nums; }
.ctip .sub { color: var(--muted); font-size: .74rem; margin-left: 1.15rem; }
.ctip .why { margin-top: .55rem; padding: .45rem .55rem; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: .76rem; }

/* ================================================================== mood card */
.mood { position: relative; display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 14px; overflow: hidden;
  background: linear-gradient(150deg, color-mix(in srgb, var(--brand) 9%, var(--surface)), var(--surface) 60%); }
.plant-box { width: 84px; height: 100px; align-self: center; }
.plant { width: 100%; height: 100%; overflow: visible; }
.plant .stem { fill: none; stroke: var(--leaf); stroke-width: 1.6; stroke-linecap: round; }
.plant .leaf { fill: var(--leaf-fill); stroke: var(--leaf); stroke-width: .9; stroke-linejoin: round; transition: fill .6s; }
.plant .vein { fill: none; stroke: var(--leaf); stroke-width: .45; stroke-opacity: .55; }
.plant .sprig { transform-origin: 50px 100px; animation: sway 5s ease-in-out infinite; transition: transform .8s var(--ease), filter .8s; }
.plant .drops path { fill: var(--s-rain); opacity: 0; }
.plant .zz { opacity: 0; font-family: var(--display); font-weight: 800; fill: var(--muted); font-size: 9px; }
@keyframes sway { 50% { transform: rotate(2.5deg); } }
[data-mood="watering"] .plant .drops path { animation: fall 1.1s linear infinite; }
[data-mood="watering"] .plant .drops path:nth-child(2) { animation-delay: .37s; }
[data-mood="watering"] .plant .drops path:nth-child(3) { animation-delay: .74s; }
[data-mood="watering"] .plant .leaf { fill: color-mix(in srgb, var(--s-water) 30%, var(--leaf-fill)); }
@keyframes fall { 0% { transform: translateY(0); opacity: 0; } 25% { opacity: .9; } 100% { transform: translateY(40px); opacity: 0; } }
[data-mood="off"] .plant .sprig { animation: none; transform: rotate(-4deg); filter: grayscale(.85); }
[data-mood="off"] .plant .zz { opacity: 1; }
[data-mood="off"] .plant .zz text { animation: zz 3s ease-in-out infinite; }
[data-mood="off"] .plant .zz text:nth-child(2) { animation-delay: .4s; }
[data-mood="off"] .plant .zz text:nth-child(3) { animation-delay: .8s; }
@keyframes zz { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
[data-mood="problem"] .plant .sprig { animation: none; transform: rotate(-9deg) scaleY(.94); }
[data-mood="problem"] .plant .leaf { fill: color-mix(in srgb, var(--warn) 35%, var(--leaf-fill)); }
@media (prefers-reduced-motion: reduce) { .plant *, .pill { animation: none !important; } }
.mood-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mood-tag { align-self: flex-start; font-size: .66rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase;
  padding: .12rem .5rem; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.mood-text[data-mood="watering"] .mood-tag { background: color-mix(in srgb, var(--s-water) 16%, var(--surface)); color: var(--s-water); }
.mood-text[data-mood="off"] .mood-tag { background: var(--surface-3); color: var(--muted); }
.mood-text[data-mood="problem"] .mood-tag { background: var(--bad-soft); color: var(--bad-ink); }
.mood-text h2 { font-size: 1.25rem; }
.mood-text p { color: var(--ink-2); font-size: .82rem; line-height: 1.4; }
.mood-text details { font-size: .8rem; color: var(--ink-2); }
.mood-text summary { cursor: pointer; font-weight: 650; color: var(--ink); }
.mood-text button { align-self: flex-start; margin-top: 2px; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 2px; }
.progress div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--s-water), var(--s-rain)); transition: width 1s linear; }

/* ================================================================== plan card */
.plan { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-head h2 { font-size: 1.15rem; }
.mode { display: flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-3); }
.mode button { height: 32px; min-height: 0; padding: 0 .8rem; border: 0; border-radius: 9px; background: transparent; box-shadow: none;
  color: var(--muted); font-size: .84rem; gap: .35rem; }
.mode button svg { width: 15px; height: 15px; }
.mode button[aria-pressed="true"] { cursor: default; }
.mode .off[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.mode .auto[aria-pressed="true"] { background: linear-gradient(135deg, #22c06d, var(--brand-strong)); color: #fff; box-shadow: 0 6px 14px -8px var(--brand); }
.mode .auto[aria-pressed="true"] svg { color: var(--lime); }
.row-amount { display: flex; align-items: baseline; gap: 10px; }
.row-amount label { font-weight: 650; font-size: .8rem; color: var(--muted); margin: 0; }
.row-amount .big { font-family: var(--display); font-weight: 750; font-size: 2rem; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.row-amount .big small { font-size: .9rem; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.row-amount .mins { margin-left: auto; color: var(--muted); font-size: .8rem; }
.range input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: -6px 0 0; background: transparent; cursor: pointer; --pct: 10%; }
.range input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, #6ff0d2, var(--s-water) var(--pct), var(--surface-3) var(--pct)); }
.range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -7px;
  border-radius: 50% 50% 50% 3px; transform: rotate(-45deg); background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--s-water) 35%, transparent), 0 3px 8px rgba(0, 0, 0, .25); }
.range input[type=range]::-moz-range-track { height: 8px; border-radius: 999px; background: var(--surface-3); }
.range input[type=range]::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--s-water); }
.range input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--s-water) 35%, transparent); }
.range input[type=range]:focus-visible { box-shadow: none; }
.range input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 650; font-size: .8rem; color: var(--muted); padding: 0; margin-bottom: 5px; }
.choices.four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.choice { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; margin: 0;
  height: 50px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer;
  font-size: .8rem; font-weight: 650; transition: border-color .15s, background .15s, transform .15s var(--ease); }
.choice:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice svg { width: 18px; height: 18px; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface-2); }
.choice:has(input:checked) svg { color: var(--ink); }
.choice[data-t="morning"]:has(input:checked) svg { color: #f59e0b; }
.choice[data-t="lunch"]:has(input:checked) svg { color: #f97316; }
.choice[data-t="evening"]:has(input:checked) svg { color: #e2557a; }
.choice[data-t="night"]:has(input:checked) svg { color: #6d6af0; }
.choice:has(input:focus-visible) { box-shadow: var(--focus); }
.choice .level { display: block; width: 60%; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--s-rain) var(--l), var(--surface-3) var(--l)); }
.limits { border-top: 1px solid var(--line); padding-top: 10px; }
.limits summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .45rem; font-weight: 650; font-size: .85rem; }
.limits summary::-webkit-details-marker { display: none; }
.limits summary .ic { color: var(--muted); }
.limits summary .muted { margin-left: auto; font-size: .78rem; }
.limits summary .chev { width: 15px; height: 15px; color: var(--muted); transition: transform .2s; }
.limits[open] summary .chev { transform: rotate(180deg); }
.limits .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.limits .fields label { font-size: .76rem; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 4px; margin: 0; }
.limits .hint { margin-top: 8px; }
.upcoming { padding: 12px 14px; }
.upcoming h2 { font-size: 1rem; margin-bottom: 6px; }
.upcoming ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.upcoming li { display: grid; grid-template-columns: 62px 1fr 44px 64px; align-items: center; gap: 8px; font-size: .8rem; height: 24px; }
.upcoming .d { font-weight: 650; }
.upcoming .d small { color: var(--muted); font-weight: 500; margin-left: .3rem; font-size: .72rem; }
.upcoming .bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.upcoming .bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6ff0d2, var(--s-water)); }
.upcoming b { text-align: right; font-variant-numeric: tabular-nums; }
.upcoming .why { color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming li.skip b { color: var(--s-rain); }
.plan-foot { display: grid; grid-template-columns: 1fr 40px; gap: 6px; }
.plan-foot .calib { padding: 0; color: #c2622a; }
.plan-foot .calib:disabled { opacity: .8; cursor: help; }
.plan-foot .calib svg { width: 18px; height: 18px; }
@media (max-height: 820px) {
  .upcoming li:nth-child(n+6) { display: none; }
  .choice { height: 40px; }
  .choice svg { width: 16px; height: 16px; }
  .plan { gap: 9px; padding: 12px 14px; }
  .mood { padding: 10px 14px; }
  .mood-text h2 { font-size: 1.1rem; }
  .plant-box { height: 86px; }
  .upcoming { padding: 10px 14px; }
  .upcoming li { height: 21px; }
  .row-amount .big { font-size: 1.75rem; }
}
.badge { display: inline-flex; align-items: center; padding: .14rem .5rem; border-radius: 999px; font-size: .64rem; font-weight: 750;
  letter-spacing: .05em; text-transform: uppercase; background: var(--surface-3); color: var(--muted); }
.badge.you { background: var(--brand-soft); color: var(--brand-strong); }

/* ================================================================== buttons and inputs */
button, .btn { font: inherit; font-weight: 650; cursor: pointer; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); padding: .5rem 1rem; min-height: 40px; display: inline-flex; align-items: center;
  justify-content: center; gap: .45rem; font-size: .9rem; text-decoration: none; transition: background .15s, border-color .15s, transform .1s; }
button:hover { border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
button:active { transform: scale(.98); }
button:focus-visible, .btn:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); }
button:disabled { opacity: .5; cursor: not-allowed; }
button svg { width: 16px; height: 16px; }
.primary { background: var(--ink); color: var(--bg); border-color: transparent; }
.primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--brand)); border-color: transparent; }
.go { background: linear-gradient(135deg, #22c06d, var(--brand-strong)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -10px var(--brand); }
.go:hover { filter: brightness(1.06); border-color: transparent; }
.danger { background: var(--bad); color: #fff; border-color: transparent; }
.ghost-danger { color: var(--bad-ink); border-color: transparent; background: transparent; }
.ghost-danger:hover { background: var(--bad-soft); border-color: transparent; }
.sm { min-height: 30px; padding: .2rem .7rem; font-size: .8rem; border-radius: 9px; }
.full-w { width: 100%; }
.htmx-request button, button.htmx-request { opacity: .6; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 11px; }
.seg button { min-height: 0; height: 28px; padding: 0 .7rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .8rem; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 3px 8px -3px rgba(0, 0, 0, .15); }
label { display: block; font-weight: 650; font-size: .85rem; margin: 0 0 .35rem; }
input[type=text], input[type=email], input[type=password], input[type=number] { font: inherit; width: 100%; padding: .5rem .75rem;
  min-height: 40px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); }
input:focus { border-color: var(--brand); background: var(--surface); }
.hint { color: var(--muted); font-size: .78rem; line-height: 1.45; }

/* ================================================================== other pages */
.page-main { max-width: 1100px; margin: 0 auto; padding: 8px var(--gap) 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 6px 2px 16px; }
.page-head h1 { font-size: 1.9rem; }
.page-head p { color: var(--muted); margin-top: .25rem; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: var(--gap); align-items: start; }
.settings .panel { padding: 18px; }
.card-head { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: 14px; }
.card-head h2 { font-size: 1.2rem; }
.card-title { display: flex; gap: .7rem; align-items: flex-start; }
.card-head p { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
.icon-tile { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-strong); }
.icon-tile svg { width: 19px; height: 19px; }
.icon-tile.blue { background: color-mix(in srgb, var(--s-rain) 14%, var(--surface)); color: var(--s-rain); }
.icon-tile.orange { background: color-mix(in srgb, var(--s-temp) 14%, var(--surface)); color: var(--s-temp); }
.list { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: .4rem .7rem; padding: 9px 12px; flex-wrap: wrap; }
.list li + li { border-top: 1px solid var(--line); }
.list li:has(> form) { flex-wrap: nowrap; }
.list li:has(> form) .who strong { overflow: hidden; text-overflow: ellipsis; }
.list .who { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.list .who > div { min-width: 0; overflow-wrap: anywhere; }
.list .meta { color: var(--muted); font-size: .76rem; }
.list .avatar { margin: 0; }
.list .avatar.mail { background: color-mix(in srgb, var(--s-rain) 14%, var(--surface)); color: var(--s-rain) !important; }
.list .avatar.mail svg { width: 16px; height: 16px; }
.list details summary { cursor: pointer; color: var(--brand-strong); font-weight: 650; font-size: .8rem; list-style: none; }
.list details summary::-webkit-details-marker { display: none; }
.list details[open] { flex-basis: 100%; }
.list details form { margin-top: .5rem; }
.more { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; font-weight: 650; font-size: .88rem; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary .chev { width: 15px; height: 15px; margin-left: auto; color: var(--muted); transition: transform .2s; }
.more[open] > summary .chev { transform: rotate(180deg); }
.more > div { padding-top: 12px; }
.fields { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } }
.inline-input { display: flex; gap: .45rem; }
.inline-input input { flex: 1; min-width: 0; }
.actions-row { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: 12px; }
.notice { display: flex; gap: .65rem; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn-ink); margin-bottom: 12px; font-size: .8rem; }
.notice svg { width: 18px; height: 18px; flex: none; }
.notice strong { color: var(--ink); }
.place { display: flex; align-items: center; gap: .75rem; padding: 12px; border-radius: 14px; margin-bottom: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.place .pin { width: 38px; height: 38px; border-radius: 11px; background: var(--surface); display: grid; place-items: center; color: var(--brand-strong); flex: none; box-shadow: var(--shadow); }
.place .pin svg { width: 19px; height: 19px; }
.place b { display: block; font-family: var(--display); font-size: 1.1rem; }
.place span { color: var(--muted); font-size: .78rem; }

/* Ferns, as quiet decoration */
.fern { position: fixed; z-index: -1; pointer-events: none; width: 340px; height: 360px; opacity: .5; }
.fern .rachis { fill: none; stroke: var(--leaf); stroke-width: .6; }
.fern .pinna { fill: color-mix(in srgb, var(--leaf-fill) 70%, transparent); stroke: var(--leaf); stroke-width: .35; stroke-opacity: .6; }
.fern.bl { left: -40px; bottom: -40px; transform: rotate(-12deg); }
.fern.tr { right: -60px; top: -30px; transform: rotate(160deg) scaleX(-1); width: 280px; height: 300px; }

/* Toast */
#toast-area { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 50; width: min(92vw, 480px); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 14px; box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .4);
  display: flex; gap: .65rem; align-items: center; margin-top: 6px; font-weight: 550; font-size: .86rem; animation: pop .3s var(--ease); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); flex: none; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.bad::before { background: #fff; }
.toast button { background: transparent; border: 0; color: inherit; min-height: 0; padding: 0 .2rem; font-size: 1.2rem; line-height: 1; opacity: .7; }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } }

/* Login */
.page-main:has(.login-shell) { padding: 0; max-width: none; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(380px, 100%); }
.login .plant-box { margin: 0 auto 6px; width: 110px; height: 130px; }
.login .logo { justify-content: center; display: flex; font-size: 1.7rem; }
.login .tag-line { text-align: center; color: var(--muted); margin: 4px 0 18px; }
.login form { padding: 20px; }
.login form > * + * { margin-top: 14px; }
.err { color: var(--bad-ink); background: var(--bad-soft); padding: .6rem .8rem; border-radius: 11px; font-weight: 600; font-size: .85rem; }
