:root {
  --paper: #f3ecdf;
  --sheet: #fffdf8;
  --ink: #1c1915;
  --muted: #5e564c;
  --line: #e3d6c4;
  --pine: #1b4332;
  --pine-dark: #10281e;
  --clay: #8c3a28;
  --gold: #8a5a12;
  --ok: #1b4332;
  --focus: #1b4332;
  --shadow: 0 18px 50px rgba(48, 32, 16, 0.08);
  --sans: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Noto Serif", "Iowan Old Style", Palatino, Georgia, "Times New Roman", serif;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(27, 67, 50, 0.08), transparent 50%),
    var(--paper);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.55;
}
img { max-width: 100%; }
a { color: var(--pine); }
a:hover { color: var(--pine-dark); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 0.2rem 0 0.8rem; }
h2 { font-size: 1.55rem; margin: 2rem 0 0.6rem; }
p { margin: 0.6rem 0; }
.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--ink);
  color: white;
  padding: 0.4rem 0.7rem;
  z-index: 5;
}
.skip:focus { top: 0.5rem; }
.wrap { width: min(920px, calc(100% - 2rem)); margin: 0 auto; }
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.8);
  backdrop-filter: blur(8px);
}
.header-inner, .footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 0;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.wordmark img { display: block; }
.byline { margin: 0; color: var(--muted); font-size: 0.95rem; }
.byline a { color: inherit; }
.sheet {
  margin: 1.5rem auto 2.5rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.4rem 1.8rem;
  position: relative;
}
.sheet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 7px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--pine);
}
.sheet-pad { padding-left: 0.6rem; }
.eyebrow {
  margin: 0;
  color: var(--pine);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lead { font-size: 1.15rem; max-width: 38rem; }
.quiet { color: var(--muted); }
.fine { color: var(--muted); font-size: 0.92rem; }
.stack { display: grid; gap: 0.9rem; }
.field { display: grid; gap: 0.35rem; }
label { font-weight: 600; }
.help { color: var(--muted); font-size: 0.92rem; font-weight: 450; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="url"], textarea {
  width: 100%;
  border: 1px solid #d9cbb6;
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  min-height: 46px;
}
textarea { min-height: 5.5rem; resize: vertical; }
input:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(27, 67, 50, 0.35);
  outline-offset: 2px;
}
.mode-grid, .link-grid { display: grid; gap: 0.8rem; }
.mode {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  background: #fff;
  cursor: pointer;
}
.mode:has(input:checked) {
  border-color: var(--pine);
  box-shadow: inset 0 0 0 1px var(--pine);
}
.mode strong { display: block; color: var(--ink); }
.mode span span { color: var(--muted); font-size: 0.95rem; }
.lines { display: grid; gap: 0.8rem; }
.line {
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem;
  border: 1px dashed #ddcfbb;
  border-radius: 12px;
  background: #fffaf3;
}
.line-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.line-no { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }
.line-grid { display: grid; gap: 0.6rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 46px;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}
.btn-primary { background: var(--pine); color: #f7f3ea; }
.btn-primary:hover { background: var(--pine-dark); color: white; }
.btn-secondary { background: transparent; border-color: #cbbba6; color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--clay); color: var(--clay); }
.btn-small { min-height: 36px; padding: 0.2rem 0.75rem; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.banner[hidden], [hidden] { display: none !important; }
.banner {
  background: var(--pine-dark);
  color: #f6f1e7;
}
.banner a { color: #f3d7a1; }
.banner-inner {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.85rem 0;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
.banner p { margin: 0; }
.banner-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.banner .btn-primary { background: #f3d7a1; color: var(--pine-dark); }
.banner .btn-secondary { border-color: rgba(246, 241, 231, 0.4); color: #f6f1e7; }
.alert {
  background: #fff1ea;
  border: 1px solid #e7c2b4;
  color: #6d2c1d;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}
.result {
  display: grid;
  gap: 0.9rem;
}
.link-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: #fff;
}
.link-card.keep { border-color: #e7c2b4; }
.link-card label { display: block; margin-bottom: 0.35rem; }
.link-row { display: flex; gap: 0.5rem; }
.link-row input { flex: 1; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; }
.check input { margin-top: 0.35rem; width: 1.1rem; height: 1.1rem; }
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.later {
  margin-top: 1.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}
.cards { display: grid; gap: 0.8rem; }
.item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem;
  background: #fff;
}
.item header { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.item h2 { margin: 0.2rem 0; font-size: 1.35rem; }
.meta { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.choices { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.7rem 0; }
.choices label {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-weight: 550;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  min-height: 44px;
  background: #fffdf8;
}
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: #f3ecdf;
}
.pill.done { background: #e5f2ea; color: var(--pine); }
.pill.explained { background: #f8efd8; color: var(--gold); }
.summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}
.save-bar {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
.footer-inner { align-items: flex-start; padding: 1.2rem 0 2rem; }
.prose { padding: 0.4rem 0 2rem; }
.prose ul { padding-left: 1.2rem; }
.stats { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
.stats th, .stats td { border-bottom: 1px solid var(--line); text-align: left; padding: 0.45rem 0.4rem; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.noscript {
  background: #fff1ea;
  padding: 0.8rem 1rem;
}
@media (min-width: 760px) {
  .sheet { padding: 2rem 2rem 2.2rem; }
  .sheet-pad { padding-left: 0.8rem; }
  .mode-grid, .link-grid { grid-template-columns: 1fr 1fr; }
  .line-grid { grid-template-columns: 1.5fr 0.7fr 0.7fr; }
  .item h2 { font-size: 1.55rem; }
}
@media (max-width: 700px) {
  .header-inner, .footer-inner, .banner-inner, .summary, .link-row { flex-direction: column; align-items: stretch; }
  .banner-actions, .actions { width: 100%; }
  .banner-actions .btn, .actions .btn { flex: 1; }
}
@media print {
  .site-header, .site-footer, .banner, .save-bar, .no-print { display: none !important; }
  body { background: white; }
  .sheet { box-shadow: none; border: 0; }
}
