/* AIDO Tools — shared styles. Minimal, warm neutrals, one accent. */
:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f3f2ee;
  --ink: #1a1a1a;
  --ink-2: #55554f;
  --ink-3: #8a8a83;
  --line: #e6e4de;
  --accent: #0f6e56;
  --accent-ink: #ffffff;
  --accent-soft: #e4f1ec;
  --warn-bg: #fff7e6;
  --warn-ink: #7a4b00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 19, .04), 0 8px 24px -12px rgba(20, 20, 19, .12);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --surface: #1d1d1b; --surface-2: #262624; --ink: #f2f1ec; --ink-2: #b9b8b0; --ink-3: #85847c;
    --line: #33332f; --accent: #3fb391; --accent-ink: #0b1f19; --accent-soft: #1b2f29; --warn-bg: #30250f; --warn-ink: #f0c070;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font); font-feature-settings: "cv11", "ss01", "tnum";
  display: flex; flex-direction: column; min-height: 100vh;
}
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-top: 32px; padding-bottom: 64px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; letter-spacing: -.01em; margin: 2.5rem 0 .75rem; }
h3 { font-size: 1rem; margin: 1.5rem 0 .5rem; }
p { margin: 0 0 1rem; }
.lead { color: var(--ink-2); font-size: 1.05rem; max-width: 62ch; margin-bottom: 2rem; }
.muted { color: var(--ink-3); }
small, .small { font-size: .875rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; z-index: 10; }

/* Header / footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.site-nav { display: flex; gap: 20px; align-items: center; font-size: .925rem; }
.site-nav a { color: var(--ink-2); }
.site-nav .lang { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; color: var(--ink); }
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--ink-3); font-size: .85rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px 24px; margin: 12px 0; }
.site-footer nav a { color: var(--ink-2); }
.footer-note { max-width: 72ch; }
.copy { margin: 0; }

/* Home grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 8px; }
.card-link { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 20px; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.card-link:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.card-link h2 { margin: 10px 0 6px; font-size: 1.1rem; }
.card-link p { margin: 0; color: var(--ink-2); font-size: .925rem; }
.card-link .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.card-link .icon svg { width: 22px; height: 22px; }

/* Calculator layout */
.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
.calc > * { min-width: 0; }
@media (max-width: 820px) { .calc { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel h2 { margin-top: 0; font-size: 1.05rem; }
.results { position: sticky; top: 20px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 500; font-size: .925rem; margin-bottom: 6px; }
.field .hint { display: block; color: var(--ink-3); font-size: .8rem; margin-top: 5px; }
.control { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; transition: border-color .15s; }
.control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.control input, .control select { flex: 1; width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.05rem; padding: 11px 12px; outline: none; -moz-appearance: textfield; }
.control input::-webkit-outer-spin-button, .control input::-webkit-inner-spin-button { -webkit-appearance: none; }
.control .unit { padding: 0 12px; color: var(--ink-3); font-size: .9rem; border-left: 1px solid var(--line); align-self: stretch; display: flex; align-items: center; }
.control select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a8a83' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.row > * { min-width: 0; }
@media (max-width: 480px) { .row { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.check { display: flex; align-items: center; gap: 10px; font-size: .925rem; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 3px; }
.segmented label { margin: 0; text-align: center; font-size: .875rem; font-weight: 500; padding: 8px 6px; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + label { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); }
details.more { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 500; font-size: .925rem; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; width: 20px; height: 20px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-weight: 600; }
details.more[open] summary::before { content: "−"; }
details.more > :not(summary) { margin-top: 14px; }

/* Results */
.hero-result { padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.hero-result .label { color: var(--ink-2); font-size: .925rem; margin-bottom: 4px; }
.hero-result .value { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--accent); }
.hero-result .sub { color: var(--ink-3); font-size: .9rem; margin-top: 6px; }
.kv { display: grid; gap: 8px; margin: 0; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.kv dt { color: var(--ink-2); min-width: 0; }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv .total { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.kv .total dd { color: var(--accent); }
.kv .neg dd { color: var(--ink-3); }
.verdict { background: var(--accent-soft); border-radius: 10px; padding: 14px 16px; margin: 0 0 16px; font-weight: 500; }
.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 12px 14px; font-size: .875rem; margin: 16px 0 0; }
.badge { display: inline-block; background: var(--surface-2); color: var(--ink-2); font-size: .75rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; margin-bottom: 12px; }
.bars { display: grid; gap: 10px; margin-top: 16px; }
.bar { font-size: .875rem; }
.bar .track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; margin-top: 4px; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 5px; transition: width .3s ease; }
.bar.alt .fill { background: var(--ink-3); }
.bar .meta { display: flex; justify-content: space-between; }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 12px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--ink-2); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
.btn { display: inline-block; font: inherit; font-weight: 500; font-size: .9rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* Chart */
.chart { width: 100%; height: auto; margin-top: 16px; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .area-contrib { fill: var(--ink-3); opacity: .35; }
.chart .area-interest { fill: var(--accent); opacity: .55; }
.chart text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.legend { display: flex; gap: 18px; font-size: .825rem; color: var(--ink-2); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .l-contrib::before { background: var(--ink-3); }
.legend .l-interest::before { background: var(--accent); }

/* Explainer */
.explain { max-width: 72ch; margin-top: 48px; }
.explain ol, .explain ul { padding-left: 1.3rem; }
.explain li { margin-bottom: .4rem; }
.formula { background: var(--surface-2); border-radius: 10px; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; overflow-x: auto; }
.sources { font-size: .875rem; color: var(--ink-2); }
.disclaimer { border-left: 3px solid var(--line); padding-left: 14px; color: var(--ink-3); font-size: .875rem; margin-top: 32px; }

/* Legal / text pages */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2rem; }
