:root {
  --ink: #1A1A2E;
  --text: #3A3A4A;
  --muted: #6B6B7B;
  --line: #DCDCE6;
  --soft: #F4F5F9;
  --paper: #FFFFFF;
  --blue: #0052CC;
  --blue-dark: #003D99;
  --blue-soft: #E8F0FE;
  --accent: #FF6B00;
  --accent-dark: #E05E00;
  --warn-bg: #FFF4E5;
  --warn-line: #F0A64A;
  --radius: 10px;
  --max: 1080px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--paper); line-height: 1.6; font-size: 16px; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-weight: 700; margin-top: 2.2rem; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .92em; background: var(--soft); padding: .1em .35em; border-radius: 4px; color: var(--ink); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* header */
.site-head { background: var(--ink); color: #fff; }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-top: .8rem; padding-bottom: .8rem; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.brand:hover { color: #fff; }
.brand svg { flex: none; }
.brand small { font-weight: 500; color: #A9B4CC; font-size: .78rem; display: block; letter-spacing: 0; }
.nav { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .92rem; }
.nav a { color: #D6DCEA; text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: #fff; border-bottom-color: var(--accent); }

/* hero */
.hero { background: linear-gradient(180deg, var(--blue-soft), var(--paper)); padding: 2.2rem 0 1.2rem; }
.hero p.sub { font-size: 1.08rem; color: var(--text); max-width: 46rem; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
.crumbs a { color: var(--muted); }

/* tool cards on home */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.card { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; text-decoration: none; color: var(--text); background: var(--paper); transition: border-color .2s, box-shadow .2s; }
.card:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(0, 82, 204, .1); color: var(--text); }
.card h3 { color: var(--blue); margin-bottom: .3rem; }
.card p { margin: 0; font-size: .95rem; }

/* tool layout */
.tool { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem; margin: 1.2rem 0 1rem; align-items: start; }
@media (max-width: 820px) { .tool { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; background: var(--paper); }
.panel.inputs { background: var(--soft); }
.panel h2 { margin-top: 0; font-size: 1.15rem; }
.field { margin-bottom: .9rem; }
.field label, .field legend { display: block; font-weight: 600; color: var(--ink); font-size: .92rem; margin-bottom: .3rem; }
.field .help { display: block; font-size: .82rem; color: var(--muted); margin-top: .25rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
input[type=number], input[type=text], select {
  width: 100%; font: inherit; font-size: 1rem; padding: .55rem .65rem; border: 1px solid #C4C4D0; border-radius: 7px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
fieldset { border: 0; padding: 0; margin: 0 0 .9rem; }
.choices { display: flex; flex-wrap: wrap; gap: .4rem; }
.choices label { display: inline-flex; align-items: center; gap: .35rem; font-weight: 500; border: 1px solid #C4C4D0; background: #fff; border-radius: 999px; padding: .3rem .75rem; cursor: pointer; margin: 0; font-size: .9rem; }
.choices input { accent-color: var(--blue); margin: 0; }
.choices label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.examples { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.examples button { font: inherit; font-family: var(--mono); font-size: .85rem; border: 1px dashed #A9B0C2; background: #fff; border-radius: 6px; padding: .2rem .55rem; cursor: pointer; color: var(--ink); }
.examples button:hover { border-color: var(--blue); color: var(--blue); }

/* results */
.out { min-height: 6rem; }
.hint { color: var(--muted); }
.lead-result { font-size: 1.05rem; }
table { border-collapse: collapse; width: 100%; }
.results { margin: .3rem 0 1rem; font-size: .95rem; }
.results th, .results td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.results th[scope=row] { color: var(--muted); font-weight: 500; width: 42%; }
.results thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.res-h { font-size: 1rem; margin-top: 1rem; }
.warn { background: var(--warn-bg); border-left: 4px solid var(--warn-line); padding: .6rem .8rem; border-radius: 0 6px 6px 0; font-size: .93rem; }
.matches { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .55rem; }
.match { border: 1px solid var(--line); border-radius: 8px; padding: .65rem .8rem; font-size: .92rem; }
.match.best { border-color: var(--blue); background: var(--blue-soft); }
.match-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .15rem; }
.match-name { font-weight: 800; color: var(--ink); font-size: 1.05rem; }
.tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--blue); color: #fff; border-radius: 4px; padding: .1rem .4rem; }
.quote { border: 1px solid #FFD2B0; background: #FFF8F2; border-radius: var(--radius); padding: 1rem 1.1rem; margin-top: 1rem; }
.quote p { margin-bottom: .7rem; font-size: .95rem; }
.quote-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn { display: inline-block; font: inherit; font-weight: 700; font-size: .93rem; border-radius: 7px; padding: .55rem 1rem; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: #fff; border-color: #C4C4D0; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

/* prose + reference */
.prose { max-width: 46rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .35rem; }
.formula { font-family: var(--mono); background: var(--soft); border-radius: 8px; padding: .7rem .9rem; overflow-x: auto; color: var(--ink); font-size: .92rem; }
.table-scroll { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
.ref { font-size: .93rem; min-width: 560px; }
.ref th, .ref td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); text-align: left; }
.ref thead th { background: var(--soft); color: var(--ink); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.ref tbody tr:last-child td { border-bottom: 0; }
.ref td.num { font-variant-numeric: tabular-nums; }
.faq h3 { margin-top: 1.3rem; margin-bottom: .3rem; font-size: 1.02rem; }
.note { font-size: .88rem; color: var(--muted); }

/* footer */
.site-foot { background: var(--ink); color: #C7CDDC; margin-top: 3rem; padding: 2rem 0 1.4rem; font-size: .9rem; }
.site-foot a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.5rem; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-by img { width: 220px; margin: .3rem 0 .8rem; }
.foot-links { list-style: none; padding: 0; margin: 0; }
.foot-links li { margin-bottom: .35rem; }
.foot-small { border-top: 1px solid #33334A; margin-top: 1.4rem; padding-top: 1rem; font-size: .8rem; color: #9097AA; }
