:root {
  --paper: #f7f2ea; --card: #fffdf9; --ink: #221d17; --muted: #6d6458; --line: #e4dacb;
  --accent: #b5502c; --accent-ink: #fff; --accent-soft: #f4e2d8; --ok: #2f7a4f; --warn: #9a5b00; --err: #a2321c;
  --radius: 14px; --shadow: 0 1px 2px rgba(34,29,23,.05), 0 8px 24px rgba(34,29,23,.06);
  --serif: "Fraunces", Georgia, serif; --sans: "Work Sans", system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 5vw, 52px); } h2 { font-size: clamp(24px, 3vw, 32px); } h3 { font-size: 19px; }
p { margin: 0 0 1em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.kicker { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: rgba(247,242,234,.92); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 21px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font: 600 15px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { opacity: .9; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: progress; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input, textarea, select { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: 15px var(--sans); }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.notice { padding: 12px 14px; border-radius: 10px; background: #fff7e6; border: 1px solid #f0d9a8; color: var(--warn); font-size: 14px; }
.error { padding: 12px 14px; border-radius: 10px; background: #fbe9e4; border: 1px solid #efc1b4; color: var(--err); font-size: 14px; }
.success { padding: 12px 14px; border-radius: 10px; background: #e6f3ea; border: 1px solid #b9dcc6; color: var(--ok); font-size: 14px; }

/* Landing */
.hero { padding: 72px 0 56px; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 600px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 28px; }
.facts span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; background: var(--card); }
.section { padding: 48px 0; }
.feature { display: grid; grid-template-columns: 44px 1fr; gap: 14px; }
.feature .num { font-family: var(--serif); font-size: 26px; color: var(--accent); }
.feature small { color: var(--muted); display: block; margin-top: 6px; }
.band { background: var(--ink); color: var(--paper); border-radius: 22px; padding: 40px; }
.band .muted { color: #cdc3b5; }
footer.site { border-top: 1px solid var(--line); padding: 28px 0 40px; margin-top: 40px; font-size: 14px; color: var(--muted); }
footer.site .wrap { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }

/* App */
.app-main { padding: 28px 0 60px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 22px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; border-radius: 10px 10px 0 0; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.tabs a.on { color: var(--ink); background: var(--card); border: 1px solid var(--line); border-bottom-color: var(--card); margin-bottom: -1px; }
.day { border-left: 3px solid var(--accent); }
.day .meta { font-size: 13px; color: var(--muted); }
.tags { color: var(--accent); font-size: 14px; }
.pre { white-space: pre-wrap; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
.table-wrap { overflow-x: auto; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.legal h2 { font-size: 22px; margin-top: 32px; }

@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .top .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .top nav .btn.small { min-height: 32px; padding: 0 11px; font-size: 13px; }
  .band { padding: 26px; }
  .hero { padding: 44px 0 36px; }
  .card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
