/* Intake portal: a moonlit storybook.
   The spooky lives in the frame (night sky, illustrated hill, curly headings,
   stripes, moon-phase status icons). Everything people read or fill in sits on
   calm parchment cards with high-contrast text and large targets.
   Fonts are bundled, so the page makes no requests to outside servers. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Griffy";
  src: url("fonts/griffy-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --night: #17121d;
  --night-2: #211a29;
  --night-3: #2e2438;
  --night-line: #44374f;
  --moon: #f4ecd2;
  --mist: #bdb1ca;
  --bone: #efe6d1;
  --bone-2: #e4d8bd;
  --paper: #fbf7ec;
  --ink: #1d1722;
  --ink-2: #544959;
  --rule: #b9a88a;
  --stitch: #a8967a;
  --field: #8a7a64;
  --pumpkin: #f0883a;
  --pumpkin-deep: #a43f0a;
  --pumpkin-press: #6f2a05;
  --pumpkin-tint: #f8ddc2;
  --gold: #e8b84a;
  --gold-deep: #b8862a;
  --hex-deep: #4a2a6d;
  --blood: #8e2727;
  --blood-tint: #f4d6cf;

  --display: "Griffy", "Atkinson Hyperlegible Next", Georgia, serif;
  --body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wobble: 16px 6px 14px 7px / 7px 14px 6px 16px;
  --wobble-sm: 10px 4px 9px 5px / 5px 9px 4px 10px;
  --narrow: 48rem;
  --wide: 64rem;

  /* context colors: night by default, cards switch them */
  --text: var(--moon);
  --muted: var(--mist);
  --focus-c: #ffd27a;
  --btn2: var(--moon);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 88% -8%, #2c2138 0%, rgba(44, 33, 56, 0) 62%),
    var(--night);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.55;
}

a:not([class]) { color: var(--pumpkin); text-underline-offset: 0.18em; }
a:not([class]):hover { color: #ffad6a; }
.card a:not([class]) { color: var(--pumpkin-deep); }
.card a:not([class]):hover { color: var(--pumpkin-press); }

:focus-visible { outline: 3px solid var(--focus-c); outline-offset: 2px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 0; z-index: 30; background: var(--bone); color: var(--ink); padding: 0.6rem 1rem; }
.skip:focus { left: 1rem; }
.js .nojs-only { display: none; }

.wrap { max-width: var(--narrow); margin: 0 auto; padding: 0 16px; }
.wrap.wide, main.wide { max-width: var(--wide); }

h1, h2, h3, h4 { line-height: 1.15; margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.005em; }
h1 { font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.3rem); margin: 2.2rem 0 0.6rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.4rem; }
p { margin: 0.6rem 0; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 36em; }
.fine { font-size: 0.9rem; color: var(--muted); }
.muted { color: var(--muted); font-weight: 400; font-family: var(--body); font-size: 0.9rem; }
.pre { white-space: pre-line; }
code { font-size: 0.9em; background: rgba(0, 0, 0, 0.08); padding: 0.05em 0.35em; border-radius: 4px; }

/* ---------------------------------------------------------------- stripes (used as accents) */

.masthead::after, .bucket > summary::after, .savebar::before {
  content: ""; position: absolute; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(135deg, var(--moon) 0 7px, rgba(0, 0, 0, 0) 7px 14px);
  opacity: 0.55; pointer-events: none;
}

/* ---------------------------------------------------------------- helper update strip */

.updatebar { background: #0d0a11; color: var(--mist); font-size: 0.9rem; border-bottom: 1px solid var(--night-line); }
.updatebar .wrap { max-width: var(--wide); }
.updatebar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; padding-top: 0.4rem; padding-bottom: 0.4rem; }
.upd-msg { margin: 0; margin-right: auto; }
.updatebar.has-update { background: var(--pumpkin-deep); color: var(--paper); }
.updatebar.has-update .btn-primary { background: var(--paper); color: var(--pumpkin-deep); border-color: var(--pumpkin-press); }
.upd-details summary { cursor: pointer; text-decoration: underline; }
.upd-details ul { margin: 0.4rem 0 0.2rem; padding-left: 1.2rem; }
.upd-note { flex-basis: 100%; margin: 0; font-size: 0.85rem; opacity: 0.9; }

/* ---------------------------------------------------------------- masthead */

.masthead { position: relative; background: var(--night-2); }
.masthead::after { bottom: -6px; }
.masthead .wrap { max-width: var(--wide); }
.masthead-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; padding-top: 0.55rem; padding-bottom: 0.55rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem; margin-right: auto;
  font-family: var(--display); font-size: 1.5rem; color: var(--moon); text-decoration: none;
}
.brand:hover { color: var(--moon); }
.brand-mark { width: 1.6rem; height: 1.6rem; fill: var(--gold); transform: rotate(-12deg); }
.mainnav { display: flex; flex-wrap: wrap; gap: 0 0.25rem; }
.mainnav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.4rem 0.65rem;
  color: var(--mist); text-decoration: none;
}
.mainnav a:hover { color: var(--moon); }
.mainnav a[aria-current="page"] {
  color: var(--moon);
  text-decoration: underline wavy var(--pumpkin); text-decoration-thickness: 2px; text-underline-offset: 0.45em;
}
.signout { margin: 0; }
@media (max-width: 40rem) {
  .masthead-row { gap: 0 0.5rem; padding-bottom: 0.2rem; }
  .signout { order: 2; }
  .mainnav { order: 3; flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 32px); margin: 0 -16px; padding: 0 8px; scrollbar-width: none; }
  .mainnav a { white-space: nowrap; }
}

.foot { color: var(--mist); font-size: 0.85rem; padding-top: 3rem; padding-bottom: 2.5rem; max-width: var(--wide); }

/* ---------------------------------------------------------------- the hill */

.hero { position: relative; overflow: hidden; }
.scene { position: absolute; left: 0; bottom: 0; width: 100%; height: clamp(170px, 25vw, 320px); }
.hero-text { position: relative; padding-top: 0.5rem; padding-bottom: clamp(150px, 17vw, 210px); }
.hero-text h1, .hero-text .lead { text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65); }
.newnote { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; color: var(--moon); margin-top: 0.9rem; }

.s-moon { fill: #f3e6bf; }
.s-crater { fill: #d6c493; opacity: 0.75; }
.s-stars { fill: var(--moon); opacity: 0.75; }
.s-hill-far { fill: #2a2034; }
.s-house { fill: #120d16; }
.s-window { fill: var(--pumpkin); opacity: 0.92; }
.s-hill { fill: #0f0b13; }
.s-fence path { fill: none; stroke: #0f0b13; stroke-width: 4; stroke-linecap: round; }
.s-tree path { fill: none; stroke: #0f0b13; stroke-linecap: round; stroke-linejoin: round; }
.s-tree .trunk { stroke-width: 11; }
.s-tree .limb { stroke-width: 6; }
.s-tree .twig { stroke-width: 3.5; }
.s-pumpkin ellipse { fill: #d9702a; }
.s-pumpkin .rib { fill: none; stroke: #9c4a10; stroke-width: 1.6; }
.s-pumpkin .stem { fill: #3d4a22; }
.s-pumpkin .face { fill: #2a1206; }
.bat { fill: #0b080e; animation: flit 2.4s cubic-bezier(.2, .7, .2, 1) both; }
.bat-2 { animation-delay: 0.25s; }
.bat-3 { animation-delay: 0.5s; }
@keyframes flit {
  0% { transform: translate(-170px, 60px) scale(0.5) rotate(-10deg); opacity: 0; }
  35% { opacity: 1; }
  70% { transform: translate(8px, -6px) scale(1.04) rotate(3deg); }
  100% { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .bat { animation: none; }
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ---------------------------------------------------------------- parchment cards */

.card {
  --text: var(--ink); --muted: var(--ink-2); --focus-c: var(--hex-deep); --btn2: var(--ink);
  position: relative; color-scheme: light;
  background: var(--bone); color: var(--ink);
  border-radius: var(--wobble);
  padding: 1.5rem 1.6rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 12px 28px rgba(0, 0, 0, 0.38);
}
.card::before {
  content: ""; position: absolute; inset: 7px; pointer-events: none;
  border: 1.5px dashed var(--stitch); border-radius: inherit; opacity: 0.5;
}
@media (max-width: 40rem) { .card { padding: 1.15rem 1.05rem; } .card::before { inset: 5px; } }
.card h1, .card h2, .card h3 { color: var(--ink); }

/* ---------------------------------------------------------------- buttons */

.btn-primary, .btn-secondary, .btn-quiet, .btn-danger, .btn-ghost, .btn-link {
  font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 44px; padding: 0.55rem 1.05rem; cursor: pointer; text-decoration: none; line-height: 1.2;
  border-radius: var(--wobble-sm); transition: transform 0.12s ease, background-color 0.12s ease;
}
.btn-primary {
  background: var(--pumpkin-deep); color: var(--paper); border: 2px solid var(--pumpkin-press);
  font-weight: 700; box-shadow: 0 3px 0 var(--pumpkin-press);
}
.btn-primary:hover { background: #b84a0d; color: var(--paper); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--pumpkin-press); }
.btn-secondary { background: transparent; color: var(--btn2); border: 2px solid var(--btn2); font-weight: 700; }
.btn-secondary:hover { background: rgba(127, 110, 90, 0.14); color: var(--btn2); }
.btn-quiet, .btn-link { background: none; border: 2px solid transparent; color: var(--muted); padding-left: 0.55rem; padding-right: 0.55rem; }
.btn-quiet:hover, .btn-link:hover { color: var(--text); text-decoration: underline; }
.btn-ghost { background: none; color: inherit; border: 1.5px solid currentColor; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-danger { background: var(--blood); color: var(--paper); border: 2px solid #5e1717; font-weight: 700; }
.btn-small { min-height: 34px; padding: 0.25rem 0.75rem; font-size: 0.9rem; }
.btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.9rem 0; }
.inline { display: inline; margin: 0; }

/* ---------------------------------------------------------------- messages */

.flashes { margin-top: 1.5rem; display: grid; gap: 0.5rem; }
.flash {
  margin: 0; padding: 0.7rem 1rem; color: var(--ink); background: var(--bone);
  border-left: 7px solid var(--gold); border-radius: var(--wobble-sm);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.flash-warn { background: var(--blood-tint); border-left-color: var(--blood); }

.callout { background: var(--bone-2); color: var(--ink); border-radius: var(--wobble-sm); padding: 0.8rem 1rem; margin: 1rem 0; }
.callout p { margin: 0.3rem 0; }
.callout-urgent { box-shadow: inset 7px 0 0 var(--blood), 0 12px 28px rgba(0, 0, 0, 0.38); }
.callout-urgent ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.card .callout { box-shadow: none; }

.badge {
  display: inline-block; font-family: var(--body); font-size: 0.78rem; font-weight: 700; line-height: 1.3;
  padding: 0.12rem 0.55rem; border-radius: 999px; background: var(--bone-2); color: var(--ink); vertical-align: 0.12em;
}
.badge-new { background: var(--pumpkin); color: var(--ink); }
.badge-urgent { background: var(--blood); color: var(--paper); }

/* ---------------------------------------------------------------- moon-phase status icons */

.glyph { display: inline-flex; width: 1.65rem; height: 1.65rem; flex: none; }
.glyph svg { width: 100%; height: 100%; overflow: visible; }
.g-ring { fill: none; stroke: var(--ink-2); stroke-width: 1.7; }
.g-dashed { stroke-dasharray: 3.3 2.6; }
.g-half { fill: var(--ink); }
.g-full { fill: var(--gold); stroke: var(--ink); stroke-width: 1.5; }
.g-crater { fill: var(--gold-deep); opacity: 0.6; }
.g-faint { opacity: 0.4; }
.g-cloud { fill: var(--bone-2); stroke: var(--ink-2); stroke-width: 1.4; stroke-linejoin: round; }

/* ---------------------------------------------------------------- To do and Done */

.bucket { margin-top: 2.25rem; }
.bucket > summary {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding: 0.6rem 0 1rem; min-height: 44px; cursor: pointer; list-style: none;
}
.bucket > summary::-webkit-details-marker { display: none; }
.bucket > summary::after { bottom: 0; border-radius: 3px; }
.bucket-title { font-size: clamp(2.1rem, 1.6rem + 1.8vw, 2.8rem); color: var(--moon); }
.bucket > summary:hover .bucket-title { color: var(--pumpkin); }
.bucket-count {
  font-weight: 700; font-variant-numeric: tabular-nums; padding: 0.15rem 0.75rem;
  border-radius: var(--wobble-sm); background: var(--pumpkin); color: var(--ink);
}
.bucket-done .bucket-count { background: none; color: var(--moon); border: 2px solid var(--moon); }
.bucket-meter { width: min(16rem, 38vw); height: 8px; }
.meter-track { fill: var(--night-3); }
.meter-fill { fill: var(--gold); }
.chev {
  margin-left: auto; width: 0.8rem; height: 0.8rem; flex: none;
  border-right: 3px solid var(--moon); border-bottom: 3px solid var(--moon);
  transform: rotate(45deg) translate(-3px, -3px); transition: transform 0.15s ease;
}
.bucket[open] > summary .chev { transform: rotate(225deg) translate(-3px, -3px); }
.bucket-body { display: grid; gap: 1.75rem; padding-top: 1.5rem; }
.bucket-lead { color: var(--ink-2); margin: 0 0 0.5rem; }

.group { scroll-margin-top: 1rem; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.group-head h3 { font-size: 1.6rem; }
.group-meta { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: var(--ink-2); }
.group-count { margin-left: auto; font-size: 0.9rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.group-lead { color: var(--ink-2); max-width: 46em; margin: 0.4rem 0 0; }
.group-tip { font-size: 0.92rem; background: var(--bone-2); border-radius: var(--wobble-sm); padding: 0.65rem 0.9rem; margin: 0.8rem 0 0; }
.group-urgent { box-shadow: inset 7px 0 0 var(--blood), inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 12px 28px rgba(0, 0, 0, 0.38); }
.group-featured {
  background: var(--paper);
  box-shadow: 0 0 0 3px var(--pumpkin), 0 0 34px rgba(240, 136, 58, 0.28), 0 12px 28px rgba(0, 0, 0, 0.38);
  margin-top: 0.6rem;
}
.ribbon {
  position: absolute; top: -1rem; right: 1.4rem; margin: 0; z-index: 1;
  font-family: var(--display); font-size: 1.1rem; color: var(--ink);
  background: var(--pumpkin); padding: 0.1rem 0.95rem 0.25rem; border-radius: var(--wobble-sm);
  transform: rotate(2.5deg); box-shadow: 0 3px 0 var(--pumpkin-press);
}
.entries { margin-top: 0.8rem; border-top: 1.5px dashed var(--stitch); }
.empty { margin: 0; color: var(--ink-2); }

/* ---------------------------------------------------------------- one item */

.item, .fu {
  display: grid; grid-template-columns: 1.65rem minmax(0, 1fr); gap: 0.9rem;
  padding: 1.15rem 0; border-bottom: 1.5px dashed var(--stitch); scroll-margin-top: 1rem;
}
.entries > :last-child { border-bottom: 0; padding-bottom: 0.25rem; }
.item .glyph, .fu .glyph { margin-top: 0.05rem; }
.item:target, .fu:target {
  background: var(--pumpkin-tint); margin: 0 -0.75rem; padding-left: 0.75rem; padding-right: 0.75rem;
  border-radius: var(--wobble-sm);
}
.item-body, .fu-body { min-width: 0; }
.item-title { margin: 0; font-size: 1.07rem; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; }
.item-detail { margin: 0.25rem 0 0.7rem; color: var(--ink-2); max-width: 46em; }
.state-na .item-title { color: var(--ink-2); }
.item-na { margin: 0.2rem 0 0.5rem; font-size: 0.95rem; color: var(--ink-2); font-style: italic; }
.item-note { margin: 0.2rem 0 0.6rem; font-size: 0.95rem; }
.item-note span { color: var(--ink-2); }
.item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }

.files { list-style: none; padding: 0; margin: 0.35rem 0 0.75rem; display: grid; gap: 5px; }
.files li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.6rem;
  padding: 0.2rem 0.2rem 0.2rem 0.7rem; background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--wobble-sm);
}
.file-name { font-weight: 700; overflow-wrap: anywhere; }
.file-meta { font-size: 0.85rem; color: var(--ink-2); margin-right: auto; font-variant-numeric: tabular-nums; }

.upload { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; }
.upload-btn:focus-within { outline: 3px solid var(--focus-c); outline-offset: 2px; }
.upload-msg { font-size: 0.9rem; color: var(--blood); }
.upload-msg:empty { display: none; }
.is-uploading .upload-btn, .is-saving { opacity: 0.6; pointer-events: none; }

.done-form { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; }
.done-toggle, .finish-toggle {
  display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: 700;
  min-height: 44px; padding: 0.45rem 0.95rem 0.45rem 0.75rem;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--wobble-sm);
}
.done-toggle:hover, .finish-toggle:hover { background: #fff; }
.done-toggle:has(input:checked), .finish-toggle:has(input:checked) { background: var(--gold); }
.done-toggle input, .finish-toggle input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--ink); }

details.note { display: contents; }
details.note > summary { list-style: none; cursor: pointer; }
details.note > summary::-webkit-details-marker { display: none; }
details.note[open] > form { flex-basis: 100%; display: grid; gap: 0.5rem; margin-top: 0.25rem; max-width: 34rem; }
details.note[open] > form .btn-secondary { justify-self: start; }

.survey-item { padding: 0.85rem 0; }
.survey-item .item-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 1rem; }
.survey-item .item-title, .survey-item .item-detail { grid-column: 1; }
.survey-item .item-detail { margin: 0.1rem 0 0; }
.survey-item .item-actions { grid-column: 2; grid-row: 1 / span 2; }
.group-featured .survey-item:first-child .btn-secondary { background: var(--pumpkin-deep); color: var(--paper); border-color: var(--pumpkin-press); box-shadow: 0 3px 0 var(--pumpkin-press); }
.group-featured .survey-item:first-child .btn-secondary:hover { background: #b84a0d; }

/* ---------------------------------------------------------------- Done list */

.donecard { padding-top: 1.2rem; }
.donelist { list-style: none; padding: 0; margin: 0; border-top: 1.5px dashed var(--stitch); }
.done-row { border-bottom: 1.5px dashed var(--stitch); scroll-margin-top: 1rem; }
.donelist li:last-child .done-row { border-bottom: 0; }
.done-row > summary {
  display: grid; grid-template-columns: 1.65rem minmax(0, 1fr); gap: 0.1rem 0.9rem; align-items: start;
  padding: 0.75rem 0; cursor: pointer; list-style: none;
}
.done-row > summary::-webkit-details-marker { display: none; }
.done-row > summary .glyph { grid-row: span 2; }
.done-title { font-weight: 700; }
.done-meta { font-size: 0.9rem; color: var(--ink-2); overflow-wrap: anywhere; }
.done-row > summary:hover .done-title { text-decoration: underline; text-underline-offset: 0.18em; }
.done-row[open] > summary .done-title { color: var(--pumpkin-deep); }
.done-body { padding: 0 0 1.1rem 2.55rem; }
.done-body .item, .done-body .fu { display: block; padding: 0; border: 0; }
.done-body .glyph, .done-body .item-title { display: none; }
.done-body .item-detail { margin-top: 0; }
.done-body .survey-item .item-actions { grid-row: auto; }

.privacy { margin-top: 3rem; }
.privacy h2 { color: var(--moon); }
.privacy ul { padding-left: 1.2rem; color: var(--mist); }
.privacy li { margin: 0.35rem 0; }

/* ---------------------------------------------------------------- form fields */

input[type="text"], input[type="password"], textarea, select {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--field); border-radius: var(--wobble-sm);
  padding: 0.5rem 0.7rem; width: 100%; min-height: 44px;
}
textarea { resize: vertical; min-height: 5.5rem; }
input.short { max-width: 10rem; }
input:hover, textarea:hover, select:hover { border-color: var(--ink); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--pumpkin-deep); width: 1.15rem; height: 1.15rem; margin: 0.2rem 0 0; flex: none; }
input[type="file"] { font: inherit; font-size: 0.95rem; max-width: 100%; }

.money { position: relative; display: block; }
.money > span { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.money > input { padding-left: 1.45rem; }
.short-money { max-width: 12rem; }

/* ---------------------------------------------------------------- questions page */

.qnav ol { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.qnav li {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.92rem;
  padding: 0.2rem 0.7rem; background: var(--night-3); border: 1.5px solid var(--night-line); border-radius: 999px;
}
.qnav li a { color: var(--moon); text-decoration: none; padding: 0.2rem 0; }
.qnav li a:hover { text-decoration: underline; }
.qnav-count { color: var(--mist); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.qnav li.started { border-color: var(--pumpkin); }
.qnav li.finished { background: var(--gold); border-color: var(--gold); }
.qnav li.finished a, .qnav li.finished .qnav-count { color: var(--ink); }

.qsec { margin-top: 2rem; scroll-margin-top: 1rem; }
.qsec h2 { display: flex; align-items: center; gap: 0.7rem; font-size: 1.9rem; }
.qsec-num {
  display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; flex: none;
  font-family: var(--body); font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--pumpkin-deep); color: var(--paper); border-radius: 50% 46% 52% 48% / 48% 52% 46% 50%;
}
.qsec-intro { color: var(--ink-2); }

.q { margin: 1.5rem 0; }
.qlabel { display: block; font-weight: 700; margin: 0 0 0.3rem; padding: 0; }
.qhelp { margin: 0 0 0.45rem; color: var(--muted); font-size: 0.95rem; }
fieldset.choices { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice {
  display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; max-width: 32rem;
  padding: 0.55rem 0.75rem; margin-bottom: 6px;
  background: var(--paper); border: 1.5px solid var(--rule); border-radius: var(--wobble-sm);
}
.choice:hover { border-color: var(--ink-2); }
.choice:has(input:checked) { border-color: var(--pumpkin-deep); background: var(--pumpkin-tint); }
.clear-choice { font-size: 0.9rem; }

.rrows { display: grid; gap: 0.75rem; }
.rrow {
  margin: 0; padding: 0.85rem; min-width: 0;
  background: var(--bone-2); border: 1.5px dashed var(--stitch); border-radius: var(--wobble-sm);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.6rem 0.7rem;
}
.rcell { display: block; min-width: 0; }
.rcell-wide { grid-column: span 2; }
.rcell-full { grid-column: 1 / -1; }
.rlabel { display: block; font-size: 0.82rem; font-weight: 700; color: var(--ink-2); margin-bottom: 0.2rem; }
.rrow-remove { grid-column: 1 / -1; justify-self: end; font-size: 0.9rem; min-height: 36px; }
.add-row { margin-top: 0.75rem; }
@media (max-width: 22rem) { .rcell-wide { grid-column: auto; } }

.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0 1.5rem; margin-top: 0.4rem; }
.mcell { display: grid; grid-template-columns: 1fr 7.5rem; align-items: center; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px dashed var(--stitch); }
.mlabel { font-size: 0.95rem; }

.finish { margin-top: 2rem; padding-top: 1.1rem; border-top: 1.5px dashed var(--stitch); }
.finish .qhelp { margin-top: 0.5rem; }

.has-savebar main { padding-bottom: 6rem; }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--night-2); box-shadow: 0 -8px 22px rgba(0, 0, 0, 0.45); }
.savebar::before { top: -6px; }
.savebar .wrap { max-width: var(--wide); }
.savebar-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.save-status { margin: 0; color: var(--muted); font-size: 0.95rem; }
.save-status.is-error { color: #ffb4a6; font-weight: 700; }
.card .save-status.is-error { color: var(--blood); }

/* ---------------------------------------------------------------- follow-up requests */

.round { margin-top: 2rem; }
.docsec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.docsec-count { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.docsec-lead { color: var(--ink-2); max-width: 46em; }
.fus { margin-top: 0.8rem; border-top: 1.5px dashed var(--stitch); }
.fu-body > .upload { margin: 0.2rem 0 0.75rem; }
.fu-body > .done-form { margin: 0 0 0.75rem; }
.fu-form { display: grid; gap: 0.5rem; margin: 0; }
.fu-form [data-qid] { display: grid; gap: 0.6rem; max-width: 46rem; }
.fu-form .rtable { margin-top: 0.25rem; }
.fu-note > summary { list-style: none; cursor: pointer; display: inline-flex; }
.fu-note > summary::-webkit-details-marker { display: none; }
.fu-note[open] > summary { color: var(--ink-2); font-size: 0.9rem; min-height: 0; padding-bottom: 0.2rem; }
.cant { display: inline-flex; align-items: flex-start; gap: 0.55rem; font-size: 0.95rem; color: var(--ink-2); cursor: pointer; }
.state-na .cant { color: var(--ink); }
.fu-save { display: flex; align-items: center; gap: 0.75rem; min-height: 1.5rem; }
.fu-save .save-status { font-size: 0.88rem; }
.js .fu-save:has(.save-status:empty) { display: none; }

/* ---------------------------------------------------------------- tables */

.rtable { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.rtable th, .rtable td { text-align: left; vertical-align: top; padding: 0.6rem 0.5rem; border-bottom: 1px dashed var(--stitch); }
.rtable thead th { font-family: var(--body); font-size: 0.85rem; color: var(--ink-2); border-bottom: 2px solid var(--rule); }
.rtable th[scope="row"] { font-weight: 700; }
.rtable select { min-width: 9rem; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
@media (max-width: 44rem) {
  .rtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rtable, .rtable tbody, .rtable tr, .rtable th, .rtable td { display: block; width: 100%; }
  .rtable tr { border: 1.5px dashed var(--stitch); border-radius: var(--wobble-sm); background: var(--paper); padding: 0.4rem 0.75rem; margin-bottom: 0.75rem; }
  .rtable th, .rtable td { border: 0; padding: 0.35rem 0; }
  .rtable td { display: grid; grid-template-columns: 6.5rem 1fr; align-items: center; gap: 0.5rem; }
  .rtable td::before { content: attr(data-label); font-size: 0.85rem; color: var(--ink-2); }
  .rtable th[scope="row"] { font-size: 1.02rem; }
  .rtable td.num { text-align: left !important; }
}

/* ---------------------------------------------------------------- review (helper) */

.rv { margin-top: 1.75rem; scroll-margin-top: 1rem; }
.rv h2 { font-size: 1.8rem; }
.rv h3 { font-family: var(--body); font-weight: 700; font-size: 1.05rem; margin-top: 1.5rem; }
.rv-details { margin: 0.75rem 0; }
.rv-details summary { cursor: pointer; font-weight: 700; padding: 0.4rem 0; }
.tablewrap { overflow-x: auto; margin: 0.6rem 0; }
.dtable { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.dtable caption { text-align: left; font-weight: 700; padding: 0.5rem 0; }
.dtable th, .dtable td { text-align: left; vertical-align: top; padding: 0.4rem 0.5rem; border-bottom: 1px dashed var(--stitch); }
.dtable thead th { font-family: var(--body); color: var(--ink-2); font-size: 0.82rem; border-bottom: 2px solid var(--rule); }
.rv-items { list-style: none; padding: 0; margin: 0.5rem 0 0; border-top: 1px dashed var(--stitch); }
.rv-items > li { display: grid; grid-template-columns: 1.65rem 1fr; gap: 0.7rem; padding: 0.5rem 0; border-bottom: 1px dashed var(--stitch); }
.rv-title { font-weight: 700; }
.state-needed .rv-title { color: var(--ink-2); font-weight: 400; }
.rv-files { list-style: none; padding: 0; margin: 0.2rem 0 0; font-size: 0.95rem; }
.rv-files li { overflow-wrap: anywhere; }
dl.answers { margin: 0.5rem 0 0; }
dl.answers dt { font-weight: 700; margin-top: 0.9rem; }
dl.answers dd { margin: 0.15rem 0 0; }
.log { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.78rem; line-height: 1.5; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 0.75rem; overflow: auto; max-height: 22rem; }
.danger h2 { color: var(--blood); }
.wipe-form, .round-form { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.wipe-form { max-width: 22rem; }
.wipe-form .btn-danger, .round-form .btn-primary { justify-self: start; }
.round-form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
textarea.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.85rem; line-height: 1.45; }
.rounds-table .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.rounds-table .actions .btn-primary { min-height: 36px; padding: 0.3rem 0.8rem; }

/* ---------------------------------------------------------------- sign in, updating */

.page-login main { position: relative; z-index: 1; }
.login-scene { position: fixed; left: 0; right: 0; bottom: 0; height: clamp(190px, 34vh, 340px); z-index: 0; }
.login-scene .scene { height: 100%; }
.login { max-width: 27rem; margin: 9vh auto 40vh; }
.login h1 { margin-top: 0.5rem; font-size: 2.3rem; }
.login-mark { width: 2.6rem; height: 2.6rem; fill: var(--gold); stroke: var(--ink); stroke-width: 0.8; transform: rotate(-12deg); display: block; }
.login-form { display: grid; gap: 0.35rem; margin-top: 1.4rem; }
.login-form .btn-primary { margin-top: 0.8rem; justify-self: start; }

.updating { max-width: 36rem; margin: 3rem auto; }
.updating h1 { margin-top: 0; }

/* ---------------------------------------------------------------- helper dashboard */

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
@media (max-width: 52rem) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-hero, .kpis .kpi:last-child:nth-child(even) { grid-column: 1 / -1; }
}
.kpi { padding: 1.1rem 1.3rem; }
.kpi-label { margin: 0; font-size: 0.9rem; color: var(--ink-2); }
.kpi-value { margin: 0.2rem 0 0; font-size: 1.65rem; font-weight: 700; line-height: 1.15; }
.hero-figure { margin: 0.1rem 0 0; font-size: 3.6rem; font-weight: 700; line-height: 1; letter-spacing: -0.01em; }
.kpi-sub { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--ink-2); }
.kpi-meter { display: block; width: 100%; height: 8px; margin-top: 0.8rem; }
.meter-track-light { fill: #ddd0b4; }
.meter-fill-dark { fill: #5f2305; }

.dash-card { margin-top: 1.5rem; }
.dash-card h2 { font-size: 1.65rem; }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; }
.chart-sub { color: var(--ink-2); margin: 0.35rem 0 0.75rem; max-width: 46em; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0 0 0 auto; padding: 0; font-size: 0.9rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.key { display: inline-block; flex: none; }
.key-line { width: 18px; height: 0; border-top: 2px solid; border-radius: 2px; }
.key-done { border-color: #5f2305; }
.key-scope { border-color: var(--ink-2); }
.key-swatch { width: 12px; height: 12px; border-radius: 3px; }

.chart { margin: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .chart-sm { display: none; }
@media (max-width: 40rem) {
  .chart .chart-lg { display: none; }
  .chart .chart-sm { display: block; }
}
.grid-line { stroke: #d9ccb0; stroke-width: 1; }
.axis-text { fill: var(--ink-2); font-family: var(--body); font-size: 11px; font-variant-numeric: tabular-nums; }
.bu-area { fill: #5f2305; opacity: 0.1; }
.bu-done { fill: none; stroke: #5f2305; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bu-scope { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linejoin: round; }
.end-dot, .hit-dot { fill: #5f2305; stroke: var(--bone); stroke-width: 2; }
.end-label { fill: var(--ink); font-family: var(--body); font-size: 12px; font-weight: 700; }
.end-label-muted { fill: var(--ink-2); }
.hit-area { fill: transparent; }
.xhair { stroke: var(--ink-2); stroke-width: 1; opacity: 0; }
.hit-dot { opacity: 0; }
.hit:hover .xhair, .hit:focus .xhair, .hit:hover .hit-dot, .hit:focus .hit-dot { opacity: 1; }
.hit:focus, .col-hit:focus, .seg:focus { outline: none; }
.hit:focus-visible .xhair { stroke: var(--hex-deep); stroke-width: 2; }
.col { fill: #5f2305; }
.col-hit:hover .col, .col-hit:focus .col { fill: #8a3a0d; }
.col-hit:focus-visible .hit-area { fill: rgba(74, 42, 109, 0.12); }

.seg-done { fill: #5f2305; background: #5f2305; }
.seg-started { fill: #a04c14; background: #a04c14; }
.seg-todo { fill: #c98a55; background: #c98a55; }
.seg:hover, .seg:focus { opacity: 0.85; }
.seg:focus-visible { stroke: var(--hex-deep); stroke-width: 0.6; }
.areas { list-style: none; padding: 0; margin: 0.9rem 0 0; display: grid; gap: 0.6rem; }
.area-row { display: grid; grid-template-columns: minmax(9rem, 16rem) minmax(0, 1fr) 3.5rem; align-items: center; gap: 0.8rem; }
.area-label { font-size: 0.95rem; }
.area-bar { display: block; width: 100%; height: 14px; }
.area-count { text-align: right; font-size: 0.9rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) {
  .area-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 0.8rem; }
  .area-bar { grid-column: 1 / -1; grid-row: 2; }
}
.tableview { margin-top: 0.75rem; }
.tableview summary { cursor: pointer; color: var(--ink-2); font-size: 0.9rem; }

.nudges { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.75rem; }
.nudge { padding: 0.6rem 0.85rem; background: var(--paper); border-radius: var(--wobble-sm); border-left: 5px solid var(--rule); }
.nudge-warn { border-left-color: var(--blood); }
.nudge-title { margin: 0; font-weight: 700; }
.nudge-items { margin: 0.35rem 0 0; padding-left: 1.2rem; color: var(--ink-2); }

.feed-day { font-family: var(--body); font-weight: 700; font-size: 0.95rem; color: var(--ink-2); margin: 1rem 0 0.3rem; }
.feed { list-style: none; padding: 0; margin: 0; border-top: 1px dashed var(--stitch); }
.feed li { display: grid; grid-template-columns: 5.2rem 1fr; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px dashed var(--stitch); }
.feed-time { color: var(--ink-2); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) { .feed li { grid-template-columns: 4.6rem 1fr; } }
.feed-more { margin: 0.8rem 0 0; font-size: 0.9rem; }

.chart-tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 16rem;
  background: var(--ink); color: var(--paper); border-radius: 6px; padding: 0.45rem 0.65rem;
  font-size: 0.85rem; line-height: 1.35; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.chart-tip .tip-title { color: #cdbfd6; font-size: 0.8rem; margin-bottom: 0.15rem; }
.chart-tip strong { font-weight: 700; }

@media print {
  .updatebar, .masthead, .hero, .savebar, .item-actions, .foot { display: none; }
  body { background: #fff; color: #000; }
}
