:root {
  --paper: #f3ecdf;
  --ink: #221c16;
  --muted: #5e564c;
  --card: #fffaf3;
  --line: #e4d7c6;
  --clay: #9a4630;
  --clay-dark: #6f3122;
  --loss: #8d2f2a;
  --loss-bg: #f8ebe6;
  --gain: #1d6b45;
  --gain-bg: #e7f3ec;
  --wait: #8a5a12;
  --wait-bg: #f8f0dc;
  --shadow: 0 16px 40px rgba(70, 42, 24, 0.08);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 880px; margin: 0 auto; padding: 48px 20px 80px; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 12px;
}
h2 { font-size: 1.35rem; font-weight: 650; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.site-name {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 28px;
}
.site-mark { display: none; }
.eyebrow {
  margin-bottom: 8px;
  color: var(--clay);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lede, .quiet { color: var(--muted); line-height: 1.5; }
.lede { font-size: 1.12rem; max-width: 38rem; }

.drop-wrap, .panel, .summary, .order {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.drop-wrap { padding: 18px; }
.drop {
  width: 100%;
  border: 1.5px dashed #c4ad96;
  background: #fbf6ee;
  border-radius: 14px;
  padding: 36px 16px;
  text-align: center;
}
.drop:hover, .drop:focus-visible, .drop.hot { border-color: var(--clay); background: #fff; outline: none; }
.drop-title { display: block; font-size: 1.25rem; font-weight: 650; }
.drop-sub { display: block; margin-top: 6px; color: var(--muted); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.row-actions button, .export {
  border: 1px solid var(--line);
  background: var(--ink);
  color: #fffaf3;
  border-radius: 999px;
  padding: 10px 16px;
}
.row-actions button.ghost, .export { background: transparent; color: var(--ink); }
.file-list, .checklist { list-style: none; padding: 0; margin: 12px 0 0; }
.file-list li, .checklist li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.file-list button {
  border: 0;
  background: transparent;
  color: var(--clay-dark);
  text-decoration: underline;
}
.ok { color: var(--gain); }
.missing { color: var(--wait); }
.pay {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbf6ee;
}
.pay.attention { outline: 3px solid #e7c2b4; }
.pay-kicker {
  margin: 0 0 6px;
  color: var(--clay);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pay h2 { font-size: 1.35rem; margin-bottom: 6px; }
.pay-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 14px; }
.pay-actions button {
  border: 0;
  background: var(--ink);
  color: #fffaf3;
  border-radius: 999px;
  padding: 12px 18px;
}
.pay-actions button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.pay-actions button:disabled { opacity: 0.6; }
.license-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; flex: 1; }
.license-form label { display: grid; gap: 4px; color: var(--muted); font-size: 0.92rem; flex: 1; min-width: 12rem; }
.license-form input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}
.pay-note { margin: 10px 0 0; }
#pay-remove {
  background: transparent;
  color: var(--clay-dark);
  border: 0;
  padding: 0;
  text-decoration: underline;
}
.help { margin-top: 14px; }
.help summary, .advanced summary, .lines summary { cursor: pointer; font-weight: 650; }
.guides { display: grid; gap: 18px; margin-top: 14px; }
.guide h3 { margin-bottom: 8px; font-size: 1.05rem; }
.path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}
.path span {
  background: #f6efe4;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.92rem;
}
.path .arrow {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--clay);
  font-weight: 700;
}
.sheet { margin: 12px 0 0; }
.sheet figcaption { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.sheet-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.sheet table { border-collapse: collapse; font-size: 0.82rem; white-space: nowrap; }
.sheet th, .sheet td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.sheet th { background: #f6efe4; font-weight: 650; }
.sheet .quiet, .wrong-file { margin: 8px 0 0; }
.practice {
  margin-top: 28px;
  padding: 22px 22px 18px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 250, 243, 0.16), transparent 42%),
    var(--clay);
  color: #fffaf3;
  box-shadow: var(--shadow);
}
.practice-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.practice-kicker {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.16);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fffaf3;
}
.practice-copy { flex: 1; }
.practice h2 { font-size: 1.45rem; margin-bottom: 6px; color: #fffaf3; }
.practice p { margin: 0; color: #f8e6df; line-height: 1.45; }
.practice-actions { display: flex; flex-direction: column; gap: 8px; flex: none; }
.practice button {
  border: 0;
  background: #fffaf3;
  color: var(--clay-dark);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
}
.practice button.ghost {
  background: transparent;
  color: #fffaf3;
  box-shadow: inset 0 0 0 1.5px rgba(255, 250, 243, 0.75);
}
.tickets {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
}
.ticket {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fffaf3;
  color: var(--ink);
}
.ticket.loss { box-shadow: inset 4px 0 0 var(--loss); }
.ticket.gain { box-shadow: inset 4px 0 0 var(--gain); }
.ticket-item { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ticket-money { font-family: Georgia, "Iowan Old Style", serif; font-size: 1.45rem; line-height: 1.1; }
.ticket-why { color: var(--muted); font-size: 0.9rem; line-height: 1.35; }
.tour {
  margin-top: 14px;
  padding: 16px 18px;
  background: #fffaf3;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.tour-kicker {
  margin-bottom: 4px;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tour p { margin-bottom: 0; line-height: 1.45; }
.tour-stops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tour-stops button {
  border: 1px solid #d9c8b4;
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 12px;
}
.tour-hit { outline: 3px solid var(--clay); outline-offset: 4px; }
.reset-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--ink);
  color: #fffaf3;
  border-radius: 16px;
}
.reset-bar p { margin: 0; color: #f3ecdf; line-height: 1.4; }
.reset-kicker {
  margin-bottom: 4px;
  color: #e7c2b4;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.reset-bar button {
  flex: none;
  border: 0;
  background: #fffaf3;
  color: var(--ink);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
}
.reset-bar-drop { margin-top: 14px; }
.reset-bar.attention { outline: 3px solid #e7c2b4; }

.panel { margin-top: 22px; padding: 22px; }
.hidden { display: none; }
.cost-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 12px;
  align-items: end;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.cost-row label, .pricer label { display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.sold { color: var(--muted); font-weight: 400; }
input, select {
  border: 1px solid #d9c8b4;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 3px solid #e7c2b4;
  outline-offset: 1px;
}
.need { color: var(--wait); font-size: 0.85rem; }

.summary {
  margin-top: 22px;
  padding: 22px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 18px;
}
.summary .amount {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  margin: 6px 0;
}
.summary p { margin-bottom: 0; }
.stat-label { color: var(--muted); font-size: 0.92rem; }
.results-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}
.results-tools label { font-size: 0.92rem; display: flex; flex-direction: column; gap: 6px; }
.results-tools input { width: 110px; }
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.results-actions button, .export {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
}
.results-actions button { background: var(--ink); color: #fffaf3; }
.results-actions .export { background: transparent; color: var(--ink); }
.results-actions button:disabled { opacity: 0.55; cursor: wait; }
.print-only { display: none; }
.pdf-status {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(243, 236, 223, 0.94);
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 1.8rem;
}
.pdf-status.hidden { display: none; }
body.pdf-capture { background: #fff; }
body.pdf-capture * { letter-spacing: 0 !important; }
body.pdf-capture h1,
body.pdf-capture .amount,
body.pdf-capture .verdict { line-height: 1.35 !important; }
body.pdf-capture main { max-width: 720px; padding-top: 12px; }
body.pdf-capture .print-only { display: block; margin: 0 0 18px; color: var(--muted); }
#pdf-sheet {
  position: absolute;
  left: 0;
  top: 0;
  width: 186mm;
  background: #fff;
  z-index: 30;
}
.pdf-sheet-page {
  display: flow-root;
  box-sizing: border-box;
  width: 100%;
  padding: 6px 14px 10px 4px;
  background: #fff;
}
body.pdf-capture .site-name {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}
body.pdf-capture .site-mark {
  display: block;
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 2rem;
  line-height: 0.8;
}
body.pdf-capture .lede,
body.pdf-capture .drop-wrap,
body.pdf-capture .practice,
body.pdf-capture #costs,
body.pdf-capture .reset-bar,
body.pdf-capture #tour,
body.pdf-capture .results-tools,
body.pdf-capture #advanced,
body.pdf-capture footer { display: none !important; }
body.pdf-capture .summary,
body.pdf-capture .callout,
body.pdf-capture .month-row,
body.pdf-capture .product,
body.pdf-capture .order { box-shadow: none; }
body.pdf-capture .month-row { column-gap: 8px; }
body.pdf-capture .summary { margin-top: 0; }
body.pdf-capture details.lines summary { display: none !important; }
.callout {
  margin-top: 14px;
  padding: 16px 18px;
  background: #fffaf3;
  border: 1px solid var(--line);
  border-left: 4px solid var(--clay);
  border-radius: 12px;
  line-height: 1.45;
}
.insight { margin-top: 22px; }
.insight h2 { margin-bottom: 6px; }
.month-row, .product {
  display: grid;
  gap: 4px 16px;
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.month-row { grid-template-columns: 1.2fr 1fr 1fr 1fr; align-items: baseline; }
.month-row.total { border-top: 2px solid var(--ink); }
.month-row span, .product .quiet { color: var(--muted); }
.product.loss { background: var(--loss-bg); }
.product.gain { background: var(--gain-bg); }
.product.wait { background: var(--wait-bg); }
.product h3 { margin-bottom: 0; font-size: 1.05rem; }
.kicker { font-weight: 700; color: var(--clay-dark); }

.order { margin-top: 14px; padding: 18px 20px; }
.order.loss { background: var(--loss-bg); }
.order.wait { background: var(--wait-bg); }
.order h3 { margin-bottom: 4px; font-size: 1.15rem; }
.verdict { font-family: Georgia, serif; font-size: 1.7rem; margin: 8px 0; }
.order.loss .verdict { color: var(--loss); }
.order.gain .verdict { color: var(--gain); }
.order.wait .verdict { color: var(--wait); }
.meta { color: var(--muted); margin-bottom: 0; }
.advice { margin: 10px 0 0; line-height: 1.45; }
.lines { margin-top: 8px; }
.lines table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.lines td { padding: 6px 0; border-top: 1px solid var(--line); vertical-align: top; }
.lines td:last-child { text-align: right; white-space: nowrap; }

.pricer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.pricer .check { flex-direction: row; align-items: center; grid-column: 1 / -1; }
.pricer-result { font-family: Georgia, serif; font-size: 1.6rem; margin: 16px 0 6px; }
footer { margin-top: 28px; color: var(--muted); font-size: 0.92rem; }
.warn { color: var(--loss); }

@page { margin: 14mm; }

@media print {
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .print-only { display: block; margin: 0 0 18px; color: var(--muted); }
  .site-name { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
  .site-mark {
    display: block;
    font-family: Georgia, "Iowan Old Style", serif;
    font-size: 2rem;
    line-height: 0.8;
  }
  .lede, .drop-wrap, .practice, #costs, .reset-bar, #tour, .results-tools, #advanced, footer {
    display: none !important;
  }
  .summary, .callout, .month-row, .product, .order {
    break-inside: avoid;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .summary { margin-top: 0; }
  details.lines, details.lines > * { display: block !important; }
  details.lines > table { display: table !important; width: 100%; }
  details.lines summary { display: none !important; }
  h1, h2, h3 { break-after: avoid; }
}

@media (max-width: 700px) {
  main { padding-top: 28px; }
  .summary, .cost-row, .pricer, .month-row { grid-template-columns: 1fr; }
  .practice-top, .reset-bar, .pay-actions, .license-form { flex-direction: column; align-items: stretch; }
  .tickets { grid-template-columns: 1fr; }
  .results-tools { flex-direction: column; align-items: stretch; }
}
