/* ==========================================================================
   Pomodoro Valley — a cosy pixel-art focus farm
   ========================================================================== */

@font-face {
  font-family: "Pixelify Sans";
  src: url("assets/fonts/pixelify-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("assets/fonts/pixelify-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("assets/fonts/pixelify-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("assets/fonts/pixelify-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("assets/fonts/silkscreen-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("assets/fonts/silkscreen-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #3b2418;
  --ink-soft: #785335;
  --ink-faint: #967049;
  --paper: #f2dcaa;
  --paper-light: #faedc9;
  --paper-deep: #e4c58d;
  --paper-edge: #c49a61;
  --wood: #4b2c1f;
  --wood-deep: #28150f;
  --wood-light: #7c5032;
  --cream: #ffe9b7;
  --gold: #e8b45e;
  --gold-bright: #ffd985;
  --green: #5d773f;
  --green-deep: #3b4d2b;
  --tomato: #cf5342;
  --tomato-light: #ec765e;
  --plum: #2a1733;
  --accent: #f2b45e;
  --btn-1: #f4ce7b;
  --btn-2: #dca14b;
  --btn-edge: #7d4723;
  --ring-on: #f7c46f;
  --ring-off: rgba(255, 233, 183, 0.14);
  --stage-glow: rgba(234, 158, 78, 0.18);
  --font-pixel: "Pixelify Sans", "Trebuchet MS", sans-serif;
  --font-small: "Silkscreen", "Courier New", monospace;
}

body[data-mode="short"] {
  --accent: #9dd3c2;
  --btn-1: #c4e6d8;
  --btn-2: #83b8a9;
  --btn-edge: #3d6d62;
  --ring-on: #9edac5;
  --ring-off: rgba(205, 243, 231, 0.13);
  --stage-glow: rgba(95, 178, 159, 0.16);
}

body[data-mode="long"] {
  --accent: #c2a7ea;
  --btn-1: #ddcbf6;
  --btn-2: #a98ad6;
  --btn-edge: #584078;
  --ring-on: #cbb1f3;
  --ring-off: rgba(223, 207, 250, 0.14);
  --stage-glow: rgba(158, 122, 213, 0.17);
}

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

html {
  min-height: 100%;
  background: #1b1028;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-pixel);
  background: #1b1028;
  overflow: hidden;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
}

body.modal-open { overflow: hidden; }

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px dashed #fff1b8;
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

::selection {
  background: #b57432;
  color: #fff4ce;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex: none;
  image-rendering: pixelated;
  vertical-align: -0.12em;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   The valley
   -------------------------------------------------------------------------- */
.scene-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #1b1028;
}

.scene-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 57%;
  image-rendering: pixelated;
  transform: scale(1.015);
  animation: sceneBreathe 24s ease-in-out infinite alternate;
}

.scene-tint {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 8, 24, 0.54) 0%, transparent 20%, transparent 74%, rgba(16, 8, 20, 0.74) 100%),
    radial-gradient(ellipse at 50% 46%, transparent 28%, rgba(19, 9, 26, 0.34) 100%);
}

.scene-grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: soft-light;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 4px);
}

.ambient-fireflies i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffe8a1;
  box-shadow: 0 0 6px 3px rgba(255, 219, 115, 0.45), 0 0 20px 9px rgba(255, 190, 84, 0.12);
  opacity: 0;
  animation: firefly var(--d) ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes firefly {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(0.7); }
  25% { opacity: 0.9; }
  50% { opacity: 0.45; transform: translate(8px, -12px) scale(1); }
  75% { opacity: 0.85; }
}

@keyframes sceneBreathe {
  from { transform: scale(1.015) translateY(0); }
  to { transform: scale(1.035) translateY(-4px); }
}

/* --------------------------------------------------------------------------
   Shell and top HUD
   -------------------------------------------------------------------------- */
.game-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px 8px;
}

.hud {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-plaque {
  position: relative;
  min-width: 310px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 18px 8px 10px;
  border: 3px solid var(--wood-deep);
  border-radius: 4px;
  color: var(--cream);
  background:
    linear-gradient(90deg, rgba(255, 220, 159, 0.07) 1px, transparent 1px) 0 0 / 41px 100%,
    linear-gradient(180deg, #593725 0%, #3c241b 56%, #2e1a15 100%);
  box-shadow:
    inset 0 0 0 2px #a97543,
    inset 0 0 0 4px #3c2118,
    0 5px 0 rgba(18, 9, 14, 0.36),
    0 10px 24px rgba(15, 7, 22, 0.24);
}

.brand-plaque::before,
.brand-plaque::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 4px;
  height: 4px;
  background: #d2a15d;
  box-shadow: 0 1px 0 #5e361f;
}

.brand-plaque::before { left: 7px; }
.brand-plaque::after { right: 7px; }

.brand-mark {
  width: 43px;
  height: 43px;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px solid #1b0e0a;
  background: #24150f;
  box-shadow: inset 0 0 0 2px #8c5a31, 0 2px 0 rgba(0, 0, 0, 0.3);
  border-radius: 2px;
}

.brand-mark svg {
  width: 29px;
  height: 29px;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 0 #1b0d09);
}

.brand-copy {
  min-width: 0;
  overflow: hidden;
}

.brand-copy h1 {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-pixel);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.2px;
  color: #ffe6ae;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 0 #2b130d, 0 3px 0 rgba(0, 0, 0, 0.2);
}

.brand-copy p {
  margin: 5px 0 0;
  font-family: var(--font-small);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #d6a25b;
}

.brand-vine {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 32px;
  height: 10px;
  opacity: 0.45;
  border-bottom: 2px solid #9bbb63;
  border-right: 2px solid #9bbb63;
  transform: skewX(-25deg);
}

.day-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px 12px 7px 8px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.44), transparent 45%),
    linear-gradient(180deg, #f5e1b4, #e9cd96);
  border: 3px solid #5c3620;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px #ffedc4,
    inset 0 0 0 4px rgba(151, 99, 52, 0.12),
    0 4px 0 rgba(37, 18, 10, 0.32);
  transform: rotate(-0.25deg);
}

.day-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid #394927;
  background: #5b733e;
  color: #f4dca4;
  box-shadow: inset 0 0 0 1px #a4b775;
  border-radius: 2px;
}

.day-icon .icon { font-size: 19px; }

.day-copy { display: flex; flex-direction: column; line-height: 1; }
.day-season {
  font-family: var(--font-small);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #8d5d33;
  text-transform: uppercase;
}
.day-copy strong {
  margin-top: 5px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: #3a2114;
}
.day-divider {
  width: 2px;
  height: 31px;
  margin: 0 2px;
  background: rgba(94, 54, 29, 0.24);
  box-shadow: 1px 0 0 rgba(255, 247, 215, 0.55);
}
.day-time {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-small);
  font-size: 9px;
  color: #55341f;
  white-space: nowrap;
}
.day-time .icon { font-size: 13px; color: #8a5b35; }

.hud-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
}

.hud-chip {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 2px solid #1d0f0b;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(71, 44, 31, 0.96), rgba(45, 26, 20, 0.96));
  box-shadow: inset 0 0 0 1px #96693d, 0 3px 0 rgba(18, 8, 13, 0.33);
  color: #f6d994;
}

.hud-chip .icon { font-size: 16px; }
.gold-chip { color: #ffd67c; }
.gold-chip .icon { filter: drop-shadow(0 1px 0 #6b421b); }
.gold-chip b {
  font-family: var(--font-small);
  font-size: 9px;
  letter-spacing: 0.3px;
}

.streak-chip {
  gap: 6px;
  color: #efb069;
}
.streak-chip .icon { font-size: 18px; color: #f0a453; }
.streak-chip span { display: flex; flex-direction: column; line-height: 0.9; }
.streak-chip b {
  font-family: var(--font-small);
  font-size: 10px;
  color: #ffe2a2;
}
.streak-chip small {
  margin-top: 5px;
  font-family: var(--font-small);
  font-size: 6px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #b78b5a;
}

.hud-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid #1d0f0b;
  border-radius: 3px;
  color: #f0d69a;
  background: linear-gradient(180deg, #4b3023, #2d1a15);
  box-shadow: inset 0 0 0 1px #91623a, 0 3px 0 rgba(18, 8, 13, 0.33);
  transition: transform 120ms ease, filter 120ms ease;
}
.hud-button .icon { font-size: 18px; }
.hud-button:hover { filter: brightness(1.16); transform: translateY(-1px); }
.hud-button:active { transform: translateY(1px); }
.hud-button.is-muted { color: #a88867; }

/* --------------------------------------------------------------------------
   Dashboard columns and parchment panels
   -------------------------------------------------------------------------- */
.dashboard {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 320px minmax(410px, 1fr) 356px;
  gap: 16px;
  align-items: stretch;
}

.panel {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  border: 3px solid #51301e;
  border-radius: 5px;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 17% 23%, rgba(255, 255, 255, 0.42) 0 1px, transparent 1.6px),
    radial-gradient(circle at 71% 66%, rgba(123, 77, 37, 0.13) 0 1px, transparent 1.7px),
    linear-gradient(90deg, rgba(112, 70, 35, 0.038) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 247, 221, 0.12) 1px, transparent 1px);
  background-size: 31px 37px, 47px 43px, 8px 8px, 9px 9px;
  box-shadow:
    0 0 0 2px #28140e,
    inset 0 0 0 2px #ffecc0,
    inset 0 0 0 4px rgba(143, 93, 47, 0.12),
    0 10px 26px rgba(13, 6, 18, 0.32);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(104, 63, 33, 0.28);
  border-radius: 2px;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(circle at 0 0, #8e5b35 0 2.5px, transparent 3px),
    radial-gradient(circle at 100% 0, #8e5b35 0 2.5px, transparent 3px),
    radial-gradient(circle at 0 100%, #8e5b35 0 2.5px, transparent 3px),
    radial-gradient(circle at 100% 100%, #8e5b35 0 2.5px, transparent 3px);
}

.panel-head {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 15px 11px;
  border-bottom: 1px solid rgba(103, 63, 32, 0.25);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.panel-emblem {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  color: #f2d495;
  border: 2px solid #24120d;
  border-radius: 2px;
  background: linear-gradient(180deg, #5b3d2a, #3a241a);
  box-shadow: inset 0 0 0 1px #a27444, 0 2px 0 rgba(93, 57, 29, 0.25);
  transform: rotate(-1.5deg);
}
.panel-emblem .icon { font-size: 20px; }
.ledger-emblem { transform: rotate(1.5deg); }

.eyebrow {
  margin: 0 0 3px;
  font-family: var(--font-small);
  font-size: 7px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 1.15px;
  text-transform: uppercase;
  color: #8f5e36;
}

.panel-head h2,
.card-heading h3 {
  margin: 0;
  color: #382012;
  font-family: var(--font-pixel);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1px;
}

.count-badge {
  flex: none;
  min-width: 48px;
  height: 39px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  padding: 4px 7px 0;
  border: 2px solid #25130d;
  border-radius: 3px;
  background: linear-gradient(180deg, #52683b, #3a4c2b);
  box-shadow: inset 0 0 0 1px #8fa06b, 0 2px 0 rgba(91, 55, 29, 0.25);
  color: #f5dfad;
  font-family: var(--font-small);
}
.count-badge b { font-size: 17px; line-height: 1; }
.count-badge span { font-size: 9px; opacity: 0.6; }
.count-badge i { font-style: normal; font-size: 10px; opacity: 0.7; }

/* --------------------------------------------------------------------------
   Chores
   -------------------------------------------------------------------------- */
.chores-panel {
  animation: riseIn 520ms cubic-bezier(0.2, 0.85, 0.3, 1) both;
}

.chore-form {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 13px 11px;
  border-bottom: 1px dashed rgba(116, 72, 38, 0.33);
}

.chore-input-row {
  display: flex;
  gap: 6px;
}

#choreInput {
  min-width: 0;
  width: 100%;
  height: 39px;
  padding: 0 11px;
  color: #3c2517;
  font-family: var(--font-pixel);
  font-size: 15px;
  font-weight: 500;
  border: 2px solid #89603b;
  border-radius: 3px;
  background: #f9e9c3;
  box-shadow: inset 0 2px 0 rgba(100, 63, 31, 0.12), 0 1px 0 rgba(255, 248, 220, 0.6);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
#choreInput::placeholder { color: #a57e57; }
#choreInput:focus {
  outline: none;
  border-color: #526a38;
  box-shadow: inset 0 2px 0 rgba(100, 63, 31, 0.1), 0 0 0 2px rgba(96, 126, 66, 0.2);
}
#choreInput.is-shaking { animation: inputShake 280ms ease; }

.add-button {
  width: 39px;
  height: 39px;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px solid #24130d;
  border-radius: 3px;
  color: #ffe9b7;
  background: linear-gradient(180deg, #637a48, #435832);
  box-shadow: inset 0 0 0 1px #95a873, 0 2px 0 #24321b;
  transition: transform 120ms ease, filter 120ms ease;
}
.add-button .icon { font-size: 19px; }
.add-button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.add-button:active { transform: translateY(1px); }

.chore-form-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-small);
  color: #855a35;
}

.estimate-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 6.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.mini-tomato {
  width: 13px;
  height: 13px;
  image-rendering: pixelated;
}

.mini-stepper {
  display: flex;
  align-items: center;
  height: 22px;
  border: 1px solid #9d7449;
  border-radius: 2px;
  background: #f8e7bf;
  overflow: hidden;
}
.mini-stepper button {
  width: 21px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #714a2b;
  font-family: var(--font-small);
  font-size: 11px;
  line-height: 1;
}
.mini-stepper button:hover { background: #e7cc97; }
.mini-stepper b {
  width: 20px;
  text-align: center;
  color: #3f2918;
  font-family: var(--font-small);
  font-size: 8px;
}
.estimate-time {
  margin-left: auto;
  font-size: 6.5px;
  color: #9a714b;
}
.estimate-time i { font-style: normal; }

.task-scroll {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 54px;
  overflow: auto;
  padding: 10px 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: #a47446 transparent;
}
.task-scroll::-webkit-scrollbar { width: 7px; }
.task-scroll::-webkit-scrollbar-thumb {
  background: #b18251;
  border: 2px solid #f1d9a5;
  border-radius: 5px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 52px;
  border: 2px solid #c39a60;
  border-radius: 3px;
  background: rgba(252, 240, 207, 0.8);
  box-shadow: 0 2px 0 #b58850, inset 0 1px 0 #fff6d7;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
  animation: taskIn 240ms ease both;
}
.task-item:hover { border-color: #a77b49; background: #fff1cb; }
.task-item.is-active {
  border-color: #607b42;
  background: #fff2cd;
  box-shadow: 0 0 0 1px #414f2c, 0 3px 0 #6d4a2b, inset 0 0 0 1px rgba(255, 251, 224, 0.75);
}
.task-item.is-active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #6f8b4b;
}
.task-item.is-done {
  opacity: 0.58;
  background: rgba(231, 211, 171, 0.7);
}
.task-item.is-done .task-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  color: #765a3e;
}

.task-check {
  width: 34px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
}
.check-box {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  color: #fff0bf;
  border: 2px solid #765130;
  border-radius: 2px;
  background: #f9e9c3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: background 120ms ease;
}
.check-box .icon {
  width: 12px;
  height: 12px;
  opacity: 0;
}
.task-check:hover .check-box { background: #f0d9a8; }
.task-item.is-done .check-box {
  background: #5c753e;
  border-color: #394c27;
  box-shadow: inset 0 0 0 1px #8fa466;
}
.task-item.is-done .check-box .icon { opacity: 1; }

.task-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 8px 2px 8px 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.task-title {
  width: 100%;
  overflow: hidden;
  color: #3e2717;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-meta {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 10px;
  color: #91663e;
}
.task-meta .pip {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: #d8bf91;
  box-shadow: inset 0 0 0 1px rgba(94, 58, 30, 0.22);
}
.task-meta .pip.is-filled {
  background: #cc5844;
  box-shadow: inset 0 1px 0 #ee8b6d, 0 1px 0 rgba(94, 38, 28, 0.25);
}
.task-meta .pip.is-done { background: #7a9253; }
.task-count {
  margin-left: 3px;
  font-family: var(--font-small);
  font-size: 5.5px;
  letter-spacing: 0.2px;
  opacity: 0.8;
}
.task-now {
  margin-left: 5px;
  padding: 2px 4px 1px;
  border: 1px solid #6f8550;
  border-radius: 2px;
  background: #e7efcc;
  color: #4c6034;
  font-family: var(--font-small);
  font-size: 5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.task-delete {
  width: 26px;
  flex: none;
  display: grid;
  place-items: center;
  align-self: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9d6b45;
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease;
}
.task-delete .icon { font-size: 13px; }
.task-item:hover .task-delete,
.task-delete:focus-visible { opacity: 1; }
.task-delete:hover { color: #a83e32; }

.task-empty {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  color: #8a623e;
  text-align: center;
}
.empty-illustration {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 50%;
  background: rgba(104, 126, 71, 0.12);
  color: #758a51;
  box-shadow: inset 0 0 0 1px rgba(100, 124, 67, 0.2);
}
.empty-illustration .icon { font-size: 27px; }
.task-empty p { margin: 0; font-size: 17px; font-weight: 700; color: #6d4b2d; }
.task-empty small { margin-top: 4px; max-width: 225px; font-size: 11.5px; line-height: 1.35; }

.field-note {
  position: relative;
  margin: 15px 2px 4px;
  padding: 12px 13px 9px;
  border: 1px solid #c7a06a;
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(150, 101, 51, 0.065) 1px, transparent 1px) 0 0 / 13px 100%,
    linear-gradient(180deg, #f9e8bd, #eed5a1);
  box-shadow: 0 2px 0 #b68854, inset 0 0 0 1px rgba(255, 247, 218, 0.54);
  transform: rotate(-0.55deg);
}
.field-note::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 38px;
  height: 8px;
  transform: translateX(-50%) rotate(1.2deg);
  background: rgba(158, 108, 58, 0.55);
  box-shadow: 0 1px 0 rgba(93, 58, 31, 0.18);
}
.field-note p {
  margin: 0;
  color: #765131;
  font-family: var(--font-pixel);
  font-size: 13px;
  font-style: italic;
  line-height: 1.35;
  text-align: center;
}
.field-note small {
  display: block;
  margin-top: 6px;
  color: #9b744b;
  font-family: var(--font-small);
  font-size: 5px;
  letter-spacing: 0.25px;
  text-align: right;
  text-transform: uppercase;
}
.note-sprig {
  position: absolute;
  top: 8px;
  left: 9px;
  color: #a6b477;
  opacity: 0.7;
}
.note-sprig .icon { font-size: 14px; }

.plant-mascot {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 9px auto 6px;
  opacity: 0.92;
}
.plant-mascot img {
  width: min(86%, 238px);
  height: auto;
  display: block;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 0 rgba(91, 55, 30, 0.12));
}
.plant-mascot span {
  margin-top: 2px;
  color: #9b744a;
  font-family: var(--font-small);
  font-size: 5.5px;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.chores-panel.is-nudged { animation: panelNudge 560ms ease; }
.current-chore.is-attention { animation: ribbonPulse 700ms ease; }

@keyframes panelNudge {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-3px); }
  60% { transform: translateX(2px); }
}
@keyframes ribbonPulse {
  0%, 100% { box-shadow: inset 0 0 0 1px #fff2ca, 0 3px 0 rgba(12, 5, 10, 0.37); }
  45% { box-shadow: inset 0 0 0 2px #e5b361, 0 3px 0 rgba(12, 5, 10, 0.37), 0 0 16px rgba(239, 183, 89, 0.28); }
}

.chores-foot {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 14px 11px;
  border-top: 2px solid rgba(104, 64, 32, 0.22);
  background:
    linear-gradient(180deg, rgba(228, 198, 143, 0.64), rgba(237, 211, 159, 0.76)),
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(112, 71, 36, 0.035) 9px 10px);
}

.basket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-small);
}
.basket-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #7e5634;
  font-size: 6.5px;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}
.basket-row > b {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: #4e3521;
  font-size: 9px;
}
.basket-row > b i { font-style: normal; opacity: 0.45; }
.basket-pips {
  display: grid;
  grid-template-columns: repeat(var(--goal, 6), minmax(0, 1fr));
  gap: 4px;
  margin: 7px 0 5px;
}
.basket-pip {
  position: relative;
  height: 10px;
  border: 1px solid #a47b50;
  border-radius: 1px;
  background: #e3c896;
  box-shadow: inset 0 1px 0 rgba(255, 249, 225, 0.54);
}
.basket-pip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 5px;
  height: 4px;
  transform: translateX(-50%);
  background: #a9b782;
  opacity: 0;
}
.basket-pip.is-filled {
  border-color: #8a3d30;
  background: linear-gradient(180deg, #e26851, #bf4d3c);
  box-shadow: inset 0 1px 0 #f39a7d, 0 1px 0 rgba(95, 46, 30, 0.18);
}
.basket-pip.is-filled::before { opacity: 1; background: #758b4e; }
.chores-foot p {
  margin: 0;
  color: #89623f;
  font-size: 10.5px;
  line-height: 1.15;
}

/* --------------------------------------------------------------------------
   Focus timer
   -------------------------------------------------------------------------- */
.focus-panel {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 4px solid #24120d;
  border-radius: 6px;
  color: var(--cream);
  background:
    radial-gradient(ellipse at 50% 40%, var(--stage-glow), transparent 60%),
    radial-gradient(ellipse at 78% 8%, rgba(185, 132, 208, 0.11), transparent 42%),
    linear-gradient(180deg, #2f1b3b 0%, #21142e 44%, #1a1125 100%);
  box-shadow:
    inset 0 0 0 2px #7a4c2f,
    inset 0 0 0 5px #321d17,
    inset 0 0 0 7px rgba(214, 166, 94, 0.18),
    0 12px 32px rgba(11, 5, 16, 0.42);
  animation: riseIn 560ms 60ms cubic-bezier(0.2, 0.85, 0.3, 1) both;
}

.focus-panel::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 5;
  pointer-events: none;
  border: 1px solid rgba(246, 211, 143, 0.22);
  border-radius: 2px;
}

.focus-panel::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 5;
  pointer-events: none;
  background:
    radial-gradient(circle at 0 0, #c28d4f 0 2.5px, transparent 3px),
    radial-gradient(circle at 100% 0, #c28d4f 0 2.5px, transparent 3px),
    radial-gradient(circle at 0 100%, #c28d4f 0 2.5px, transparent 3px),
    radial-gradient(circle at 100% 100%, #c28d4f 0 2.5px, transparent 3px);
}

.focus-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.focus-glow {
  position: absolute;
  left: 50%;
  top: 41%;
  width: 78%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--stage-glow) 0 18%, transparent 68%);
  opacity: 0.78;
}

.focus-stars {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(circle, #ffe9b0 0 1px, transparent 1.6px),
    radial-gradient(circle, #d7c5f1 0 1px, transparent 1.8px),
    radial-gradient(circle, #ffe2a2 0 1.2px, transparent 2px),
    radial-gradient(circle, #f7d48f 0 1px, transparent 1.6px);
  background-size: 143px 137px, 211px 191px, 97px 113px, 173px 159px;
  background-position: 15px 28px, 54px 91px, 90px 13px, 31px 62px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.68) 48%, transparent 86%);
}

.focus-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 13px 17px 0;
}

.mode-row {
  flex: none;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mode-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(243, 209, 146, 0.19);
  border-radius: 4px;
  background: rgba(11, 6, 17, 0.29);
  box-shadow: inset 0 1px 0 rgba(255, 244, 209, 0.05);
}

.mode-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 9px;
  border: 2px solid transparent;
  border-radius: 3px;
  color: #bda987;
  background: transparent;
  font-family: var(--font-small);
  font-size: 7px;
  letter-spacing: 0.25px;
  white-space: nowrap;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.mode-tab .icon { font-size: 14px; opacity: 0.8; }
.mode-tab small {
  font-family: var(--font-small);
  font-size: 5.5px;
  color: #9c8768;
  opacity: 0.8;
}
.mode-tab:hover { color: #f5dfab; background: rgba(255, 240, 199, 0.06); }
.mode-tab.is-active {
  border-color: #996d42;
  color: #ffe5ad;
  background: linear-gradient(180deg, #463023, #332116);
  box-shadow: inset 0 0 0 1px #2b1911, 0 2px 0 rgba(0, 0, 0, 0.24);
}
.mode-tab.is-active .icon { color: var(--accent); opacity: 1; }
.mode-tab.is-active small { color: var(--accent); }

.round-chip {
  display: flex;
  align-items: baseline;
  gap: 3px;
  padding: 6px 9px;
  color: #ae9676;
  border: 1px solid rgba(235, 201, 140, 0.18);
  border-radius: 3px;
  background: rgba(12, 7, 17, 0.27);
  font-family: var(--font-small);
  font-size: 6px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.round-chip b { color: var(--accent); font-size: 9px; }
.round-chip i { font-style: normal; opacity: 0.4; }

.timer-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 0 3px;
}

.timer-ring-wrap {
  position: relative;
  width: min(46vh, 480px, 80%);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  flex: none;
  filter: drop-shadow(0 8px 22px rgba(6, 2, 10, 0.34));
}

.timer-ring {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring-track {
  fill: none;
  stroke: rgba(242, 211, 151, 0.14);
  stroke-width: 1.5;
}
.ring-inner {
  fill: rgba(24, 14, 31, 0.38);
  stroke: rgba(241, 207, 143, 0.11);
  stroke-width: 1;
}
.ring-dash {
  fill: none;
  stroke: rgba(242, 211, 151, 0.18);
  stroke-width: 1.5;
  stroke-dasharray: 1 7;
}
.seg {
  fill: var(--ring-off);
  transition: fill 260ms linear, opacity 260ms linear;
}
.seg.is-on {
  fill: var(--ring-on);
  opacity: 0.92;
}
.seg.is-head {
  fill: #fff1be;
  filter: drop-shadow(0 0 4px var(--ring-on));
}
.ring-marker {
  fill: #ffeab2;
  filter: drop-shadow(0 0 6px var(--ring-on));
  transition: transform 600ms linear;
}
.ring-marker-leaf {
  fill: #a6c372;
  transition: transform 600ms linear;
}

.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 7px;
  pointer-events: none;
}

.mode-kicker {
  margin-bottom: 7px;
  color: var(--accent);
  font-family: var(--font-small);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.time-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  color: #ffebba;
  font-family: var(--font-small);
  font-size: clamp(50px, 7.9vh, 82px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 0.98;
  letter-spacing: -3px;
  text-shadow:
    0 4px 0 #4a2a1c,
    0 6px 0 rgba(0, 0, 0, 0.24),
    0 0 28px rgba(255, 198, 102, 0.22);
  white-space: nowrap;
}
body[data-mode="short"] .time-display {
  text-shadow: 0 4px 0 #28433d, 0 6px 0 rgba(0, 0, 0, 0.24), 0 0 28px rgba(129, 209, 188, 0.23);
}
body[data-mode="long"] .time-display {
  text-shadow: 0 4px 0 #382a4b, 0 6px 0 rgba(0, 0, 0, 0.24), 0 0 28px rgba(195, 163, 237, 0.23);
}
.time-display.is-ticking .time-colon { animation: colonBlink 1s steps(1, end) infinite; }
.time-colon { display: inline-block; transform: translateY(-1px); }

.time-note {
  margin-top: 9px;
  color: #b6a17f;
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1px;
}

.center-flourish {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  opacity: 0.58;
}
.center-flourish i {
  width: 18px;
  height: 1px;
  background: #b68b52;
}
.center-flourish span {
  width: 5px;
  height: 5px;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(255, 199, 105, 0.25);
}

.ring-badge {
  position: absolute;
  left: 50%;
  bottom: 4.5%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  color: #d6bb83;
  border: 1px solid #70502f;
  border-radius: 50%;
  background: #2b1b1b;
  box-shadow: inset 0 0 0 1px #1a0f0d, 0 1px 0 rgba(255, 224, 164, 0.14);
  opacity: 0.85;
}
.ring-badge .icon { font-size: 14px; }

.timer-whisper {
  flex: none;
  margin: 2px 0 0;
  color: #9d8a6d;
  font-family: var(--font-pixel);
  font-size: 11.5px;
  font-style: italic;
  text-align: center;
}

.current-chore {
  position: relative;
  flex: none;
  width: min(88%, 520px);
  min-height: 43px;
  margin: 4px auto 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: #3c2316;
  border: 2px solid #20100c;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(150, 103, 52, 0.08) 1px, transparent 1px) 0 0 / 17px 100%,
    linear-gradient(180deg, #f7e2b4, #ebcf94);
  box-shadow:
    inset 0 0 0 1px #fff2ca,
    0 3px 0 rgba(12, 5, 10, 0.37);
  text-align: left;
  transition: transform 120ms ease, filter 120ms ease;
}
.current-chore:hover {
  transform: translateY(-1px);
  filter: brightness(1.025);
}
.current-chore:active { transform: translateY(1px); }
.current-chore-label {
  padding-right: 8px;
  color: #906039;
  border-right: 1px solid rgba(108, 67, 33, 0.28);
  font-family: var(--font-small);
  font-size: 5.5px;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  white-space: nowrap;
}
.current-chore-title {
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-chore.is-empty .current-chore-title { color: #7f603f; font-style: italic; }
.current-chore-arrow { font-size: 15px; color: #8d5b32; }

.timer-controls {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 12px;
}

.control-side {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  flex: none;
  color: #f2d49b;
  border: 2px solid #1b0e0a;
  border-radius: 3px;
  background: linear-gradient(180deg, #442d20, #2b1914);
  box-shadow: inset 0 0 0 1px #825431, 0 3px 0 #150b09;
  transition: transform 120ms ease, filter 120ms ease;
}
.control-side .icon { font-size: 18px; }
.control-side:hover { filter: brightness(1.16); transform: translateY(-1px); }
.control-side:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px #825431, 0 1px 0 #150b09; }

.start-button {
  position: relative;
  min-width: 232px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  color: #3c220f;
  border: 3px solid #1c0e09;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--btn-1), var(--btn-2));
  box-shadow:
    inset 0 0 0 2px rgba(255, 245, 197, 0.72),
    inset 0 -4px 0 rgba(104, 59, 27, 0.18),
    0 5px 0 var(--btn-edge),
    0 8px 17px rgba(9, 4, 14, 0.3);
  font-family: var(--font-small);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}
.start-button::after {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  border: 1px solid rgba(84, 47, 19, 0.22);
  border-radius: 1px;
}
.start-button .icon { font-size: 18px; filter: drop-shadow(0 1px 0 rgba(255, 244, 200, 0.3)); }
.start-button kbd {
  margin-left: 4px;
  padding: 3px 4px 2px;
  border: 1px solid rgba(72, 40, 16, 0.4);
  border-radius: 2px;
  background: rgba(255, 247, 210, 0.24);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  font-family: var(--font-small);
  font-size: 5.5px;
  letter-spacing: 0.2px;
  opacity: 0.72;
}
.start-button:hover {
  filter: brightness(1.055);
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 2px rgba(255, 245, 197, 0.76), inset 0 -4px 0 rgba(104, 59, 27, 0.18), 0 6px 0 var(--btn-edge), 0 10px 20px rgba(9, 4, 14, 0.34);
}
.start-button:active {
  transform: translateY(4px);
  box-shadow: inset 0 0 0 2px rgba(255, 245, 197, 0.66), inset 0 -2px 0 rgba(104, 59, 27, 0.2), 0 1px 0 var(--btn-edge);
}
.start-button.is-running {
  background: linear-gradient(180deg, var(--btn-2), var(--btn-edge));
  color: #fff4ce;
  box-shadow:
    inset 0 0 0 2px rgba(255, 247, 211, 0.2),
    inset 0 -4px 0 rgba(37, 20, 8, 0.18),
    0 4px 0 #24130d,
    0 8px 17px rgba(9, 4, 14, 0.3);
}
.start-button.is-running kbd { border-color: rgba(255, 244, 208, 0.25); }

.focus-panel.session-complete {
  animation: completeGlow 1.1s ease;
}

.focus-garden {
  flex: none;
  margin: 12px -17px 0;
  padding: 8px 17px 10px;
  border-top: 1px solid rgba(238, 205, 142, 0.14);
  background: linear-gradient(180deg, rgba(17, 10, 21, 0.08), rgba(36, 22, 24, 0.67));
}

.garden-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: #a38d6d;
  font-family: var(--font-small);
  font-size: 6px;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}
.garden-head > span { display: flex; align-items: center; gap: 4px; }
.garden-head .icon { color: #93a966; font-size: 10px; }
.garden-head b { color: #d8bf8d; font-size: 6px; font-weight: 400; }
.garden-head b span { color: #f0d090; }

.garden-plots {
  display: grid;
  grid-template-columns: repeat(var(--plots, 6), minmax(0, 1fr));
  gap: 5px;
}

.plot {
  position: relative;
  height: 38px;
  overflow: hidden;
  border: 1px solid #160c0b;
  border-bottom-width: 3px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(27, 14, 12, 0.35) 8px 10px),
    linear-gradient(180deg, #68452f, #3f2821 76%);
  box-shadow: inset 0 0 0 1px rgba(246, 196, 116, 0.06);
}
.plot::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 5px;
  height: 2px;
  background: rgba(35, 18, 15, 0.55);
}
.plot .seed {
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 4px;
  height: 4px;
  transform: translateX(-50%);
  background: #b08b58;
  opacity: 0.5;
}
.plot.is-planted {
  background:
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(27, 14, 12, 0.3) 8px 10px),
    linear-gradient(180deg, #614633, #3a2b22 76%);
}
.plot.is-planted::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 2px;
  height: 16px;
  transform: translateX(-50%);
  background: #6e8a49;
  box-shadow: -5px -4px 0 #6d8b48, 6px -6px 0 #7e9b53;
}
.plot.is-planted::after {
  left: calc(50% - 7px);
  right: auto;
  bottom: 10px;
  width: 7px;
  height: 5px;
  background: #91ab5e;
  box-shadow: 9px -4px 0 #7b954f, 1px -7px 0 #a4ba69;
}
.plot-fruit {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 13px;
  height: 13px;
  transform: translateX(-50%);
  z-index: 1;
  filter: drop-shadow(0 1px 0 rgba(49, 19, 16, 0.4));
  animation: cropPop 420ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.plot.is-new { animation: plotGlow 900ms ease; }

@keyframes cropPop {
  from { transform: translateX(-50%) translateY(5px) scale(0.4); opacity: 0; }
  to { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}
@keyframes plotGlow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(246, 196, 116, 0.06); }
  40% { box-shadow: inset 0 0 0 2px #ffd686, 0 0 12px rgba(255, 196, 98, 0.38); }
}

/* --------------------------------------------------------------------------
   Ledger
   -------------------------------------------------------------------------- */
.ledger-panel {
  animation: riseIn 560ms 110ms cubic-bezier(0.2, 0.85, 0.3, 1) both;
}

.ledger-head { padding-bottom: 10px; }

.text-button {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #7b5432;
  font-family: var(--font-small);
  font-size: 5.5px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.text-button .icon { font-size: 10px; }
.text-button:hover { color: #3f2a19; background: rgba(255, 244, 211, 0.55); border-color: #c9a56f; }

.range-tabs {
  position: relative;
  z-index: 2;
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 14px;
  padding: 2px;
  border: 1px solid rgba(133, 89, 48, 0.4);
  border-radius: 3px;
  background: rgba(205, 170, 113, 0.24);
  box-shadow: inset 0 1px 2px rgba(105, 65, 34, 0.11);
}

.range-tab {
  height: 25px;
  padding: 0 3px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #88603a;
  font-family: var(--font-small);
  font-size: 6px;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  transition: color 120ms ease, background 120ms ease;
}
.range-tab:hover { color: #463020; }
.range-tab.is-active {
  color: #f9e6b7;
  background: linear-gradient(180deg, #5b743f, #445d33);
  box-shadow: inset 0 0 0 1px #7f9760, 0 1px 0 rgba(52, 34, 20, 0.22);
}

.ledger-scroll {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 14px 14px;
  scrollbar-width: thin;
  scrollbar-color: #a47446 transparent;
}
.ledger-scroll::-webkit-scrollbar { width: 7px; }
.ledger-scroll::-webkit-scrollbar-thumb {
  background: #b18251;
  border: 2px solid #f1d9a5;
  border-radius: 5px;
}

.harvest-hero {
  position: relative;
  overflow: hidden;
  padding: 11px 12px 12px;
  color: #f7e3b2;
  border: 2px solid #27341f;
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 96% 0%, rgba(209, 165, 95, 0.14), transparent 48%),
    linear-gradient(145deg, #4b6039 0%, #364a2d 58%, #2c4027 100%);
  box-shadow:
    inset 0 0 0 2px rgba(220, 230, 176, 0.16),
    0 3px 0 #a37545,
    0 4px 0 rgba(100, 64, 33, 0.28);
}
.harvest-hero::after {
  content: "";
  position: absolute;
  inset: 7px;
  pointer-events: none;
  border: 1px solid rgba(247, 224, 166, 0.12);
  border-radius: 1px;
}
.harvest-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #c3d2a2;
  font-family: var(--font-small);
  font-size: 6px;
  letter-spacing: 0.75px;
  text-transform: uppercase;
}
.harvest-hero-top em {
  padding: 3px 5px;
  border: 1px solid rgba(213, 228, 174, 0.22);
  border-radius: 2px;
  color: #d9e4b9;
  background: rgba(17, 28, 15, 0.24);
  font-style: normal;
  font-size: 5.5px;
  letter-spacing: 0.35px;
}
.harvest-value-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}
.harvest-value-row > strong {
  color: #ffe5a5;
  font-family: var(--font-pixel);
  font-size: 42px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.5px;
  text-shadow: 0 3px 0 #24331c;
}
.hero-delta {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 3px;
  padding: 3px 5px;
  border: 1px solid rgba(215, 233, 166, 0.2);
  border-radius: 2px;
  color: #e1edbd;
  background: rgba(20, 31, 15, 0.28);
  font-family: var(--font-small);
  font-size: 5.5px;
  white-space: nowrap;
}
.hero-delta .icon { font-size: 9px; color: #b9d77e; }
.hero-delta.is-down { color: #f1c2a1; }
.hero-delta.is-flat { color: #c2c8a0; }
.harvest-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: #b9c69d;
  font-size: 10.5px;
  line-height: 1;
}
.harvest-meta b { color: #f2dfac; font-weight: 600; }
.harvest-meta i { width: 3px; height: 3px; border-radius: 50%; background: #91a573; opacity: 0.7; }
.hero-vines {
  position: absolute;
  right: -4px;
  bottom: -7px;
  width: 90px;
  height: 35px;
  opacity: 0.28;
  pointer-events: none;
}
.hero-vines i {
  position: absolute;
  width: 24px;
  height: 10px;
  border-top: 3px solid #b6cb83;
  border-radius: 50%;
  transform: rotate(-30deg);
}
.hero-vines i:nth-child(1) { right: 8px; bottom: 2px; }
.hero-vines i:nth-child(2) { right: 18px; bottom: 8px; transform: rotate(12deg) scale(0.75); }
.hero-vines i:nth-child(3) { right: 33px; bottom: 1px; transform: rotate(-46deg) scale(0.6); }
.hero-vines i:nth-child(4) { right: 2px; bottom: 17px; transform: rotate(-67deg) scale(0.58); }
.hero-vines i:nth-child(5) { right: 44px; bottom: 15px; transform: rotate(22deg) scale(0.5); }

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 9px;
}

.mini-stat {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 2px solid #bd925b;
  border-radius: 3px;
  background: rgba(252, 240, 207, 0.72);
  box-shadow: 0 2px 0 #b0834c, inset 0 1px 0 #fff5d6;
}
.mini-icon {
  width: 27px;
  height: 27px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid #3f2b1d;
  border-radius: 2px;
  color: #f9e2ac;
  background: #52683b;
  box-shadow: inset 0 0 0 1px #8ca165;
}
.mini-icon.tomato { background: #8d4938; box-shadow: inset 0 0 0 1px #b66b53; }
.mini-icon .icon, .mini-icon svg { width: 15px; height: 15px; image-rendering: pixelated; }
.mini-stat > div { min-width: 0; display: flex; flex-direction: column; line-height: 1; }
.mini-stat span {
  color: #8f6038;
  font-family: var(--font-small);
  font-size: 5px;
  letter-spacing: 0.25px;
  text-transform: uppercase;
  white-space: nowrap;
}
.mini-stat b {
  margin-top: 3px;
  overflow: hidden;
  color: #3d2616;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-stat small {
  margin-top: 4px;
  overflow: hidden;
  color: #99754f;
  font-size: 8px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-card {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(117, 74, 38, 0.32);
}

.card-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.card-heading .eyebrow { margin-bottom: 2px; }
.card-heading h3 { font-size: 20px; }
.chart-total {
  padding: 3px 6px;
  border: 1px solid #c9a36b;
  border-radius: 2px;
  color: #6f4a2c;
  background: rgba(251, 238, 204, 0.6);
  font-family: var(--font-small);
  font-size: 6px;
  white-space: nowrap;
}

.chart-wrap {
  position: relative;
  height: 160px;
  margin-top: 8px;
  padding-bottom: 20px;
}

.chart-grid {
  position: absolute;
  inset: 2px 0 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.chart-grid i { display: block; border-top: 1px dashed rgba(118, 76, 40, 0.19); }

.goal-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(20px + (100% - 22px) * var(--goal-ratio, 0.75));
  z-index: 1;
  border-top: 2px dashed #c06a48;
  opacity: 0.66;
  pointer-events: none;
}
.goal-line span {
  position: absolute;
  right: 1px;
  top: -13px;
  padding: 1px 3px;
  color: #9e573b;
  background: #f2dcaa;
  font-family: var(--font-small);
  font-size: 5px;
  letter-spacing: 0.25px;
  text-transform: uppercase;
}

.chart-bars {
  position: absolute;
  inset: 2px 0 20px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  z-index: 2;
}
.chart-col {
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.bar-space {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.chart-bar {
  position: relative;
  width: min(24px, 66%);
  height: var(--bar-height, 0%);
  min-height: 3px;
  border: 2px solid #5f4027;
  border-radius: 2px 2px 1px 1px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px) 0 0 / 5px 100%,
    linear-gradient(180deg, #e6b05e 0%, #c98745 55%, #a46338 100%);
  box-shadow: inset 0 1px 0 #f6d58f, 0 2px 0 rgba(104, 64, 35, 0.28);
  transition: height 550ms cubic-bezier(0.2, 0.9, 0.3, 1), filter 150ms ease;
  animation: barRise 600ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
  transform-origin: bottom;
}
.chart-bar::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 6px;
  height: 5px;
  transform: translateX(-50%);
  background: #7d964e;
  box-shadow: 3px 1px 0 #96ac60;
}
.chart-bar.is-zero {
  border-color: #b38a59;
  background: #d2b17d;
  box-shadow: none;
  opacity: 0.55;
}
.chart-bar.is-zero::before { display: none; }
.chart-col.is-today .chart-bar {
  border-color: #7d3d2c;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px) 0 0 / 5px 100%,
    linear-gradient(180deg, #ef8b63 0%, #d65c45 55%, #b34737 100%);
  box-shadow: inset 0 1px 0 #ffb38a, 0 2px 0 rgba(104, 48, 35, 0.28);
}
.chart-col.is-today .chart-bar::before { background: #89a75a; box-shadow: 3px 1px 0 #a7c06d; }
.chart-col.is-today .chart-day { color: #3f2b1a; background: #d9b277; }
.chart-col:hover .chart-bar { filter: brightness(1.08) saturate(1.06); }

.chart-tip {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bar-height, 0%) + 12px);
  z-index: 8;
  transform: translate(-50%, 4px);
  padding: 4px 6px;
  color: #ffebba;
  border: 1px solid #1d100b;
  border-radius: 2px;
  background: #3b251c;
  box-shadow: 0 2px 0 rgba(38, 20, 13, 0.3);
  font-family: var(--font-small);
  font-size: 5.5px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}
.chart-tip b { color: #f5c66d; font-weight: 400; }
.chart-col:hover .chart-tip,
.chart-col:focus-visible .chart-tip { opacity: 1; transform: translate(-50%, 0); }

.chart-day {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 17px;
  margin-top: 2px;
  border-radius: 2px;
  color: #8b623d;
  font-family: var(--font-small);
  font-size: 6px;
  text-transform: uppercase;
}
.chart-col.is-today .chart-day { font-weight: 700; }

.chart-foot {
  margin: 4px 0 0;
  color: #8d6743;
  font-size: 9.5px;
  line-height: 1.25;
}

.recent-section {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed rgba(117, 74, 38, 0.32);
}
.live-tag {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #6b7c4b;
  font-family: var(--font-small);
  font-size: 5.5px;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}
.live-tag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7c9a50;
  box-shadow: 0 0 0 2px rgba(124, 154, 80, 0.16);
  animation: livePulse 2.4s ease infinite;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}
.recent-item {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 6px;
  border: 1px solid #d0ac73;
  border-radius: 2px;
  background: rgba(252, 240, 207, 0.52);
}
.recent-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: #f6dfaa;
  border: 1px solid #3c2a1d;
  border-radius: 2px;
  background: #5b7340;
  box-shadow: inset 0 0 0 1px #81975d;
}
.recent-icon.is-rest { background: #4d6b6c; box-shadow: inset 0 0 0 1px #759192; }
.recent-icon .icon { font-size: 12px; }
.recent-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.05; }
.recent-copy strong {
  overflow: hidden;
  color: #4a301c;
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-copy span { margin-top: 3px; color: #9a744f; font-size: 7.5px; }
.recent-min {
  padding: 2px 4px;
  color: #f6e3b4;
  border-radius: 1px;
  background: #5a3a25;
  font-family: var(--font-small);
  font-size: 5.5px;
  white-space: nowrap;
}
.recent-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  color: #98714c;
  text-align: center;
}
.recent-empty .icon { font-size: 20px; color: #849b5e; }
.recent-empty p { margin: 4px 0 2px; font-size: 13px; font-weight: 600; }
.recent-empty small { font-size: 9px; line-height: 1.3; }

/* --------------------------------------------------------------------------
   Bottom bar
   -------------------------------------------------------------------------- */
.bottom-bar {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  color: #d3bf9c;
  font-family: var(--font-small);
  font-size: 5.5px;
  letter-spacing: 0.35px;
  text-shadow: 0 1px 2px #160b1e, 0 1px 0 #160b1e;
}
.autosave { display: flex; align-items: center; gap: 5px; text-transform: uppercase; }
.autosave i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9fbd6a;
  box-shadow: 0 0 5px rgba(159, 189, 106, 0.5);
}
.shortcut-hints { display: flex; align-items: center; gap: 5px; opacity: 0.82; }
.shortcut-hints kbd {
  padding: 2px 3px;
  color: #e5d2ae;
  border: 1px solid rgba(235, 210, 164, 0.3);
  border-radius: 2px;
  background: rgba(28, 15, 31, 0.4);
  font-family: var(--font-small);
  font-size: 5px;
}
.valley-quote {
  font-family: var(--font-pixel);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0;
  color: #e0c9a1;
  opacity: 0.78;
}

/* --------------------------------------------------------------------------
   Toasts and celebration
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 150;
  width: min(390px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 7px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  color: #3b2417;
  border: 3px solid #2a140d;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(136, 89, 45, 0.055) 1px, transparent 1px) 0 0 / 12px 100%,
    linear-gradient(180deg, #f9e8bd, #edd39d);
  box-shadow:
    inset 0 0 0 2px #fff0c4,
    0 5px 0 rgba(30, 15, 10, 0.32),
    0 12px 28px rgba(12, 5, 16, 0.3);
  pointer-events: auto;
  animation: toastIn 300ms cubic-bezier(0.2, 0.9, 0.3, 1.08) both;
}
.toast::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: #8aa05d;
  transform-origin: left;
  animation: toastTimer var(--toast-life, 4s) linear both;
}
.toast.is-leaving { animation: toastOut 240ms ease both; }
.toast-icon {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  color: #f9e5b1;
  border: 2px solid #2b170f;
  border-radius: 2px;
  background: #5c743f;
  box-shadow: inset 0 0 0 1px #90a669;
}
.toast-icon.is-rest { background: #486968; box-shadow: inset 0 0 0 1px #799594; }
.toast-icon.is-warn { background: #92513b; box-shadow: inset 0 0 0 1px #bb7a5e; }
.toast-icon .icon, .toast-icon svg { width: 19px; height: 19px; image-rendering: pixelated; }
.toast-copy { min-width: 0; }
.toast-copy strong {
  display: block;
  font-family: var(--font-pixel);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: #3a2113;
}
.toast-copy span {
  display: block;
  margin-top: 3px;
  color: #7d5a3a;
  font-size: 10.5px;
  line-height: 1.2;
}
.toast-action {
  padding: 4px 5px;
  border: 1px solid #8d6338;
  border-radius: 2px;
  background: #f8e7bf;
  color: #654128;
  font-family: var(--font-small);
  font-size: 5.5px;
  text-transform: uppercase;
}
.toast-action:hover { background: #fff1c9; }

.celebration-layer {
  position: fixed;
  inset: 0;
  z-index: 160;
  pointer-events: none;
  overflow: hidden;
}
.leaf-particle {
  position: absolute;
  left: var(--start-x, 50%);
  top: var(--start-y, 36%);
  width: var(--size, 7px);
  height: var(--size, 7px);
  background: var(--color, #d66a4d);
  box-shadow: 0 0 0 1px rgba(68, 31, 25, 0.15);
  animation: leafFall var(--dur, 1.8s) cubic-bezier(0.18, 0.7, 0.34, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes leafFall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  70% { opacity: 0.9; }
  100% { transform: translate(var(--dx, 40px), var(--dy, 300px)) rotate(var(--rot, 240deg)); opacity: 0; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px) scale(0.98); }
}
@keyframes toastTimer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}
@keyframes taskIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes barRise {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(124, 154, 80, 0.14); }
  50% { box-shadow: 0 0 0 4px rgba(124, 154, 80, 0.06); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes completeGlow {
  0%, 100% { box-shadow: inset 0 0 0 2px #7a4c2f, inset 0 0 0 5px #321d17, 0 12px 32px rgba(11, 5, 16, 0.42); }
  35% { box-shadow: inset 0 0 0 2px #d6a45e, inset 0 0 0 8px rgba(255, 203, 106, 0.36), 0 0 48px rgba(255, 190, 87, 0.4); }
}
@keyframes colonBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.32; }
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 22px;
}
.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(11, 6, 17, 0.7);
  backdrop-filter: blur(3px);
  animation: scrimIn 180ms ease both;
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: calc(100dvh - 44px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  border: 4px solid #422518;
  border-radius: 6px;
  background-color: #f2dcaa;
  background-image:
    radial-gradient(circle at 18% 15%, rgba(255, 255, 255, 0.42) 0 1px, transparent 1.5px),
    radial-gradient(circle at 74% 64%, rgba(120, 75, 36, 0.13) 0 1px, transparent 1.7px),
    linear-gradient(90deg, rgba(108, 67, 34, 0.035) 1px, transparent 1px);
  background-size: 29px 35px, 43px 47px, 8px 8px;
  box-shadow:
    0 0 0 2px #1d0f0a,
    inset 0 0 0 2px #ffedc2,
    inset 0 0 0 5px rgba(132, 84, 42, 0.12),
    0 24px 70px rgba(5, 2, 10, 0.55);
  animation: modalIn 240ms cubic-bezier(0.2, 0.9, 0.25, 1.08) both;
}
.modal-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 5;
  pointer-events: none;
  border: 1px solid rgba(103, 62, 33, 0.26);
  border-radius: 2px;
}

.modal-head {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 2px solid rgba(101, 61, 31, 0.24);
  background: linear-gradient(180deg, rgba(244, 222, 176, 0.55), rgba(227, 197, 143, 0.38));
}
.modal-heading { display: flex; align-items: center; gap: 11px; }
.modal-emblem {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex: none;
  color: #f4d99e;
  border: 2px solid #24130d;
  border-radius: 2px;
  background: linear-gradient(180deg, #5b3c29, #382219);
  box-shadow: inset 0 0 0 1px #a47442;
}
.modal-emblem .icon { font-size: 22px; }
.modal-heading h2 {
  margin: 0;
  color: #382012;
  font-family: var(--font-pixel);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.modal-heading .eyebrow { margin-bottom: 4px; }

.close-button {
  width: 35px;
  height: 35px;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px solid #56351f;
  border-radius: 2px;
  color: #6b4629;
  background: #f7e3b6;
  box-shadow: inset 0 0 0 1px #fff0c8, 0 2px 0 #b18351;
}
.close-button .icon { font-size: 15px; }
.close-button:hover { background: #fff0c7; color: #3c2515; }
.close-button:active { transform: translateY(1px); box-shadow: inset 0 0 0 1px #fff0c8; }

.modal-body {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px 20px 18px;
  scrollbar-width: thin;
  scrollbar-color: #a47446 transparent;
}
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb {
  background: #b18251;
  border: 2px solid #f1d9a5;
  border-radius: 5px;
}

.modal-foot {
  position: relative;
  z-index: 6;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  border-top: 2px solid rgba(103, 62, 32, 0.24);
  background: linear-gradient(180deg, rgba(230, 202, 150, 0.35), rgba(229, 199, 142, 0.6));
  color: #8b653f;
  font-size: 10px;
}
.modal-foot > div { display: flex; align-items: center; gap: 7px; }

.button-primary,
.button-secondary,
.danger-button {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  border: 2px solid #28150e;
  border-radius: 3px;
  font-family: var(--font-small);
  font-size: 6.5px;
  letter-spacing: 0.25px;
  text-transform: uppercase;
  transition: transform 120ms ease, filter 120ms ease;
}
.button-primary {
  color: #fff0c1;
  background: linear-gradient(180deg, #5d7642, #41562f);
  box-shadow: inset 0 0 0 1px #8da364, 0 3px 0 #28351d;
}
.button-secondary {
  color: #5b3b24;
  background: linear-gradient(180deg, #f8e7bc, #e8cd96);
  box-shadow: inset 0 0 0 1px #ffefc6, 0 3px 0 #b0824d;
}
.button-primary .icon,
.button-secondary .icon { font-size: 12px; }
.button-primary:hover,
.button-secondary:hover { filter: brightness(1.04); transform: translateY(-1px); }
.button-primary:active,
.button-secondary:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px rgba(255, 245, 209, 0.3); }

.settings-section { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px dashed rgba(112, 70, 35, 0.3); }
.settings-section:last-of-type { margin-bottom: 0; }
.section-heading { margin-bottom: 9px; }
.section-heading h3 {
  margin: 0;
  color: #3d2616;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}
.section-heading p { margin: 4px 0 0; color: #8b663f; font-size: 10.5px; line-height: 1.3; }

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border: 2px solid #c39a60;
  border-radius: 2px;
  background: rgba(252, 241, 211, 0.6);
  box-shadow: inset 0 1px 0 #fff7dc;
  color: #4a301d;
  font-size: 12.5px;
  font-weight: 600;
}
.number-field {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 5px;
  border: 1px solid #9e7448;
  border-radius: 2px;
  background: #f9e9c3;
}
.number-field input {
  width: 39px;
  padding: 2px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #4b301b;
  font-family: var(--font-small);
  font-size: 9px;
  text-align: right;
}
.number-field input::-webkit-inner-spin-button { opacity: 0.4; }
.number-field i { color: #8d653e; font-size: 9px; font-style: normal; }

.switch-list { margin-top: 8px; border-top: 1px solid rgba(133, 91, 49, 0.16); }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 1px;
  border-bottom: 1px solid rgba(133, 91, 49, 0.14);
  cursor: pointer;
}
.switch-row > span { display: flex; flex-direction: column; gap: 3px; }
.switch-row b { color: #482f1d; font-size: 13px; font-weight: 600; }
.switch-row small { color: #8e6944; font-size: 9.5px; }
.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.switch {
  position: relative;
  width: 39px;
  height: 22px;
  flex: none;
  border: 2px solid #7b5532;
  border-radius: 12px;
  background: #d6b98a;
  box-shadow: inset 0 1px 2px rgba(103, 64, 31, 0.2);
  transition: background 160ms ease, border-color 160ms ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff1c7;
  box-shadow: 0 1px 0 #a37b4f;
  transition: transform 160ms ease;
}
.switch-row input:checked + .switch {
  background: #5d773f;
  border-color: #3c4f29;
}
.switch-row input:checked + .switch::after { transform: translateX(17px); }
.switch-row input:focus-visible + .switch { outline: 2px dashed #8e5b30; outline-offset: 2px; }

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 15px;
  padding: 10px 11px;
  border: 2px solid rgba(153, 79, 55, 0.42);
  border-radius: 3px;
  background: rgba(178, 99, 68, 0.08);
}
.danger-zone h3 { margin: 0; color: #683725; font-size: 16px; font-weight: 700; line-height: 1; }
.danger-zone p { margin: 4px 0 0; color: #8b5b43; font-size: 10px; line-height: 1.25; }
.danger-button {
  flex: none;
  color: #74382b;
  border-color: #8e4b38;
  background: #f6dfb5;
  box-shadow: 0 2px 0 #b18156;
}
.danger-button:hover { background: #ffeecb; }
.danger-button.is-armed {
  color: #fff0d5;
  background: #994c38;
  border-color: #5c261b;
  box-shadow: 0 2px 0 #4e2118;
}

.modal-scrim { cursor: pointer; }

/* Full ledger */
.ledger-modal { width: min(790px, 100%); }
.ledger-modal-body { padding-top: 14px; }
.ledger-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ledger-stat {
  padding: 9px 10px;
  border: 2px solid #bf955d;
  border-radius: 3px;
  background: rgba(252, 240, 207, 0.66);
  box-shadow: 0 2px 0 #af824b, inset 0 1px 0 #fff5d8;
}
.ledger-stat span {
  display: block;
  color: #8f6038;
  font-family: var(--font-small);
  font-size: 5px;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}
.ledger-stat b {
  display: block;
  margin-top: 4px;
  color: #3c2516;
  font-size: 22px;
  font-weight: 700;
  line-height: 0.95;
}
.ledger-stat small { display: block; margin-top: 4px; color: #98734d; font-size: 8px; line-height: 1.1; }

.ledger-section {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px dashed rgba(112, 70, 35, 0.32);
}
.ledger-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.heat-legend { display: flex; align-items: center; gap: 3px; color: #926b45; font-family: var(--font-small); font-size: 5px; }
.heat-legend i { width: 10px; height: 10px; border: 1px solid rgba(82, 53, 31, 0.16); }
.heat-legend .lvl0 { background: #e5cea1; }
.heat-legend .lvl1 { background: #c9c28d; }
.heat-legend .lvl2 { background: #9eae72; }
.heat-legend .lvl3 { background: #728e51; }
.heat-legend .lvl4 { background: #4e6b38; }

.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 15px);
  gap: 4px;
  width: max-content;
  max-width: 100%;
  padding: 8px;
  border: 1px solid rgba(138, 93, 53, 0.25);
  border-radius: 2px;
  background: rgba(255, 248, 222, 0.32);
}
.heat-cell {
  width: 15px;
  height: 15px;
  border: 1px solid rgba(86, 53, 29, 0.18);
  border-radius: 1px;
  background: #e5cea1;
}
.heat-cell.lvl1 { background: #c9c28d; }
.heat-cell.lvl2 { background: #9eae72; }
.heat-cell.lvl3 { background: #728e51; }
.heat-cell.lvl4 { background: #4e6b38; }
.heat-cell.is-today { outline: 2px solid #b85a3f; outline-offset: 1px; }
.heat-cell:hover { filter: brightness(1.12); }

.task-breakdown { display: flex; flex-direction: column; gap: 6px; }
.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(80px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid #d0ac73;
  border-radius: 2px;
  background: rgba(252, 240, 207, 0.48);
}
.breakdown-title { min-width: 0; }
.breakdown-title strong {
  display: block;
  overflow: hidden;
  color: #482f1c;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breakdown-title span { display: block; margin-top: 2px; color: #9a744d; font-size: 8px; }
.breakdown-bar {
  height: 8px;
  overflow: hidden;
  border: 1px solid #b28a5b;
  border-radius: 1px;
  background: #e8d1a5;
}
.breakdown-bar i { display: block; height: 100%; background: linear-gradient(90deg, #788f4e, #526b39); }
.breakdown-value {
  color: #5c3d24;
  font-family: var(--font-small);
  font-size: 6px;
  white-space: nowrap;
}
.breakdown-empty { padding: 10px 2px; color: #8d6743; font-size: 11px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes scrimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Responsive layout
   -------------------------------------------------------------------------- */
@media (max-width: 1370px) {
  .dashboard { grid-template-columns: 304px minmax(390px, 1fr) 338px; gap: 13px; }
  .game-shell { padding-left: 14px; padding-right: 14px; }
  .brand-plaque { min-width: 292px; }
  .brand-copy h1 { font-size: 25px; }
  .hud-chip { padding-left: 8px; padding-right: 8px; }
  .panel-head { padding-left: 13px; padding-right: 13px; }
  .ledger-scroll { padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 1180px) {
  body { overflow-y: auto; overflow-x: hidden; }
  .game-shell { height: auto; min-height: 100dvh; padding-bottom: 12px; }
  .plant-mascot { display: none; }
  .dashboard {
    grid-template-columns: minmax(280px, 0.72fr) minmax(440px, 1.28fr);
    grid-template-rows: minmax(640px, auto) 720px;
  }
  .chores-panel { grid-column: 1; grid-row: 1; }
  .focus-panel { grid-column: 2; grid-row: 1; }
  .ledger-panel { grid-column: 1 / -1; grid-row: 2; }
  .ledger-scroll {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
    grid-template-rows: auto auto auto;
    gap: 0 14px;
    align-items: start;
  }
  .harvest-hero { grid-column: 1; }
  .mini-stats { grid-column: 1; }
  .chart-card { grid-column: 2; grid-row: 1 / 3; margin-top: 0; padding-top: 0; border-top: 0; }
  .recent-section { grid-column: 1; margin-top: 11px; }
  .chart-wrap { height: 220px; }
  .bottom-bar { margin-top: 4px; }
}

@media (max-width: 900px) {
  .game-shell { padding: 10px 10px 8px; gap: 9px; }
  .hud { flex-wrap: wrap; gap: 8px; }
  .brand-plaque { flex: 1 1 250px; min-width: 0; max-width: calc(100% - 92px); }
  .brand-copy h1 { font-size: 23px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-mark svg { width: 25px; height: 25px; }
  .day-card { order: 3; flex: 1 1 100%; width: 100%; min-width: 0; justify-content: center; padding-top: 5px; padding-bottom: 5px; }
  .hud-actions { margin-left: auto; }
  .gold-chip { display: none; }
  .dashboard { display: flex; flex-direction: column; gap: 12px; width: 100%; min-width: 0; }
  .focus-panel { order: 1; min-height: 720px; }
  .chores-panel { order: 2; min-height: 520px; max-height: 660px; }
  .ledger-panel { order: 3; min-height: 680px; }
  .ledger-scroll { display: block; }
  .chart-card { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(117, 74, 38, 0.32); }
  .chart-wrap { height: 170px; }
  .timer-ring-wrap { width: min(46vh, 460px, 88%); }
  .time-display { font-size: clamp(54px, 9vh, 78px); }
  .bottom-bar { flex-wrap: wrap; justify-content: center; gap: 8px 14px; padding-top: 4px; }
  .autosave { display: none; }
  .valley-quote { font-size: 10px; }
}

@media (max-width: 900px) and (max-height: 840px) {
  .focus-panel { min-height: 570px; }
  .focus-inner { padding-top: 9px; }
  .timer-ring-wrap { width: min(46vh, 360px, 80%); }
  .time-display { font-size: clamp(48px, 8.5vh, 66px); }
  .mode-tab { height: 28px; }
  .timer-whisper { font-size: 10.5px; }
  .current-chore { min-height: 38px; padding-top: 5px; padding-bottom: 5px; }
  .timer-controls { margin-top: 8px; }
  .start-button { height: 46px; }
  .control-side { width: 43px; height: 43px; }
  .focus-garden { margin-top: 8px; padding-top: 6px; padding-bottom: 7px; }
  .garden-head { margin-bottom: 5px; }
  .plot { height: 31px; }
}

@media (max-width: 640px) {
  .game-shell { padding: 8px 8px 6px; }
  .hud { gap: 6px; }
  .brand-plaque { padding: 6px 12px 6px 7px; }
  .brand-copy h1 { font-size: 21px; }
  .brand-copy p { font-size: 6px; letter-spacing: 1.2px; }
  .brand-mark { width: 33px; height: 33px; }
  .brand-mark svg { width: 22px; height: 22px; }
  .streak-chip { display: none; }
  .hud-button { width: 37px; height: 37px; }
  .hud-button .icon { font-size: 16px; }
  .day-card { gap: 7px; }
  .day-copy strong { font-size: 17px; }
  .day-time { font-size: 8px; }
  .day-icon { width: 29px; height: 29px; }
  .day-icon .icon { font-size: 16px; }

  .focus-panel { min-height: 680px; }
  .focus-inner { padding: 10px 11px 0; }
  .mode-row { gap: 5px; }
  .mode-tabs { gap: 1px; padding: 3px; }
  .mode-tab { padding: 0 6px; font-size: 6px; gap: 3px; }
  .mode-tab small { display: none; }
  .mode-tab .icon { font-size: 12px; }
  .round-chip { padding: 5px 6px; font-size: 5px; }
  .timer-stage { padding-top: 2px; }
  .timer-ring-wrap { width: min(80vw, 390px); }
  .time-display { font-size: clamp(48px, 13vw, 64px); letter-spacing: -2px; }
  .mode-kicker { font-size: 7px; letter-spacing: 1.5px; }
  .time-note { font-size: 10.5px; }
  .current-chore { width: 100%; min-height: 41px; }
  .current-chore-label { font-size: 5px; }
  .current-chore-title { font-size: 13px; }
  .timer-controls { gap: 6px; margin-top: 10px; }
  .control-side { width: 42px; height: 44px; }
  .start-button { min-width: 0; flex: 1; max-width: 218px; height: 48px; font-size: 8.5px; gap: 6px; padding: 0 8px; }
  .start-button kbd { display: none; }
  .focus-garden { margin-left: -11px; margin-right: -11px; padding: 7px 11px 9px; }
  .plot { height: 34px; }
  .garden-plots { gap: 3px; }
  .panel-head { padding: 12px 12px 9px; }
  .panel-head h2 { font-size: 21px; }
  .panel-emblem { width: 33px; height: 33px; }
  .panel-emblem .icon { font-size: 18px; }
  .count-badge { min-width: 44px; height: 35px; }
  .chore-form { padding: 9px 11px; }
  .task-scroll { padding-left: 10px; padding-right: 10px; }
  .chores-foot { padding: 9px 12px 10px; }
  .ledger-panel { min-height: 650px; }
  .ledger-scroll { padding: 9px 11px 12px; }
  .harvest-value-row > strong { font-size: 38px; }
  .chart-wrap { height: 155px; }
  .chart-bars { gap: 1px; }
  .chart-bar { width: 18px; max-width: 70%; }
  .chart-tip { font-size: 5px; }
  .bottom-bar { font-size: 5px; }
  .shortcut-hints { display: none; }
  .valley-quote { font-size: 10px; }
  .toast-stack { top: 12px; }
  .toast { grid-template-columns: 29px minmax(0, 1fr) auto; }
  .toast-icon { width: 29px; height: 29px; }

  .modal-layer { padding: 10px; }
  .modal-panel { max-height: calc(100dvh - 20px); }
  .modal-head { padding: 12px 13px; gap: 8px; }
  .modal-heading { gap: 8px; }
  .modal-heading h2 { font-size: 23px; }
  .modal-emblem { width: 36px; height: 36px; }
  .modal-emblem .icon { font-size: 19px; }
  .modal-body { padding: 12px 13px 14px; }
  .modal-foot { padding: 9px 13px; flex-wrap: wrap; }
  .modal-foot > span { flex: 1 1 100%; font-size: 9px; }
  .settings-grid { grid-template-columns: 1fr; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
  .danger-button { width: 100%; }
  .ledger-summary { grid-template-columns: 1fr 1fr; }
  .ledger-stat b { font-size: 20px; }
  .breakdown-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .breakdown-bar { display: none; }
  .heatmap { gap: 3px; padding: 6px; }
  .heat-cell { width: 13px; height: 13px; }
  .heatmap { grid-template-rows: repeat(7, 13px); }
  .ledger-section-head { align-items: flex-start; flex-direction: column; }
  .heat-legend { align-self: flex-end; }
  .ledger-modal .modal-foot > div { width: 100%; }
  .ledger-modal .modal-foot button { flex: 1; }
}

@media (max-height: 840px) and (min-width: 1181px) {
  .game-shell { gap: 8px; padding-top: 9px; padding-bottom: 5px; }
  .hud { min-height: 56px; }
  .brand-plaque { padding-top: 5px; padding-bottom: 5px; }
  .brand-copy h1 { font-size: 23px; }
  .brand-mark { width: 37px; height: 37px; }
  .brand-mark svg { width: 25px; height: 25px; }
  .day-card { padding-top: 4px; padding-bottom: 4px; }
  .day-copy strong { font-size: 18px; }
  .hud-chip, .hud-button { height: 37px; }
  .hud-button { width: 37px; }

  .focus-inner { padding-top: 9px; }
  .mode-tab { height: 27px; padding-left: 7px; padding-right: 7px; }
  .timer-ring-wrap { width: min(42vh, 390px, 74%); }
  .time-display { font-size: clamp(44px, 6.9vh, 62px); }
  .mode-kicker { margin-bottom: 4px; font-size: 7px; }
  .time-note { margin-top: 5px; font-size: 10.5px; }
  .center-flourish { margin-top: 5px; }
  .ring-badge { width: 24px; height: 24px; bottom: 3%; }
  .timer-whisper { font-size: 10px; }
  .current-chore { min-height: 38px; padding-top: 5px; padding-bottom: 5px; margin-top: 1px; }
  .current-chore-title { font-size: 13px; }
  .timer-controls { margin-top: 8px; }
  .start-button { height: 45px; min-width: 208px; }
  .control-side { width: 43px; height: 43px; }
  .focus-garden { margin-top: 8px; padding-top: 6px; padding-bottom: 7px; }
  .garden-head { margin-bottom: 5px; }
  .plot { height: 31px; }
  .plot.is-planted::before { height: 13px; bottom: 7px; }
  .plot-fruit { bottom: 9px; width: 11px; height: 11px; }
  .plot::after { bottom: 4px; }
  .plant-mascot { display: none; }

  .panel-head { padding-top: 11px; padding-bottom: 8px; }
  .panel-head h2 { font-size: 21px; }
  .chore-form { padding-top: 8px; padding-bottom: 8px; }
  .chores-foot { padding-top: 8px; padding-bottom: 8px; }
  .basket-pips { margin-top: 5px; margin-bottom: 4px; }
  .ledger-scroll { padding-top: 8px; }
  .harvest-hero { padding-top: 8px; padding-bottom: 9px; }
  .harvest-value-row > strong { font-size: 36px; }
  .mini-stat { padding-top: 6px; padding-bottom: 6px; }
  .chart-card { margin-top: 8px; padding-top: 8px; }
  .chart-wrap { height: 137px; }
  .recent-section { margin-top: 8px; padding-top: 8px; }
  .recent-item { min-height: 30px; padding-top: 3px; padding-bottom: 3px; }
  .bottom-bar { min-height: 15px; }
}

@media (max-height: 700px) and (min-width: 1181px) {
  .timer-ring-wrap { width: min(41vh, 340px, 65%); }
  .timer-whisper { display: none; }
  .focus-garden { display: none; }
  .current-chore { margin-top: 4px; }
  .chart-wrap { height: 120px; }
}

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