/* Feeproof — design system
   Concept: the warehouse floor. Cool concrete page, white thermal-label
   result card with heavy black rules, cobalt for interaction, packing-tape
   yellow reserved for fee-cliff callouts. One family for text (Inter, tabular
   figures for money), a condensed grotesque for headings (TeX Gyre Heros Cn). */

@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-400.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-500.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-600.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Heros Cn'; src: url('/assets/fonts/heroscn-700.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Heros Cn'; src: url('/assets/fonts/heroscn-400.woff') format('woff'); font-weight: 400; font-display: swap; }

:root {
  --concrete: #E3E6E9;
  --concrete-2: #D6DADE;
  --paper: #FFFFFF;
  --ink: #16191D;
  --ink-2: #4C545D;
  --ink-3: #6E7780;
  --rule: #000000;
  --line: #C3C9CF;
  --cobalt: #1E3FCE;
  --cobalt-ink: #1834AD;
  --cobalt-wash: #E8ECFB;
  --tape: #F4CE3B;
  --tape-ink: #4A3B00;
  --gain: #07724A;
  --loss: #B3232A;
  --focus: #1E3FCE;

  --f-text: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-cond: 'Heros Cn', 'Arial Narrow', 'Helvetica Neue Condensed', sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --step-4: 2.75rem;
  --step-5: 3.75rem;

  --r-field: 6px;
  --r-label: 3px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--concrete); color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--f-text);
  font-feature-settings: 'cv11', 'ss01';
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--cobalt-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.num, table td.n, .money { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ header */
.site-head { border-bottom: 2px solid var(--rule); background: var(--concrete); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 26px; height: 26px; }
.brand-name { font: 700 1.5rem/1 var(--f-cond); letter-spacing: 0.01em; }
.nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.9375rem; padding: 8px 10px; border-radius: 4px; }
.nav a:hover { background: var(--concrete-2); }
.nav a[aria-current='page'] { box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.nav-toggle { display: none; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ------------------------------------------------------------ type */
h1, h2, h3 { font-family: var(--f-cond); font-weight: 700; line-height: 1.02; letter-spacing: -0.005em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6vw, var(--step-5)); }
h2 { font-size: clamp(1.75rem, 3.6vw, var(--step-4)); }
h3 { font-size: var(--step-2); line-height: 1.1; }
p { margin: 0 0 1em; }
.lede { font-size: var(--step-1); color: var(--ink-2); max-width: 46ch; line-height: 1.5; }

/* ------------------------------------------------------------ hero */
.hero { padding: clamp(28px, 5vw, 56px) 0 24px; display: grid; grid-template-columns: 1fr auto; gap: 24px 48px; align-items: end; }
.hero h1 { max-width: 12ch; }
.hero .lede { margin: 16px 0 0; }
.ratecheck { font-size: var(--step--1); color: var(--ink-2); border-left: 3px solid var(--rule); padding: 2px 0 2px 12px; max-width: 34ch; }
.ratecheck strong { color: var(--ink); font-weight: 600; display: block; }

/* ------------------------------------------------------------ calculator layout */
.calc { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; padding-bottom: 64px; }
.form { display: grid; gap: 14px; }
.panel { background: var(--paper); border-radius: 10px; padding: 20px 20px 22px; border: 1px solid var(--line); }
.panel > legend, .panel-title { font: 700 var(--step-1)/1.1 var(--f-cond); padding: 0; margin: 0 0 14px; float: left; width: 100%; }
fieldset.panel { margin: 0; min-width: 0; }
fieldset.panel > legend + * { clear: both; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.field { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 6px; min-width: 0; }
.field > label, .field > .flabel { font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.hint { font-size: var(--step--1); color: var(--ink-3); line-height: 1.4; }
.inputbox { position: relative; display: flex; min-width: 0; width: 100%; align-items: stretch; border: 1.5px solid #9AA3AC; border-radius: var(--r-field); background: var(--paper); transition: border-color .12s; }
.inputbox:focus-within { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-wash); }
.inputbox input, .inputbox select {
  flex: 1; min-width: 0; border: 0; background: transparent; font: 500 1.0625rem/1 var(--f-text);
  font-variant-numeric: tabular-nums; color: var(--ink); padding: 11px 12px; outline: none; height: 46px; width: 100%;
}
.inputbox select { appearance: none; padding-right: 36px; font-size: 1rem; cursor: pointer; }
.inputbox.select::after { content: ''; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.affix { display: flex; align-items: center; padding: 0 12px; color: var(--ink-3); font-size: 0.9375rem; white-space: nowrap; }
.affix.pre { padding-right: 0; }
.inputbox input[type=date] { font-size: 1rem; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.unit-toggle { display: inline-flex; border: 1.5px solid #9AA3AC; border-radius: var(--r-field); overflow: hidden; height: 32px; }
.unit-toggle button { border: 0; background: var(--paper); font: 500 0.8125rem/1 var(--f-text); padding: 0 10px; cursor: pointer; color: var(--ink-2); }
.unit-toggle button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.rowhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.rowhead .flabel { font-size: 0.875rem; font-weight: 500; }

details.more { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
details.more > summary { cursor: pointer; font-weight: 600; font-size: 0.9375rem; list-style: none; display: flex; align-items: center; gap: 8px; }
details.more > summary::before { content: '+'; display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--ink); border-radius: 50%; font-size: 14px; line-height: 1; }
details.more[open] > summary::before { content: '−'; }
details.more > summary::-webkit-details-marker { display: none; }
details.more .grid { margin-top: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--cobalt); }

/* ------------------------------------------------------------ the label */
.result { position: sticky; top: 16px; }
.label {
  background: var(--paper); border: 3px solid var(--rule); border-radius: var(--r-label);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.12);
}
.label-sect { border-top: 2px solid var(--rule); padding: 14px 18px; }
.label-sect:first-child { border-top: 0; }
.label-top { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.tier-code { font: 700 4rem/0.82 var(--f-cond); letter-spacing: -0.02em; padding-right: 16px; border-right: 2px solid var(--rule); min-width: 2.2ch; }
.tier-name { font: 700 var(--step-1)/1.1 var(--f-cond); }
.tier-meta { font-size: var(--step--1); color: var(--ink-2); margin-top: 4px; line-height: 1.4; }
.net { background: var(--ink); color: #fff; padding: 16px 18px 18px; border-top: 0; }
.net-k { font-size: 0.875rem; color: #C9CED4; display: flex; justify-content: space-between; gap: 8px; }
.net-v { font: 700 clamp(3rem, 7vw, 4.25rem)/1 var(--f-cond); font-variant-numeric: tabular-nums; margin-top: 6px; letter-spacing: -0.01em; }
.net-v.neg { color: #FF9A9E; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--rule); }
.kpi { padding: 10px 14px 12px; border-left: 2px solid var(--rule); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi-k { font-size: 0.75rem; color: var(--ink-2); line-height: 1.2; }
.kpi-v { font: 700 1.625rem/1.1 var(--f-cond); font-variant-numeric: tabular-nums; margin-top: 2px; }

.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 7px 0; border-top: 1px dashed var(--line); }
.line:first-child { border-top: 0; }
.line-k { font-size: 0.9375rem; font-weight: 500; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.line-v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }
.line-d { grid-column: 1 / -1; font-size: 0.78rem; color: var(--ink-3); line-height: 1.35; }
.line.sum { border-top: 2px solid var(--rule); margin-top: 4px; padding-top: 9px; }
.line.sum .line-k, .line.sum .line-v { font-weight: 700; }
.line.sub .line-d { padding-left: 14px; }
.line.sub .line-k { padding-left: 14px; font-weight: 400; color: var(--ink-2); }
.line.sub .line-v { font-weight: 500; color: var(--ink-2); }
.group-k { font: 700 0.9375rem/1 var(--f-cond); margin: 4px 0 2px; color: var(--ink-2); }

.tag { font: 600 0.75rem/1 var(--f-text); padding: 3px 6px 3px; border-radius: 3px; letter-spacing: 0.01em; border: 1px solid; white-space: nowrap; }
.tag-v { color: var(--ink); border-color: var(--ink); }
.tag-d { color: var(--cobalt-ink); border-color: var(--cobalt); background: var(--cobalt-wash); }
.tag-e { color: var(--tape-ink); border-color: #C9A51E; background: #FBF0C2; }
.tag-u { color: var(--ink-2); border-color: #9AA3AC; }

.cliffs { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.cliff { position: relative; background: var(--tape); color: var(--tape-ink); padding: 10px 12px 10px 14px; font-size: 0.875rem; line-height: 1.4; clip-path: polygon(0 4%, 2% 0, 98% 3%, 100% 0, 99% 96%, 100% 100%, 3% 97%, 0 100%); }
.cliff strong { color: #000; font-variant-numeric: tabular-nums; }
.cliffs-empty { font-size: 0.875rem; color: var(--ink-2); margin: 0; }

.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 2px solid var(--rule); }
.vs > div { padding: 10px 12px; }
.vs > div + div { border-left: 2px solid var(--rule); }
.vs .k { font-size: 0.75rem; color: var(--ink-2); }
.vs .v { font: 700 1.5rem/1.1 var(--f-cond); font-variant-numeric: tabular-nums; }
.vs .win { background: #EEF6F1; }
.label-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { font: 600 0.9375rem/1 var(--f-text); padding: 11px 14px; border-radius: 6px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { background: var(--concrete); }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-ink); }
.notice { font-size: var(--step--1); color: var(--ink-2); line-height: 1.45; }
.warn { background: #FCEBEC; border-left: 3px solid var(--loss); padding: 8px 10px; font-size: 0.8125rem; margin-top: 8px; }

.gain { color: var(--gain); }
.loss { color: var(--loss); }

/* mobile sticky summary */
.dock { display: none; }

/* ------------------------------------------------------------ prose / content */
.section { padding: clamp(40px, 7vw, 80px) 0; border-top: 2px solid var(--rule); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px 56px; }
.prose { max-width: 68ch; }
.sheet.prose { max-width: none; }
.sheet.prose > :not(.cols-2):not(.tablewrap):not(.section-head) { max-width: 70ch; }
.prose p, .prose li { font-size: 1.0625rem; line-height: 1.65; }
.prose h2 { margin: 1.6em 0 0.5em; font-size: clamp(1.5rem, 4.2vw, var(--step-3)); }
.prose h3 { margin: 1.4em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.35em; }
.prose code { font-size: 0.92em; background: var(--concrete-2); padding: 1px 5px; border-radius: 3px; }
.prose blockquote { margin: 1.2em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--rule); color: var(--ink-2); }

.page-head { padding: clamp(32px, 6vw, 64px) 0 clamp(24px, 4vw, 40px); }
.page-head .lede { margin-top: 16px; max-width: 60ch; }
.crumbs { font-size: var(--step--1); color: var(--ink-2); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); }
.meta-line { font-size: var(--step--1); color: var(--ink-2); margin-top: 14px; }

.sheet { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: clamp(20px, 4vw, 44px); margin-bottom: 40px; }
.sheet + .sheet { margin-top: -16px; }

.cols-2 > *, .tool > *, .section-head > *, .calc > * { min-width: 0; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 48px; }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
.points h3 { font-size: var(--step-1); margin-bottom: 6px; }
.points p { color: var(--ink-2); margin: 0; }

/* tables */
.tablewrap { overflow-x: auto; margin: 0 0 24px; -webkit-overflow-scrolling: touch; border: 2px solid var(--rule); border-radius: var(--r-label); background: var(--paper); }
table.rates { border-collapse: collapse; width: 100%; font-size: 0.9375rem; min-width: 520px; }
table.rates caption { text-align: left; font: 700 var(--step-1)/1.2 var(--f-cond); padding: 12px 14px; border-bottom: 2px solid var(--rule); caption-side: top; }
table.rates caption small { display: block; font: 400 var(--step--1)/1.4 var(--f-text); color: var(--ink-2); margin-top: 3px; }
table.rates th, table.rates td { padding: 9px 14px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
table.rates thead th { background: var(--concrete); font-weight: 600; font-size: 0.8125rem; border-top: 0; }
table.rates td.n, table.rates th.n { text-align: right; white-space: nowrap; }
table.rates tbody tr:hover { background: #F6F7F8; }
table.rates td.hl { background: var(--cobalt-wash); font-weight: 600; }

.source-list { font-size: 0.875rem; color: var(--ink-2); padding-left: 1.1em; }
.callout { border: 2px solid var(--rule); padding: 14px 16px; border-radius: var(--r-label); background: var(--paper); margin: 1.2em 0; }
.callout p:last-child { margin-bottom: 0; }

.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 40px; }

/* footer */
.site-foot { border-top: 2px solid var(--rule); padding: 40px 0 56px; font-size: 0.875rem; color: var(--ink-2); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 24px; }
.foot-grid h2 { font-size: var(--step-0); font-family: var(--f-text); font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.foot-grid a { color: var(--ink-2); }
.foot-small { margin-top: 32px; font-size: 0.8125rem; max-width: 80ch; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .calc { grid-template-columns: 1fr; }
  .result { position: static; }
  .hero { grid-template-columns: 1fr; }
  .section-head, .cols-2, .tool { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav { display: none; position: absolute; left: 0; right: 0; top: 60px; background: var(--concrete); border-bottom: 2px solid var(--rule); flex-direction: column; padding: 8px var(--gutter) 16px; z-index: 20; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; font-size: 1.0625rem; }
  .nav-toggle { display: inline-flex; margin-left: auto; align-items: center; gap: 8px; background: none; border: 1.5px solid var(--ink); border-radius: 6px; padding: 8px 12px; font: 600 0.875rem var(--f-text); color: var(--ink); }
  .site-head .wrap { position: relative; }
  .panel { padding: 16px 14px 18px; border-radius: 8px; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tier-code { font-size: 3.25rem; }
  .label-sect { padding: 12px 14px; }
  .dock {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--ink); color: #fff;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); align-items: center; justify-content: space-between; gap: 12px;
    transform: translateY(0); transition: transform .2s;
  }
  .dock.hide { transform: translateY(110%); }
  .dock-k { font-size: 0.75rem; color: #C9CED4; }
  .dock-v { font: 700 1.75rem/1 var(--f-cond); font-variant-numeric: tabular-nums; }
  .dock a { color: #fff; font-weight: 600; font-size: 0.9375rem; border: 1.5px solid #fff; border-radius: 6px; padding: 9px 12px; text-decoration: none; }
  body.has-dock { padding-bottom: 72px; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 340px) {
  .grid { grid-template-columns: 1fr; }
  .grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-2 { grid-column: auto; }
  .kpi { padding: 9px 10px 10px; }
  .kpi-v { font-size: 1.375rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .site-head, .site-foot, .form, .dock, .label-actions { display: none !important; }
  .calc { display: block; }
  .label { box-shadow: none; }
}

/* ------------------------------------------------------------ tools v2 */
.textarea { width: 100%; font: 400 0.875rem/1.5 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; border: 1.5px solid #9AA3AC; border-radius: var(--r-field); padding: 10px 12px; background: var(--paper); color: var(--ink); resize: vertical; }
.textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-wash); }
label.btn { cursor: pointer; }
label.btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.bulk-summary { margin-top: 20px; }
.bulk-kpis { border: 2px solid var(--rule); border-radius: var(--r-label); background: var(--paper); grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
#b-wrap { margin-top: 16px; }
table.bulk th button { all: unset; cursor: pointer; font-weight: 600; }
table.bulk th button:focus-visible { outline: 3px solid var(--focus); }
table.bulk th[scope=col] button::after { content: ''; display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: middle; }
table.bulk th button[aria-sort=descending]::after { border: 4px solid transparent; border-top-color: var(--ink); margin-top: 4px; }
table.bulk th button[aria-sort=ascending]::after { border: 4px solid transparent; border-bottom-color: var(--ink); margin-top: -4px; }
table.bulk tbody th { font-weight: 500; max-width: 26ch; }
tr.row-loss { background: #FCEBEC; }
tr.row-warn { background: #FBF6E2; }
tr.row-best { background: var(--cobalt-wash); }
.cliff-mini { background: var(--tape); color: var(--tape-ink); font-weight: 700; padding: 1px 6px; border-radius: 2px; font-variant-numeric: tabular-nums; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 6.5em 1fr auto; gap: 10px; align-items: center; font-size: 0.8125rem; }
.bar-track { height: 14px; background: var(--concrete); border-radius: 2px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--ink-3); }
.bar-fill.is-peak { background: var(--cobalt); }
.bar-v { font-variant-numeric: tabular-nums; font-weight: 600; }
.tool-list, .fee-index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 40px; }
.panel-title { float: none; }
.vs .k + .k { margin-top: 2px; }
@media (max-width: 760px) {
  .tool-list, .fee-index { grid-template-columns: 1fr; }
  table.bulk { font-size: 0.8125rem; }
}
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.todo { background: var(--tape); color: var(--tape-ink); padding: 0 4px; }
.related h2 { font-size: var(--step-1); margin-bottom: 12px; }
.plain-list.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .plain-list.cols-3 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ marketplace switcher */
.mkt-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.mkt-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1.5px solid var(--rule); border-radius: 6px; background: #fff; color: var(--ink); text-decoration: none; font: 600 0.875rem/1 var(--f-text); }
.mkt-switch a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.mkt-switch a .cc { font: 700 0.75rem/1 var(--f-cond); letter-spacing: .04em; opacity: .7; }
.lang-alt { font-size: 0.875rem; margin: 6px 0 0; }
.mkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.mkt-grid li { background: #fff; border: 1.5px solid var(--rule); border-radius: 8px; padding: 14px 16px; }
.mkt-grid h3 { margin: 0 0 4px; font-size: var(--step-1); }
.mkt-grid p { margin: 0; font-size: 0.875rem; color: var(--ink-2); }
.mkt-grid .soon { opacity: .65; }

/* ------------------------------------------------------------ fee index bars (single series) */
.bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.bars li { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr) 4.2rem; align-items: center; gap: 10px; padding: 3px 0; font-size: 0.875rem; }
.bars li:hover { background: var(--concrete-2); }
.bar-k { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-t { height: 12px; background: var(--line); border-radius: 0 4px 4px 0; }
.bar-f { display: block; height: 100%; background: var(--cobalt); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
@media (max-width: 520px) { .bars li { grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr) 3.6rem; gap: 6px; } }

/* ------------------------------------------------------------ audit fixes 2026-10-18 */
h2.h3 { font-size: var(--step-1); line-height: 1.15; margin-bottom: 6px; }
.foot-about { margin-top: 12px; max-width: 34ch; }
@media (max-width: 760px) {
  .crumbs a { display: inline-block; padding: 6px 0; }
  .foot-grid li a { display: inline-block; padding: 6px 0; }
  .foot-grid ul { gap: 0; }
}

/* ------------------------------------------------------------ store picker */
.store-pick { position: relative; z-index: 15; }
.store-pick > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 8px 6px 14px; background: var(--paper); border: 1.5px solid var(--rule); border-radius: 8px; font-size: 0.9375rem; }
.store-pick > summary::-webkit-details-marker { display: none; }
.sp-k { color: var(--ink-2); font-size: 0.8125rem; }
.sp-v { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.sp-cc { font: 700 0.75rem/1 var(--f-cond); letter-spacing: .05em; background: var(--ink); color: #fff; padding: 4px 5px 3px; border-radius: 3px; }
.sp-c { font-weight: 600; color: var(--cobalt-ink); padding: 6px 10px; border-left: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; }
.sp-c::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.store-pick[open] .sp-c::after { transform: translateY(2px) rotate(-135deg); }
.store-pick > summary:hover { border-color: var(--cobalt); }
.sp-panel { position: absolute; left: 0; top: calc(100% + 6px); width: min(880px, calc(100vw - 2 * var(--gutter))); background: var(--paper); border: 1.5px solid var(--rule); border-radius: 10px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.28); padding: 18px 20px 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 24px; }
.sp-g ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sp-r { font: 700 0.8125rem/1 var(--f-cond); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 8px; }
.sp-g a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; margin: 0 -8px; border-radius: 5px; color: var(--ink); text-decoration: none; font-size: 0.9375rem; }
.sp-g a:hover { background: var(--concrete); }
.sp-g a[aria-current="page"] { background: var(--ink); color: #fff; }
.sp-d { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 0.8125rem; }
.sp-g a[aria-current="page"] .sp-d { color: #C9CED4; }
.sp-all { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 600; font-size: 0.9375rem; }
@media (max-width: 760px) {
  .store-pick > summary { display: flex; width: 100%; }
  .sp-c { margin-left: auto; }
  .sp-panel { position: static; width: auto; margin-top: 6px; grid-template-columns: 1fr 1fr; box-shadow: none; padding: 14px; }
}
@media (max-width: 420px) { .sp-k { display: none; } }

/* ------------------------------------------------------------ toolbar: store picker + proof points */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 0 0 18px; }
.proof { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.875rem; color: var(--ink-2); }
.proof li { display: inline-flex; align-items: center; gap: 8px; }
.proof li::before { content: ''; width: 14px; height: 14px; flex: none; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2l2.3 2.3 4.7-4.9' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.proof a { color: inherit; text-decoration-color: var(--line); }
.proof a:hover { color: var(--ink); text-decoration-color: currentColor; }
@media (max-width: 760px) { .toolbar { display: block; } .proof { margin-top: 12px; gap: 6px 16px; font-size: 0.8125rem; } }

/* ------------------------------------------------------------ marketplace cards */
.mkt-grid li { padding: 0; border: 0; background: none; }
.mkt-card { display: grid; gap: 2px; height: 100%; padding: 14px 16px 14px; background: var(--paper); border: 1.5px solid var(--rule); border-radius: 8px; color: var(--ink); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.mkt-card:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.mc-top { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--ink-2); }
.mc-name { font: 700 var(--step-1)/1.15 var(--f-cond); margin-top: 6px; }
.mc-fee { font: 700 1.75rem/1.1 var(--f-cond); font-variant-numeric: tabular-nums; margin-top: 8px; }
.mc-k { font-size: 0.75rem; color: var(--ink-2); }

/* Japanese: no small kana or long-vowel mark at the start of a line; slightly smaller display type */
:lang(ja) { line-break: strict; }
:lang(ja) h1 { font-size: clamp(2rem, 7.4vw, 3.5rem); line-height: 1.15; word-break: auto-phrase; max-width: none !important; }
:lang(ja) h2 { line-height: 1.2; word-break: auto-phrase; }

/* headline stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 24px 0 0; border: 2px solid var(--rule); border-radius: var(--r-label); background: var(--paper); max-width: 880px; }
.stats > div { padding: 12px 16px 14px; border-left: 2px solid var(--rule); min-width: 0; }
.stats > div:first-child { border-left: 0; }
.stats dt { font-size: 0.8125rem; color: var(--ink-2); }
.stats dd { margin: 0; font: 700 2.25rem/1.05 var(--f-cond); font-variant-numeric: tabular-nums; }
.stats dd.s { font: 400 0.8125rem/1.3 var(--f-text); color: var(--ink-2); margin-top: 2px; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } .stats > div:nth-child(3) { border-left: 0; } .stats > div:nth-child(n+3) { border-top: 2px solid var(--rule); } }
.muted { color: var(--ink-3); }
@media (max-width: 520px) {
  .mkt-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mkt-card { padding: 10px 12px; }
  .mc-name { font-size: 1.0625rem; }
  .mc-fee { font-size: 1.375rem; }
  .mc-top .mc-store { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
