/* Kit Rx Statement Converter. No external fonts, scripts, or trackers. */
:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --ink: #14201b;
  --muted: #5a6761;
  --line: #e0e3db;
  --rule: #e9ece4;
  --accent: #0c6a4c;
  --accent-hover: #09573e;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0e8;
  --warn: #8a5300;
  --warn-soft: #fff2d3;
  --bad: #b42318;
  --bad-soft: #fde9e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 32, 27, 0.05), 0 10px 30px rgba(20, 32, 27, 0.07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1411;
    --surface: #151d19;
    --surface-2: #121915;
    --ink: #e6ece8;
    --muted: #9caaa3;
    --line: #26322c;
    --rule: #1d2722;
    --accent: #43c495;
    --accent-hover: #5fd3a8;
    --accent-ink: #052016;
    --accent-soft: #17332a;
    --warn: #f2b955;
    --warn-soft: #382b12;
    --bad: #ff8b80;
    --bad-soft: #3a1c1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1411;
  --surface: #151d19;
  --surface-2: #121915;
  --ink: #e6ece8;
  --muted: #9caaa3;
  --line: #26322c;
  --rule: #1d2722;
  --accent: #43c495;
  --accent-hover: #5fd3a8;
  --accent-ink: #052016;
  --accent-soft: #17332a;
  --warn: #f2b955;
  --warn-soft: #382b12;
  --bad: #ff8b80;
  --bad-soft: #3a1c1a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
img, svg { max-width: 100%; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand small { font-weight: 500; color: var(--muted); }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.nav a:hover { background: var(--surface); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; white-space: nowrap; }
.chip[hidden] { display: none; }

/* type */
h1, h2, h3 { font-family: var(--serif); letter-spacing: -0.015em; line-height: 1.15; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 0.2em; }
h3 { font-size: 1.2rem; }
.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 46rem; margin: 0 0 1.5rem; }
.eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; font-family: var(--sans); }

/* sections */
.hero { padding: 48px 0 24px; }
.section { padding: 40px 0; }
.section + .section { border-top: 1px solid var(--line); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 820px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: 0.35em; }
.card p { margin: 0; color: var(--muted); }
.icon-dot { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 12px; }

/* converter */
.converter { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); padding: 18px; }
.drop {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 210px;
  padding: 28px 20px;
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: var(--radius);
  cursor: pointer;
  background:
    linear-gradient(90deg, transparent 46px, color-mix(in srgb, var(--bad) 30%, transparent) 46px, color-mix(in srgb, var(--bad) 30%, transparent) 47px, transparent 47px),
    repeating-linear-gradient(180deg, var(--surface-2) 0 31px, var(--rule) 31px 32px);
  transition: border-color 0.15s, background-color 0.15s;
}
.drop:hover, .drop.over { border-color: var(--accent); }
.drop:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop strong { font-size: 1.15rem; display: block; }
.drop .hint { color: var(--muted); font-size: 14px; margin-top: 4px; }
.drop-icon { width: 44px; height: 44px; margin: 0 auto 10px; color: var(--accent); }
.file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.trust-line { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.trust-line > span::before { content: "✓ "; color: var(--accent); font-weight: 700; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 15px/1 var(--sans);
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; padding-left: 8px; padding-right: 8px; }
.btn.ghost:hover { color: var(--ink); }
.btn.small { padding: 8px 12px; font-size: 14px; }

.notice { border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: 15px; border: 1px solid transparent; }
.notice.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.notice.warn { background: var(--warn-soft); color: var(--ink); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.notice.bad { background: var(--bad-soft); color: var(--ink); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.notice[hidden] { display: none; }

.progress { margin-top: 16px; }
.progress-bar { height: 8px; background: var(--rule); border-radius: 99px; overflow: hidden; }
.progress-bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width 0.8s linear; }
.progress-text { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-top: 6px; }

/* results */
.result { margin-top: 18px; }
.result[hidden] { display: none; }
.stmt-head { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; margin-bottom: 12px; }
.stmt-head h3 { margin: 0; font-size: 1.35rem; }
.recon { border-radius: 12px; padding: 14px 16px; margin: 12px 0; display: grid; gap: 6px; }
.recon.balanced { background: var(--accent-soft); }
.recon.mismatch { background: var(--bad-soft); }
.recon.unknown { background: var(--warn-soft); }
.recon .title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.recon .eq { font-variant-numeric: tabular-nums; font-size: 15px; overflow-wrap: anywhere; }
.export-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 560px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
table.tx { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 640px; }
table.tx th, table.tx td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
table.tx th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; color: var(--muted); font-size: 13px; z-index: 1; }
table.tx td.amt, table.tx th.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tx td.neg { color: var(--bad); }
table.tx tr.flag td { background: var(--bad-soft); }
table.tx td[contenteditable="true"]:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface); }
table.tx td .why { display: block; font-size: 12px; color: var(--bad); }
.legend { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 960px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan.featured { border-color: var(--accent); outline: 2px solid var(--accent); }
.plan .price { font-family: var(--serif); font-size: 2.2rem; line-height: 1; }
.plan .per { color: var(--muted); font-size: 14px; }
.plan .btn { margin-top: auto; justify-content: center; }
.badge { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }

/* content pages */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin: 0.25em 0; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; }
details.faq { border-bottom: 1px solid var(--line); padding: 14px 0; }
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::after { content: "+"; color: var(--accent); font-weight: 700; }
details.faq[open] summary::after { content: "−"; }
details.faq p { color: var(--muted); margin: 8px 0 0; }
.link-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.link-cloud a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); text-decoration: none; color: var(--ink); font-size: 14px; }
.link-cloud a:hover { border-color: var(--accent); color: var(--accent); }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.key-box { font-family: var(--mono); font-size: clamp(1rem, 3.5vw, 1.4rem); letter-spacing: 0.04em; padding: 14px 16px; background: var(--surface-2); border: 1px dashed var(--accent); border-radius: 12px; overflow-wrap: anywhere; user-select: all; }
input.text { width: 100%; font: 16px var(--mono); padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
input.text:focus { outline: 2px solid var(--accent); border-color: transparent; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > input.text { flex: 1 1 260px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer a { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
@media (max-width: 560px) {
  .hero { padding-top: 28px; }
  .site-header .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .nav { margin-left: 0; width: 100%; }
  .converter { padding: 12px; }
  .drop { min-height: 180px; }
}

[hidden] { display: none !important; }
@media (max-width: 560px) { .hero h1 br { display: none; } }

/* purchase prompt next to a partial free result (offer.js) */
.offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; border: 1px solid var(--accent); border-radius: 12px; padding: 14px 16px; margin: 12px 0; background: var(--surface); }
.offer.soon { border-color: var(--line); background: var(--surface-2); }
.offer > div { flex: 1 1 280px; }
.offer p { margin: 4px 0 0; color: var(--muted); }
.offer .btn, .file-row .btn { white-space: normal; text-align: center; line-height: 1.25; }

/* comparison tables (/compare/) */
.compare-wrap { max-height: none; background: var(--surface); margin-top: 8px; }
table.compare { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 560px; }
table.compare th, table.compare td { padding: 12px 14px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
table.compare thead th { background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; }
table.compare tbody th { font-weight: 600; width: 20%; }
table.compare tbody tr:last-child th, table.compare tbody tr:last-child td { border-bottom: 0; }
.card h2 { font-size: 1.3rem; }
.card ul { margin: 0; padding-left: 1.2em; color: var(--muted); }
.card li { margin: 0.35em 0; }
.storage-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.multi-link { margin: 10px 0 0; font-size: 14px; }
.batch-intro { display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; gap: clamp(20px, 5vw, 72px); }
.batch-intro h1 { font-size: clamp(2.5rem, 5vw, 4.1rem); }
.batch-example { padding: 20px 22px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px; background: var(--surface); }
.batch-example h2, #batch-workspace h2 { margin: 0; }
.batch-example table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.batch-example th, .batch-example td { text-align: left; border-bottom: 1px solid var(--rule); padding: 7px 5px 7px 0; }
.batch-example thead th { font-weight: 600; color: var(--muted); }
.batch-example .gap-text { color: var(--warn); font-weight: 600; }
.batch-example p { margin: 8px 0 12px; }
.batch-section { padding-top: 0; }
#batch-workspace { scroll-margin-top: 16px; }
#batch-drop { position: relative; }
#batch-drop input { position: absolute; width: 1px; height: 1px; display: block; opacity: 0; }
#batch-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
#batch-drop .hint, .batch-row small { display: block; }
.batch-list { list-style: none; padding: 0; margin: 14px 0 0; }
.batch-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.batch-row div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.batch-row small { color: var(--muted); }
#batch-workspace p:empty, #batch-workspace .export-bar:not(:has(> :not([hidden]))) { display: none; }
@media (max-width: 720px) { .batch-intro { grid-template-columns: 1fr; } .batch-row { flex-wrap: wrap; } }

#batch-request-text { display: block; width: 100%; margin: 8px 0; font: inherit; padding: 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
