/* Moss — warm, tactile, slightly odd.
   Paper, clay and moss. Soft blobs for living things, firm pills for controls. */

:root {
  --paper: #f5eddd;
  --paper-2: #ece1ca;
  --paper-3: #e2d3b4;
  --card: #fbf6ec;
  --ink: #2c241d;
  --ink-soft: #5c4f43;
  --line: #cdbb98;
  --moss: #4d6b3a;
  --moss-deep: #2f4724;
  --moss-soft: #c9d6a9;
  --clay: #c2603a;
  --clay-deep: #93401f;
  --clay-soft: #f0cdb6;
  --ochre: #e3a93d;
  --ochre-soft: #f5dfae;
  --plum: #6e3a61;
  --sky: #a9c3cc;
  --sky-deep: #2f5c6b;
  --focus: #6a1f8a;
  --focus-halo: rgba(106, 31, 138, 0.22);

  --leaf: #5f8a45;
  --leaf-dark: #3b5b2a;
  --leaf-light: #a9c47a;
  --stripe: #d7e3b8;
  --pot: #c86a43;
  --pot-rim: #d98159;
  --pot-ink: #3a2016;
  --cheek: #f19a86;
  --glochid: #f3e1a1;

  --shadow-soft: 0 1px 0 rgba(70, 48, 20, 0.08), 0 10px 24px -14px rgba(70, 48, 20, 0.35);
  --press: 0 4px 0 var(--moss-deep);

  --blob-a: 58% 42% 55% 45% / 46% 56% 44% 54%;
  --blob-b: 44% 56% 40% 60% / 58% 44% 56% 42%;
  --blob-c: 36px 36px 36px 12px;

  --font-body: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;

  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f1a15;
    --paper-2: #2a231c;
    --paper-3: #362d24;
    --card: #28211a;
    --ink: #f3e9d8;
    --ink-soft: #c9b9a2;
    --line: #4e4234;
    --moss: #9cbf7c;
    --moss-deep: #b7d596;
    --moss-soft: #34452a;
    --clay: #e08a63;
    --clay-deep: #f2a888;
    --clay-soft: #4a2a1d;
    --ochre: #e8b75a;
    --ochre-soft: #4b3a18;
    --plum: #d6a3cb;
    --sky-deep: #9fd0df;
    --focus: #e7b6ff;
    --focus-halo: rgba(231, 182, 255, 0.25);
    --leaf: #7aa35d;
    --leaf-dark: #4f7338;
    --stripe: #cfe0aa;
    --pot: #b8603c;
    --pot-rim: #cd7550;
    --shadow-soft: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 26px -14px rgba(0, 0, 0, 0.7);
    --press: 0 4px 0 #1a2a12;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  /* speckled paper */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(120, 90, 40, 0.06) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 80%, rgba(120, 90, 40, 0.05) 0 1px, transparent 1.5px);
  background-size: 23px 23px, 31px 31px;
}

h1, h2, h3, h4, p { margin: 0; }
button, input { font: inherit; color: inherit; }
kbd {
  font-family: var(--font-body);
  font-size: 0.78em;
  font-weight: 700;
  padding: 0.05em 0.45em;
  border-radius: 6px;
  border: 1.5px solid currentColor;
  border-bottom-width: 3px;
  opacity: 0.9;
}

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

.muted { color: var(--ink-soft); font-weight: 500; }

/* ---------- focus: loud, warm, never removed ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--focus-halo);
  border-radius: 12px;
}
[tabindex="-1"]:focus-visible { outline-offset: 6px; }

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus { top: 12px; }

/* ================================================================ layout */
.app {
  display: grid;
  gap: 24px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 120px;
}
.pane { display: none; }


/* Tablet: greeting and rhythm share the top row, the queue gets full width. */
@media (min-width: 700px) and (max-width: 999.98px) {
  .app {
    max-width: 820px;
    padding: 28px 28px 120px;
    grid-template-columns: 1.1fr 1fr;
    grid-template-areas: "hello rhythm" "queue queue" "hint hint";
    align-items: start;
  }
  .hello { grid-area: hello; }
  .rhythm { grid-area: rhythm; align-self: stretch; }
  .queue { grid-area: queue; }
  .keys-hint { grid-area: hint; }
}

@media (min-width: 1000px) {
  .app {
    max-width: 1380px;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(360px, 430px);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "hello  queue pane"
      "rhythm queue pane"
      "hint   queue pane";
    gap: 20px 32px;
    padding: 32px 32px 64px;
    align-items: start;
  }
  .hello { grid-area: hello; }
  .rhythm { grid-area: rhythm; }
  .keys-hint { grid-area: hint; }
  .queue { grid-area: queue; }
  .pane {
    grid-area: pane;
    display: block;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 36px;
    scrollbar-width: thin;
  }
  .queue { padding-top: 4px; }
}


/* ================================================================ greeting */

.hello {
  position: relative;
  padding: 20px 20px 18px;
  background: var(--card);
  border-radius: 34px 34px 34px 14px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 14px;
}

.brand { display: flex; align-items: center; gap: 8px; color: var(--moss); }
.brand__mark { width: 28px; height: 28px; display: inline-grid; }
.brand__mark svg { width: 100%; height: 100%; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--moss-deep);
}

.hello__row { display: flex; align-items: center; gap: 14px; }
.hello__date {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay-deep);
}
.hello__greeting {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.1;
  font-weight: 600;
}
.hello__mood {
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 34ch;
}

/* Moss, the mascot: a moss ball with opinions */
.mossball {
  --size: 64px;
  position: relative;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: var(--blob-a);
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.22) 0 14%, transparent 15%),
    radial-gradient(circle at 70% 40%, var(--leaf-light) 0 1.5px, transparent 2px) 0 0 / 11px 11px,
    radial-gradient(circle at 20% 70%, rgba(40, 60, 25, 0.35) 0 1.5px, transparent 2px) 0 0 / 13px 13px,
    var(--leaf);
  box-shadow: inset -6px -8px 0 rgba(0, 0, 0, 0.14), 0 6px 0 -2px rgba(60, 40, 10, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12%;
  padding-top: 6%;
  animation: breathe 5.5s ease-in-out infinite;
}
.mossball__eye {
  width: 15%;
  height: 20%;
  background: #1e140e;
  border-radius: 50%;
  box-shadow: inset 1.5px 1.5px 0 0 rgba(255, 255, 255, 0.55);
  animation: blink 6s infinite;
  transform-origin: center;
}
.mossball__sprout {
  position: absolute;
  top: -12%;
  left: 52%;
  width: 22%;
  height: 26%;
  border-radius: 0 100% 0 100%;
  background: var(--leaf-light);
  border: 2px solid var(--leaf-dark);
  transform: rotate(-12deg);
  transform-origin: bottom left;
}
.mossball.is-worried .mossball__eye { height: 12%; border-radius: 50% 50% 45% 45%; }
.mossball.is-worried .mossball__sprout { transform: rotate(28deg); }
.mossball.is-happy .mossball__eye {
  background: transparent;
  box-shadow: none;
  border: 3px solid #1e140e;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  height: 9%;
  width: 16%;
  animation: none;
}
.mossball.is-bouncing { animation: bounce 0.7s var(--ease-spring); }
.mossball--big { --size: 108px; }

@keyframes breathe { 0%, 100% { border-radius: var(--blob-a); } 50% { border-radius: var(--blob-b); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes bounce { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-10px) scale(1.06, 0.94); } 70% { transform: translateY(2px) scale(0.97, 1.03); } 100% { transform: none; } }

/* progress: seeds on a vine */
.progress { display: grid; gap: 6px; }
.progress__track {
  position: relative;
  height: 22px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 0%);
  background: var(--moss-soft);
  border-radius: 999px;
  transition: width 0.5s var(--ease-spring);
}
.progress__seed {
  position: relative;
  width: 12px; height: 12px;
  border-radius: 0 100% 0 100%;
  border: 2px solid var(--moss);
  background: var(--card);
  transition: background 0.3s, transform 0.4s var(--ease-spring);
}
.progress__seed.is-on { background: var(--moss); transform: scale(1.25); }
.progress__label { font-size: 0.92rem; }

/* ---------- weekly rhythm ---------- */
.rhythm {
  padding: 18px 18px 16px;
  background: var(--moss-deep);
  color: var(--paper);
  border-radius: 14px 34px 34px 34px;
  box-shadow: var(--shadow-soft);
}
@media (prefers-color-scheme: dark) {
  .rhythm { background: #243520; color: var(--ink); }
}
.rhythm__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rhythm__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.rhythm__sub { font-size: 0.82rem; opacity: 0.85; }
.rhythm__days {
  list-style: none;
  margin: 14px 0 10px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  align-items: end;
}
.day { display: grid; justify-items: center; gap: 6px; }
.day__stack {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  width: 100%;
  height: calc(var(--max, 4) * 14px + 8px);
}
/* the stem grows with the number of care moments */
.day__stack::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  height: calc(var(--n, 0) * 14px + 6px);
  border-radius: 2px;
  background: rgba(245, 237, 221, 0.45);
}
.sprig {
  position: relative;
  width: 14px;
  height: 10px;
  border-radius: 0 100% 0 100%;
  border: 2px solid rgba(245, 237, 221, 0.7);
  transform: translateX(7px) rotate(-18deg);
  transform-origin: left center;
}
.sprig:nth-child(even) { border-radius: 100% 0 100% 0; transform: translateX(-7px) rotate(18deg); transform-origin: right center; }
.sprig.is-filled { background: var(--leaf-light); border-color: var(--leaf-light); }
.day--past .sprig { background: rgba(245, 237, 221, 0.4); border-color: transparent; }
.day--today .day__stack::before { background: var(--ochre); }
.day--today .sprig { border-color: var(--ochre); }
.day--today .sprig.is-filled { background: var(--ochre); }
.sprig.is-new { animation: sprig-in 0.5s var(--ease-spring) both; }
.day__label { font-size: 0.78rem; font-weight: 700; opacity: 0.8; }
.day--today .day__label {
  opacity: 1;
  background: var(--ochre);
  color: #2c241d;
  border-radius: 999px;
  padding: 0 7px;
}
.rhythm__note { font-size: 0.86rem; opacity: 0.9; }
@keyframes sprig-in { from { scale: 0.1; } 60% { scale: 1.3; } }

.keys-hint { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.9; }
.keys-hint__label { font-weight: 700; }
@media (hover: none) and (pointer: coarse) { .keys-hint { display: none; } }

/* ================================================================ queue */
.queue { display: grid; gap: 18px; align-content: start; }
.queue__head { display: grid; gap: 2px; }
.queue__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.queue__sub { color: var(--ink-soft); }
#queue-body { display: grid; gap: 26px; }

.group { display: grid; gap: 12px; }
.group__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.group--overdue .group__title { color: var(--clay-deep); }
.group__title .icon { width: 16px; height: 16px; }
.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--ink);
}
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.task {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}
.first-paint .task { animation: row-in 0.4s var(--ease-spring) both; }
.first-paint .task:nth-child(2) { animation-delay: 0.05s; }
.first-paint .task:nth-child(3) { animation-delay: 0.1s; }
@keyframes row-in { from { opacity: 0; transform: translateY(6px) scale(0.985); } }

.task__art .plant { display: block; }
.task__body { display: grid; gap: 6px; min-width: 0; }
.task__name { font-size: 1.3rem; line-height: 1.15; }
.task__what { font-size: 0.95rem; }
.task__why { font-size: 0.92rem; color: var(--ink-soft); max-width: 44ch; }

/* The plant name is the way into details */
.plant-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
  border-radius: 6px;
}
.plant-link:hover { text-decoration-color: currentColor; }
.plant-link[aria-current="true"] { text-decoration-color: var(--clay); text-decoration-style: wavy; }

/* Overdue: the loud one. Clay blob, big plant, a sticker. */
.task--overdue {
  grid-template-columns: 1fr;
  padding: 18px 18px 20px;
  background: var(--clay-soft);
  border-radius: 40px 40px 40px 16px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.task--overdue::before {
  content: "";
  position: absolute;
  right: -40px; top: -50px;
  width: 190px; height: 190px;
  border-radius: var(--blob-b);
  background: var(--clay);
  opacity: 0.18;
}
.task--overdue .task__art { justify-self: center; width: 150px; margin-bottom: -6px; position: relative; }
.task--overdue .task__name { font-size: 1.9rem; }
.task--overdue .task__body { position: static; }
.sticker {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 88px; height: 88px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.1;
  color: #3a2016;
  background: var(--ochre);
  border-radius: 50%;
  transform: rotate(9deg);
  box-shadow: 0 0 0 4px var(--clay-soft), 0 0 0 6px var(--ochre), 0 4px 10px -2px rgba(80, 40, 0, 0.35);
}
.sticker span { padding: 0 10px; }

@media (min-width: 520px) {
  .task--overdue { grid-template-columns: 170px 1fr; gap: 18px; padding: 22px 26px 24px 18px; }
  .task--overdue .task__art { width: 170px; margin: 0; }
  .sticker { position: static; justify-self: start; width: auto; height: auto; padding: 6px 12px; border-radius: 999px; transform: rotate(-3deg); }
  .sticker span { padding: 0; }
}

/* Today: warm paper cards with an asymmetric corner, plant peeking out */
.list--today { gap: 14px; }
@media (min-width: 700px) {
  .list--today { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
.task--today {
  grid-template-columns: 92px 1fr;
  padding: 14px 16px 16px 10px;
  background: var(--card);
  border-radius: var(--blob-c);
  box-shadow: var(--shadow-soft);
}
.task--today:nth-child(even) { border-radius: 36px 12px 36px 36px; }
.task--today .task__art { width: 92px; align-self: center; }
.task--today .actions { margin-top: 4px; }

.chip {
  display: inline-block;
  padding: 1px 10px;
  margin-right: 4px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--ochre-soft);
  color: var(--ink);
}
.chip--pothos { background: var(--moss-soft); }
.chip--cactus { background: var(--ochre-soft); }
.chip--calathea { background: #e5d5e4; }
@media (prefers-color-scheme: dark) { .chip--calathea { background: #47304a; } }

/* Coming up / snoozed: quiet dashed rows */
.task--later {
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  padding: 8px 12px 8px 8px;
  border: 2px dashed var(--line);
  border-radius: 999px 28px 28px 999px;
}
.task--later .task__art { width: 56px; }
.task--later .task__name { font-size: 1.1rem; }
.task--later .task__what { font-size: 0.9rem; }
@media (max-width: 419.98px) {
  .task--later { grid-template-columns: 56px 1fr; border-radius: 28px 28px 28px 999px; }
  .task--later > .btn { grid-column: 2; justify-self: start; margin-top: -6px; }
}
.task--later.is-snoozed { background: repeating-linear-gradient(-45deg, transparent 0 10px, var(--paper-2) 10px 12px); }

/* Done shelf */
.group--done { position: relative; }
.shelf {
  list-style: none;
  margin: 0;
  padding: 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 0;
  align-items: start;
}
.shelf__item { display: grid; justify-items: center; gap: 6px; width: 100px; text-align: center; }
@media (min-width: 420px) { .shelf__item { width: 112px; } }
.shelf__item .plant-link { font-size: 1rem; text-align: center; display: grid; justify-items: center; }
.shelf__what { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-body); font-weight: 600; font-size: 0.8rem; color: var(--moss); }
.shelf__what .icon { width: 14px; height: 14px; }
.shelf__art { position: relative; width: 100%; display: grid; justify-items: center; padding-bottom: 10px; }
.shelf__art .plant { width: 72px; position: relative; z-index: 1; }
/* each pot sits on a length of plank; neighbours join into one shelf */
.shelf__art::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 12px;
  background: linear-gradient(#b98a55, #93683a);
  box-shadow: 0 5px 0 -1px rgba(80, 50, 20, 0.22);
}
.shelf__item:first-child .shelf__art::after { border-radius: 8px 0 0 8px; }
.shelf__item:last-child .shelf__art::after { border-radius: 0 8px 8px 0; }
.shelf__item:only-child .shelf__art::after { border-radius: 8px; }
.shelf__item.is-fresh .plant { animation: pop 0.6s var(--ease-spring); }
@keyframes pop { 0% { transform: translateY(8px) scale(0.8); } 60% { transform: translateY(-6px) scale(1.06); } 100% { transform: none; } }

/* ---------- all done ---------- */
.alldone {
  position: relative;
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 26px 22px 22px;
  background: var(--moss-soft);
  border-radius: 44px 44px 44px 18px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.alldone__art { position: relative; justify-self: center; padding: 8px 20px 0; }
.alldone__title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--moss-deep);
}
@media (prefers-color-scheme: dark) { .alldone__title { color: var(--ink); } }
.alldone__lead { font-size: 1.05rem; max-width: 48ch; }
.alldone__facts {
  margin: 4px 0;
  display: grid;
  gap: 10px;
  width: 100%;
}
@media (min-width: 560px) { .alldone__facts { grid-template-columns: 1fr 1fr; } }
.alldone__facts > div {
  padding: 12px 14px;
  background: var(--card);
  border-radius: 20px;
}
.alldone__facts dt {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.alldone__facts dd { margin: 4px 0 0; }
.alldone__facts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.alldone__nudge { font-style: italic; color: var(--ink-soft); }

.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 0 100% 0 100%;
  background: var(--leaf);
  animation: drift 2.6s ease-in-out infinite alternate;
}
.confetti i:nth-child(1) { left: 0; top: 20%; background: var(--ochre); }
.confetti i:nth-child(2) { right: 0; top: 10%; transform: rotate(90deg); animation-delay: -0.6s; }
.confetti i:nth-child(3) { left: 10%; bottom: 0; background: var(--clay); animation-delay: -1.1s; }
.confetti i:nth-child(4) { right: 6%; bottom: 10%; background: var(--ochre); animation-delay: -1.7s; }
.confetti i:nth-child(5) { left: 44%; top: -6px; background: var(--clay); animation-delay: -0.3s; width: 8px; height: 8px; }
.confetti i:nth-child(6) { right: 30%; top: 0; animation-delay: -2s; width: 9px; height: 9px; }
@keyframes drift { from { translate: 0 0; rotate: 0deg; } to { translate: 0 -8px; rotate: 30deg; } }

/* ================================================================ buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  --btn-bg: var(--card);
  --btn-fg: var(--ink);
  --btn-edge: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid var(--btn-edge);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 800;
  font-size: 0.98rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--btn-edge);
  transform: translateY(0);
  transition: transform 0.12s, box-shadow 0.12s, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn .icon { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--btn-edge); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--btn-edge); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

.btn--primary { --btn-bg: var(--moss-deep); --btn-fg: #fbf6ec; --btn-edge: #1d2d16; }
@media (prefers-color-scheme: dark) {
  .btn--primary { --btn-bg: var(--moss); --btn-fg: #16210f; --btn-edge: #0e160a; }
}
.btn--quiet { --btn-bg: transparent; --btn-edge: var(--ink); box-shadow: 0 3px 0 var(--btn-edge); }
.task--overdue .btn--primary { --btn-bg: var(--clay-deep); --btn-edge: #4d1d0a; }
@media (prefers-color-scheme: dark) {
  .task--overdue .btn--primary { --btn-bg: var(--clay); --btn-fg: #2a1208; --btn-edge: #1a0a03; }
}
.btn--water { --btn-bg: var(--sky); --btn-fg: #16323b; --btn-edge: #16323b; }
.btn--small { min-height: 40px; padding: 0 14px; font-size: 0.9rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--card);
  cursor: pointer;
}
.icon-btn .icon { width: 18px; height: 18px; }

/* ================================================================ plant svg */
.plant { width: 100%; height: auto; overflow: visible; }
.plant__shadow { fill: rgba(60, 40, 10, 0.14); }
.plant .leaf { fill: var(--leaf); }
.plant .leaf--new { fill: var(--leaf-light); }
.plant .frond { fill: none; stroke: var(--leaf); stroke-width: 11; stroke-dasharray: 2.4 1.5; stroke-linecap: round; }
.plant .vein-dark { fill: none; stroke: var(--leaf-dark); stroke-width: 1.6; stroke-linecap: round; }
.plant .vein { fill: none; stroke: var(--leaf-dark); stroke-width: 1; opacity: 0.7; }
.plant .leaf-streak { fill: none; stroke: var(--glochid); stroke-width: 2.4; stroke-linecap: round; }
.plant .vine, .plant .stem { fill: none; stroke: var(--leaf-dark); stroke-width: 2; stroke-linecap: round; }
.plant .stripe { fill: none; stroke: var(--stripe); stroke-width: 1.4; stroke-linecap: round; }
.plant .glochid { fill: var(--glochid); }
.plant .pot__body { fill: var(--pot); }
.plant .pot__rim { fill: var(--pot-rim); }
.plant .face__eye { fill: var(--pot-ink); }
.plant .face__line, .plant .face__z { fill: none; stroke: var(--pot-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.plant .face__z { stroke: var(--ink-soft); stroke-width: 1.8; }
.plant .face__cheek { fill: var(--cheek); opacity: 0.8; }
.plant .blink { transform-box: fill-box; transform-origin: center; animation: blink 7s infinite; }
.plant .face__eye:nth-of-type(2) { animation-delay: 0.04s; }
.plant .sway { transform-box: view-box; transform-origin: 50% 60%; }
.plant--wobble .sway { animation: droop 3.2s ease-in-out infinite; }
.task:hover .sway, .shelf__item:hover .sway { animation: sway 1.6s ease-in-out; }
.plant .sway--stiff { animation-duration: 0.6s; }
@keyframes droop { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2.5deg) translateY(1px); } }
@keyframes sway { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(3deg); } 65% { transform: rotate(-2deg); } }

/* ================================================================ detail */
.pane__card {
  padding: 22px 22px 26px;
  background: var(--card);
  border-radius: 36px;
  box-shadow: var(--shadow-soft);
}

.detail { display: grid; gap: 18px; }
.detail__top {
  position: relative;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  align-items: end;
  padding: 14px 14px 16px;
  background: var(--paper-2);
  border-radius: 30px 30px 30px 10px;
}
.detail__close { position: absolute; top: 10px; right: 10px; }
.detail__art { width: 112px; }
.detail__id { display: grid; gap: 4px; padding-bottom: 4px; }
.detail__kicker { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--clay-deep); padding-right: 48px; }
.detail__name { font-family: var(--font-display); font-size: 2.1rem; line-height: 1; font-weight: 700; }
.detail__where { display: inline-flex; align-items: center; gap: 4px; font-size: 0.92rem; color: var(--ink-soft); }
.detail__where .icon { width: 15px; height: 15px; }
.detail__quirk { font-family: var(--font-display); font-style: italic; font-size: 1.08rem; color: var(--ink-soft); padding: 0 6px; }
.detail__task .actions .btn { flex: 1 1 auto; }

.status {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--card);
}
.status .icon { width: 15px; height: 15px; }
.status--overdue { background: var(--clay-deep); color: #fbf6ec; }
@media (prefers-color-scheme: dark) { .status--overdue { color: #2a1208; background: var(--clay); } }
.status--done { background: var(--moss-soft); }
.status--snoozed { background: var(--paper-3); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .facts { grid-template-columns: 1fr; } }
.fact {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 14px;
  border-radius: 24px;
}
.fact--light { background: var(--ochre-soft); border-radius: 24px 24px 8px 24px; }
.fact--water { background: color-mix(in srgb, var(--sky) 45%, var(--card)); border-radius: 24px 24px 24px 8px; }
.fact__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.fact__title .icon { width: 16px; height: 16px; }
.fact__value { font-weight: 700; line-height: 1.3; }
.fact__tip { font-size: 0.88rem; color: var(--ink-soft); }
.fact .btn { justify-self: start; margin-top: 4px; }

.meter { display: flex; gap: 5px; }
.meter i {
  width: 22px; height: 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  opacity: 0.35;
}
.meter i.is-on { background: var(--ochre); border-color: var(--ink); opacity: 1; }

.history { display: grid; gap: 10px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; }
.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 7px 0 7px 22px;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: 3px; top: 13px;
  width: 11px; height: 11px;
  border-radius: 0 100% 0 100%;
  background: var(--card);
  border: 2px solid var(--moss);
  transform: rotate(-45deg);
}
.timeline__item::after {
  content: "";
  position: absolute;
  left: 9px; top: 28px; bottom: -8px;
  border-left: 2px dotted var(--line);
}
.timeline__item:last-child::after { display: none; }
.timeline__item.is-latest::before { background: var(--moss); }
.timeline__when { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.note { display: grid; gap: 6px; margin-top: 4px; }
.note__label { font-size: 0.9rem; font-weight: 700; }
.note__row { display: flex; gap: 8px; }
.note__input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}
.note__input::placeholder { color: var(--ink-soft); opacity: 0.8; }
.note__input[aria-invalid="true"] { border-color: var(--clay-deep); }
.note__input:focus-visible { border-color: var(--focus); border-radius: 16px; }

/* ---------- mobile sheet ---------- */
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 34px 34px 0 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 -10px 40px -10px rgba(40, 25, 10, 0.4);
  overflow: auto;
  overscroll-behavior: contain;
}
.sheet[open] { animation: sheet-up 0.38s var(--ease-spring); }
.sheet::backdrop { background: rgba(44, 36, 29, 0.45); }
.sheet__grip { width: 48px; height: 5px; margin: 10px auto 0; border-radius: 999px; background: var(--line); }
.sheet__inner { padding: 12px 16px 28px; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@media (min-width: 700px) {
  .sheet { margin: auto; border-radius: 36px; max-height: 88vh; }
}

/* ================================================================ toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 32px));
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 14px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 28px 28px 28px 10px;
  box-shadow: 0 16px 30px -12px rgba(30, 20, 10, 0.55);
  animation: toast-in 0.35s var(--ease-spring);
  overflow: hidden;
}
.toast[hidden] { display: none; }
.toast__msg { font-weight: 700; }
.toast__undo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--paper);
  background: transparent;
  color: var(--paper);
  font-weight: 800;
  cursor: pointer;
}
.toast__undo:hover { background: rgba(245, 237, 221, 0.12); }
.toast__undo:focus-visible { outline-color: var(--ochre); box-shadow: 0 0 0 7px rgba(227, 169, 61, 0.3); border-radius: 999px; }
.toast__timer { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; }
.toast__timer span { display: block; height: 100%; background: var(--ochre); transform-origin: left; }
.toast.is-running .toast__timer span { animation: drain var(--undo-ms, 8000ms) linear forwards; }
.toast.is-paused .toast__timer span { animation-play-state: paused; }
@keyframes drain { to { transform: scaleX(0); } }
@keyframes toast-in { from { transform: translate(-50%, 20px); opacity: 0; } }

.noscript { padding: 24px; text-align: center; }

/* ================================================================ motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .mossball, .mossball__eye, .plant .blink, .plant--wobble .sway, .confetti i { animation: none !important; }
  /* keep the undo countdown legible without motion: a static full bar */
  .toast.is-running .toast__timer span { animation: none !important; opacity: 0.6; }
  .btn:hover, .btn:active { transform: none; }
}

@media (forced-colors: active) {
  .btn, .icon-btn, .toast__undo, .note__input { border: 2px solid ButtonText; }
  .task, .pane__card, .hello, .rhythm, .alldone { border: 1px solid CanvasText; }
  :focus-visible { outline: 3px solid Highlight; }
}
