/* ————————————————————————————————————————————————————————————————
   Fasset tools — calculator components on the natural.css shell.
   Loads AFTER styles/natural.css; light-only, same warm-paper law:
   no lines in content, never box a number, sentence case, ink chrome,
   one saturated accent moment per page (the result / the chart).
   Form + figure grammar transplanted from fasset-biz css/app.css.
   ———————————————————————————————————————————————————————————————— */

:root {
  --text-subtle: oklch(0.5261 0.0088 130);
  --text-faint: oklch(0.6768 0.0072 125);
  --border-faint: oklch(0.9524 0.0048 120);
  --accent-tint: oklch(0.6061 0.1275 162 / 0.09);
  --negative: oklch(0.6113 0.1641 25.4);
  --warning: oklch(0.6293 0.1129 68.7);
  --ease: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-snappy: cubic-bezier(0.23, 1, 0.32, 1);
  --dur-1: 120ms;
  --border: oklch(0.9269 0.006 120);
  --border-strong: oklch(0.8792 0.0085 120);
  --bg-hover: oklch(0.9707 0.0048 120);
  --elev-1: 0 1px 1px rgba(20, 26, 18, 0.05), 0 3px 6px -2px rgba(20, 26, 18, 0.03);
}

/* ————— tool hero — title commands the page, calculator in the fold ————— */
.tool-hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 56px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tool-hero .kicker { margin-bottom: 10px; }
.tool-hero h1 { font-size: 40px; line-height: 1.12; letter-spacing: -0.025em; max-width: 21ch; }
.tool-hero .hero-sub { font-size: 17px; line-height: 1.55; color: var(--ink-soft); max-width: 56ch; margin: 16px 0 0; }

/* ————— the calculator — a white instrument card floating on linen ————— */
.calc-wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 8px var(--gutter) 0;
}
.calc-panel {
  border-radius: 10px;
  padding: clamp(20px, 4vw, 44px);
  background: radial-gradient(120% 130% at 8% -10%, oklch(0.6061 0.1275 162 / 0.10), transparent 62%), var(--linen);
}
.calc {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 1px rgba(20, 26, 18, 0.08), 0 1px 1px rgba(20, 26, 18, 0.05),
    0 24px 48px -12px rgba(10, 14, 8, 0.10);
  display: grid;
  grid-template-columns: minmax(300px, 5fr) 7fr;
}
.calc-inputs { padding: 32px 32px 28px; }
.calc-result {
  padding: 32px 36px 28px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
/* separation by material, not line: results sit on the faintest linen step */
.calc-result { background: oklch(0.9868 0.0032 120); border-radius: 0 8px 8px 0; }
.calc--single { grid-template-columns: 1fr; }
.calc--single .calc-result { border-radius: 0 0 8px 8px; }
@media (max-width: 900px) {
  .calc { grid-template-columns: 1fr; }
  .calc-result { border-radius: 0 0 8px 8px; }
}

/* ————— fields — quiet hairline inputs, ink focus, no glow ————— */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text-subtle); margin-bottom: 6px; }
.input, .select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.input:hover, .select:hover { border-color: var(--line-hover); }
.input:focus, .select:focus {
  border-color: var(--ink-strong);
  box-shadow: 0 0 0 0.5px var(--ink-strong);
  outline: none;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m1 1 4 4 4-4' stroke='%2371706a' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.input-amount {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  padding: 10px 12px;
}
/* amount field with a fixed currency tag inside the hairline */
.amount-field { position: relative; }
.amount-field .input-amount { padding-left: 30px; }
.amount-field .cur-sym {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--ink); pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.amount-field .cur-code {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--text-faint); pointer-events: none;
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }
.hint { font-size: 13px; line-height: 19px; color: var(--text-faint); margin-top: 6px; }

/* range slider — hairline track, ink thumb */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: none; margin: 4px 0 0; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--line); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--btn-ink); margin-top: -6.5px;
  box-shadow: 0 1px 2px rgba(20, 26, 18, 0.2);
  transition: transform var(--dur-1) var(--ease);
}
.range::-webkit-slider-thumb:hover { transform: scale(1.12); transition: none; }
.range::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line); }
.range::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--btn-ink); }
.range:focus-visible { outline: 1.5px solid oklch(0.2019 0.0108 145 / 0.35); outline-offset: 4px; border-radius: 4px; }

/* ————— segmented control — squared quiet track, white active chip ————— */
.seg { display: inline-flex; padding: 3px; background: var(--linen); border-radius: 8px; }
.seg-btn {
  padding: 5px 14px; border-radius: 6px; font-size: 13px; color: var(--text-subtle);
  cursor: pointer; border: 0; background: none; font: inherit; white-space: nowrap;
  transition: color var(--dur-1) var(--ease);
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: #fff; color: var(--ink-strong); box-shadow: var(--elev-1); }
.seg-btn:active { transform: scale(0.99); }
.seg--block { display: flex; width: 100%; flex-wrap: wrap; }
.seg--block .seg-btn { flex: 1 1 auto; text-align: center; white-space: normal; }

/* ————— results — open typography, never boxed ————— */
.result-label { font-size: 13px; color: var(--text-subtle); }
.result-hero {
  font-size: clamp(34px, 4.5vw, 42px);
  line-height: 1.15;
  font-weight: var(--w-title);
  letter-spacing: -0.02em;
  color: var(--midnight);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  white-space: nowrap;
}
.result-hero .money-dec, .result-hero .money-ccy, .result-hero .unit { color: var(--ink-ghost); }
.result-hero .money-ccy, .result-hero .unit { font-size: 0.55em; font-weight: var(--w-body); margin-left: 0.22em; letter-spacing: 0; }
.result-sub { font-size: 14px; line-height: 21px; color: var(--ink-soft); margin-top: 6px; }
.result-sub .pos { color: var(--accent); }
.result-sub .neg { color: var(--negative); }

/* per-digit assemble — figures arrive, they don't appear */
.dg { display: inline-block; animation: dg-in 240ms var(--ease) both; }
@keyframes dg-in {
  from { opacity: 0; transform: translateY(0.35em); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .dg { animation: none; } }

/* definition rows — the computed breakdown */
.def-group { padding: 4px 0; }
.def-group + .def-group { margin-top: 14px; padding-top: 14px; }
/* the one permitted hairline: above a totals line */
.def-group.totals { border-top: 1px solid var(--border-faint); }
.def-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; padding: 8px 0;
}
.def-label { color: var(--text-subtle); font-size: 14px; flex-shrink: 0; }
.def-label small { display: block; font-size: 12px; color: var(--text-faint); }
.def-value {
  color: var(--ink); text-align: right; font-size: 14px;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.def-value.strong { color: var(--ink-strong); font-weight: var(--w-medium); }
.def-value.pos { color: var(--accent); }
.def-value.neg { color: var(--negative); }

/* stat strip — columns of open figures, faint vertical hairlines only */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 8px; }
/* site.css also styles `.stat-strip > div` (min-width:180px, 32px padding) at a
   higher specificity than `> *`, which overflows the four-column tool strips;
   restate both selectors so the tool version wins. */
.stat-strip > *, .stat-strip > div { padding: 6px 20px 8px; border-left: 1px solid var(--border-faint); min-width: 0; }
.stat-strip > :first-child, .stat-strip > div:first-child { border-left: none; padding-left: 0; }
.stat-strip > div + div { border-left-color: var(--border-faint); }
.stat-strip--3 { grid-template-columns: repeat(3, 1fr); }
.stat-strip--2 { grid-template-columns: repeat(2, 1fr); }
.tile-label { font-size: 13px; color: var(--text-subtle); }
.tile-value {
  font-size: 20px; font-weight: var(--w-medium); color: var(--ink-strong);
  line-height: 1.2; margin-top: 5px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  white-space: nowrap;
}
.tile-value .money-dec, .tile-value .unit { color: var(--text-faint); font-weight: var(--w-body); }
.tile-value .unit { font-size: 0.7em; margin-left: 0.15em; }
.tile-sub { font-size: 12.5px; color: var(--text-faint); margin-top: 3px; }
@media (max-width: 640px) {
  .stat-strip, .stat-strip--3 { grid-template-columns: repeat(2, 1fr); }
  .stat-strip > :nth-child(odd), .stat-strip > div:nth-child(odd) { border-left: none; padding-left: 0; }
  .stat-strip > *, .stat-strip > div { padding: 6px 14px 8px; }
}

/* meter rows — labeled horizontal bars (fee comparisons, percentiles) */
.meter-list { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.meter { display: grid; grid-template-columns: 132px 1fr auto; align-items: center; gap: 14px; }
/* site.css/natural.css own a global page-layout `.hero`; `.meter.hero` must stay
   a meter row, so restate the row layout at higher specificity. */
.meter.hero {
  display: grid; align-items: center; gap: 14px;
  max-width: none; margin: 0; padding: 0; text-align: left;
}
.meter .m-label { font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter .m-track { height: 6px; border-radius: 3px; background: var(--linen); overflow: hidden; }
.meter .m-fill {
  display: block; height: 100%; border-radius: 3px; background: var(--ink-ghost);
  transform-origin: left; transition: width 600ms var(--ease-out-soft);
}
.meter.hero .m-fill { background: var(--accent); }
.meter.hero .m-label, .meter.hero .m-value { color: var(--ink-strong); font-weight: var(--w-medium); }
.meter .m-value { font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* chart host + readout (js/chart.js) */
.chart-block { margin-top: 10px; }
.chart-readout { display: flex; flex-direction: column; margin-bottom: 4px; }
.chart-host { width: 100%; }
.chart-host svg { display: block; width: 100%; }
.ac-crosshair { stroke: var(--line-hover); stroke-width: 1; }
.ac-dot { fill: var(--accent); }
.ac-dot-glow { fill: var(--accent); opacity: 0.15; }

/* ————— SEO body: methodology, tables, faq ————— */
.tool-section {
  max-width: 880px;
  margin: 0 auto;
  padding: 72px var(--gutter) 0;
}
.tool-section > .kicker { margin-bottom: 8px; }
.tool-section h2 { font-size: 26px; line-height: 34px; letter-spacing: -0.022em; }
.tool-section .lede { color: var(--ink-soft); margin-top: 12px; max-width: 62ch; }
/* site.css's `.prose` is the blog measure (680px, centred, section-pad bottom);
   inside a tool section the body must align with its own H2 and not trail
   120px of dead air before the source line. */
.tool-section .prose {
  max-width: none; margin: 16px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.tool-section .prose p { color: var(--ink); max-width: 68ch; }
.tool-section .prose p.muted { color: var(--ink-soft); }
.tool-section .prose a { color: var(--ink-strong); text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 3px; }
.tool-section .prose a:hover { text-decoration-color: var(--ink-soft); }

/* data table — no row borders, height + alignment separate */
.data-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.data-table th {
  text-align: left; font-weight: var(--w-body); font-size: 13px; color: var(--text-subtle);
  padding: 0 16px 10px 0;
}
.data-table th:last-child, .data-table td:last-child { text-align: right; padding-right: 0; }
/* money grammar: every column after the label column carries figures, so it
   right-aligns; a page with a prose column opts that column back out. */
.data-table th:not(:first-child), .data-table td:not(:first-child) { text-align: right; }
.data-table th:not(:first-child):not(:last-child), .data-table td:not(:first-child):not(:last-child) { padding-right: 28px; }
.data-table td {
  padding: 13px 16px 13px 0; font-size: 14.5px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.data-table td:first-child { color: var(--ink-strong); }
.data-table tr { transition: background var(--dur-1) var(--ease); }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table .sub { display: block; font-size: 12.5px; color: var(--text-faint); margin-top: 1px; }

/* faq — quiet disclosure, no boxes */
.faq { margin-top: 12px; }
.faq details { padding: 18px 0; }
.faq details + details { border-top: 1px solid var(--border-faint); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between;
  align-items: baseline; gap: 16px; font-size: 16px; color: var(--ink-strong);
  font-weight: var(--w-medium);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-faint); font-size: 18px; transition: transform 200ms var(--ease-snappy); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-soft); margin-top: 10px; max-width: 64ch; }
.faq details p + p { margin-top: 8px; }
/* prose links in answers read as links, same treatment as .tool-section .prose a */
.faq details p a { color: var(--ink-strong); text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 3px; }
.faq details p a:hover { text-decoration-color: var(--ink-soft); }

/* footnote / source line */
.srcline { font-size: 13px; line-height: 20px; color: var(--legal); margin-top: 18px; max-width: 68ch; }

/* ————— cross-links: more tools ————— */
.more-tools {
  max-width: var(--container); margin: 0 auto;
  padding: 96px var(--gutter) 104px;
}
.more-tools h2 { font-size: 26px; letter-spacing: -0.022em; }
.tool-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 24px; }
.tool-link {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 18px 20px; border-radius: 10px; margin: -2px;
  transition: background var(--dur-1) var(--ease);
}
.tool-link:hover { background: var(--bg-hover); transition: none; }
.tool-link .t-name { font-size: 15px; color: var(--ink-strong); font-weight: var(--w-medium); }
.tool-link .t-desc { font-size: 13.5px; line-height: 20px; color: var(--ink-soft); }
@media (max-width: 900px) { .tool-links { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tool-links { grid-template-columns: 1fr; } }

/* ————— hub page grid ————— */
.hub-grid {
  max-width: var(--container); margin: 0 auto;
  padding: 24px var(--gutter) 104px;
  display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; gap: 24px;
}
.hub-card {
  display: flex; flex-direction: column;
  border-radius: 10px; padding: 36px 36px 32px;
  background: var(--linen);
  transition: transform 300ms var(--ease-out-soft);
}
.hub-card:nth-child(1) { background: radial-gradient(120% 130% at 8% -10%, oklch(0.6061 0.1275 162 / 0.10), transparent 62%), var(--linen); }
.hub-card:nth-child(2) { background: radial-gradient(120% 130% at 92% -10%, oklch(0.6061 0.1275 162 / 0.09), transparent 60%), var(--linen); }
.hub-card:nth-child(3) { background: radial-gradient(120% 130% at 6% 110%, oklch(0.6061 0.1275 162 / 0.08), transparent 60%), var(--linen); }
.hub-card:nth-child(4) { background: radial-gradient(120% 130% at 94% 110%, oklch(0.6061 0.1275 162 / 0.09), transparent 60%), var(--linen); }
.hub-card:nth-child(5) { background: radial-gradient(130% 140% at 50% -20%, oklch(0.6061 0.1275 162 / 0.10), transparent 62%), var(--linen); }
.hub-card:active { transform: scale(0.995); }
.hub-card .kicker { font-size: 13.5px; }
.hub-card h3 { font-size: 21px; line-height: 28px; letter-spacing: -0.018em; margin-top: 6px; font-weight: var(--w-title); }
.hub-card p { color: var(--ink-soft); margin-top: 8px; max-width: 44ch; }
.hub-card .hub-go { margin-top: auto; padding-top: 28px; font-size: 14.5px; color: var(--ink-strong); font-weight: var(--w-medium); }
@media (max-width: 800px) { .hub-grid { grid-template-columns: 1fr; } }

/* ————— shared page bits ————— */
/* NOTE: this site's shared nav/footer chrome (site.css + natural.css) now
   owns .nav, .nav-brand, .nav-links styling on ported tool pages — the
   tools-specific two-line "Business / Tools" lockup rules that used to
   live here were removed on port to avoid a specificity fight. */

/* the funnel bridge — one section-scale head and one sentence, no CTA of its own */
.bridge {
  max-width: 880px; margin: 0 auto; padding: 88px var(--gutter) 0;
  display: flex; flex-direction: column; gap: 12px;
}
.bridge h2 { font-size: 26px; line-height: 34px; letter-spacing: -0.022em; max-width: 34ch; }
.bridge p { color: var(--ink-soft); max-width: 58ch; }
.bridge p a { color: var(--ink-strong); text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 3px; }
.bridge p a:hover { text-decoration-color: var(--ink-soft); }

.disclaimer { font-size: 13px; line-height: 20px; color: var(--legal); max-width: 68ch; }

@media (max-width: 900px) {
  .tool-hero h1 { font-size: 32px; }
  .calc-inputs, .calc-result { padding: 24px 22px; }
}

/* ————— phone ————— */
@media (max-width: 640px) {
  /* inputs at 16px so iOS Safari doesn't zoom the page on focus */
  .input, .select { font-size: 16px; }
  .input-amount { font-size: 19px; }

  .tool-hero { padding-top: 36px; }
  .tool-hero h1 { font-size: 29px; }
  .tool-hero .hero-sub { font-size: 15.5px; }
  .tool-section { padding-top: 56px; }
  .tool-section h2 { font-size: 22px; line-height: 29px; }
  .bridge h2 { font-size: 22px; line-height: 29px; }
  .more-tools { padding-top: 64px; padding-bottom: 72px; }
  .result-hero { font-size: 31px; }

  /* wide tables scroll inside themselves, never the page */
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table th, .data-table td { white-space: nowrap; }

  /* meters stack: label + value on one line, the bar full-width below */
  .meter, .meter.hero {
    grid-template-columns: 1fr auto;
    grid-template-areas: "label value" "track track";
    row-gap: 5px;
    column-gap: 10px;
  }
  .meter .m-label { grid-area: label; }
  .meter .m-value { grid-area: value; }
  .meter .m-track { grid-area: track; }
  .meter-list { gap: 18px; }
}


/* Phones: stat columns stack; separation returns to whitespace. */
@media (max-width: 480px) {
  .stat-strip, .stat-strip--3, .stat-strip--2 { grid-template-columns: 1fr; row-gap: 18px; }
  .stat-strip > *, .stat-strip > div { border-left: none; padding-left: 0; padding-right: 0; }
  .def-label { flex-shrink: 1; }
}
