:root {
  --bg: #f8fafc;
  --fg: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --surface: #ffffff;
  --accent: #18181b;
  --accent-soft: #f1f5f9;
  --ok: #0f766e;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --max: 960px;
  --pad: clamp(1rem, 3vw, 1.75rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--fg);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: #334155;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 250, 252, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2) blur(8px);
}

.topbar-inner {
  max-width: calc(var(--max) + 2 * var(--pad));
  margin: 0 auto;
  padding: 0.7rem var(--pad);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.brand-mark {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-sep,
.brand-sub {
  color: var(--muted);
  font-weight: 400;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  font-size: 0.78rem;
  flex: 1;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--fg);
  text-decoration: underline;
}

.print-btn {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  border-radius: 6px;
  cursor: pointer;
}

.print-btn:hover {
  background: var(--accent-soft);
}

main {
  max-width: calc(var(--max) + 2 * var(--pad));
  margin: 0 auto;
  padding: 1.5rem var(--pad) 3rem;
}

section + section {
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.hero {
  padding-top: 0.5rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.65rem, 3.5vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.lede {
  margin: 0 0 1.75rem;
  color: var(--muted);
  max-width: 42rem;
}

.lede strong {
  color: var(--fg);
  font-weight: 600;
}

.dot {
  margin: 0 0.25rem;
  color: var(--line-strong);
}

.total-block {
  display: grid;
  gap: 0.15rem;
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.75rem;
}

.total-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.total-amount {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.total-meta {
  margin: 0.25rem 0 0;
  color: var(--ok);
  font-size: 0.88rem;
  font-weight: 500;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem 1.25rem;
  margin: 0;
}

.meta-grid dt {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.2rem;
}

.meta-grid dd {
  margin: 0;
  font-weight: 500;
  font-size: 0.92rem;
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 40rem;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.claim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.claim-table th,
.claim-table td {
  padding: 0.55rem 0.55rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.claim-table th {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.claim-table tbody tr:hover {
  background: rgba(241, 245, 249, 0.55);
}

.claim-table .num {
  text-align: right;
  white-space: nowrap;
}

.claim-table .usd {
  font-weight: 600;
}

.claim-table .usd::before {
  content: "$";
  font-weight: 500;
  color: var(--muted);
}

.claim-table tfoot td {
  border-bottom: none;
  border-top: 1px solid var(--line-strong);
  font-weight: 600;
  padding-top: 0.75rem;
}

.claim-table.compact td,
.claim-table.compact th {
  padding: 0.45rem 0.5rem;
}

.muted-row td {
  color: var(--muted);
}

.muted-row .usd::before {
  color: var(--line-strong);
}

.caveat-list {
  margin: 0;
  padding: 0 0 0 1.1rem;
  display: grid;
  gap: 0.75rem;
  color: var(--fg);
  max-width: 44rem;
}

.caveat-list li {
  padding-left: 0.15rem;
}

.caveat-list strong {
  font-weight: 600;
}

.note {
  margin: 1rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  max-width: 44rem;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.receipt-thumb {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  text-align: left;
}

.receipt-thumb:hover,
.receipt-thumb:focus-visible {
  border-color: var(--line-strong);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.receipt-thumb img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: top;
  background: var(--accent-soft);
}

.receipt-thumb span {
  padding: 0 0.5rem 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.lightbox {
  border: none;
  padding: 0;
  max-width: min(920px, 94vw);
  max-height: 92vh;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
}

.lightbox::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.lightbox form {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.5rem 0;
}

.lightbox-close {
  font: inherit;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  padding: 0.5rem 1rem 0;
}

#lightbox-caption {
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem var(--pad) 2rem;
  max-width: calc(var(--max) + 2 * var(--pad));
  margin: 0 auto;
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 720px) {
  .toc {
    display: none;
  }

  .claim-table {
    font-size: 0.78rem;
  }

  .claim-table th:nth-child(4),
  .claim-table td:nth-child(4),
  .claim-table th:nth-child(7),
  .claim-table td:nth-child(7) {
    display: none;
  }
}

@media print {
  .topbar,
  .print-btn,
  .receipt-grid,
  #receipts,
  .lightbox {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  main {
    max-width: none;
    padding: 0;
  }

  section + section {
    break-inside: avoid;
  }

  .total-amount {
    font-size: 28pt;
  }

  .claim-table tbody tr:hover {
    background: transparent;
  }

  a {
    text-decoration: none;
    color: inherit;
  }

  .site-footer {
    border-top: 1px solid #ccc;
  }
}
