:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #5b6475;
  --line: #e4e1da;
  --brand: #1f5fbf;
  --brand-ink: #ffffff;
  --brand-soft: #e8f0fb;
  --accent: #d6452f;
  --good: #1f7a4d;
  --good-soft: #e5f3ec;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 16px rgba(20, 30, 50, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c;
    --surface: #1a1f29;
    --ink: #e8ebf1;
    --muted: #a2a9b8;
    --line: #2c3341;
    --brand: #6aa0f0;
    --brand-ink: #0e1420;
    --brand-soft: #1d2a40;
    --accent: #f07a64;
    --good: #6bcf9b;
    --good-soft: #17301f;
    --warn: #f0c26a;
    --warn-soft: #33290f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
}
a { color: var(--brand); }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 15px; font-weight: 800; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--brand-soft); }

/* page */
main { padding: 32px 0 56px; }
h1 { font-size: clamp(26px, 4.5vw, 36px); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 22px; line-height: 1.3; margin: 40px 0 12px; }
h3 { font-size: 17px; margin: 24px 0 8px; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 24px; max-width: 680px; }
.meta { font-size: 14px; color: var(--muted); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.tool-card { display: block; text-decoration: none; color: inherit; transition: transform .12s ease, border-color .12s ease; }
.tool-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.tool-card h3 { margin: 8px 0 6px; font-size: 18px; color: var(--ink); }
.tool-card p { margin: 0; color: var(--muted); font-size: 15px; }
.tool-card .tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input, select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
input:focus, select:focus, button:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 1px; border-color: var(--brand); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; text-align: center; padding: 10px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--muted); background: var(--bg); }
.seg input:checked + span { background: var(--brand); color: var(--brand-ink); }
.seg input:focus-visible + span { outline: 3px solid var(--brand-soft); outline-offset: -3px; }
button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 10px 16px; min-height: 44px; cursor: pointer; background: var(--brand); color: var(--brand-ink); }
button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* results */
.results { margin-top: 20px; display: grid; gap: 12px; }
.option { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: start; }
.option.off { opacity: .6; }
.option h3 { margin: 0; font-size: 17px; }
.option .price { font-size: 20px; font-weight: 700; text-align: right; white-space: nowrap; }
.option .sub { color: var(--muted); font-size: 14px; }
.option ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--good-soft); color: var(--good); }
.badge.alt { background: var(--brand-soft); color: var(--brand); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.est { font-size: 12px; color: var(--muted); font-weight: 500; }

.total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.total .big { font-size: 32px; font-weight: 800; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.notice { border-left: 4px solid var(--warn); background: var(--warn-soft); padding: 12px 14px; border-radius: 8px; font-size: 15px; margin: 16px 0; }
.notice.info { border-color: var(--brand); background: var(--brand-soft); }

.receipt-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 8px; }
.receipt-row button { min-width: 44px; padding: 0 12px; }

.hol { display: grid; grid-template-columns: 112px 1fr; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hol .d { font-weight: 700; white-space: nowrap; }
.hol .n { }
.hol .x { grid-column: 2; font-size: 13px; color: var(--muted); }
.hol.major .d { color: var(--accent); }
.hol.in-trip { background: var(--brand-soft); border-radius: 8px; padding-left: 8px; padding-right: 8px; }

.sources { font-size: 14px; color: var(--muted); }
.sources li { margin: 4px 0; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--muted); }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.site-footer a { color: var(--muted); }

@media (max-width: 560px) {
  .option { grid-template-columns: 1fr; }
  .option .price { text-align: left; }
  .hol { grid-template-columns: 1fr; }
  .hol .x { grid-column: 1; }
}
