/* Moss. Warm paper, ink outlines, leaf-shaped corners, hard little shadows.
   Mobile first. Wider screens re-compose into a rail, a queue and a detail panel. */

:root {
  --paper: #f5eddc;
  --paper-2: #eadfc6;
  --paper-3: #fdf8ea;
  --ink: #2a2620;
  --ink-2: #5b5245;
  --moss: #37552b;
  --moss-2: #6b9448;
  --leaf: #8fae5a;
  --mint: #d3e2b4;
  --clay: #b4452a;
  --clay-2: #d9704c;
  --peach: #f4c9ab;
  --butter: #f2c94c;
  --butter-soft: #f9e6a6;
  --teal: #2a6f77;
  --teal-soft: #bfdcd8;
  --plum: #5b3a58;
  --plum-soft: #e2d0e0;
  --lilac: #d8c5d9;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", Nunito, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* The shape language: leaves (two big corners, two small) and soft blobs. */
  --r-leaf: 8px 26px 8px 26px;
  --r-panel: 26px 44px 30px 40px;
  --r-hero: 30px 66px 34px 60px;
  --blob-a: 58% 42% 52% 48% / 46% 54% 46% 54%;
  --blob-b: 44% 56% 38% 62% / 55% 40% 60% 45%;
  --blob-c: 62% 38% 46% 54% / 40% 58% 42% 60%;
  --blob-d: 40% 60% 60% 40% / 60% 44% 56% 40%;

  --line: 2.5px;
  --shadow: 5px 6px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .16  0 0 0 0 .14  0 0 0 0 .1  0 0 0 .08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
body.sheet-open { overflow: hidden; }

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
svg { display: block; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 12px; top: -80px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper-3);
  font-weight: 700;
  border-radius: var(--r-leaf);
}
.skip-link:focus { top: 12px; }

/* Focus: an ink ring with a butter halo, readable on cream, clay and moss alike. */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--butter);
}
.btn:focus-visible { box-shadow: 0 3px 0 var(--ink), 0 0 0 6px var(--butter); }
#queue:focus, #detail-title:focus, #alldone-title:focus { outline: none; box-shadow: none; }

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "status" "queue" "rhythm" "foot";
  gap: 22px;
  max-width: 600px;
  margin-inline: auto;
  padding: 16px 16px calc(48px + env(safe-area-inset-bottom));
}
.masthead { grid-area: head; }
.status { grid-area: status; }
.queue { grid-area: queue; }
.rhythm { grid-area: rhythm; }
.foot { grid-area: foot; }
.detail { grid-area: detail; }

/* ------------------------------------------------------------------ */
/* Masthead                                                            */
/* ------------------------------------------------------------------ */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--r-leaf);
}
.brand-mark { width: 40px; height: 40px; }
.brand-name {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.datepill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--butter-soft);
  border: 2px solid var(--ink);
  border-radius: 999px 999px 999px 8px;
}
.datepill-dot {
  width: 10px; height: 10px;
  background: var(--clay);
  border: 2px solid var(--ink);
  border-radius: var(--blob-b);
}

/* ------------------------------------------------------------------ */
/* Status: greeting, sprout, progress                                  */
/* ------------------------------------------------------------------ */
.status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: end;
  gap: 8px 14px;
}
.status-copy { min-width: 0; }
.status-art { grid-column: 2; grid-row: 1; }
.sprout { width: 92px; height: auto; overflow: visible; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.headline {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 7.4vw, 2.35rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.headline em {
  font-style: italic;
  color: var(--clay);
  text-decoration: underline wavy var(--butter);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  text-decoration-skip-ink: none;
}
.subline { margin-top: 10px; font-weight: 600; color: var(--ink-2); }
.pips { display: flex; gap: 6px; margin-top: 12px; min-height: 20px; }
.pip {
  width: 34px; height: 20px;
  background: var(--paper-3);
  border: 2px solid var(--ink);
  border-radius: 4px 14px 4px 14px;
}
.pip.is-done { background: var(--moss-2); }

.sprout .sleaf, .sprout .bloom { transform-box: fill-box; transform: scale(0); opacity: 0; }
.sprout .sleaf-1, .sprout .sleaf-3 { transform-origin: 100% 100%; }
.sprout .sleaf-2 { transform-origin: 0% 100%; }
.sprout .bloom { transform-origin: 50% 60%; }
.sprout.has-leaf-1 .sleaf-1, .sprout.has-leaf-2 .sleaf-2, .sprout.has-leaf-3 .sleaf-3 { transform: scale(1); opacity: 1; }
.sprout.is-bloom .bloom { transform: scale(1); opacity: 1; }
.sprout.is-bloom .bud { display: none; }
.sprout .sprout-plant { transform-origin: 60px 80px; }
.sprout.is-worried .sprout-plant { transform: rotate(-9deg); }
.sprout .eye { transform-box: fill-box; transform-origin: center; }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
  background: var(--paper-3);
  border: var(--line) solid var(--ink);
  border-radius: var(--r-leaf);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn .ico { width: 1.3em; height: 1.3em; flex: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--moss); color: var(--paper-3); }
.btn-ghost { background: var(--paper-3); }
.btn-quiet {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.9375rem;
  background: transparent;
  border-width: 2px;
  box-shadow: none;
}
.btn-quiet:active { transform: translateY(2px); }
.btn-quiet:focus-visible { box-shadow: 0 0 0 6px var(--butter); }
.btn-toast { min-height: 44px; background: var(--butter); color: var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5); }
.btn-toast:focus-visible { outline-color: var(--paper-3); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5), 0 0 0 6px var(--clay-2); }

.linkish {
  padding: 8px 4px;
  min-height: 44px;
  font-weight: 700;
  color: var(--ink);
  background: none;
  border: 0;
  text-decoration: underline wavy var(--clay-2);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  cursor: pointer;
}

@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
  .btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
  .btn-quiet:hover { background: var(--butter-soft); box-shadow: none; transform: none; }
  .btn-toast:hover { box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5); }
}

/* ------------------------------------------------------------------ */
/* Queue                                                               */
/* ------------------------------------------------------------------ */
.queue {
  display: grid;
  gap: 26px;
  align-content: start;
  container: queue / inline-size;
}
.q-section { display: grid; gap: 12px; }
.q-heading { display: flex; align-items: center; gap: 8px; }
.q-tag {
  padding: 4px 14px 5px;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  border-radius: 999px 999px 999px 6px;
  background: var(--butter);
}
.q-count {
  display: grid;
  place-items: center;
  min-width: 26px; height: 26px;
  padding: 0 6px;
  font-size: 0.8125rem;
  font-weight: 800;
  background: var(--paper-3);
  border: 2px solid var(--ink);
  border-radius: var(--blob-b);
}
.q-section--overdue .q-tag { background: var(--clay); color: var(--paper-3); }
.q-section--later .q-tag { background: transparent; border-style: dashed; }
.q-section--done .q-tag { background: var(--mint); }
.q-section--snoozed .q-tag { background: var(--plum-soft); }

.q-list { display: grid; gap: 12px; }

/* Portraits: every plant sits in its own blob. */
.portrait {
  --tint: var(--mint);
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  background: var(--tint);
  border: var(--line) solid var(--ink);
  border-radius: var(--blob-a);
  overflow: hidden;
}
.portrait .art { position: absolute; inset: 0; width: 100%; height: 100%; }
.tint-fern { --tint: var(--mint); border-radius: var(--blob-a); }
.tint-pothos { --tint: var(--butter-soft); border-radius: var(--blob-b); }
.tint-cactus { --tint: var(--peach); border-radius: var(--blob-c); }
.tint-calathea { --tint: var(--lilac); border-radius: var(--blob-d); }

/* Whole item is one big tap target through the name button. */
.q-item { position: relative; --q-r: 22px; }
.q-open {
  font: inherit;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.q-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--q-r); }
.q-open:focus-visible { outline: none; box-shadow: none; }
.q-open:focus-visible::after { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--butter); }
.q-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.q-actions .btn { flex: 1 1 auto; }
.q-actions .btn-primary { flex-grow: 1.5; }

.q-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.q-task { display: inline-flex; align-items: center; gap: 6px; }
.q-task .ico { width: 1.2em; height: 1.2em; }
.q-due {
  padding: 1px 10px 2px;
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 0.875rem;
  background: var(--butter);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.q-name { margin-top: 2px; font-family: var(--serif); font-size: 1.5rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; }
.q-meta { margin-top: 2px; font-size: 0.9375rem; color: var(--ink-2); }
.q-quip { margin-top: 8px; font-style: italic; }

/* Overdue: the loud one. A stitched terracotta patch. */
.q-hero {
  --q-r: var(--r-hero);
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 6px 16px;
  align-items: center;
  padding: 20px 18px 18px;
  color: var(--paper-3);
  background: var(--clay);
  border: var(--line) solid var(--ink);
  border-radius: var(--r-hero);
  box-shadow: 6px 7px 0 var(--ink);
}
.q-hero::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px dashed rgba(253, 248, 234, 0.5);
  border-radius: 24px 58px 28px 52px;
  pointer-events: none;
}
.q-hero .q-name { font-size: 2rem; }
.q-hero .q-meta { color: rgba(253, 248, 234, 0.92); }
.q-hero .q-quip { color: var(--paper-3); }
.q-hero .q-actions { grid-column: 1 / -1; margin-top: 10px; }
.q-hero .btn-primary { background: var(--butter); color: var(--ink); flex-grow: 1.3; }
.q-hero .btn-ghost { background: var(--paper-3); }
.q-hero .btn { box-shadow: 0 3px 0 var(--ink); }
.q-hero .portrait { border-color: var(--ink); }

/* Due today: one shared paper panel, rows divided by a dashed line. */
.q-list--today {
  gap: 0;
  background: var(--paper-3);
  border: var(--line) solid var(--ink);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow);
}
.q-row {
  --q-r: 0px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: center;
  padding: 16px;
}
.q-row:first-child { --q-r: 26px 44px 0 0; }
.q-row:last-child { --q-r: 0 0 30px 40px; }
.q-row:only-child { --q-r: var(--r-panel); }
.q-row + .q-row { border-top: 2px dashed rgba(42, 38, 32, 0.35); }
.q-row .q-actions { grid-column: 1 / -1; margin-top: 8px; }
.q-row .q-kicker { color: var(--ink-2); }

/* Up next: quieter, outlined in dashes. */
.q-list--later { gap: 10px; }
.q-quiet {
  --q-r: 26px 40px 28px 36px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: center;
  padding: 14px;
  border: var(--line) dashed rgba(42, 38, 32, 0.5);
  border-radius: 26px 40px 28px 36px;
}
.q-quiet .q-kicker { color: var(--ink-2); }
.q-quiet .q-due { background: transparent; }
.q-quiet .q-name { font-size: 1.25rem; }
.q-quiet .q-actions { grid-column: 1 / -1; margin-top: 8px; }
.q-quiet .btn-primary { background: transparent; color: var(--moss); }

/* Tended / snoozed: compact receipts with a persistent undo. */
.q-list--compact { gap: 8px; }
.q-compact {
  --q-r: 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 10px 12px;
  border: 2px solid var(--moss);
  border-radius: 20px 30px 20px 30px;
  background: rgba(211, 226, 180, 0.55);
}
.q-compact.is-snoozed { border-color: var(--plum); background: rgba(226, 208, 224, 0.55); }
.c-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  color: var(--paper-3);
  background: var(--moss);
  border: 2px solid var(--ink);
  border-radius: var(--blob-b);
  flex: none;
}
.c-mark .ico { width: 18px; height: 18px; }
.is-snoozed .c-mark { background: var(--plum); }
.c-name { font-family: var(--serif); font-size: 1.125rem; font-weight: 700; line-height: 1.2; }
.c-note { font-size: 0.875rem; color: var(--ink-2); }
.q-compact .btn { position: relative; z-index: 1; }

@media (hover: hover) {
  .q-row:hover { background: rgba(242, 201, 76, 0.16); }
  .q-quiet:hover, .q-compact:hover { background-color: rgba(242, 201, 76, 0.16); }
  .q-hero:hover { background: #bd4e32; }
}

@container queue (min-width: 600px) {
  .q-row { grid-template-columns: 72px minmax(0, 1fr) auto; padding: 16px 18px; }
  .q-row .q-actions { grid-column: 3; grid-row: 1; margin-top: 0; align-self: center; }
  .q-row .q-actions .btn { flex: 0 0 auto; }
  .q-quiet { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .q-quiet .q-actions { grid-column: 3; grid-row: 1; margin-top: 0; }
  .q-quiet .q-actions .btn { flex: 0 0 auto; }
  .q-hero { grid-template-columns: 116px minmax(0, 1fr); padding: 24px 26px 22px; }
  .q-hero .q-name { font-size: 2.4rem; }
  .q-hero .q-actions .btn { flex: 1 1 0; }
.q-actions .btn-primary { flex-grow: 1.5; }
}

/* All-done. */
.alldone {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 18px 18px 22px;
  background: var(--mint);
  border: var(--line) solid var(--ink);
  border-radius: 34px 64px 34px 58px;
  box-shadow: 6px 7px 0 var(--ink);
  overflow: hidden;
}
.alldone-art { position: relative; height: 92px; margin: -2px -18px 8px; border-bottom: 2.5px solid var(--ink); background: var(--butter-soft); overflow: hidden; }
.alldone-art::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 22px;
  background: var(--moss-2);
  border-top: 2.5px solid var(--ink);
}
.snail-art { position: absolute; bottom: 14px; left: 8%; width: 104px; height: auto; z-index: 1; }
.alldone h2 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.alldone-lead { margin-top: 6px; font-weight: 600; }
.recap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.recap li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 5px;
  font-weight: 800;
  background: var(--paper-3);
  border: 2px solid var(--ink);
  border-radius: 999px 999px 999px 8px;
}
.recap-what { font-weight: 600; color: var(--ink-2); }
.recap-dot { width: 10px; height: 10px; background: var(--moss-2); border: 2px solid var(--ink); border-radius: var(--blob-b); }
.recap-snoozed .recap-dot { background: var(--plum-soft); }
.alldone-next { margin-top: 12px; padding: 10px 14px; background: rgba(253, 248, 234, 0.7); border: 2px dashed var(--ink); border-radius: 18px 26px 18px 26px; }
.alldone-nudge { margin-top: 10px; font-size: 0.9375rem; color: var(--ink); }
.alldone-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.alldone .btn-quiet { background: var(--paper-3); }
.alldone .btn-quiet:hover { background: var(--butter-soft); }

/* ------------------------------------------------------------------ */
/* Weekly rhythm                                                       */
/* ------------------------------------------------------------------ */
.rhythm {
  padding: 18px 16px 16px;
  background: var(--paper-2);
  border: var(--line) solid var(--ink);
  border-radius: 40px 26px 44px 28px;
}
.rhythm-title { font-family: var(--serif); font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.rc-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 14px; }
.rc { position: relative; display: grid; grid-template-rows: auto auto; gap: 8px; padding: 8px 2px 8px; border-radius: 16px 16px 20px 20px; }
.rc.is-today { background: var(--butter); border: 2px solid var(--ink); padding: 6px 0 6px; }
.rc .stack { display: flex; flex-direction: column-reverse; justify-content: flex-start; gap: 5px; height: 114px; }
.rc-label { text-align: center; font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.04em; }
.rc.is-past .rc-label { color: var(--ink-2); }
.rc.is-today .rc-label { color: var(--ink); }
.peb {
  display: block;
  flex: none;
  width: var(--w, 80%);
  height: 17px;
  margin-inline: auto;
  border: 2px solid var(--ink);
  border-radius: 50% 46% 52% 48% / 62% 56% 44% 38%;
  transform: rotate(var(--rot, 0deg));
  background: var(--paper-3);
}
.peb--done { background: var(--moss-2); }
.peb--late { background: var(--clay); }
.peb--due { background: var(--paper-3); }
.peb--moved { background: transparent; border-style: dashed; }
.rhythm-cap { margin-top: 12px; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend .peb { width: 20px; height: 12px; margin: 0; transform: none; border-width: 2px; }

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; font-size: 0.875rem; color: var(--ink-2); }

/* ------------------------------------------------------------------ */
/* Detail: bottom sheet on mobile, side panel on desktop               */
/* ------------------------------------------------------------------ */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(42, 38, 32, 0.5); }

.detail {
  position: fixed;
  z-index: 50;
  left: 0; right: 0; bottom: 0;
  max-width: 640px;
  max-height: min(90vh, 780px);
  max-height: min(90dvh, 780px);
  margin-inline: auto;
  padding: 8px 18px calc(32px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper-3);
  border: var(--line) solid var(--ink);
  border-bottom: 0;
  border-radius: 36px 48px 0 0;
  box-shadow: 0 -6px 0 rgba(42, 38, 32, 0.14);
  transform: translateY(105%);
  visibility: hidden;
}
.detail.is-open { transform: none; visibility: visible; }
.grab { width: 48px; height: 6px; margin: 6px auto 14px; background: rgba(42, 38, 32, 0.3); border-radius: 99px; }

.d-head { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.d-title h2 { margin-top: 2px; font-family: var(--serif); font-size: 2.1rem; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; }
.d-species { margin-top: 2px; color: var(--ink-2); font-weight: 600; }
.d-close { align-self: start; width: 46px; min-height: 46px; padding: 0; border-radius: 50%; background: var(--paper-2); }
.d-close span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.d-next {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 26px 16px 28px 16px;
}
.d-next-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.d-due { padding: 1px 10px 2px; font-size: 0.875rem; letter-spacing: 0.02em; text-transform: none; background: var(--paper-3); border: 2px solid var(--ink); border-radius: 999px; }
.d-due.is-late { background: var(--clay); color: var(--paper-3); }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.d-actions .btn { flex: 1 1 auto; }
.d-actions .btn-primary { flex-grow: 1.5; }
.d-state { display: flex; align-items: center; gap: 12px; }
.d-state p { flex: 1; font-weight: 700; }
.d-inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.d-inline-note { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--teal); }
.d-inline-note .ico { width: 1.2em; height: 1.2em; }
.d-inline .btn-quiet { background: var(--paper-3); }

.d-sec { margin-top: 22px; padding-top: 18px; border-top: 2px dashed rgba(42, 38, 32, 0.35); }
.d-sec h3 { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.375rem; font-weight: 700; line-height: 1.2; }
.d-ico { display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--ink); border-radius: var(--blob-c); }
.d-ico .ico { width: 18px; height: 18px; }
.d-ico--light { background: var(--butter); }
.d-ico--water { background: var(--teal); color: var(--paper-3); }
.d-ico--obs { background: var(--plum); color: var(--paper-3); }
.d-meter { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.sunpips { display: flex; align-items: flex-end; gap: 5px; }
.sunpip { display: block; background: transparent; border: 2px dashed rgba(42, 38, 32, 0.5); border-radius: 50%; }
.sunpip.s1 { width: 14px; height: 14px; }
.sunpip.s2 { width: 19px; height: 19px; }
.sunpip.s3 { width: 24px; height: 24px; }
.sunpip.s4 { width: 29px; height: 29px; }
.sunpip.is-on { background: var(--butter); border: 2px solid var(--ink); }
.d-big { font-size: 1.0625rem; font-weight: 600; }
.d-big strong { font-weight: 800; }
.d-small { margin-top: 2px; font-size: 0.9375rem; color: var(--ink-2); }
.d-sec h3 + .d-big { margin-top: 12px; }
.d-tip { margin-top: 10px; font-style: italic; color: var(--ink-2); }

.drips { display: grid; grid-template-columns: repeat(21, minmax(0, 1fr)); align-items: end; gap: 3px; height: 28px; margin-top: 12px; }
.dr { height: 7px; background: rgba(42, 38, 32, 0.16); border-radius: 50%; }
.dr--watered { height: 26px; background: var(--teal); border: 2px solid var(--ink); border-radius: 50% 50% 50% 50% / 68% 68% 32% 32%; }
.dr--misted { height: 13px; background: var(--teal-soft); border: 2px solid var(--teal); border-radius: 50%; }
.drips-scale { display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.75rem; font-weight: 700; color: var(--ink-2); }

.hist { display: grid; gap: 6px; margin-top: 12px; }
.hist li {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 7px 12px 8px;
  background: var(--paper-2);
  border-left: 6px solid var(--butter);
  border-radius: 6px 18px 6px 18px;
}
.d-water .hist li { border-left-color: var(--teal); }
.d-obs .hist li { border-left-color: var(--plum); }
.hist li.is-fresh { background: var(--butter-soft); }
.hist-date { font-size: 0.875rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hist-what { font-weight: 700; }
.hist-ago { font-size: 0.875rem; color: var(--ink-2); white-space: nowrap; }
.hist-empty { margin-top: 12px; padding: 10px 14px; color: var(--ink-2); border: 2px dashed rgba(42, 38, 32, 0.35); border-radius: 18px 8px 18px 8px; }

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */
.toast-region {
  position: fixed;
  z-index: 60;
  left: 0; right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  padding: 0 14px;
  pointer-events: none;
}
.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 520px);
  padding: 10px 10px 12px 18px;
  overflow: hidden;
  color: var(--paper-3);
  background: var(--ink);
  border: 2px solid var(--paper-3);
  border-radius: 16px 30px 16px 30px;
  box-shadow: 0 6px 0 rgba(42, 38, 32, 0.35);
  pointer-events: auto;
}
.toast-msg { flex: 1; font-weight: 700; line-height: 1.3; }
.toast-x { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--paper-3); background: none; border: 0; border-radius: 50%; cursor: pointer; }
.toast-x .ico { width: 18px; height: 18px; }
.toast-x:focus-visible { outline-color: var(--paper-3); box-shadow: 0 0 0 6px var(--clay-2); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 5px; width: 100%; background: var(--butter); transform-origin: left; }

/* ------------------------------------------------------------------ */
/* Wider screens: two columns, then a three-part composition           */
/* ------------------------------------------------------------------ */
@media (min-width: 900px) {
  .app {
    max-width: 1140px;
    grid-template-columns: minmax(0, 1fr) 410px;
    grid-template-rows: auto auto auto auto auto 1fr;
    grid-template-areas:
      "head    detail"
      "status  detail"
      "queue   detail"
      "rhythm  detail"
      "foot    detail"
      ".       detail";
    column-gap: 36px;
    row-gap: 26px;
    padding: 28px 32px 56px;
    align-items: start;
  }
  .scrim { display: none; }
  .grab, .d-close { display: none; }
  .detail {
    position: sticky;
    top: 24px;
    left: auto; right: auto; bottom: auto;
    max-width: none;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    margin: 0;
    padding: 24px 24px 28px;
    border: var(--line) solid var(--ink);
    border-radius: 40px 60px 40px 56px;
    box-shadow: 7px 8px 0 var(--ink);
    transform: none;
    visibility: visible;
  }
  .d-head { grid-template-columns: 96px minmax(0, 1fr); }
  .status { grid-template-columns: minmax(0, 1fr) 120px; }
  .sprout { width: 120px; }
  .headline { font-size: clamp(2.2rem, 3.4vw, 2.9rem); }

  /* On desktop the selection is meaningful, so mark it. */
  .q-item.is-selected .portrait { box-shadow: 0 0 0 4px var(--butter), 0 0 0 6.5px var(--ink); }
  .q-item.is-selected .q-name .q-open { text-decoration: underline wavy var(--butter); text-decoration-thickness: 3px; text-underline-offset: 5px; }
  .q-hero.is-selected .q-name .q-open { text-decoration-color: var(--butter); }
  .q-row.is-selected { background: rgba(242, 201, 76, 0.2); }
  .q-quiet.is-selected, .q-compact.is-selected { background-color: rgba(242, 201, 76, 0.2); }
}

@media (min-width: 1240px) {
  .app {
    max-width: 1400px;
    grid-template-columns: 330px minmax(0, 1fr) 420px;
    grid-template-rows: auto auto auto auto 1fr;
    grid-template-areas:
      "head   queue detail"
      "status queue detail"
      "rhythm queue detail"
      "foot   queue detail"
      ".      queue detail";
    column-gap: 44px;
    row-gap: 28px;
    padding: 36px 40px 64px;
  }
  .masthead { flex-wrap: wrap; }
  .status { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 22px 22px 24px; background: var(--butter-soft); border: var(--line) solid var(--ink); border-radius: 48px 28px 52px 30px; box-shadow: var(--shadow); }
  .status-art { grid-column: 1; grid-row: 1; justify-self: start; margin-bottom: -6px; }
  .sprout { width: 132px; }
  .headline { font-size: 2.3rem; }
  .rhythm { position: sticky; top: 24px; }
  .queue { padding-top: 6px; }
  .q-hero .q-name { font-size: 2.6rem; }
}

@media (min-width: 1500px) {
  .app { max-width: 1520px; grid-template-columns: 360px minmax(0, 1fr) 460px; }
}

/* ------------------------------------------------------------------ */
/* Motion: only when the person has not asked for less                 */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.2s ease; }
  .detail { transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.3, 1), visibility 0s linear 0.34s; }
  .detail.is-open { transition-delay: 0s; }
  @media (min-width: 900px) { .detail { transition: none; } }
  .scrim { animation: fade-in 0.25s ease both; }

  .q-item.is-new { animation: settle 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
  .q-item { transition: background-color 0.2s ease; }
  .alldone.is-new { animation: settle 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
  .toast { animation: toast-in 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
  .toast-bar { animation-name: toast-bar; animation-timing-function: linear; animation-fill-mode: forwards; }

  .sprout .sleaf, .sprout .bloom { transition: transform 0.5s cubic-bezier(0.2, 1.2, 0.4, 1), opacity 0.3s ease; }
  .sprout .sprout-plant { transition: transform 0.6s cubic-bezier(0.2, 1, 0.4, 1); }
  .sprout .eye { animation: blink 5.5s infinite; }
  .sprout.is-bloom .bloom { animation: sway 3.2s ease-in-out 0.6s infinite alternate; }
  .snail-art { animation: crawl 46s linear -14s infinite; }
}

@keyframes settle { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.12); } }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes crawl { from { left: -30%; } to { left: 105%; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .toast-bar { display: none; }
}

@media (forced-colors: active) {
  .btn, .q-hero, .q-list--today, .detail, .toast { border: 2px solid CanvasText; }
  .pip.is-done, .peb--done, .sunpip.is-on { background: Highlight; }
}
