/* ══════════════════════════════════════════════════════════════
   My Plants — a plant health journal
   Warm paper, rounded type, single-column feed.
   ══════════════════════════════════════════════════════════════ */

:root {
  --paper:      #F4EFE4;
  --paper-dot:  rgba(58, 46, 28, .055);
  --surface:    #FFFCF6;
  --surface-2:  #EFE9DB;
  --ink:        #1E241F;
  --ink-2:      #5D6A5C;
  --ink-3:      #939C8F;
  --line:       #E2DAC7;
  --line-soft:  #EDE7D9;
  --accent:     #2F7D4F;

  --shadow-sm: 0 1px 2px rgba(40,34,20,.05);
  --shadow:    0 1px 2px rgba(40,34,20,.05), 0 10px 28px -14px rgba(40,34,20,.28);
  --shadow-lg: 0 2px 4px rgba(40,34,20,.06), 0 24px 60px -22px rgba(40,34,20,.38);

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;

  --font-display: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Nunito", system-ui, sans-serif;
  --font-body:    ui-serif, "New York", Iowan Old Style, Georgia, serif;
  --font-ui:      system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:     #0F1310;
    --paper-dot: rgba(255,255,255,.035);
    --surface:   #191E19;
    --surface-2: #232922;
    --ink:       #E9EDE3;
    --ink-2:     #A2AD9C;
    --ink-3:     #6E7A6B;
    --line:      #2B322A;
    --line-soft: #232A23;
    --accent:    #5CBE84;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 12px 30px -16px rgba(0,0,0,.8);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 30px 70px -24px rgba(0,0,0,.9);
  }
}
:root[data-theme="dark"] {
  --paper:     #0F1310;
  --paper-dot: rgba(255,255,255,.035);
  --surface:   #191E19;
  --surface-2: #232922;
  --ink:       #E9EDE3;
  --ink-2:     #A2AD9C;
  --ink-3:     #6E7A6B;
  --line:      #2B322A;
  --line-soft: #232A23;
  --accent:    #5CBE84;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 12px 30px -16px rgba(0,0,0,.8);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 30px 70px -24px rgba(0,0,0,.9);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, var(--paper-dot) 1px, transparent 0);
  background-size: 20px 20px;
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

/* ── top bar ─────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 13px 20px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
}
.wordmark-leaf { font-size: 25px; line-height: 1; transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.wordmark:hover .wordmark-leaf { transform: rotate(-14deg) scale(1.12); }
.wordmark-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.wordmark { flex: 0 0 auto; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color .18s, box-shadow .18s;
  min-width: 0;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.search-icon { color: var(--ink-3); font-size: 15px; }
.search input {
  border: 0;
  background: none;
  outline: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  width: 128px;
  min-width: 0;
}
.search input::-webkit-search-cancel-button { filter: grayscale(1) opacity(.5); }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 15px;
  transition: transform .18s, border-color .18s;
}
.icon-btn:hover { transform: scale(1.08); border-color: var(--ink-3); }
.icon-btn:active { transform: scale(.94); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun,
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }

/* ── view tabs ───────────────────────────────────────────── */

.tabs {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 11px;
  display: flex;
  gap: 5px;
}

.tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: none;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .16s, color .16s;
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.tab-count {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-2) 16%, transparent);
  font-variant-numeric: tabular-nums;
}
.tab[aria-pressed="true"] .tab-count { background: color-mix(in srgb, var(--paper) 26%, transparent); }
.tab-count.hot { background: #C43D2C; color: #fff; }

/* ── toolbar (sorting) ───────────────────────────────────── */

.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--ink-3);
  margin-right: 2px;
}
.toolbar-count { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s;
}
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 9px;
  margin-bottom: 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.back:hover { border-color: var(--ink-3); color: var(--ink); }

/* ── layout ──────────────────────────────────────────────── */

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 26px 20px 70px;
}

/* ── garden mood banner ──────────────────────────────────── */

.mood {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 30px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.mood:empty { display: none; }
.ring { flex: 0 0 auto; }
.mood-copy { min-width: 0; }
.mood-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.015em;
  margin: 0 0 3px;
}
.mood-sub { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }

/* ── plant dossier (single-plant view) ───────────────────── */

.dossier {
  padding: 22px;
  margin-bottom: 32px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.dossier::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent-plant, var(--accent));
}
.dossier-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.dossier-emoji {
  width: 52px; height: 52px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 27px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--accent-plant, var(--accent)) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-plant, var(--accent)) 28%, transparent);
}
.dossier-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 25px;
  letter-spacing: -.025em;
  margin: 1px 0 2px;
}
.dossier-species { font-style: italic; font-family: var(--font-body); font-size: 14px; color: var(--ink-2); margin: 0; }
.dossier-meta { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }

.dossier-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 18px;
}
.stat { background: var(--surface); padding: 12px 14px; }
.stat-k {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-3);
  font-weight: 650;
  margin: 0 0 4px;
}
.stat-v {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.02em;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.stat-v small { font-size: 12px; font-weight: 650; color: var(--ink-3); letter-spacing: 0; }

.spark-wrap { padding: 4px 2px 0; }
.spark-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); font-weight: 650; margin: 0 0 8px;
}
.spark { display: block; height: 62px; overflow: visible; }
.dossier-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ── month divider ───────────────────────────────────────── */

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 34px 2px 22px;
  color: var(--ink-3);
}
.divider:first-child { margin-top: 0; }
.divider::before, .divider::after {
  content: ""; height: 1px; background: var(--line); flex: 1;
}
.divider span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ── post ────────────────────────────────────────────────── */

.feed { display: flex; flex-direction: column; }

.post {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 26px;
  animation: rise .5s cubic-bezier(.22,1,.36,1) backwards;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .post { animation: none; }
  * { transition-duration: .01ms !important; }
}

.post-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 18px;
}
.post-avatar {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 21px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-plant, var(--accent)) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-plant, var(--accent)) 28%, transparent);
}
.post-who { flex: 1; min-width: 0; }
.post-name {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 16px;
  letter-spacing: -.015em;
  margin: 0;
  cursor: pointer;
}
.post-name:hover { color: var(--accent); }
.post-species {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  font-family: var(--font-body);
  font-style: italic;
}
.post-when { text-align: right; flex: 0 0 auto; }
.post-rel { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.post-abs { margin: 1px 0 0; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Never crop a plant photo. object-fit: cover would chop the top off a tall
   plant and the pot off the bottom — the two most diagnostic parts of the
   shot. So: natural aspect ratio, whatever orientation it was taken in.
   A portrait photo simply makes a tall post, which is correct for a photo
   journal. max-height is a guard against pathological panoramas only — it
   sits well above any phone photo (a 9:16 at 620px wide is ~1100px), so
   normal shots never letterbox. */
.post-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 1400px;
  min-height: 240px;   /* placeholder box before load; real photos exceed it */
  object-fit: contain;
  background: var(--surface-2);
  cursor: zoom-in;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  transition: filter .25s;
}
.post-photo:hover { filter: brightness(1.03) saturate(1.05); }
.post-photo.missing {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}

.photo-missing {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

/* health strip */
.health {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px 4px;
}
.health-score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 38px;
  line-height: .95;
  letter-spacing: -.045em;
  color: var(--state);
  font-variant-numeric: tabular-nums;
}
.health-score span { font-size: 16px; font-weight: 700; opacity: .5; letter-spacing: 0; }
.health-mid { flex: 1; min-width: 0; }
.health-state {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 15px;
  letter-spacing: -.01em;
  margin: 0 0 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.health-face { font-size: 16px; }
.meter {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--state) 55%, transparent), var(--state));
  animation: fill .9s cubic-bezier(.22,1,.36,1) backwards;
}
@keyframes fill { from { width: 0 !important; } }

.delta {
  flex: 0 0 auto;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}
.delta.up   { color:#1F7A45; background: color-mix(in srgb, #1F7A45 12%, transparent); border-color: color-mix(in srgb, #1F7A45 24%, transparent); }
.delta.down { color:#B4402F; background: color-mix(in srgb, #B4402F 12%, transparent); border-color: color-mix(in srgb, #B4402F 24%, transparent); }
.delta.flat { color: var(--ink-3); background: var(--surface-2); }
:root[data-theme="dark"] .delta.up   { color:#6FD09A; }
:root[data-theme="dark"] .delta.down { color:#F09080; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .delta.up   { color:#6FD09A; }
  :root:not([data-theme="light"]) .delta.down { color:#F09080; }
}

/* body copy */
.post-body { padding: 14px 18px 18px; }

.headline {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -.022em;
  margin: 0 0 10px;
  text-wrap: balance;
}
.verdict {
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--ink-2);
  margin: 0;
}
:root[data-theme="dark"] .verdict { color: color-mix(in srgb, var(--ink) 82%, transparent); }

.section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 700;
  color: var(--ink-3);
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

/* actions */
.actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.action {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--a) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--a) 22%, transparent);
}
.action-icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--a) 16%, var(--surface));
  font-size: 15px;
}
.action-copy { min-width: 0; flex: 1; }
.action-title {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 14.5px;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.urg {
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2.5px 6px;
  border-radius: 5px;
}
.urg.now      { background:#C43D2C; color:#fff; }
.urg.soon     { background: color-mix(in srgb, var(--ink) 12%, transparent); color: var(--ink-2); }
.urg.whenever { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }
.action-note {
  margin: 4px 0 0;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* observations */
.obs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.obs li {
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 5px 11px 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.obs li::before { content: "🍃"; font-size: 11px; }

.sample-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 5px;
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 5px, transparent 5px, transparent 10px);
  border: 1px dashed var(--line);
  color: var(--ink-3);
  margin-left: 8px;
  vertical-align: middle;
}

/* ── empty state ─────────────────────────────────────────── */

.empty {
  text-align: center;
  padding: 48px 26px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.empty-emoji { font-size: 52px; line-height: 1; margin-bottom: 14px; }
.empty h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.025em;
  margin: 0 0 8px;
}
.empty p {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 42ch;
  margin: 0 auto 18px;
}
.empty ol {
  text-align: left;
  max-width: 40ch;
  margin: 0 auto;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-2);
}
.empty code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
}

/* ── footer / to-top ─────────────────────────────────────── */

.foot {
  text-align: center;
  padding: 0 20px 54px;
  color: var(--ink-3);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13.5px;
}

.totop {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  z-index: 30;
}
.totop.on { opacity: 1; pointer-events: auto; transform: none; }
.totop:hover { border-color: var(--ink-3); }

/* ── lightbox ────────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: color-mix(in srgb, #0B0E0A 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 30px;
}
.lightbox.on { display: flex; animation: fade .2s ease backwards; }
@keyframes fade { from { opacity: 0; } }
.lightbox img {
  max-width: min(96vw, 1100px);
  max-height: 82vh;
  width: auto;
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
}
.lightbox-cap { color: #E9EDE3; font-size: 13.5px; margin: 0; text-align: center; }
.lightbox-close {
  position: absolute;
  top: 18px; right: 20px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.1);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
}
.lightbox-close:hover { background: rgba(255,255,255,.2); }

/* ── session summary (a whole walk round the garden) ─────── */

.session {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 18px;
  margin: 36px 0 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.feed > .session:first-child { margin-top: 0; }
.session-copy { min-width: 0; flex: 1; }
.session-date {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16.5px;
  letter-spacing: -.02em;
  margin: 0 0 2px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.session-rel { font-family: var(--font-ui); font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.session-sub { margin: 0; font-size: 13px; color: var(--ink-2); }
.session-moves { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sess-move {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.sess-move.up { color: #1F7A45; background: color-mix(in srgb, #1F7A45 12%, transparent); }
.sess-move.down { color: #B4402F; background: color-mix(in srgb, #B4402F 12%, transparent); }
.sess-move.urgent { color: #fff; background: #C43D2C; }
:root[data-theme="dark"] .sess-move.up { color: #6FD09A; }
:root[data-theme="dark"] .sess-move.down { color: #F09080; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sess-move.up { color: #6FD09A; }
  :root:not([data-theme="light"]) .sess-move.down { color: #F09080; }
}

/* ── plant grid ──────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
}

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 15px 13px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform .18s cubic-bezier(.34,1.4,.64,1), box-shadow .18s, border-color .18s;
}
.pcard::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent-plant, var(--accent));
  opacity: .85;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ink-3); }
.pcard:active { transform: translateY(-1px); }

.pcard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pcard-emoji {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 20px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent-plant, var(--accent)) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-plant, var(--accent)) 28%, transparent);
}
.pcard-name {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 15.5px;
  letter-spacing: -.02em;
  margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pcard-species {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0 0 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Wrap as whole items: on a narrow card the delta drops to its own line
   rather than the state label getting chopped to "Nee…". */
.pcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: auto;
}
.pcard-state { font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.pcard-foot .delta { flex: 0 0 auto; }
.pcard-seen { margin: 7px 0 0; font-size: 11.5px; color: var(--ink-3); }
.pcard-seen.overdue { color: #C4693B; font-weight: 650; }

.delta.sm { font-size: 10.5px; padding: 2.5px 7px; }

/* ── to-do list ──────────────────────────────────────────── */

.section-label.big {
  font-size: 12.5px;
  letter-spacing: .05em;
  color: var(--ink);
  margin: 30px 0 4px;
}
.section-label.big:first-child { margin-top: 0; }
.section-label.big span {
  font-family: var(--font-ui);
  font-size: 11px;
  padding: 1.5px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  letter-spacing: 0;
}
.group-note {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  color: var(--ink-3);
}

.todo { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo-row {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--a) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--a) 22%, transparent);
}
.todo-copy { min-width: 0; flex: 1; }
.todo-title {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 14.5px;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.todo-plant {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 650;
  padding: 2.5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.todo-plant:hover { border-color: var(--ink-3); color: var(--ink); }

/* ── load more ───────────────────────────────────────────── */

.loadmore {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 4px;
  border-radius: var(--r);
  border: 1.5px dashed var(--line);
  background: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
}
.loadmore:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.feed-end {
  text-align: center;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 6px 0 0;
}

/* ── small screens ───────────────────────────────────────── */

@media (max-width: 620px) {
  .wrap { padding: 20px 13px 60px; }
  .topbar-inner, .tabs { padding-left: 13px; padding-right: 13px; }
  .post { border-radius: var(--r); }
  .health-score { font-size: 33px; }
  .headline { font-size: 17.5px; }
  .verdict, .action-note { font-size: 15.5px; }
  .dossier-stats { grid-template-columns: 1fr 1fr; }
  .dossier-stats .stat:last-child { grid-column: span 2; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .tab { padding: 6px 10px; font-size: 13.5px; }
  .session { padding: 13px 15px; gap: 12px; }

  /* Let the search take whatever room is left rather than disappearing. */
  .topbar-right { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
  .search { flex: 1 1 auto; min-width: 0; max-width: 168px; padding: 0 9px; }
  .search input { width: 100%; }
  .wordmark-text { font-size: 19px; }
}
