/* ============================================================
   ReceiptSweep — shared design system
   Direction: accountant's columnar pad (green ledger grid)
   + thermal receipt paper. One bold signature, rest quiet.
   ============================================================ */

:root {
  --paper:      #F2F4EC;   /* ledger paper white, green-tinted */
  --paper-deep: #E7EADF;   /* slightly deeper paper (panels)   */
  --ink:        #1B2B20;   /* ledger ink (dark green-black)    */
  --ink-soft:   #55665A;   /* secondary text                   */
  --line:       #C4D1BA;   /* grid line green                  */
  --line-strong:#9FB293;   /* emphasized rule                  */
  --accent:     #0E7A4E;   /* ledger green (CTA, links)        */
  --accent-deep:#0A5C3B;
  --thermal:    #4C4640;   /* thermal paper gray-brown         */
  --total-hi:   #FFD64D;   /* highlighter on the TOTAL line    */
  --danger:     #B3402E;
  --ok:         #0E7A4E;

  --font-ui:  "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-mono:"IBM Plex Mono", "Cascadia Mono", Consolas, monospace;

  --maxw: 1060px;
  --maxw-read: 680px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    repeating-linear-gradient(to bottom, transparent 0 27px, rgba(155,173,142,.14) 27px 28px),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- header / footer ---------- */
.site-header, .site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.site-header { border-bottom: 1.5px solid var(--line-strong); }
.site-footer {
  border-top: 1.5px solid var(--line-strong);
  margin-top: 72px;
  padding: 22px 24px 40px;
  color: var(--ink-soft);
  font-size: 13.5px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: var(--ink);
}
.logo .tick { color: var(--accent); }
.site-nav { margin-left: auto; display: flex; gap: 22px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.site-nav a:hover { border-bottom-color: var(--accent); color: var(--accent-deep); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--accent-deep); }

/* ---------- type helpers ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 14px;
}
h1 {
  font-size: clamp(34px, 5.2vw, 54px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -1.2px;
  margin: 0 0 18px;
}
h2 { font-size: 26px; letter-spacing: -0.5px; font-weight: 700; margin: 0 0 10px; }
p  { margin: 0 0 12px; }
.muted { color: var(--ink-soft); }
.mono  { font-family: var(--font-mono); }

a.btn, button.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-radius: var(--radius);
  padding: 14px 26px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 0 var(--accent-deep);
  transition: transform .06s ease, box-shadow .06s ease;
}
a.btn:hover, button.btn:hover { background: var(--accent-deep); }
a.btn:active, button.btn:active { transform: translateY(2px); box-shadow: none; }
a.btn:focus-visible, button.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--total-hi);
  outline-offset: 2px;
}
.btn-ghost {
  background: transparent;
  color: var(--accent-deep);
  border: 1.5px solid var(--line-strong);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--paper-deep); color: var(--ink); }

/* ---------- generic layout ---------- */
.wrap   { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-read { max-width: var(--maxw-read); margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0 0; }
.rule { border: none; border-top: 1.5px solid var(--line-strong); margin: 56px 0 0; }

/* ledger-row structure device: each step is literally a line in the books */
.ledger-steps { border-top: 2px solid var(--ink); margin-top: 22px; }
.ledger-row {
  display: grid;
  grid-template-columns: 110px 1fr 220px;
  gap: 18px;
  padding: 18px 6px;
  border-bottom: 1.5px solid var(--line-strong);
  align-items: baseline;
}
.ledger-row .no {
  font-family: var(--font-mono);
  color: var(--accent-deep);
  font-size: 13px;
  letter-spacing: 1px;
}
.ledger-row .what { font-weight: 600; font-size: 17px; }
.ledger-row .what .muted { font-weight: 400; display: block; font-size: 14.5px; margin-top: 3px; }
.ledger-row .qty {
  font-family: var(--font-mono);
  text-align: right;
  color: var(--ink-soft);
  font-size: 13.5px;
}

/* ---------- hero receipt (the one signature element) ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
  padding-top: 64px;
}
.hero-copy .btn { margin-top: 10px; }
.hero-note { font-size: 13.5px; color: var(--ink-soft); margin-top: 12px; font-family: var(--font-mono); }

.receipt {
  background: #FBFAF6;
  color: var(--thermal);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.9;
  padding: 26px 26px 34px;
  width: min(330px, 100%);
  margin: 0 auto;
  position: relative;
  box-shadow: 0 10px 26px rgba(27,43,32,.14), 0 2px 6px rgba(27,43,32,.08);
  transform: rotate(1.6deg);
}
/* torn thermal edges */
.receipt::before, .receipt::after {
  content: "";
  position: absolute; left: 0; right: 0; height: 10px;
  background: linear-gradient(-45deg, transparent 70%, #FBFAF6 72%) 0 0/12px 12px,
              linear-gradient(45deg,  transparent 70%, #FBFAF6 72%) 6px 0/12px 12px;
}
.receipt::before { top: -9px; }
.receipt::after  { bottom: -9px; transform: scaleY(-1); }
.receipt .r-head { text-align: center; font-weight: 700; letter-spacing: 1px; }
.receipt .r-line { border-top: 1.5px dashed var(--thermal); margin: 12px 0; opacity: .5; }
.receipt .r-item { display: flex; justify-content: space-between; gap: 12px; }
.receipt .r-item .amt { white-space: nowrap; }
.receipt .r-total {
  font-weight: 700;
  color: var(--ink);
  background: var(--total-hi);
  padding: 1px 6px;
  margin: 4px -6px;
  display: flex; justify-content: space-between;
  transform: rotate(-0.5deg);
}
.receipt .r-foot { text-align: center; font-size: 11.5px; opacity: .75; margin-top: 12px; letter-spacing: 1px; }
.receipt .r-line-in { opacity: 0; }
.receipt.printed .r-line-in { animation: rprint .18s steps(6) forwards; }
@keyframes rprint { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .receipt .r-line-in { opacity: 1 !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- trust strip ---------- */
.trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  margin-top: 56px;
  overflow: hidden;
  background: rgba(255,255,255,.45);
}
.trust div { padding: 18px 20px; }
.trust div + div { border-left: 1.5px solid var(--line-strong); }
.trust b { display: block; font-size: 15px; margin-bottom: 3px; }
.trust span { color: var(--ink-soft); font-size: 13.5px; }

/* ---------- pricing ---------- */
.price-card {
  max-width: 460px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #FBFAF6;
  padding: 26px 28px;
  box-shadow: 6px 6px 0 var(--line);
}
.price-card .amount {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -1px;
}
.price-card .amount small { font-size: 15px; color: var(--ink-soft); font-weight: 400; letter-spacing: 0; }
.price-card ul { margin: 16px 0 20px; padding: 0; list-style: none; }
.price-card li { padding: 9px 0 9px 30px; border-top: 1.5px solid var(--line); position: relative; font-size: 15px; }
.price-card li::before { content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }
.price-note { font-size: 13.5px; color: var(--ink-soft); margin-top: 14px; max-width: 460px; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1.5px solid var(--line-strong); padding: 4px 0; }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16.5px;
  padding: 12px 0;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px;
  font-family: var(--font-mono); color: var(--accent-deep);
}
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-soft); padding-bottom: 14px; margin: 0; font-size: 15px; }

/* ---------- workbench (tool pages) ---------- */
.bench {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  margin-top: 34px;
  align-items: start;
}
@media (max-width: 860px) { .bench { grid-template-columns: 1fr; } }

.panel {
  background: #FBFAF6;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
}
.panel h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: .3px; }

.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 34px 18px;
  text-align: center;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(14,122,78,.05); }
.dropzone b { color: var(--ink); }
.dropzone .dz-icon { font-size: 30px; display: block; margin-bottom: 8px; }
.dropzone input[type=file] { display: none; }

.filelist { margin: 14px 0 0; padding: 0; list-style: none; font-family: var(--font-mono); font-size: 12.8px; }
.filelist li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 7px 8px; border-bottom: 1px solid var(--line);
}
.filelist li .st { color: var(--ink-soft); white-space: nowrap; }
.filelist li.st-reading .st { color: var(--accent-deep); }
.filelist li.st-done   .st { color: var(--ok); }
.filelist li.st-fail   .st { color: var(--danger); }

.actionbar { display: flex; gap: 12px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.limit-note {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 14px;
}
.license-row { display: flex; gap: 8px; margin-top: 10px; }
.license-row input {
  flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 9px 10px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.license-ok { color: var(--ok); font-family: var(--font-mono); font-size: 12.5px; margin-top: 8px; }
.license-err { color: var(--danger); font-family: var(--font-mono); font-size: 12.5px; margin-top: 8px; }

/* ledger result table */
.sheetwrap { overflow-x: auto; }
table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: #FBFAF6;
  border: 1.5px solid var(--line-strong);
}
table.ledger th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: left;
  color: var(--accent-deep);
  background: var(--paper-deep);
  padding: 10px 10px;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
table.ledger td {
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
  vertical-align: middle;
}
table.ledger tr:hover td { background: rgba(14,122,78,.045); }
table.ledger input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  padding: 3px 2px;
}
table.ledger input:hover { background: rgba(14,122,78,.07); border-radius: 4px; }
table.ledger input:focus { outline: 2px solid var(--accent); border-radius: 4px; }
table.ledger .num { text-align: right; }
table.ledger .num input { text-align: right; }
table.ledger td.src { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.ledger tr.row-total td.total-cell { background: var(--total-hi); font-weight: 700; }
table.ledger td .mini { font-family: var(--font-mono); font-size: 11px; color: var(--danger); cursor: pointer; background: none; border: none; padding: 4px; }
table.ledger td .mini:hover { text-decoration: underline; }

.status-line { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); margin-top: 12px; min-height: 1.2em; }
.status-line.err { color: var(--danger); }
.status-line.ok  { color: var(--ok); }

/* progress */
.prog { height: 6px; background: var(--paper-deep); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }

/* empty state */
.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 40px 10px;
  font-size: 14.5px;
}
.empty .mono { font-size: 12px; }

/* page intro for tool pages */
.tool-intro { padding-top: 44px; max-width: 760px; }
.tool-intro h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 10px; }
.backline { font-family: var(--font-mono); font-size: 12.5px; margin-bottom: 18px; display: inline-block; color: var(--accent-deep); text-decoration: none; }
.backline:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .trust { grid-template-columns: 1fr; }
  .trust div + div { border-left: none; border-top: 1.5px solid var(--line-strong); }
  .ledger-row { grid-template-columns: 70px 1fr; }
  .ledger-row .qty { display: none; }
  .site-nav { gap: 14px; }
}
