
/* Layout: one column field log. Header with today's date and the season, a capture bar, then plants ordered by next watering. Every plant carries a water gauge that drains toward its next watering day. */
:root {
  --bg: #EBF1EE;
  --surface: #F8FAF8;
  --ink: #10302B;
  --ink-2: #4B6560;
  --line: #CBD8D2;
  --water: #1D6F8C;
  --on-water: #FFFFFF;
  --water-soft: #D3E8EF;
  --leaf: #2F7A4D;
  --leaf-soft: #DCEBDD;
  --due: #B33A22;
  --due-soft: #F7DDD5;
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Instrument Sans', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1715;
    --surface: #14231F;
    --ink: #E3EFEB;
    --ink-2: #94ADA6;
    --line: #26393B;
    --water: #5DB8D6;
    --on-water: #062029;
    --water-soft: #173642;
    --leaf: #6CC38A;
    --leaf-soft: #1B3226;
    --due: #F59A82;
    --due-soft: #3B221C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C1715;
  --surface: #14231F;
  --ink: #E3EFEB;
  --ink-2: #94ADA6;
  --line: #26393B;
  --water: #5DB8D6;
  --on-water: #062029;
  --water-soft: #173642;
  --leaf: #6CC38A;
  --leaf-soft: #1B3226;
  --due: #F59A82;
  --due-soft: #3B221C;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--font-body);
  padding-block: 20px 72px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: 36px; line-height: 1.05; font-weight: 800; }
h2 { font-size: 26px; line-height: 1.1; font-weight: 700; }
h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); font-family: var(--font-body); }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; }

/* header */
.top { display: flex; flex-direction: column; gap: 6px; }
.date { color: var(--ink-2); font-size: 15px; }
.summary { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.summary.is-due { color: var(--due); }
.season { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.season::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--leaf); }

/* buttons */
.btn {
  font: 600 15px/1 var(--font-body);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--water); border-color: var(--water); color: var(--on-water); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn.danger { color: var(--due); border-color: var(--due); background: transparent; }
.link { font: 500 15px/1.3 var(--font-body); color: var(--water); background: none; border: 0; padding: 10px 0; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.link.plain { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; padding: 8px 0; color: var(--ink-2); }

/* capture */
.capture { display: flex; flex-direction: column; gap: 4px; }
.capture-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.capture .btn { min-height: 52px; }
.capture .note { font-size: 13px; color: var(--ink-2); }

/* list */
.group { display: flex; flex-direction: column; gap: 10px; }
.plant { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.plant.is-due { border-color: var(--due); }
.plant-main {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; padding: 12px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.plant-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plant-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
.plant-latin { font-size: 13px; font-style: italic; color: var(--ink-2); overflow-wrap: anywhere; }
.status { font-size: 14px; font-weight: 500; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }
.status.today, .status.late { color: var(--due); font-weight: 600; }
.plant-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 12px 12px; }
.plant-actions .every { font-size: 13px; color: var(--ink-2); }

.thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--leaf-soft); color: var(--leaf); display: grid; place-items: center; flex: none; }
.thumb.lg { width: 88px; height: 88px; border-radius: 16px; }
img.thumb { display: block; }

/* water gauge: the fill is the share of the interval still left */
.gauge { --lvl: 50%; position: relative; width: 12px; height: 56px; border-radius: 999px; background: var(--water-soft); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); flex: none; }
.gauge i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--lvl); background: var(--water); }
.gauge.is-due { box-shadow: inset 0 0 0 1.5px var(--due); }
.gauge.is-due i { background: var(--due); }
.gauge.h { width: 100%; height: 18px; }
.gauge.h i { top: 0; bottom: 0; right: auto; left: 0; width: var(--lvl); height: auto; }
.gauge.h.ticks::after {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(var(--tick) - 1.5px), var(--surface) calc(var(--tick) - 1.5px), var(--surface) var(--tick));
}
.gauge.h.working i { animation: fill 2.2s ease-in-out infinite alternate; }
@keyframes fill { from { width: 8%; } to { width: 92%; } }

/* empty + skeleton */
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 18px; padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.empty .tubes { display: flex; gap: 8px; align-items: flex-end; }
.empty .tubes .gauge { width: 14px; }
.empty p { color: var(--ink-2); max-width: 46ch; }
.skel { height: 112px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); animation: pulse 1.4s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }

/* detail + scan */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.hero { display: flex; gap: 14px; align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hero-text .latin { font-style: italic; color: var(--ink-2); overflow-wrap: anywhere; }
.big-status { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.big-status.is-due { color: var(--due); }
.sub { color: var(--ink-2); font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--water-soft); color: var(--ink); border: 0; font-family: var(--font-body); }
.chip.ok { background: var(--leaf-soft); color: var(--leaf); }
.chip.warn { background: var(--due-soft); color: var(--due); }
button.chip { cursor: pointer; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 6px; background: var(--bg); }
.stepper button { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 24px/1 var(--font-body); cursor: pointer; }
.stepper output { font-size: 17px; text-align: center; flex: 1; font-variant-numeric: tabular-nums; }
.stepper output strong { font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 500 17px/1.2 var(--font-body); }
.input.err { border-color: var(--due); }
select.input { appearance: auto; }
input[type="time"].input { width: auto; min-width: 128px; font-variant-numeric: tabular-nums; }
.photo-big { width: 100%; max-height: 280px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; display: block; background: var(--water-soft); }
dl.care { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
dl.care div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
dl.care dt { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-top: 2px; }
dl.care dd { margin: 0; overflow-wrap: anywhere; }
ul.tips { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.note-box { background: var(--water-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.note-box.warn { background: var(--due-soft); color: var(--due); }
.msg { font-size: 14px; padding: 10px 12px; border-radius: 12px; }
.msg.ok { background: var(--leaf-soft); color: var(--leaf); }
.msg.err { background: var(--due-soft); color: var(--due); }
.foot { font-size: 13px; color: var(--ink-2); }

.toast {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 0 max(16px, env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px));
  display: flex; justify-content: center; pointer-events: none; z-index: 20;
}
.toast-in { pointer-events: auto; max-width: 560px; width: 100%; background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; font-size: 15px; }
.toast-in button { font: 600 15px/1 var(--font-body); background: none; border: 0; color: var(--bg); text-decoration: underline; cursor: pointer; padding: 8px 4px; }

@media (prefers-reduced-motion: reduce) {
  .gauge.h.working i, .skel { animation: none; }
  .btn:active { transform: none; }
}

.account-nav{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.account-nav .btn{font-size:15px}.account-form{display:grid;gap:12px}.plan-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}.plan-grid .panel{margin:0}.recommended{border:2px solid var(--water)}

[hidden]{display:none!important}
