/* Keepsum page CSS: calculator widgets, rate tables, payout bars, tool directory panels, email preview and legal layout */

.hero-copy > .hero-kicker {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  color: var(--accent);
  font-weight: 500;
  margin: 0;
}
.hero-copy > .hero-kicker a { text-decoration: underline; text-underline-offset: 3px; }
.hero-copy > .hero-kicker + h1 { margin-top: var(--s-3); }
.hero h1 { font-size: min(var(--ly-h1), 3.75rem); }

/* Hero live calculator ledger card */
.hero-calc { display: flex; align-items: flex-start; }
.calc {
  width: 100%;
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  background: #ffffff;
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 50px -28px rgb(11 12 14 / .22);
  font-family: var(--font-text);
}
.calc__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.calc__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  margin: 0;
}
.calc__ic { width: 18px; height: 18px; color: var(--accent); flex: none; }
.calc__src {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.calc__src:hover { color: var(--action); }

.calc__seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.calc__seg--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calc__seg button {
  min-height: 44px;
  padding: 6px 10px;
  border-radius: var(--r-btn);
  border: 1px solid color-mix(in oklab, var(--ink) 18%, transparent);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.calc__seg button[aria-pressed="true"] {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}
.calc__seg button:hover:not([aria-pressed="true"]) {
  border-color: var(--ink);
}

.calc__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3) var(--s-4);
}
.calc__field { display: grid; gap: 4px; font-size: .8125rem; color: var(--muted); font-weight: 500; }
.calc__field input,
.calc__field select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid color-mix(in oklab, var(--ink) 20%, transparent);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: .9375rem;
  font-variant-numeric: tabular-nums;
}
.calc__field select { font-family: var(--font-text); }
.calc__field input:focus,
.calc__field select:focus {
  outline: 2px solid var(--action);
  outline-offset: 1px;
  border-color: var(--action);
}

.calc__checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
}
.calc__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: .875rem;
  color: var(--ink);
  cursor: pointer;
}
.calc__check input { width: 18px; height: 18px; accent-color: var(--action); margin: 0; flex: none; }

.calc__details {
  border-top: 1px solid var(--line);
  padding-top: var(--s-2);
}
.calc__details summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: .875rem;
  font-weight: 500;
  color: var(--action);
}
.calc__details[open] .calc__fields { margin-top: var(--s-2); }

/* Ledger output table inside hero */
.calc__tablewrap { overflow-x: auto; border-top: 1px solid var(--line); padding-top: var(--s-2); }
.calc__table { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
.calc__table th,
.calc__table td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
.calc__table thead th { font-size: .75rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.calc__table th:first-child,
.calc__table td:first-child { text-align: left; padding-left: 0; }
.calc__table td:last-child,
.calc__table thead th:last-child { padding-right: 0; }
.calc__table tbody th { font-weight: 500; color: var(--ink); }
.calc__table tbody td { font-family: var(--font-mono); font-size: .8125rem; }
.calc__rate { display: block; font-family: var(--font-mono); font-size: .75rem; color: var(--muted); font-weight: 400; }
.calc__table tr.is-focus { background: color-mix(in oklab, var(--accent) 7%, transparent); }
.calc__table tr.is-focus th:first-child { color: var(--accent); padding-left: 6px; }
.calc__table tr.is-focus td:last-child { padding-right: 6px; }
.calc__table tr:last-child > * { border-bottom: 0; }

/* 3-stat readout for Etsy / PayPal / Stripe-vs-LS calculators */
.calc__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}
.calc__stat {
  padding: var(--s-3);
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--line);
}
.calc__stat.is-accent {
  background: color-mix(in oklab, var(--accent) 8%, #ffffff);
  border-color: color-mix(in oklab, var(--accent) 28%, transparent);
}
.calc__stat span { display: block; font-size: .75rem; color: var(--muted); }
.calc__stat strong { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 1.25rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); }
.calc__stat.is-accent strong { color: var(--accent); }
.calc__stat em { display: block; margin-top: 2px; font-style: normal; font-size: .75rem; color: var(--muted); }

.calc__lines { list-style: none; margin: 0; padding: 0; display: grid; }
.calc__lines li {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 6px 0;
  font-size: .8125rem;
  border-bottom: 1px solid var(--line);
}
.calc__lines li:last-child { border-bottom: 0; }
.calc__lines li b { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

.calc__note { margin: 0; font-size: .75rem; color: var(--muted); line-height: 1.45; }

/* Section 2: Published rate table + payout bars */
#breakdown > .wrap,
#notify > .wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ptable {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  font-family: var(--font-text);
  overflow-x: auto;
}
.ptable table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ptable th,
.ptable td { padding: 12px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.ptable thead th { font-size: .75rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ptable th:first-child { text-align: left; padding-left: 0; }
.ptable td:last-child,
.ptable thead th:last-child { padding-right: 0; }
.ptable tbody th { font-weight: 500; text-align: left; }
.ptable tbody th a { text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--ink) 28%, transparent); text-underline-offset: 3px; }
.ptable tbody th a:hover { color: var(--action); }
.ptable tbody td { font-family: var(--font-mono); font-size: .875rem; white-space: nowrap; }
.ptable tbody tr:last-child > * { border-bottom: 0; }
.ptable__note { margin: 12px 0 0; font-size: .8125rem; color: var(--muted); }
.src-line { color: var(--muted); font-size: var(--t-small); }
.src-line a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.src-line a:hover { color: var(--action); }
.notes-list { margin: 0; padding-left: 20px; display: grid; gap: var(--s-2); color: var(--ink); }

.keep-bars {
  padding: var(--s-4);
  background: #ffffff;
  border: 1px solid color-mix(in oklab, var(--ink) 14%, transparent);
  border-radius: var(--r-lg);
  display: grid;
  gap: 10px;
}
.keep-bars__h {
  margin: 0;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.keep-bars__row {
  display: grid;
  grid-template-columns: 124px 1fr 62px;
  align-items: center;
  gap: 10px;
  font-size: .8125rem;
}
.keep-bars__row span { color: var(--ink); font-weight: 500; }
.keep-bars__row i {
  display: block;
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.keep-bars__row i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  background: var(--accent);
  border-radius: 4px;
}
.keep-bars__row b {
  font-family: var(--font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Section 3: Grouped calculator directory (3 visual cards + marquee moment) */
#tools .card--row { gap: var(--s-3); }
#tools .panel { --p-h: 72px; }
.tool-band {
  width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-3) var(--s-4);
}
.tool-band__icons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-band__icons img { width: 24px; height: 24px; object-fit: contain; display: block; }
.tool-band__tag {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
}
.tool-links { list-style: none; margin: 0; padding: 0; display: grid; }
.tool-links li { border-top: 1px solid var(--line); }
.tool-links li:first-child { border-top: 0; }
.tool-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: 38px;
  padding: 5px 0;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink);
  transition: color .15s;
}
.tool-links a span {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}
.tool-links a:hover,
.tool-links a[aria-current="page"] { color: var(--action); }
.tool-links a[aria-current="page"] span { color: var(--action); }
.card__foot { margin-top: auto; padding-top: var(--s-2); }

.rates-marquee { margin-top: var(--s-5); min-width: 0; max-width: 100%; overflow: hidden; }
.rates-marquee > .t-label { margin-bottom: var(--s-2); }
.rates-marquee > [data-moment] { min-width: 0; max-width: 100%; }

/* Section 4: Email notification waitlist + preview */
.wl { align-items: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mail { max-width: 480px; margin-inline: auto; font-size: 13px; background: #ffffff; color: #0b0c0e; --u-ink: #0b0c0e; --u-muted: #5d6470; border: 1px solid var(--line-strong); border-radius: var(--r-lg); overflow: hidden; }
.mail__bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--bg); }
.mail__head { display: grid; gap: 4px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.mail__from { color: var(--muted); font-size: 12px; }
.mail__subject { font-size: 16px; font-weight: 600; color: var(--ink); }
.mail__to { color: var(--muted); font-size: 12px; }
.mail__body { padding: 20px 22px 24px; display: grid; gap: 14px; color: #0b0c0e; }
.mail__body p { margin: 0; font-size: 14px; line-height: 1.5; }
.mail__rows { list-style: none; margin: 0; padding: 0; display: grid; }
.mail__rows li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mail__rows span { color: var(--muted); }
.mail__rows b { font-family: var(--font-mono); font-weight: 500; }
.mail__p { font-weight: 500; }
.mail__steps { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.mail__btn { display: inline-block; justify-self: start; padding: 8px 14px; border-radius: var(--r-btn); background: var(--action); color: var(--action-ink); font-weight: 500; font-size: 13px; }

/* FAQ & Legal */
.faq__ic { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; margin-right: 10px; }
.faq > .faq__item { padding: 9px 0; }
.faq__item p { margin-top: 4px; }
.faq__item h3 { display: flex; align-items: flex-start; font-size: 1.0625rem; }
.legal__form { padding: var(--s-6); background: #ffffff; border: 1px solid var(--line-strong); border-radius: var(--r-lg); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Responsive adjustments */
@media (max-width: 1279px) {
  #tools { --h: 2; }
}
@media (max-width: 1023px) {
  main > .hero { height: auto; min-height: 100svh; }
  main > .hero > .wrap { height: auto; }
  .hero-split > .hero-calc { flex: none; height: auto; }
  .hero-copy > .hero-kicker,
  .hero-copy > .t-lead,
  .hero-facts { display: none; }
  .hero-text.hero-split { gap: var(--s-3); }
}
@media (max-width: 767px) {
  .tool-links a { min-height: 44px; padding: 8px 0; }
  .ptable tbody th a, .src-line a { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 639px) {
  .calc__head,
  .calc__note { display: none; }
  .hero h1 { font-size: 2.125rem; line-height: 1.08; }
  .hero-copy > .btn-row { display: flex; margin-top: var(--s-3); }
  .calc { padding: var(--s-3); gap: var(--s-2); }
  .calc__fields { gap: var(--s-2); }
  .calc__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .calc__stat { padding: 8px; }
  .calc__stat strong { font-size: 1rem; }
  .calc__stat em { display: none; }
  .calc__lines { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .calc__lines li { padding: 3px 0; font-size: .75rem; }
  main > .hero { padding-top: calc(var(--nav) + 16px); }
  [data-calc="etsy"] .calc__checks, [data-calc="paypal"] .calc__checks { gap: 2px 12px; }
  [data-calc="etsy"] .calc__field { gap: 1px; font-size: .75rem; }
  [data-calc="etsy"] .calc__lines { display: none; }
  [data-calc="etsy"] .calc__check, [data-calc="paypal"] .calc__check { min-height: 36px; font-size: .8125rem; }
  .calc__seg--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calc__table .col-hide-sm,
  .ptable .col-hide-sm { display: none; }
  .calc__table th,
  .calc__table td { padding: 5px 4px; font-size: .8125rem; }
  .calc__rate { display: none; }
  #breakdown .keep-bars,
  #breakdown .src-line,
  #breakdown .ptable__note { display: none; }
  .ptable { padding: var(--s-4); }
  .ptable th,
  .ptable td { padding: 6px 6px; font-size: .8125rem; }
  #tools { --hm: 2; }
  #tools .card > p { display: none; }
  #tools .section-head { margin-bottom: var(--s-4); }
  #tools .grid { row-gap: var(--s-4); }
  #tools .card--row { padding: var(--s-4); gap: var(--s-3); }
  #tools .panel { --p-h: 64px; }
  #tools .tool-links a { min-height: 44px; padding: 4px 0; }
  #tools .rates-marquee { margin-top: var(--s-4); }
  #questions { --hm: 2; }
    #questions .faq > .faq__item { padding: 52px 0; }
  #questions .faq:has(.faq__item:nth-child(5)) > .faq__item { padding: 10px 0; }
  #questions .grid { row-gap: var(--s-6); }
  #notify .mail__bar,
  #notify .mail__p,
  #notify .mail__steps,
  #notify .mail__rows { display: none; }
  #notify .wl { row-gap: var(--s-2); }
  #notify .stack-5 { gap: var(--s-2); }
  #notify .mail__head { padding: 8px 14px; }
  #notify .mail__body { padding: 10px 14px; gap: 6px; }
}

@media (max-width: 1100px), (max-height: 820px) {
  .calc { padding: var(--s-3) var(--s-4); gap: var(--s-2); }
  .calc__table th, .calc__table td { padding: 4px 5px; }
  .calc__rate { display: none; }
  .calc__details { padding-top: 2px; }
}

@media (max-width: 639px) {
  footer.closing a.btn.btn--primary, footer.closing a.btn.btn--primary::after { transition: none; }
}
