/* Winter Arc Contract: night sky, ice, paper. */
:root {
  --night: #0a1420;
  --night-2: #0f1d2e;
  --night-3: #142740;
  --line-soft: rgba(156, 207, 239, .12);
  --line: rgba(156, 207, 239, .22);
  --ice: #dbe8f4;
  --ice-dim: #a9bfd3;
  --ice-mute: #7f97ad;
  --frost: #9ccfef;
  --frost-strong: #5aa8dc;
  --paper: #faf6ee;
  --paper-2: #f2ecdf;
  --ink: #1b2532;
  --ink-soft: #586577;
  --ink-blue: #1f3b63;
  --ok: #46a876;
  --warn: #d39443;
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -20px rgba(0, 0, 0, .55);
  --serif: "Fraunces", "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Segoe Script", cursive;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--night);
  color: var(--ice);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(156, 207, 239, .35); color: #fff; }
a { color: var(--frost); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #fff; }
img, svg, canvas { max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--frost); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 30;
  background: rgba(10, 20, 32, .72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.site-head .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 600 18px/1 var(--serif); letter-spacing: -.005em; }
.brand svg { width: 26px; height: 26px; color: var(--frost); stroke-width: 1.6; }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; font-size: 15px; }
.nav a { color: var(--ice-dim); text-decoration: none; padding: 8px 12px; border-radius: 999px; transition: color .2s, background .2s; }
.nav a:hover { color: #fff; background: rgba(156, 207, 239, .08); }
.nav a[aria-current="page"] { color: #fff; background: rgba(156, 207, 239, .12); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; padding: clamp(64px, 11vw, 132px) 0 clamp(56px, 8vw, 96px); text-align: center; }
.hero-art {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 20, 32, .25) 0%, rgba(10, 20, 32, .35) 45%, var(--night) 100%),
    radial-gradient(1200px 500px at 50% -10%, rgba(90, 168, 220, .30), transparent 70%),
    var(--hero-img, url("/assets/img/hero.webp")) center 38% / cover no-repeat,
    linear-gradient(180deg, #08111c, #0d1d31 60%, var(--night));
}
.hero-inner { max-width: 820px; }
@media (max-width: 700px) { .hero-art { --hero-img: url("/assets/img/hero-960.webp"); } }
.eyebrow { display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(10, 20, 32, .45); font: 600 12px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--frost); backdrop-filter: blur(6px); }
.hero h1 { font: 600 clamp(36px, 6.4vw, 68px)/1.04 var(--serif); margin: 0 0 20px; color: #fff; letter-spacing: -.02em; text-wrap: balance; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--frost); }
.hero-sub { margin: 0 auto; max-width: 620px; font-size: clamp(17px, 2vw, 19px); color: #c5d6e6; text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }
.trust { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; font-size: 14px; color: var(--ice-dim); }
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust svg { width: 16px; height: 16px; color: var(--ok); stroke-width: 2.4; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: 600 15px/1 var(--sans); padding: 13px 18px; border-radius: 12px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); background: rgba(156, 207, 239, .04); color: #fff;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.btn:hover { border-color: var(--frost); color: #fff; background: rgba(156, 207, 239, .09); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary {
  background: linear-gradient(180deg, #bfe2f7, #8cc4ec); border-color: transparent; color: #0a1420;
  box-shadow: 0 10px 30px -10px rgba(140, 196, 236, .6), 0 1px 0 rgba(255, 255, 255, .5) inset;
}
.btn.primary:hover { background: linear-gradient(180deg, #d3ecfa, #a3d2f1); color: #0a1420; }
.btn.ghost { background: rgba(10, 20, 32, .35); backdrop-filter: blur(6px); }
.btn.large { padding: 16px 24px; font-size: 16px; border-radius: 14px; }
.btn.small { padding: 10px 14px; font-size: 14px; }
.link-btn { background: none; border: 0; color: var(--ice-dim); font: 500 14px/1.4 var(--sans); cursor: pointer; padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(156, 207, 239, .4); }
.link-btn:hover { color: #fff; }

/* ---------- Builder ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 4vw, 48px); padding: 8px 0 72px; align-items: start; scroll-margin-top: 80px; }
.panel { background: linear-gradient(180deg, rgba(20, 39, 64, .72), rgba(15, 29, 46, .9)); border: 1px solid var(--line-soft); border-radius: 22px; padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow); scroll-margin-top: 80px; }

.progress { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 26px; padding: 0; counter-reset: none; }
.progress li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ice-mute); padding: 8px 10px; border-radius: 10px; background: rgba(10, 20, 32, .45); border: 1px solid transparent; transition: color .25s, background .25s, border-color .25s; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress li span { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); font-size: 11px; font-weight: 600; transition: all .25s; }
.progress li.done { color: #dff3e8; background: rgba(70, 168, 118, .12); border-color: rgba(70, 168, 118, .3); }
.progress li.done span { background: var(--ok); border-color: var(--ok); color: transparent; position: relative; }
.progress li.done span::after { content: ""; position: absolute; width: 8px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

.step + .step { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.step h2 { font: 600 21px/1.25 var(--serif); margin: 0 0 6px; color: #fff; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.step h2 > span { flex-basis: 100%; color: var(--frost); font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px; }
.hint { margin: 0 0 14px; font-size: 14.5px; color: var(--ice-mute); }
.sub-label { margin: 20px 0 4px; font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ice-mute); }

label.field { display: block; font-size: 14px; font-weight: 500; color: var(--ice-dim); margin: 14px 0 7px; }
label.field small { font-weight: 400; color: var(--ice-mute); }
input[type="text"], input[type="date"], select {
  width: 100%; font: inherit; font-size: 16px; color: #fff; background: rgba(6, 13, 22, .6);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px;
  color-scheme: dark; transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder { color: #5f758a; }
input:hover, select:hover { border-color: rgba(156, 207, 239, .4); }
input:focus, select:focus { outline: none; border-color: var(--frost); box-shadow: 0 0 0 4px rgba(156, 207, 239, .16); background: rgba(6, 13, 22, .8); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ccfef' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg-btn {
  font: 600 15px/1.2 var(--sans); color: #fff; text-align: left; cursor: pointer;
  background: rgba(6, 13, 22, .5); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 3px; transition: border-color .2s, background .2s;
}
.seg-btn small { font-weight: 400; font-size: 13px; color: var(--ice-mute); }
.seg-btn:hover { border-color: rgba(156, 207, 239, .5); }
.seg-btn[aria-pressed="true"] { border-color: var(--frost); background: rgba(156, 207, 239, .12); box-shadow: 0 0 0 1px var(--frost) inset; }
.date-summary { margin: 12px 0 0; font-size: 14px; color: var(--ice-dim); min-height: 1.4em; }
.date-summary b { color: #fff; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-group + .chip-group { margin-top: 16px; }
.chip-group h3 { margin: 0 0 9px; font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ice-mute); }
.chip {
  font: inherit; font-size: 14px; color: var(--ice); background: rgba(6, 13, 22, .45); cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 38px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .2s, border-color .2s, color .2s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.chip::before { content: "+"; font-weight: 600; color: var(--frost); width: 10px; text-align: center; }
.chip:hover { border-color: var(--frost); }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--frost); border-color: var(--frost); color: var(--night); font-weight: 600; }
.chip[aria-pressed="true"]::before { content: "\2713"; color: var(--night); }
.chip.more { border-style: dashed; color: var(--frost); }
.chip.more::before { content: none; }
.motto-ideas { margin-top: 10px; }
.motto-ideas .chip { font-style: italic; font-family: var(--serif); }
.motto-ideas .chip::before { content: none; }

.rule-count { font: 600 12px/1 var(--sans); padding: 5px 9px; border-radius: 999px; background: rgba(156, 207, 239, .12); color: var(--frost); letter-spacing: .02em; }
.rule-count.good { background: rgba(70, 168, 118, .16); color: #9fe0bd; }
.rule-count.warn { background: rgba(211, 148, 67, .16); color: #f2cf9f; }

.rule-list { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: rule; }
.rule-list li { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 14px; border-radius: 12px; background: rgba(6, 13, 22, .5); border: 1px solid var(--line-soft); margin-top: 8px; font-size: 15px; animation: rule-in .25s var(--ease); }
@keyframes rule-in { from { opacity: 0; transform: translateY(-4px); } }
.rule-list li::before { counter-increment: rule; content: counter(rule); flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(156, 207, 239, .14); color: var(--frost); font-size: 12px; font-weight: 600; }
.rule-list li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rule-list button { flex: none; width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 0; border-radius: 10px; color: var(--ice-mute); cursor: pointer; font-size: 20px; line-height: 1; }
.rule-list button:hover { color: #fff; background: rgba(156, 207, 239, .1); }
.rule-list:empty::after { content: "No rules yet. Tap a suggestion above."; display: block; margin-top: 8px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--ice-mute); font-size: 14px; text-align: center; }
.add-rule { display: flex; gap: 8px; margin-top: 10px; }
.add-rule input { flex: 1; }

.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; font-size: 15px; color: var(--ice-dim); cursor: pointer; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(6, 13, 22, .35); }
.check strong { color: #fff; font-weight: 600; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--frost); }

/* ---------- Preview ---------- */
.preview { position: sticky; top: 88px; scroll-margin-top: 80px; }
.preview-label { display: flex; align-items: center; gap: 8px; font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ice-mute); margin: 4px 0 14px; }
.preview-label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(70, 168, 118, .18); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(70, 168, 118, .05); } }
.paper-wrap { position: relative; }
.seal { position: absolute; right: -14px; bottom: -22px; width: clamp(84px, 11vw, 116px); height: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); transform: rotate(-12deg); pointer-events: none; }

.contract {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, .7), transparent 60%),
    linear-gradient(180deg, var(--paper), var(--paper-2));
  color: var(--ink); border-radius: 8px;
  padding: clamp(26px, 4.2vw, 46px) clamp(22px, 4vw, 44px) clamp(30px, 4.4vw, 50px);
  box-shadow: 0 2px 0 rgba(255, 255, 255, .6) inset, 0 40px 80px -30px rgba(0, 0, 0, .7), 0 12px 24px -12px rgba(0, 0, 0, .5);
  font-family: var(--serif); position: relative;
}
.contract::before { content: ""; position: absolute; inset: 12px; border: 1px solid #ddd3c1; border-radius: 4px; pointer-events: none; }
.contract::after { content: ""; position: absolute; inset: 16px; border: 1px solid rgba(221, 211, 193, .55); border-radius: 3px; pointer-events: none; }
.contract .c-kicker { font: 600 11px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--ink-soft); text-align: center; }
.contract .c-title { font-size: clamp(28px, 3.6vw, 38px); font-weight: 600; text-align: center; margin: 12px 0 6px; letter-spacing: -.01em; }
.contract .c-dates { text-align: center; font: 500 13.5px/1.4 var(--sans); color: var(--ink-soft); padding-bottom: 16px; border-bottom: 1px solid #e3d9c7; }
.contract .c-body { font-size: 16.5px; line-height: 1.6; margin: 18px 0 10px; }
.contract ol { margin: 0 0 14px; padding-left: 24px; font-size: 16.5px; }
.contract ol li { padding: 3px 0 3px 4px; }
.contract ol li::marker { color: var(--frost-strong); font-weight: 600; }
.contract .c-clause { font-size: 14px; color: var(--ink-soft); font-style: italic; margin: 6px 0; }
.contract .c-motto { text-align: center; font-size: 19px; font-style: italic; margin: 20px 0 6px; color: var(--ink-blue); }
.contract .c-sign { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin-top: 28px; align-items: end; }
.contract .c-line { border-top: 1px solid var(--ink); padding-top: 7px; font: 600 10.5px/1.3 var(--sans); color: var(--ink-soft); letter-spacing: .14em; text-transform: uppercase; }
.contract .c-sig { font: 38px/1 var(--hand); color: var(--ink-blue); min-height: 40px; padding-bottom: 2px; overflow-wrap: anywhere; }
.contract .c-date { font: 15px/1 var(--sans); padding-bottom: 8px; }
.contract .c-empty { color: var(--ink-soft); font-style: italic; }

.exports { display: grid; gap: 12px; margin-top: 30px; }
.exports > .btn.primary { width: 100%; }
.export-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; cursor: pointer;
  font: inherit; color: #fff; padding: 14px; border-radius: 14px; min-height: 108px;
  background: rgba(20, 39, 64, .55); border: 1px solid var(--line-soft);
  transition: border-color .2s, background .2s, transform .15s var(--ease);
}
.tile svg { width: 22px; height: 22px; color: var(--frost); margin-bottom: 6px; }
.tile b { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.tile small { font-size: 12.5px; color: var(--ice-mute); line-height: 1.35; }
.tile:hover { border-color: var(--frost); background: rgba(20, 39, 64, .85); }
.tile:active { transform: scale(.98); }
.tile[aria-busy="true"] { opacity: .6; cursor: progress; }
.exports .link-btn { justify-self: center; }
.export-note { font-size: 13px; color: var(--ice-mute); margin: 8px 0 0; text-align: center; min-height: 1.3em; }

/* Toast */
.toast-region { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: rgba(15, 29, 46, .96); border: 1px solid var(--line); color: #fff; font-size: 14.5px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6); animation: toast-in .3s var(--ease); backdrop-filter: blur(10px); }
.toast svg { width: 18px; height: 18px; color: var(--ok); flex: none; stroke-width: 2.4; }
.toast.out { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Content sections ---------- */
.section { padding: clamp(56px, 8vw, 88px) 0; border-top: 1px solid var(--line-soft); }
.section h2 { font: 600 clamp(26px, 3.4vw, 36px)/1.15 var(--serif); color: #fff; margin: 0 0 16px; letter-spacing: -.01em; text-wrap: balance; }
.section p, .section li { color: #c3d3e2; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.steps > div { background: linear-gradient(180deg, rgba(20, 39, 64, .6), rgba(15, 29, 46, .6)); border-radius: var(--radius); padding: 24px; border: 1px solid var(--line-soft); }
.steps i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(156, 207, 239, .1); color: var(--frost); margin-bottom: 16px; }
.steps i svg { width: 22px; height: 22px; }
.steps b { display: block; color: #fff; font: 600 18px/1.3 var(--serif); margin-bottom: 8px; }
.steps p { margin: 0; font-size: 15px; }
.prose { max-width: 740px; }
.prose h2 { margin-top: 44px; }
.prose h3 { font: 600 21px/1.3 var(--serif); color: #fff; margin: 30px 0 8px; }
.prose li { margin: 6px 0; }
.prose strong { color: #fff; }
.faq details { background: rgba(20, 39, 64, .45); border-radius: 14px; margin-top: 10px; border: 1px solid var(--line-soft); transition: background .2s; }
.faq details[open] { background: rgba(20, 39, 64, .75); }
.faq summary { cursor: pointer; color: #fff; font-weight: 600; padding: 16px 48px 16px 18px; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 20px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--frost); border-bottom: 2px solid var(--frost); transform: translateY(-70%) rotate(45deg); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: 0; padding: 0 18px 18px; }
.cta { text-align: center; }
.cta p { margin: 0 0 18px; }

/* ---------- Article pages ---------- */
.article { padding: clamp(40px, 6vw, 64px) 0 64px; }
.article h1 { font: 600 clamp(32px, 4.8vw, 50px)/1.1 var(--serif); color: #fff; margin: 0 0 16px; letter-spacing: -.015em; text-wrap: balance; }
.article .lede { font-size: clamp(18px, 2vw, 20px); color: #bed0e1; margin: 0 0 28px; }
.article table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.article th, .article td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.article th { color: #fff; font-weight: 600; }
.callout { background: rgba(20, 39, 64, .6); border-left: 3px solid var(--frost); border-radius: 0 14px 14px 0; padding: 16px 20px; margin: 24px 0; }

/* ---------- Tracker ---------- */
.tracker-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; justify-content: space-between; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 24px 0 14px; }
.stat { background: linear-gradient(180deg, rgba(20, 39, 64, .7), rgba(15, 29, 46, .7)); border-radius: 16px; padding: 16px 18px; border: 1px solid var(--line-soft); }
.stat b { display: block; font: 600 30px/1.1 var(--serif); color: #fff; letter-spacing: -.01em; }
.stat span { font-size: 13px; color: var(--ice-mute); }
.bar { height: 8px; border-radius: 99px; background: rgba(6, 13, 22, .7); overflow: hidden; border: 1px solid var(--line-soft); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--frost-strong), var(--frost)); border-radius: 99px; transition: width .6s var(--ease); }
.today { margin-top: 30px; }
.today h2 { margin: 0 0 4px; font: 600 24px/1.2 var(--serif); color: #fff; }
.todo { list-style: none; padding: 0; margin: 16px 0 0; }
.todo li { margin-top: 10px; }
.todo label { display: flex; gap: 14px; align-items: center; background: rgba(15, 29, 46, .8); border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px 18px; cursor: pointer; font-size: 16px; min-height: 60px; transition: border-color .2s, background .2s, transform .12s; -webkit-tap-highlight-color: transparent; }
.todo label:hover { border-color: var(--line); }
.todo label:active { transform: scale(.995); }
.todo input { appearance: none; -webkit-appearance: none; flex: none; width: 26px; height: 26px; margin: 0; border-radius: 8px; border: 2px solid rgba(156, 207, 239, .45); display: grid; place-items: center; cursor: pointer; transition: all .2s var(--ease); }
.todo input::after { content: ""; width: 10px; height: 5px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0); transition: transform .2s var(--ease); margin-top: -2px; }
.todo input:checked { background: var(--ok); border-color: var(--ok); }
.todo input:checked::after { transform: rotate(-45deg) scale(1); }
.todo input:disabled { opacity: .4; cursor: not-allowed; }
.todo label:has(input:checked) { border-color: rgba(70, 168, 118, .5); background: rgba(70, 168, 118, .08); color: #d4efe0; }
.todo label:has(input:checked) span { text-decoration: line-through; text-decoration-color: rgba(212, 239, 224, .35); }
.notice { margin-top: 14px; padding: 14px 18px; border-radius: 14px; font-size: 15px; }
.notice.warn { background: rgba(211, 148, 67, .12); border: 1px solid rgba(211, 148, 67, .35); color: #f2d5ae; }
.notice.good { background: rgba(70, 168, 118, .12); border: 1px solid rgba(70, 168, 118, .35); color: #cdeedd; }
.grid-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 6px; margin-top: 16px; }
.grid-days button {
  aspect-ratio: 1; border-radius: 9px; border: 1px solid var(--line-soft); background: rgba(15, 29, 46, .8);
  color: var(--ice-mute); font: 500 12px/1 var(--sans); cursor: pointer; padding: 0; transition: transform .12s, background .2s;
}
.grid-days button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--line); }
.grid-days button[data-level="1"] { background: rgba(156, 207, 239, .22); color: #fff; }
.grid-days button[data-level="2"] { background: rgba(156, 207, 239, .45); color: #fff; }
.grid-days button[data-level="3"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.grid-days button[data-future] { opacity: .3; cursor: default; }
.grid-days button[aria-current="date"] { outline: 2px solid #fff; outline-offset: 1px; }
.grid-days button[aria-pressed="true"] { outline: 2px solid var(--frost); outline-offset: 1px; }
.empty-state { text-align: center; padding: 44px 24px; }
.empty-state h2 { font: 600 26px/1.2 var(--serif); color: #fff; margin: 0 0 8px; }
.celebrate { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.celebrate i { position: absolute; top: -20px; width: 8px; height: 8px; border-radius: 50%; background: #e8f4fd; opacity: .9; animation: flake 1.8s ease-in forwards; }
@keyframes flake { to { transform: translate(var(--dx, 0), 105vh) rotate(180deg); opacity: 0; } }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line-soft); padding: 32px 0 44px; font-size: 14px; color: var(--ice-mute); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-foot a { color: var(--ice-dim); text-decoration: none; }
.site-foot a:hover { color: #fff; }
.lang-switch { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; border: 1px solid var(--line-soft); }
.lang-switch a { padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.lang-switch a[aria-current="true"] { background: rgba(156, 207, 239, .14); color: #fff; }

.jump { display: none; }
.print-sheet { display: none; }

@media (max-width: 900px) {
  .builder { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jump { display: flex; position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s var(--ease); }
  .jump.in-form { opacity: 1; transform: none; pointer-events: auto; }
  .jump[hidden] { display: none; }
}
@media (max-width: 560px) {
  .site-head { position: static; }
  .site-head .wrap { gap: 4px 16px; padding: 10px 0; min-height: 0; }
  .nav { margin-left: -12px; font-size: 14px; }
  .nav a { padding: 6px 10px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .progress li { font-size: 0; justify-content: center; padding: 8px 4px; }
  .progress li span { font-size: 11px; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .export-grid { grid-template-columns: minmax(0, 1fr); }
  .tile { flex-direction: row; flex-wrap: wrap; align-items: center; min-height: 0; column-gap: 12px; }
  .tile svg { margin: 0; }
  .tile small { flex-basis: 100%; padding-left: 34px; margin-top: -2px; }
  .contract .c-sign { grid-template-columns: minmax(0, 1fr); }
  .seal { right: -6px; bottom: -16px; }
}

@media print {
  @page { size: auto; margin: 12mm; }
  body { background: #fff; color: #000; }
  .site-head, .site-foot, .hero, .panel, .section, .exports, .export-note, .preview-label, .jump, .seal, .toast-region, .no-print { display: none !important; }
  .builder { display: block; padding: 0; }
  .preview { position: static; }
  .contract { box-shadow: none; max-width: 170mm; margin: 0 auto; break-after: page; background: #fff; }
  .print-sheet { display: block; color: #000; font-family: var(--sans); }
  .print-sheet h2 { font: 600 18px/1.2 var(--serif); margin: 0 0 4px; }
  .print-sheet p { margin: 0 0 8px; font-size: 11px; }
  .print-block { break-inside: avoid; margin-bottom: 8mm; }
  .print-sheet table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 9px; }
  .print-sheet th, .print-sheet td { border: 1px solid #888; height: 6mm; padding: 0 2px; text-align: center; }
  .print-sheet th.rule, .print-sheet td.rule { width: 34mm; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}
.brand img { border-radius: 8px; box-shadow: 0 0 0 1px rgba(156, 207, 239, .18), 0 6px 16px -6px rgba(90, 168, 220, .6); }
/* Inner pages: a faded strip of the hero art behind the page title. */
body:not(:has(.hero)) {
  background:
    linear-gradient(180deg, rgba(10, 20, 32, .55) 0, var(--night) 420px),
    url("/assets/img/hero-960.webp") center top / max(100%, 1200px) auto no-repeat,
    var(--night);
}
.article h2 { font: 600 clamp(24px, 3vw, 31px)/1.2 var(--serif); color: #fff; margin: 44px 0 12px; letter-spacing: -.01em; }
.article p, .article li { color: #c3d3e2; }
.article ol li::marker, .article ul li::marker { color: var(--frost); }

/* ---- features: share card, themes, PWA ---- */
.btn[aria-busy="true"], .btn:disabled { opacity: .7; cursor: progress; }

/* Wallpaper theme picker (generator) */
.wp-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.wp-pick-label { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #8fa7bd; }
.wp-themes { display: flex; flex-wrap: wrap; gap: 8px; }
.wp-theme {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px 4px 5px;
  font: 500 14px/1 var(--sans); color: var(--ice); background: transparent; cursor: pointer;
  border: 1px solid rgba(140, 196, 236, .3); border-radius: 999px;
}
.wp-theme:hover { border-color: var(--frost); }
.wp-theme[aria-checked="true"] { border-color: var(--frost); background: rgba(140, 196, 236, .16); color: #fff; box-shadow: inset 0 0 0 1px var(--frost); }
.wp-theme:focus-visible { outline: 2px solid var(--frost); outline-offset: 2px; }
.wp-swatch { width: 18px; height: 30px; flex: none; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .28); }
.wp-theme[data-theme="aurora"] .wp-swatch {
  background:
    radial-gradient(circle at 25% 40%, rgba(95, 196, 192, .85), transparent 60%),
    radial-gradient(circle at 80% 50%, rgba(140, 196, 236, .75), transparent 55%),
    linear-gradient(#060d16, #0f2238 55%, #1b3a5c);
}
.wp-theme[data-theme="dawn"] .wp-swatch {
  background:
    radial-gradient(circle at 50% 105%, rgba(244, 196, 170, .9), transparent 60%),
    linear-gradient(#e9f0f8, #f5f6f9 45%, #f7eee9 80%, #e7e3ee);
}
.wp-theme[data-theme="minimal"] .wp-swatch {
  background:
    radial-gradient(1.5px 1.5px at 30% 25%, #d9e8f5 99%, transparent),
    radial-gradient(1.5px 1.5px at 70% 55%, #d9e8f5 99%, transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, #d9e8f5 99%, transparent),
    linear-gradient(#060d16, #0f2238 55%, #1b3a5c);
}

/* Share progress (tracker) */
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.share-note { flex-basis: 100%; margin: 0; font-size: 14px; color: #b8cde0; }
.share-note:empty { display: none; }

/* Add to Home Screen hint (tracker) */
.install-hint {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin-top: 16px; padding: 14px 52px 14px 16px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 159, 214, .18), rgba(140, 196, 236, .05));
  border: 1px solid rgba(140, 196, 236, .3);
}
.install-hint[hidden] { display: none; }
.install-text { flex: 1 1 240px; min-width: 0; }
.install-title { margin: 0; font-weight: 600; font-size: 15px; color: #fff; }
.install-body { margin: 2px 0 0; font-size: 14px; color: #b8cde0; }
.install-close {
  position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: #8fa7bd; font-size: 22px; line-height: 1; cursor: pointer;
}
.install-close:hover { color: #fff; background: rgba(140, 196, 236, .12); }
.install-close:focus-visible { outline: 2px solid var(--frost); outline-offset: 2px; }

@media (max-width: 480px) {
  .share-row .btn, .install-hint .btn { flex: 1 1 auto; }
  .wp-themes { width: 100%; }
  .wp-theme { flex: 1 1 0; justify-content: center; }
}
@media print {
  .wp-pick, .share-row, .install-hint { display: none !important; }
}

/* Real art in the theme swatches once the images exist. */
.wp-theme[data-theme="aurora"] .wp-swatch { background: url("/assets/img/wp-aurora.webp") center / cover, linear-gradient(#060d16, #1b3a5c); }
.wp-theme[data-theme="dawn"] .wp-swatch { background: url("/assets/img/wp-dawn.webp") center / cover, linear-gradient(#e9f0f8, #f7eee9); }
.wp-pick { margin-top: 4px; justify-content: center; }
.wp-pick-label { color: var(--ice-mute); font-size: 12px; font-weight: 600; letter-spacing: .12em; }

/* Mobile: keep the daily checklist near the top of the tracker. */
@media (max-width: 560px) {
  .article .tracker-head .lede { font-size: 16px; margin-bottom: 4px; }
  .stats { gap: 8px; margin: 16px 0 10px; }
  .stat { padding: 10px 12px; border-radius: 12px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 12px; line-height: 1.35; display: block; }
  .today { margin-top: 22px; }
  .wp-pick { justify-content: flex-start; }
}
.share-row { margin-top: 22px; }
