:root {
  --page: #d8d0c1;
  --paper: #eee3ca;
  --paper-light: #f5ecd9;
  --ink: #193127;
  --ink-soft: #617066;
  --muted: #858074;
  --red: #d84b32;
  --ochre: #b88d40;
  --line: rgba(25,49,39,.19);
  --serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px) 0 0 / 88px 88px,
    linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px) 0 0 / 88px 88px,
    var(--page);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.17'/%3E%3C/svg%3E");
}

button, input { font: inherit; }
button { cursor: pointer; }

.garden-app {
  width: min(1240px, calc(100% - 52px));
  margin: 0 auto;
  padding: 12px 0;
}

.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 45px;
  height: 45px;
  display: block;
  flex: none;
}

.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(2px 2px 0 rgba(25,49,39,.12)); }

.brand strong, .brand small { display: block; }
.brand strong { font: 700 18px/1 var(--serif); letter-spacing: .08em; }
.brand small { margin-top: 6px; color: var(--ink-soft); font-size: 12px; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink-soft);
  background: rgba(245,236,217,.44);
  font-size: 12px;
}
.top-actions #resetToday { padding: 0 14px; }
.top-actions button:hover { color: var(--paper-light); border-color: var(--ink); background: var(--ink); }
.top-actions .icon-action {
  position: relative;
  width: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
}
.icon-action svg {
  width: 18px;
  height: 18px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-action::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  padding: 5px 7px;
  border: 1px solid var(--ink);
  color: var(--paper-light);
  background: var(--ink);
  font-size: 10px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity .18s ease, transform .18s ease;
}
.icon-action:hover::after,
.icon-action:focus-visible::after { opacity: 1; transform: translateY(0); }
.top-actions .music-toggle {
  display: inline-grid;
  align-items: center;
  color: var(--ink);
}
.music-toggle[aria-pressed="false"] { color: var(--muted); }
.music-toggle .music-off-mark { opacity: 0; stroke: var(--red); stroke-width: 1.8; transition: opacity .2s ease; }
.music-toggle[aria-pressed="false"] .music-off-mark { opacity: 1; }
.top-actions .music-toggle:hover { color: var(--paper-light); border-color: var(--ink); background: var(--ink); }

.garden-card {
  --card-height: clamp(600px, calc(100vh - 230px), 730px);
  min-height: var(--card-height);
  display: grid;
  grid-template-columns: clamp(487px, calc(80vh - 178px), 591px) minmax(420px, 1fr);
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 13px 15px 0 rgba(25,49,39,.09), 0 34px 76px rgba(52,46,31,.12);
}

.tree-scene {
  --frame-inset: 16px;
  position: relative;
  min-height: var(--card-height);
  overflow: hidden;
  background: #e9dec4;
  isolation: isolate;
}

.tree-scene::before {
  content: "";
  position: absolute;
  inset: var(--frame-inset);
  z-index: 3;
  pointer-events: none;
  border: 1px solid rgba(25,49,39,.16);
}

.tree-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #e9dec4;
  transform-origin: 41% 90%;
  transition: opacity 1.2s ease, filter 1.2s ease;
}

.stage-image {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% - var(--frame-inset) * 2);
  height: auto;
  object-fit: contain;
  object-position: center;
  background: #e9dec4;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.012);
  transition: opacity 1.15s ease, transform 1.5s ease;
}
.stage-image.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.tree-canvas.empty .stage-image.is-visible { opacity: .12; filter: grayscale(.85) sepia(.15); }
.tree-canvas.planted .stage-image.is-visible { opacity: 1; }
.tree-canvas.growing .stage-image.is-visible { animation: printBreathe 6s ease-in-out infinite; }

.fruit-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% - var(--frame-inset) * 2);
  aspect-ratio: 1122 / 1402;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
}

.tree-canvas .fruit {
  position: absolute;
  z-index: 5;
  width: var(--fruit-size);
  height: var(--fruit-size);
  background: url("assets/tomato-linocut-green-fruit-v1.png") center / contain no-repeat;
  filter: drop-shadow(3px 4px 0 rgba(25,49,39,.15));
  rotate: var(--fruit-angle);
  animation: fruitAppear .85s cubic-bezier(.18,.9,.24,1.2);
}
.tree-canvas .fruit > span {
  position: absolute;
  z-index: 1;
  bottom: calc(100% - 5px);
  left: 50%;
  width: 2px;
  height: var(--stem-height);
  border-radius: 2px;
  background: #35522f;
  box-shadow: 1px 0 rgba(238,227,202,.32);
  transform: translateX(-50%) rotate(var(--stem-angle));
  transform-origin: 50% 100%;
}
.tree-canvas .fruit::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0;
  background: url("assets/tomato-linocut-fruit-v1.png") center / contain no-repeat;
  transform: scale(.86);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.2,.8,.2,1);
}
.tree-canvas .fruit.ripe::after { opacity: 1; transform: scale(1); }

.tree-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
}

.tree-canvas.stage-arrival::after {
  opacity: 0;
  background: radial-gradient(ellipse at 39% 50%, rgba(245,225,163,.7), transparent 38%);
  animation: stageArrival 1.5s ease-out 1;
}

.scene-top {
  position: absolute;
  z-index: 4;
  top: 37px;
  left: 50%;
  right: auto;
  width: calc(100% - var(--frame-inset) * 4);
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  color: #193127;
  opacity: 1;
  visibility: visible;
  transition: opacity .5s ease, visibility .5s ease;
}
.garden-card:not(.is-planted) .scene-top { opacity: 0; visibility: hidden; }
.harvest-count { display: flex; align-items: baseline; gap: 7px; }
.harvest-count b { color: var(--red); font: 44px/.8 var(--serif); }
.harvest-count small { font-size: 12px; }

.focus-ritual {
  min-height: var(--card-height);
  display: flex;
  flex-direction: column;
  padding: 38px 46px 32px;
  border-left: 1px solid var(--ink);
  color: var(--ink);
  background:
    linear-gradient(rgba(238,227,202,.94), rgba(238,227,202,.94)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(25,49,39,.08) 31px 32px);
}

.session-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 12px;
}
.session-line b { color: var(--ink); font: 20px var(--serif); }
.session-line em {
  padding: 6px 9px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  font-style: normal;
}

.ritual-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 31px;
}
.ritual-track::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: var(--line);
}
.ritual-track span {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #969285;
  font-size: 12px;
  transition: color .35s ease;
}
.ritual-track span i {
  position: relative;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid #aaa597;
  border-radius: 50%;
  color: #89877c;
  background: var(--paper);
  font: 10px var(--sans);
  font-style: normal;
  transition: .35s ease;
}
.ritual-track span.active { color: var(--ink); }
.ritual-track span.active i { border-color: var(--red); color: var(--paper-light); background: var(--red); box-shadow: 0 0 0 5px rgba(216,75,50,.1); }
.ritual-track span.done { color: var(--ink-soft); }
.ritual-track span.done i { border-color: #788979; color: transparent; background: #788979; }
.ritual-track span.done i::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--paper-light);
  font: 600 12px/1 var(--sans);
  transform: translateY(-.5px);
}

.eyebrow { margin: 44px 0 11px; color: #936d2e; font-size: 12px; }
.focus-ritual h1 { max-width: 410px; margin: 0; font: 600 39px/1.25 var(--serif); letter-spacing: .02em; }
.ritual-copy { min-height: 42px; margin: 15px 0 29px; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }

.plant-ceremony { margin: -2px 0 28px; }
.plant-ceremony.hidden { display: none; }
.plant-ceremony button {
  width: 100%;
  height: 48px;
  border: 1px solid #9e3425;
  color: #fff3df;
  background: var(--red);
  box-shadow: 5px 6px 0 rgba(25,49,39,.16);
  font-size: 13px;
}
.plant-ceremony button i { margin-left: 18px; font-style: normal; }
.plant-ceremony button:hover { background: #e35c43; }

.task-field {
  margin-top: 24px;
  padding: 15px 0 12px;
  border-bottom: 1px solid rgba(25,49,39,.5);
}
.task-field label { display: block; margin-bottom: 9px; color: #8c692f; font-size: 12px; }
.task-field input { width: 100%; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font: 600 14px var(--sans); }
.task-field input::placeholder { color: #9e998b; font-weight: 400; }

.timer-block { margin-top: 27px; transition: opacity .4s ease; }
.timer-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.clock { color: var(--ink); font: 500 64px/.84 var(--mono); letter-spacing: -.09em; font-variant-numeric: tabular-nums; transition: opacity .4s ease; }

.duration-control {
  display: flex;
  align-items: center;
  margin-bottom: 3px;
  border: 1px solid var(--line);
}
.duration-control button { width: 30px; height: 32px; border: 0; color: var(--ink-soft); background: transparent; font-size: 16px; }
.duration-control input { width: 31px; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font: 600 12px var(--sans); text-align: center; appearance: textfield; }
.duration-control input::-webkit-inner-spin-button, .duration-control input::-webkit-outer-spin-button { appearance: none; }
.duration-control span { padding-right: 4px; color: var(--muted); font-size: 11px; }
.duration-control.locked { opacity: .4; }

.progress-line { height: 2px; margin-top: 18px; background: rgba(25,49,39,.16); }
.progress-line span { display: block; width: 0; height: 100%; background: var(--red); transition: width .2s; }

.timer-actions { display: flex; gap: 8px; margin-top: 21px; transition: opacity .4s ease; }
.quiet-control, .ritual-button { height: 45px; border-radius: 0; font-size: 12px; }
.quiet-control { width: 59px; padding: 0; border: 1px solid var(--line); color: var(--muted); background: transparent; }
.quiet-control:hover { color: var(--ink); border-color: var(--ink); }
.ritual-button { flex: 1; border: 1px solid var(--ink); color: var(--paper-light); background: var(--ink); box-shadow: 4px 5px 0 rgba(25,49,39,.12); }
.ritual-button:hover { background: #294a3c; }
.ritual-button:disabled { cursor: default; border-color: #aaa596; color: #89877b; background: #cbc1aa; box-shadow: none; }
.ritual-message { min-height: 19px; margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; text-align: center; }

.garden-card:not(.is-planted) .task-field,
.garden-card:not(.is-planted) .timer-block,
.garden-card:not(.is-planted) .timer-actions,
.garden-card:not(.is-planted) .ritual-message { opacity: .28; pointer-events: none; }

.day-log {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: rgba(238,227,202,.78);
  box-shadow: 7px 8px 0 rgba(25,49,39,.08);
}
.log-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-right: 1px solid var(--ink); }
.log-heading > div { min-width: 0; }
.log-heading small { color: #8f6630; font-size: 12px; }
.log-heading h2 { margin: 7px 0 0; white-space: nowrap; font: 18px var(--serif); }
.log-heading > span { flex: none; margin-left: 18px; color: var(--ink-soft); font-size: 12px; }
.record-list { max-height: 100px; overflow: auto; padding: 8px 24px; scrollbar-color: var(--ink-soft) transparent; scrollbar-width: thin; }
.empty-records { margin: 0; padding: 19px 0; color: var(--muted); font-size: 12px; }
.record { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; }
.record-info { min-width: 0; display: flex; align-items: center; gap: 10px; }
.record-ritual { flex: none; min-width: 50px; padding: 5px 7px; color: var(--paper-light); background: var(--ink); font-size: 11px; text-align: center; }
.record-name { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.record-duration, .record-time { flex: none; color: #77796f; font-size: 11px; }

.stats-dialog {
  width: min(1120px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 14px 16px 0 rgba(25,49,39,.16), 0 36px 90px rgba(25,49,39,.28);
}
.stats-dialog::backdrop { background: rgba(25,35,30,.52); backdrop-filter: blur(3px); }
.stats-dialog[open] { animation: statsReveal .35s cubic-bezier(.2,.8,.2,1); }
.stats-panel { display: flex; max-height: calc(100vh - 42px); flex-direction: column; }
.stats-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 25px 28px 21px;
  border-bottom: 1px solid var(--ink);
  background:
    linear-gradient(rgba(238,227,202,.94),rgba(238,227,202,.94)),
    repeating-linear-gradient(90deg,transparent 0 63px,rgba(25,49,39,.07) 63px 64px);
}
.stats-header small { color: #936d2e; font: 9px var(--mono); letter-spacing: .13em; }
.stats-header h2 { margin: 6px 0 0; font: 600 30px/1.1 var(--serif); }
.stats-header p { margin: 8px 0 0; color: var(--ink-soft); font-size: 11px; }
.stats-close { width: 37px; height: 37px; border: 1px solid var(--line); color: var(--ink); background: transparent; font: 24px/1 var(--serif); }
.stats-close:hover { color: var(--paper-light); border-color: var(--ink); background: var(--ink); }

.stats-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 28px;
  border-bottom: 1px solid var(--line);
}
.stats-tabs { display: flex; border: 1px solid var(--ink); }
.stats-tabs button { min-width: 58px; height: 32px; border: 0; border-right: 1px solid var(--ink); color: var(--ink-soft); background: transparent; font-size: 11px; }
.stats-tabs button:last-child { border-right: 0; }
.stats-tabs button.active { color: var(--paper-light); background: var(--ink); }
.stats-period-nav { display: flex; align-items: center; gap: 6px; }
.stats-period-nav button { height: 32px; padding: 0 10px; border: 1px solid var(--line); color: var(--ink-soft); background: transparent; font-size: 11px; }
.stats-period-nav button:hover:not(:disabled) { color: var(--paper-light); border-color: var(--ink); background: var(--ink); }
.stats-period-nav button:disabled { cursor: default; opacity: .3; }
.stats-period-nav strong { min-width: 210px; color: var(--ink); font: 15px var(--serif); text-align: center; }

.stats-summary { display: grid; grid-template-columns: repeat(4,1fr); border-bottom: 1px solid var(--ink); }
.stats-summary > div { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 5px; padding: 14px 20px; border-right: 1px solid var(--line); }
.stats-summary > div:last-child { border-right: 0; }
.stats-summary small { grid-column: 1/-1; color: var(--muted); font-size: 10px; }
.stats-summary strong { color: var(--red); font: 31px/.9 var(--serif); }
.stats-summary span { color: var(--ink-soft); font-size: 10px; }

.stats-garden { flex: 1; min-height: 300px; overflow: auto; padding: 20px 24px; background: #e9dec4; scrollbar-color: var(--ink-soft) transparent; scrollbar-width: thin; }
.week-garden { min-width: 760px; display: grid; grid-template-columns: repeat(7,minmax(98px,1fr)); gap: 10px; }
.day-plot {
  min-width: 0;
  min-height: 225px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 12px 11px 10px;
  border: 1px solid rgba(25,49,39,.24);
  background: rgba(245,236,217,.66);
}
.day-plot.today { border-color: var(--red); box-shadow: inset 0 0 0 2px rgba(216,75,50,.1); }
.day-plot.future { opacity: .48; }
.day-plot > header { display: flex; align-items: baseline; justify-content: space-between; }
.day-plot > header small { color: var(--muted); font-size: 9px; }
.day-plot > header strong { font: 15px var(--serif); }
.day-plot > footer { min-height: 28px; display: grid; gap: 2px; text-align: center; }
.day-plot > footer span { color: var(--ink); font-size: 10px; }
.day-plot > footer em { color: var(--muted); font-size: 8px; font-style: normal; }

.mini-garden { position: relative; min-height: 120px; display: block; overflow: hidden; }
.mini-tree {
  position: absolute;
  z-index: 2;
  bottom: 22px;
  left: 50%;
  width: 58px;
  height: 78px;
  color: #294a3c;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 25% 26%,currentColor 0 10%,transparent 11%),
    radial-gradient(ellipse at 70% 22%,currentColor 0 11%,transparent 12%),
    radial-gradient(ellipse at 16% 48%,currentColor 0 12%,transparent 13%),
    radial-gradient(ellipse at 78% 49%,currentColor 0 13%,transparent 14%),
    radial-gradient(ellipse at 31% 66%,currentColor 0 11%,transparent 12%),
    radial-gradient(ellipse at 68% 68%,currentColor 0 11%,transparent 12%);
}
.mini-tree::before { content:""; position:absolute; bottom:0; left:28px; width:3px; height:69px; border-radius:50% 50% 0 0; background:currentColor; transform:rotate(1deg); }
.mini-tree::after {
  content:"";
  position:absolute;
  inset:8px 4px 11px;
  background:
    linear-gradient(31deg,transparent 47%,currentColor 48% 51%,transparent 52%) left 25%/52% 48% no-repeat,
    linear-gradient(-32deg,transparent 47%,currentColor 48% 51%,transparent 52%) right 30%/54% 51% no-repeat,
    linear-gradient(29deg,transparent 47%,currentColor 48% 51%,transparent 52%) left 76%/52% 45% no-repeat,
    linear-gradient(-29deg,transparent 47%,currentColor 48% 51%,transparent 52%) right 78%/52% 45% no-repeat;
}
.mini-tree i { position:absolute; z-index:3; width:9px; height:9px; border-radius:50%; border:1px solid #9e3425; background:var(--red); box-shadow:1px 1px 0 rgba(25,49,39,.18); }
.mini-tree i:nth-child(1) { top:15%; left:25%; }
.mini-tree i:nth-child(2) { top:20%; left:62%; }
.mini-tree i:nth-child(3) { top:36%; left:10%; }
.mini-tree i:nth-child(4) { top:40%; left:73%; }
.mini-tree i:nth-child(5) { top:54%; left:28%; }
.mini-tree i:nth-child(6) { top:57%; left:59%; }
.mini-tree i:nth-child(7) { top:70%; left:14%; }
.mini-tree i:nth-child(8) { top:72%; left:74%; }
.mini-soil { position:absolute; z-index:1; bottom:15px; left:50%; width:84px; height:14px; border-radius:50%; background:#777453; transform:translateX(-50%); box-shadow:inset 0 3px rgba(25,49,39,.18); }
.mini-garden:not(.cultivated) .mini-tree { opacity:.17; filter:grayscale(1); }
.future .mini-tree { opacity:.08 !important; }

.calendar-grid { min-width: 780px; display: grid; grid-template-columns: repeat(7,1fr); gap: 8px; }
.calendar-weekday { padding: 0 0 4px; color: var(--muted); font-size: 9px; text-align: center; }
.calendar-blank { min-height: 1px; }
.month-view .day-plot { min-height: 132px; padding: 8px; }
.month-view .mini-garden { min-height: 72px; }
.month-view .mini-tree { bottom: 12px; transform: translateX(-50%) scale(.68); transform-origin: 50% 100%; }
.month-view .mini-soil { bottom: 8px; width: 62px; height: 10px; }
.month-view .day-plot > footer { min-height: 20px; }
.month-view .day-plot > footer em { display:none; }

.year-garden { min-width: 800px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.month-grove { padding: 11px; border: 1px solid rgba(25,49,39,.23); background: rgba(245,236,217,.57); }
.month-grove > header { display:flex; align-items:baseline; justify-content:space-between; padding-bottom:8px; border-bottom:1px solid var(--line); }
.month-grove > header strong { font: 15px var(--serif); }
.month-grove > header span { color:var(--red); font-size:9px; }
.year-day-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; padding-top:8px; }
.year-day,.year-blank { min-width:0; height:28px; }
.year-day { border:1px solid rgba(25,49,39,.08); background:rgba(238,227,202,.42); }
.year-day.today { border-color:var(--red); }
.year-day.future { opacity:.32; }
.mini-garden.compact { min-height:26px; }
.compact .mini-tree { bottom:4px; width:18px; height:25px; transform:translateX(-50%); }
.compact .mini-tree::before { left:8px; width:1px; height:21px; }
.compact .mini-tree::after { inset:2px 1px 4px; }
.compact .mini-tree i { width:3px; height:3px; border:0; box-shadow:none; }
.compact .mini-soil { bottom:2px; width:24px; height:4px; }

.stats-legend { display:flex; align-items:center; gap:22px; padding:12px 28px; border-top:1px solid var(--ink); color:var(--muted); font-size:9px; }
.stats-legend span { display:inline-flex; align-items:center; gap:6px; }
.legend-tree { width:11px; height:14px; display:inline-block; border-bottom:2px solid #777453; background:linear-gradient(90deg,transparent 45%,var(--ink) 46% 55%,transparent 56%); }
.legend-fruit { width:8px; height:8px; display:inline-block; border-radius:50%; background:var(--red); }

.developer-dialog {
  width: min(430px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 12px 14px 0 rgba(216,75,50,.16), 0 34px 80px rgba(25,49,39,.28);
}
.developer-dialog::backdrop { background: rgba(25,35,30,.5); backdrop-filter: blur(3px); }
.developer-dialog[open] { animation: statsReveal .32s cubic-bezier(.2,.8,.2,1); }
.developer-panel { position: relative; padding: 29px; }
.developer-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  font: 22px/1 var(--serif);
}
.developer-close:hover { color: var(--paper-light); border-color: var(--ink); background: var(--ink); }
.developer-heading { padding-right: 34px; }
.developer-heading small { color: #936d2e; font: 9px var(--mono); letter-spacing: .13em; }
.developer-heading h2 { max-width: 300px; margin: 8px 0 0; font: 600 26px/1.35 var(--serif); }
.developer-heading p { margin: 10px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.75; }
.developer-card { margin-top: 23px; border: 1px solid var(--ink); background: var(--paper-light); }
.developer-profile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--ink); }
.developer-seal { width: 35px; height: 35px; display: grid; place-items: center; flex: none; border-radius: 50%; color: var(--paper-light); background: var(--red); font: 18px var(--serif); box-shadow: 2px 2px 0 rgba(25,49,39,.14); }
.developer-profile small,.developer-profile strong { display: block; }
.developer-profile small { color: var(--muted); font-size: 9px; }
.developer-profile strong { margin-top: 3px; font: 16px var(--mono); letter-spacing: .05em; }
.coffee-code { display: grid; grid-template-columns: 154px 1fr; align-items: center; gap: 17px; margin: 0; padding: 16px; }
.coffee-code img { width: 154px; height: 158px; display: block; border: 7px solid #fff; object-fit: contain; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.coffee-code figcaption { display: grid; gap: 8px; }
.coffee-code figcaption b { font: 19px/1.4 var(--serif); }
.coffee-code figcaption span { color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.developer-note { margin: 17px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; text-align: center; }
.developer-note a { margin-left: 8px; color: var(--ink-soft); text-underline-offset: 3px; }
.developer-note a:hover { color: var(--red); }

.completion-toast {
  position: fixed;
  z-index: 30;
  right: 28px;
  bottom: 28px;
  width: min(360px, calc(100vw - 36px));
  display: grid;
  gap: 5px;
  padding: 20px 22px 19px 73px;
  border: 1px solid var(--ink);
  color: var(--paper-light);
  background: var(--ink);
  box-shadow: 8px 9px 0 rgba(216,75,50,.24), 0 24px 60px rgba(25,49,39,.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px);
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
.completion-toast::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 21px;
  width: 36px;
  height: 36px;
  background: url("assets/tomato-linocut-fruit-v1.png") center / contain no-repeat;
}
.completion-toast.show { opacity: 1; transform: translateY(0); }
.completion-toast small { color: #d8cdb6; font-size: 10px; letter-spacing: .12em; }
.completion-toast strong { font: 18px/1.35 var(--serif); }
.completion-toast span { color: #eee6d7; font-size: 12px; line-height: 1.65; }

@keyframes fruitAppear { from { opacity: 0; transform: scale(.2) translateY(-18px) rotate(-8deg); } }
@keyframes printBreathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.004); }
}
@keyframes stageArrival {
  0% { opacity: 0; transform: scale(.86); }
  35% { opacity: .52; }
  100% { opacity: 0; transform: scale(1.08); }
}
@keyframes statsReveal { from { opacity:0; transform:translateY(18px) scale(.985); } }

@media (max-height: 900px) and (min-width: 921px) {
  .focus-ritual { padding: 24px 38px 20px; }
  .ritual-track { margin-top: 18px; }
  .eyebrow { margin: 26px 0 8px; }
  .focus-ritual h1 { font-size: 34px; line-height: 1.2; }
  .ritual-copy { min-height: 0; margin: 10px 0 15px; line-height: 1.65; }
  .plant-ceremony { margin: 0 0 14px; }
  .plant-ceremony button { height: 43px; }
  .task-field { margin-top: 16px; padding: 10px 0 9px; }
  .task-field label { margin-bottom: 6px; }
  .timer-block { margin-top: 17px; }
  .clock { font-size: 55px; }
  .progress-line { margin-top: 13px; }
  .timer-actions { margin-top: 16px; }
  .ritual-message { margin-top: 9px; }
  .log-heading { padding-block: 16px; }
}

@media (max-width: 920px) {
  .garden-app { width: min(100% - 28px, 730px); }
  .garden-card { grid-template-columns: 1fr; }
  .tree-scene { min-height: 760px; }
  .focus-ritual { min-height: auto; padding: 40px 44px 35px; border-top: 1px solid var(--ink); border-left: 0; }
  .ritual-track { max-width: 470px; }
  .day-log { grid-template-columns: 310px minmax(0, 1fr); }
  .stats-dialog { width:calc(100vw - 24px); max-height:calc(100vh - 24px); }
  .stats-panel { max-height:calc(100vh - 26px); }
  .year-garden { grid-template-columns:repeat(2,1fr); }
}

@media (max-width: 580px) {
  .garden-app { width: min(100% - 18px, 520px); padding-top: 7px; }
  .topbar { height: 59px; }
  .brand small { display: none; }
  .top-actions { gap: 5px; }
  .top-actions #resetToday { padding-inline: 9px; }
  .top-actions .icon-action { width: 34px; }
  .icon-action::after { display: none; }
  .garden-card { box-shadow: 7px 8px 0 rgba(25,49,39,.09); }
  .tree-scene { min-height: 590px; }
  .scene-top { top: 27px; }
  .focus-ritual { padding: 31px 24px 28px; }
  .task-field { margin-top: 18px; }
  .ritual-track { margin-top: 26px; }
  .eyebrow { margin-top: 37px; }
  .focus-ritual h1 { font-size: 34px; }
  .clock { font-size: 51px; }
  .duration-control button { width: 26px; }
  .day-log { grid-template-columns: 1fr; }
  .log-heading { padding: 18px 20px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .record-list { max-height: 240px; padding-inline: 20px; }
  .record-duration { display: none; }
  .completion-toast { right: 18px; bottom: 18px; }
  .stats-header { padding:18px 17px 15px; }
  .stats-header h2 { font-size:25px; }
  .stats-header p { max-width:230px; line-height:1.5; }
  .stats-toolbar { align-items:stretch; flex-direction:column; gap:10px; padding:12px 16px; }
  .stats-tabs { align-self:flex-start; }
  .stats-period-nav { width:100%; }
  .stats-period-nav strong { min-width:0; flex:1; font-size:13px; }
  .stats-summary { grid-template-columns:repeat(2,1fr); }
  .stats-summary > div:nth-child(2) { border-right:0; }
  .stats-summary > div:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .stats-summary > div { padding:11px 15px; }
  .stats-summary strong { font-size:26px; }
  .stats-garden { min-height:260px; padding:14px; }
  .week-garden { min-width:0; grid-template-columns:repeat(2,1fr); }
  .day-plot { min-height:190px; }
  .calendar-grid { min-width:650px; }
  .year-garden { min-width:0; grid-template-columns:1fr; }
  .stats-legend { flex-wrap:wrap; gap:7px 15px; padding:10px 16px; }
  .developer-panel { padding: 24px 20px 21px; }
  .developer-heading h2 { font-size: 23px; }
  .coffee-code { grid-template-columns: 136px 1fr; gap: 14px; padding: 14px; }
  .coffee-code img { width: 136px; height: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
