/* TokenCostCalc — single stylesheet, no external fonts, no imports. */

:root {
  --bg: #ffffff;
  --soft: #f8fafc;
  --soft-2: #f1f5f9;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --brand-soft: #eff6ff;
  --good: #047857;
  --warn: #b45309;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  --wrap: 1140px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.22; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
h4 { font-size: 0.95rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: 0.4em; }
strong { color: var(--ink); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 0.8rem; letter-spacing: 0.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1rem; letter-spacing: -0.01em; }
.brand-text small { color: var(--muted); font-size: 0.72rem; }
.site-nav {
  display: flex; gap: 6px; margin-left: auto; overflow-x: auto; scrollbar-width: none; padding: 4px 0;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 7px 11px; border-radius: 8px; color: var(--ink-2); font-size: 0.88rem;
  font-weight: 600; white-space: nowrap;
}
.site-nav a:hover { background: var(--soft-2); color: var(--brand); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--soft) 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
  padding: 44px 0 34px;
}
.eyebrow {
  display: inline-block; margin: 0 0 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-2); font-size: 0.75rem;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.hero h1 { max-width: 20ch; }
.lede { color: var(--ink-2); font-size: 1.05rem; max-width: 68ch; }
.hero-points { list-style: none; padding: 0; margin: 1.2em 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.hero-points li {
  color: var(--ink-2); font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 7px;
}
.hero-points li::before {
  content: ""; width: 15px; height: 15px; flex: 0 0 15px; border-radius: 50%;
  background: var(--good) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6L9 17l-5-5'/></svg>") center/10px no-repeat;
}

/* ---------- calculator ---------- */
.calc {
  margin: 28px 0 8px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.calc-head { padding: 22px 24px 0; }
.calc-head h2 { margin-bottom: 6px; }
.calc-lede { color: var(--muted); font-size: 0.95rem; margin-bottom: 14px; }
.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.preset-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.chip {
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font: inherit;
  font-size: 0.85rem; font-weight: 600; padding: 6px 13px; border-radius: 999px; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-2); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.calc-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; padding: 22px 24px; }
.field-grid { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-head label { font-weight: 600; font-size: 0.9rem; }
.field-val {
  font-family: var(--mono); font-size: 0.86rem; font-weight: 700; color: var(--brand-2);
  background: var(--brand-soft); padding: 2px 8px; border-radius: 6px;
}
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--soft-2); border: 1px solid var(--line); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--brand), 0 2px 6px rgba(37, 99, 235, 0.35);
  margin-top: -7px;
}
.range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--soft-2); border: 1px solid var(--line); }
.range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--brand);
  border: 3px solid #fff; box-shadow: 0 0 0 1px var(--brand);
}
.range:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.num {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px;
  font: inherit; font-size: 0.95rem; font-variant-numeric: tabular-nums; color: var(--ink); background: #fff;
}
.num:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.hint { margin: 0; color: var(--muted); font-size: 0.78rem; }

.calc-side { border-left: 1px solid var(--line); padding-left: 24px; display: grid; align-content: start; gap: 12px; }
.side-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 40px; height: 23px; border-radius: 999px; background: var(--line-2); position: relative;
  flex: 0 0 40px; transition: background 0.16s ease;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.16s ease;
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch-text { font-weight: 600; }

.custom-box { margin-top: 4px; padding: 14px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--soft); }
.custom-box h4 { margin: 0 0 4px; }
.mini-field { display: grid; gap: 3px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.mini-field input {
  width: 100%; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 7px;
  font: inherit; font-size: 0.85rem; font-variant-numeric: tabular-nums; background: #fff; color: var(--ink);
}
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }

.calc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.btn {
  font: inherit; font-size: 0.86rem; font-weight: 700; padding: 9px 14px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--soft-2); border-color: var(--brand); color: var(--brand-2); }
.copy-status { margin: 0; font-size: 0.78rem; color: var(--good); min-height: 1.1em; }

.calc-results { border-top: 1px solid var(--line); padding: 18px 24px 22px; background: var(--soft); }
.summary-line { font-size: 0.92rem; color: var(--ink-2); margin: 0 0 12px; }
.summary-line strong { color: var(--brand-2); }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.cost-table { width: 100%; border-collapse: collapse; min-width: 700px; font-size: 0.88rem; }
.cost-table th, .cost-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cost-table thead th {
  background: var(--soft-2); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 700; white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.cost-table tbody tr:hover { background: #fbfdff; }
.cost-table tbody tr:last-child th, .cost-table tbody tr:last-child td { border-bottom: 0; }
.cost-table .ta-r { text-align: right; font-variant-numeric: tabular-nums; }
.cost-table .strong { font-weight: 700; color: var(--ink); }
.cost-table .save { color: var(--good); font-weight: 700; font-size: 0.82rem; }
.cost-table .bar-col { width: 22%; min-width: 110px; }
.m-name { display: block; font-weight: 700; color: var(--ink); }
.m-vendor { display: block; font-size: 0.74rem; color: var(--muted); font-weight: 500; }
.cost-table tbody tr.is-compare-a { background: var(--brand-soft); }
.cost-table tbody tr.is-compare-b { background: #f0fdf4; }
.cost-table tbody tr.is-compare-a th, .cost-table tbody tr.is-compare-b th { box-shadow: inset 3px 0 0 var(--brand); }
.cost-table tbody tr.is-compare-b th { box-shadow: inset 3px 0 0 var(--good); }
.cost-table tbody tr.is-custom th { font-style: italic; }
.bar { display: block; height: 8px; border-radius: 999px; background: var(--soft-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, var(--brand-2)); transition: width 0.25s ease; }
.table-note { margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); }
.price-table .off { display: block; font-size: 0.78rem; color: var(--warn); font-weight: 600; }
.off-cell { white-space: nowrap; }
.custom-row th, .custom-row td { background: var(--soft); color: var(--muted); font-size: 0.82rem; }

/* ---------- compare card ---------- */
.compare-card {
  position: sticky; top: 68px; z-index: 20; margin: 22px 0 26px;
  border: 1px solid var(--brand); border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, var(--brand-soft));
  box-shadow: 0 12px 32px -18px rgba(37, 99, 235, 0.5); padding: 18px 20px 14px;
}
.compare-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 12px; }
.pill {
  background: var(--brand); color: #fff; font-size: 0.7rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px;
}
.compare-label { margin: 0; font-size: 0.8rem; color: var(--ink-2); }
.compare-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.compare-side { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; position: relative; }
.compare-side .tag {
  position: absolute; top: -9px; left: 12px; font-size: 0.66rem; font-weight: 800; color: #fff;
  padding: 1px 7px; border-radius: 999px; letter-spacing: 0.06em;
}
.tag-a { background: var(--brand); }
.tag-b { background: var(--good); }
.compare-side h3 { font-size: 0.95rem; margin: 2px 0 6px; }
.compare-side .big { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.compare-side .small { margin: 0; font-size: 0.76rem; color: var(--muted); }
.compare-mid { text-align: center; padding: 6px; }
.diff-amount { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--brand-2); font-variant-numeric: tabular-nums; }
.diff-pct { margin: 0 0 4px; font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.diff-note { margin: 0; font-size: 0.78rem; color: var(--ink-2); }
.compare-foot { margin: 12px 0 0; font-size: 0.76rem; color: var(--muted); }

/* ---------- content sections ---------- */
.section { margin: 34px 0; }
.page-head { padding: 26px 0 6px; }
.page-head h1 { max-width: 30ch; }
.meta-line {
  font-size: 0.82rem; color: var(--muted); font-family: var(--mono);
  background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}
.prose p, .legal p { color: var(--ink-2); }
.prose h2, .legal h2 { margin-top: 1.4em; }
.formula {
  background: var(--soft-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; overflow-x: auto; font-size: 0.82rem; line-height: 1.7; margin: 0 0 1.2em;
}
.formula code { font-family: var(--mono); color: var(--ink); }
.steps li { margin-bottom: 0.6em; }
.numbered li { margin-bottom: 0.7em; color: var(--ink-2); }
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 26px; margin-bottom: 0.65em; color: var(--ink-2); }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.45em; width: 15px; height: 15px; border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6L9 17l-5-5'/></svg>") center/10px no-repeat;
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 20px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: #fff; }
.stat-label { margin: 0; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.stat-value { margin: 4px 0 2px; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-note { margin: 0; font-size: 0.74rem; color: var(--muted); }
.stat-grid.tall .stat { background: var(--brand-soft); border-color: #bfdbfe; }
.stat-grid.tall .stat-value { color: var(--brand-2); }
.breakdown-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 8px 0 4px; }
.breakdown-table th, .breakdown-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.breakdown-table thead th { background: var(--soft-2); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.breakdown-table th:first-child, .breakdown-table td:first-child { text-align: left; }
.breakdown-table .row-total { font-weight: 700; background: var(--soft); }
.callout { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.callout p { margin: 0; color: var(--ink-2); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.pick { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--soft); }
.pick h3 { font-size: 0.95rem; margin-bottom: 6px; color: var(--brand-2); }
.pick p { margin: 0; font-size: 0.9rem; color: var(--ink-2); }

/* ---------- faq / related / directory ---------- */
.faq-list { display: grid; gap: 14px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; background: #fff; }
.faq-item h3 { font-size: 0.98rem; margin-bottom: 6px; }
.faq-item p { margin: 0; color: var(--ink-2); font-size: 0.92rem; }
.related-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.related-list li { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; background: #fff; }
.related-list a { font-weight: 700; }
.related-list span { color: var(--muted); font-size: 0.88rem; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.dir-grid h3 { font-size: 0.95rem; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin-bottom: 6px; font-size: 0.88rem; }
.rec-slot {
  margin: 34px 0; border: 1px dashed var(--line-2); border-radius: var(--radius);
  background: var(--soft); padding: 20px 22px;
}
.rec-kicker { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.rec-inner h3 { font-size: 1rem; margin-bottom: 6px; }
.rec-inner p { margin: 0; color: var(--muted); font-size: 0.86rem; }

/* ---------- legal ---------- */
.legal { max-width: 780px; padding: 26px 0 10px; }
.legal .updated { font-size: 0.8rem; color: var(--muted); font-family: var(--mono); }
.contact-card {
  border: 1px solid var(--line); background: var(--soft); border-radius: var(--radius-sm);
  padding: 14px 18px; font-size: 1.1rem; font-weight: 700; display: inline-block;
}
.crumbs { font-size: 0.78rem; color: var(--muted); padding: 14px 20px 0; max-width: var(--wrap); margin: 0 auto; }
.crumbs a { color: var(--muted); }
.crumbs .sep { margin: 0 6px; color: var(--line-2); }
.crumbs [aria-current] { color: var(--ink-2); font-weight: 600; }

/* ---------- footer ---------- */
.site-footer { margin-top: 48px; background: #0f172a; color: #cbd5e1; padding: 34px 0 22px; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 22px; }
.foot-col h4 { color: #f1f5f9; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin-bottom: 6px; font-size: 0.84rem; }
.foot-col a { color: #94a3b8; }
.foot-col a:hover { color: #ffffff; }
.foot-bottom { border-top: 1px solid #1e293b; margin-top: 24px; padding-top: 16px; }
.foot-note { font-size: 0.8rem; color: #94a3b8; margin: 0 0 8px; max-width: 78ch; }
.foot-note strong { color: #e2e8f0; }
.foot-meta { font-size: 0.78rem; color: #64748b; margin: 0; }
.foot-meta a { color: #94a3b8; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .calc-body { grid-template-columns: 1fr; gap: 18px; }
  .calc-side { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 16px; }
  .compare-card { position: static; }
}
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 16px; }
  .header-inner { padding-bottom: 6px; }
  .site-nav { width: 100%; margin-left: 0; order: 3; border-top: 1px solid var(--line); padding-top: 6px; }
  .site-nav a { padding: 6px 9px; font-size: 0.84rem; }
  .hero { padding: 30px 0 24px; }
  .calc-head, .calc-body, .calc-results { padding-left: 16px; padding-right: 16px; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-side { padding: 10px 12px; }
  .compare-side .big { font-size: 1.35rem; }
  .compare-mid { order: 3; }
  .mini-grid { grid-template-columns: 1fr 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .foot-bottom { margin-top: 18px; }
}
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr; }
  .calc-actions .btn { width: 100%; }
  .brand-text small { display: none; }
}
@media print {
  .site-header, .site-footer, .calc-actions, .rec-slot, .site-nav { display: none; }
  .compare-card { position: static; box-shadow: none; }
}