/* Cozy To-Do: warm autumn look. Everything is drawn with CSS (no images from any game). */

:root {
  --forest: #2c4a2e;
  --forest-deep: #1a2e1c;
  --forest-light: #41683f;
  --orange: #c65f1f;
  --orange-light: #e27d35;
  --orange-dark: #8a3c12;
  --gold: #e9b44c;
  --parchment: #f6ead0;
  --parchment-2: #ecdcb6;
  --parchment-edge: #d6bd89;
  --wood: #8a5a33;
  --wood-light: #a8713f;
  --wood-dark: #5a3719;
  --wood-darker: #3b230f;
  --cream: #fff4dc;
  --ink: #3a2414;
  --ink-soft: #6b4a30;
  --ink-faded: #9b8267;
  --strike: #c1272d;
  --pixel-font: "Pixelify Sans", "Courier New", monospace;
  --text-font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--text-font);
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  background-color: var(--forest);
  background-image:
    radial-gradient(circle at 12px 12px, rgba(255, 255, 255, 0.045) 2px, transparent 2.5px),
    radial-gradient(ellipse at 50% -10%, rgba(233, 180, 76, 0.18), transparent 60%),
    linear-gradient(180deg, var(--forest) 0%, var(--forest-deep) 100%);
  background-size: 24px 24px, 100% 100%, 100% 100%;
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.pixel { font-family: var(--pixel-font); font-weight: 700; letter-spacing: 0.5px; }

/* The chosen pixel-art scene (see backgrounds.js), fixed behind everything */
#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center bottom;
  image-rendering: pixelated;
}

/* ---------- Wood panel and parchment ---------- */

.wood {
  position: relative;
  color: var(--cream);
  background-color: var(--wood);
  background-image:
    repeating-linear-gradient(180deg, transparent 0 25px, rgba(40, 18, 4, 0.38) 25px 27px, rgba(255, 220, 170, 0.1) 27px 28px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 3px, transparent 3px 11px, rgba(0, 0, 0, 0.05) 11px 13px, transparent 13px 23px),
    linear-gradient(180deg, var(--wood-light), var(--wood) 60%, #7a4d2a);
  border-radius: 4px;
  box-shadow:
    0 0 0 3px var(--wood-darker),
    inset 0 3px 0 rgba(255, 210, 160, 0.25),
    inset 0 -4px 0 rgba(0, 0, 0, 0.25),
    0 7px 0 3px rgba(0, 0, 0, 0.28);
}

.nails::before, .nails::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 6px;
  height: 6px;
  background: #caa27a;
  box-shadow: inset -2px -2px 0 #6e4a2a, 0 0 0 1px var(--wood-darker);
}
.nails::before { left: 8px; }
.nails::after { right: 8px; }

.parchment {
  position: relative;
  background:
    radial-gradient(ellipse at 18% 8%, rgba(255, 255, 255, 0.55), transparent 45%),
    radial-gradient(ellipse at 85% 95%, rgba(170, 115, 55, 0.2), transparent 55%),
    radial-gradient(circle at 65% 35%, rgba(190, 140, 70, 0.09), transparent 30%),
    var(--parchment);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 2px var(--parchment-edge),
    inset 0 0 30px rgba(150, 95, 40, 0.32),
    0 0 0 4px var(--wood-dark),
    0 0 0 8px var(--wood),
    0 0 0 11px var(--wood-darker),
    0 12px 0 11px rgba(0, 0, 0, 0.25);
}

/* ---------- Buttons (little pixel-cornered blocks) ---------- */

.btn {
  --face: var(--orange);
  --edge: var(--orange-dark);
  position: relative;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  font-family: var(--pixel-font);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: var(--cream);
  background: var(--face);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
  box-shadow:
    0 -3px 0 0 var(--wood-darker), 0 3px 0 0 var(--wood-darker),
    -3px 0 0 0 var(--wood-darker), 3px 0 0 0 var(--wood-darker),
    inset 0 -4px 0 var(--edge), inset 0 3px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: 0 -3px 0 0 var(--wood-darker), 0 3px 0 0 var(--wood-darker), -3px 0 0 0 var(--wood-darker), 3px 0 0 0 var(--wood-darker), inset 0 -1px 0 var(--edge); }
.btn:disabled { filter: grayscale(0.6) opacity(0.55); cursor: default; transform: none; }
.btn-green { --face: var(--forest-light); --edge: var(--forest); }
.btn-wood { --face: var(--wood-light); --edge: var(--wood-dark); }
.btn-red { --face: #a8322a; --edge: #6d1d17; }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 14px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--cream);
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.15); }
.icon-btn svg { width: 26px; height: 26px; shape-rendering: crispEdges; }
.icon-btn[aria-pressed="false"] svg { opacity: 0.45; filter: grayscale(1); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Layout ---------- */

.app {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 22px;
  margin: 3px 3px 22px;
}
.topbar h1 {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: clamp(22px, 6vw, 30px);
  color: var(--cream);
  text-shadow: 2px 2px 0 var(--wood-darker);
}
.topbar h1 svg { width: 30px; height: 30px; flex: none; shape-rendering: crispEdges; }
.top-actions { display: flex; align-items: center; gap: 2px; position: relative; }

.sync { width: 12px; height: 12px; margin: 0 8px; background: #7fc46b; box-shadow: 0 0 0 2px var(--wood-darker); transition: background 0.2s; }
.sync[data-state="saving"] { background: var(--gold); }
.sync[data-state="offline"] { background: #d9483b; }

.menu {
  position: absolute;
  top: 52px;
  right: 0;
  z-index: 20;
  min-width: 200px;
  padding: 8px;
  display: grid;
  gap: 4px;
}
.menu button {
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--cream);
  font-weight: 700;
  border-radius: 4px;
}
.menu button:hover, .menu button:focus-visible { background: rgba(0, 0, 0, 0.2); }

/* ---------- Tabs ---------- */

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 3px 26px;
}
.tab {
  --face: var(--wood);
  --edge: var(--wood-dark);
  min-height: 52px;
  padding: 0 6px;
  font-size: clamp(14px, 3.8vw, 17px);
}
.tabs { grid-template-columns: 1fr 1fr 1fr 52px; gap: 10px; }
.tab[aria-selected="true"] { --face: var(--orange); --edge: var(--orange-dark); }
.tab .long { display: none; }
.tab-stats { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0; }
.tab-stats svg { width: 22px; height: 22px; flex: none; shape-rendering: crispEdges; }
@media (min-width: 520px) {
  .tabs { grid-template-columns: 1fr 1fr 1fr 0.8fr; gap: 12px; }
  .tab .long { display: inline; }
  .tab .short { display: none; }
}

/* ---------- Stats ---------- */

.ranges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 18px; }
.ranges button {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  border-radius: 2px;
  font-weight: 800;
  font-size: 15px;
  color: var(--ink-soft);
  background: rgba(255, 250, 240, 0.7);
  box-shadow: inset 0 0 0 2px var(--parchment-edge);
}
.ranges button[aria-checked="true"] { color: var(--cream); background: var(--forest-light); box-shadow: inset 0 0 0 2px var(--forest-deep), inset 0 -3px 0 rgba(0, 0, 0, 0.2); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 14px; margin: 4px 3px 26px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { padding: 12px 12px 11px; text-align: center; }
.tile .value { display: block; font-family: var(--pixel-font); font-weight: 700; font-size: 28px; line-height: 1.1; text-shadow: 2px 2px 0 var(--wood-darker); }
.tile .label { display: block; margin-top: 4px; font-size: 13.5px; font-weight: 700; color: #f3dcc0; }

.stats h3 { margin: 22px 0 10px; font-family: var(--pixel-font); font-size: 18px; color: var(--forest); }
.stats h4 { margin: 14px 0 6px; font-size: 14px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: var(--ink-soft); }
.stats .note { margin: -4px 0 10px; font-size: 14px; color: var(--ink-soft); }

.rate-row { padding: 8px 0 10px; border-bottom: 2px dashed rgba(107, 74, 48, 0.18); }
.rate-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.rate-head .pct { font-family: var(--pixel-font); font-size: 17px; color: var(--ink); }
.rate-track { height: 12px; margin: 6px 0 5px; background: var(--parchment-2); border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(107, 74, 48, 0.2); }
.rate-fill { height: 100%; min-width: 0; background: var(--orange); border-radius: 4px; }
.rate-meta { font-size: 13.5px; color: var(--ink-soft); }
.rate-meta .late { color: var(--strike); font-weight: 800; }

.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; align-items: end; height: 150px; padding-top: 20px; border-bottom: 2px solid var(--ink-faded); }
.bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar .fill { margin: 0 18%; background: var(--orange); border-radius: 4px 4px 0 0; min-height: 0; }
.bar .count { position: absolute; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 800; color: var(--ink); }
.bar.top .fill { background: var(--orange-dark); }
.bar-labels { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; margin-top: 6px; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.bar-labels small { display: block; font-size: 11px; font-weight: 600; color: var(--ink-faded); }

/* ---------- The list ---------- */

.board { margin: 0 11px; padding: 18px 16px 14px; }

.list-title {
  margin: 2px 0 14px;
  font-size: 22px;
  color: var(--orange-dark);
  text-align: center;
}
.list-title::before, .list-title::after { content: "~"; margin: 0 10px; color: var(--ink-faded); }

.add-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 12px; }
.add-row.has-cats { grid-template-columns: 1fr auto; }
.add-row input { grid-column: 1 / -1; }
.add-row.no-cats input { grid-column: 1; }
@media (min-width: 560px) {
  .add-row.has-cats { grid-template-columns: 1fr minmax(150px, 200px) auto; }
  .add-row.has-cats input { grid-column: 1; }
}

.field {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-radius: 2px;
  background: #fffaf0;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--parchment-edge), inset 0 3px 0 rgba(120, 80, 40, 0.12);
}
.field:focus { outline: none; box-shadow: inset 0 0 0 3px var(--orange), inset 0 3px 0 rgba(120, 80, 40, 0.12); }
.field::placeholder { color: var(--ink-faded); }
select.field {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(-45deg, transparent 50%, var(--ink-soft) 50%);
  background-position: right 18px center, right 12px center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  background-color: #fffaf0;
  font-weight: 700;
}
textarea.field { resize: vertical; min-height: 90px; }

.tasks { list-style: none; margin: 0; padding: 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 18px 0 2px;
  padding: 0 4px 5px;
  border-bottom: 3px double var(--parchment-edge);
  font-family: var(--pixel-font);
  font-weight: 700;
  font-size: 18px;
  color: var(--forest);
}
.section-head:first-child { margin-top: 4px; }
.section-head small { font-family: var(--text-font); font-size: 13px; font-weight: 700; color: var(--ink-soft); }

.task {
  position: relative;
  display: flex;
  align-items: stretch;
  border-bottom: 2px dashed rgba(107, 74, 48, 0.22);
  background: transparent;
  transition: background 0.15s;
}
.task:hover { background: rgba(255, 255, 255, 0.28); }
.task.dragging {
  z-index: 5;
  background: var(--parchment-2);
  box-shadow: 0 8px 18px rgba(60, 30, 10, 0.3), 0 0 0 2px var(--parchment-edge);
  transition: none;
}
.task.entering { animation: drop-in 0.35s ease-out; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px); } }

.handle {
  flex: none;
  width: 34px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink-faded);
  cursor: grab;
  touch-action: none;
}
.handle svg { width: 12px; height: 20px; shape-rendering: crispEdges; }
.dragging .handle { cursor: grabbing; }

.check {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 6px 12px 2px;
  border: 0;
  background: transparent;
  text-align: left;
  min-height: 56px;
}

.box {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: -1px;
  background: #fffaf0;
  box-shadow: 0 0 0 3px var(--wood-dark), inset 0 3px 0 rgba(120, 80, 40, 0.18);
}
.box::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 9' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff4dc' d='M9 0h2v2H9zM8 2h2v2H8zM7 3h2v2H7zM6 4h2v2H6zM5 5h2v2H5zM4 6h2v2H4zM3 7h2v2H3zM2 6h2v2H2zM1 5h2v2H1zM0 4h2v2H0z'/%3E%3C/svg%3E") center / 18px no-repeat;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.15s, transform 0.2s;
}
.done .box { background: var(--forest-light); box-shadow: 0 0 0 3px var(--forest-deep), inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.done .box::after { opacity: 1; transform: scale(1); }
.task.just-done .box { animation: pop 0.35s ease-out; }
@keyframes pop { 40% { transform: scale(1.28) rotate(-6deg); } 70% { transform: scale(0.94); } }

.body { flex: 1; min-width: 0; padding-top: 1px; }
.text { display: block; overflow-wrap: anywhere; font-weight: 600; }

/* The red strike-through line: a background that grows from left to right, across every wrapped line */
.strike {
  background-image: linear-gradient(var(--strike), var(--strike));
  background-repeat: no-repeat;
  background-position: 0 60%;
  background-size: 0% 3px;
  -webkit-box-decoration-break: slice;
  box-decoration-break: slice;
  transition: background-size 0.5s cubic-bezier(0.65, 0, 0.35, 1), color 0.4s;
}
.done .strike { background-size: 100% 3px; color: var(--ink-faded); }

.chip {
  display: inline-block;
  margin-top: 5px;
  padding: 1px 8px 2px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--cream);
  background: var(--chip, var(--wood));
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.18);
  border-radius: 2px;
}
.done .chip { opacity: 0.55; }

.edit {
  flex: none;
  width: 48px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
}
.edit svg { width: 20px; height: 20px; shape-rendering: crispEdges; }
.edit:hover { color: var(--orange); }

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  pointer-events: none;
  animation: sparkle 0.6s ease-out forwards;
}
@keyframes sparkle {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}

.empty {
  margin: 28px 8px;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
}
.empty strong { display: block; font-family: var(--pixel-font); font-style: normal; font-size: 18px; color: var(--forest); margin-bottom: 4px; }

.list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Dialogs ---------- */

dialog {
  width: min(460px, calc(100vw - 48px));
  max-height: calc(100dvh - 60px);
  padding: 22px 20px 20px;
  border: 0;
  color: var(--ink);
  overflow: auto;
}
dialog::backdrop { background: rgba(16, 28, 17, 0.7); }
dialog h2 { margin: 0 0 14px; font-size: 22px; color: var(--orange-dark); }
dialog label { display: block; margin: 12px 0 6px; font-weight: 800; color: var(--ink-soft); font-size: 15px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.dialog-actions .spacer { flex: 1; }
.hint { margin: 12px 0 0; font-size: 14px; color: var(--ink-soft); }

.cat-rows { display: grid; gap: 10px; margin: 6px 0 4px; }
.cat-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; }
#catAddForm { grid-template-columns: 1fr auto; }
.btn-icon { width: 44px; padding: 0; display: grid; place-items: center; }
.btn-icon svg { width: 18px; height: 18px; shape-rendering: crispEdges; }
.cat-move { padding: 12px; display: grid; gap: 10px; background: rgba(193, 39, 45, 0.08); box-shadow: inset 0 0 0 2px rgba(193, 39, 45, 0.35); border-radius: 2px; }
.cat-move p { margin: 0; font-weight: 700; }
.cat-move-actions { display: flex; justify-content: flex-end; gap: 12px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  inset: auto auto calc(22px + env(safe-area-inset-bottom)) 50%;
  margin: 0;
  border: 0;
  width: max-content;
  z-index: 50;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 18px;
  font-weight: 700;
  transform: translate(-50%, 140%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s ease, opacity 0.25s, visibility 0s 0.25s;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform 0.25s ease, opacity 0.25s; }
.toast.show.has-action { pointer-events: auto; display: flex; align-items: center; gap: 14px; }
.toast-action {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  font-family: var(--pixel-font);
  font-weight: 700;
  color: var(--wood-darker);
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--wood-darker), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

/* ---------- Falling leaves ---------- */

#leaves { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.leaf {
  position: absolute;
  top: -50px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  opacity: 0.85;
  animation: fall var(--dur) linear var(--delay) infinite;
}
.leaf svg {
  display: block;
  width: 100%;
  height: 100%;
  shape-rendering: crispEdges;
  animation: sway calc(var(--dur) / 3) ease-in-out var(--delay) infinite alternate;
}
@keyframes fall { to { transform: translateY(calc(100vh + 100px)); } }
@keyframes sway {
  from { transform: translateX(calc(var(--sway) * -1)) rotate(-25deg); }
  to { transform: translateX(var(--sway)) rotate(30deg); }
}

/* ---------- Login page ---------- */

.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-card { width: min(400px, 100%); padding: 26px 22px 24px; }
.login-card h1 { margin: 0 0 6px; text-align: center; font-size: 28px; color: var(--orange-dark); }
.login-card p { margin: 0 0 8px; text-align: center; color: var(--ink-soft); }
.login-card .btn { width: 100%; margin-top: 22px; }
.error { min-height: 1.4em; margin: 12px 0 0; color: var(--strike); font-weight: 700; text-align: center; }

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

/* ---------- Background picker ---------- */

.bg-intro { margin: -4px 0 14px; }
#bgDialog::backdrop { background: rgba(16, 28, 17, 0.12); }
.bg-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.bg-option {
  padding: 6px 6px 8px;
  border: 0;
  border-radius: 2px;
  background: #fffaf0;
  box-shadow: inset 0 0 0 2px var(--parchment-edge);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.25;
  color: var(--ink-soft);
}
.bg-option[aria-pressed="true"] { color: var(--ink); background: #fff3dc; box-shadow: inset 0 0 0 3px var(--orange); }
.bg-option canvas, .bg-option img, .bg-option .swatch {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  margin-bottom: 7px;
  image-rendering: pixelated;
  border-radius: 2px;
}
.bg-option img { object-fit: cover; image-rendering: auto; }
.bg-option .swatch {
  background-color: var(--forest);
  background-image: radial-gradient(circle at 6px 6px, rgba(255, 255, 255, 0.07) 1.5px, transparent 2px), linear-gradient(180deg, var(--forest), var(--forest-deep));
  background-size: 12px 12px, 100% 100%;
}

/* ---------- Export ---------- */

.stats-export { margin-top: 28px; text-align: center; }
.stats-export .btn { width: 100%; max-width: 380px; }
.export-intro { margin: -4px 0 14px; }
.export-ranges { grid-template-columns: repeat(3, 1fr); margin-bottom: 4px; }
.export-preview {
  max-height: 38vh;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--text-font);
  font-size: 14.5px;
  line-height: 1.45;
  background: #fffaf0;
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px var(--parchment-edge);
}
