:root {
  --bg: #fbf9f6; --surface: #ffffff; --ink: #1c2a2f; --muted: #4b5b61; --line: #d9d3ca;
  --brand: #0f4c5c; --brand-ink: #ffffff; --accent: #9a3f17; --accent-ink: #ffffff;
  --link: #0b5a6f; --focus: #b36b00; --ok: #1f6b3a; --warn: #8a5a00; --bad: #a3231f;
  --soft: #eef4f5; --radius: 10px;
  --s1: #0f4c5c; --s2: #9a3f17; --s3: #5b6770;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12181b; --surface: #1b2428; --ink: #eef2f3; --muted: #b4c1c6; --line: #34434a;
    --brand: #7cc4d6; --brand-ink: #0b1316; --accent: #ffb48a; --accent-ink: #1a0d05;
    --link: #8fd3e4; --focus: #ffcf70; --ok: #7fd49a; --warn: #ffd37a; --bad: #ff9c97; --soft: #1f2b30;
    --s1: #7cc4d6; --s2: #ffb48a; --s3: #b4c1c6;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1rem; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { font-weight: 800; font-size: 1.25rem; color: var(--brand); text-decoration: none; letter-spacing: .01em; }
.brand span { color: var(--accent); }
.brand small { font-weight: 600; color: var(--muted); font-size: .8rem; margin-left: .25rem; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .25rem; }
nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .45rem .8rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .95rem; }
nav a:hover { background: var(--soft); }
nav a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
main { padding: 1.5rem 0 3rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: .2rem 0 .6rem; color: var(--brand); }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 2rem 0 .6rem; }
h3 { font-size: 1.1rem; margin: 1.2rem 0 .4rem; }
p { margin: .5rem 0 .9rem; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 46rem; }
.notice { background: var(--soft); border-left: 4px solid var(--brand); padding: .7rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; font-size: .95rem; margin: 1rem 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1rem 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.tool-card { display: flex; flex-direction: column; gap: .3rem; }
.tool-card h2, .tool-card h3 { margin: 0; font-size: 1.15rem; }
.tool-card p { margin: 0 0 .5rem; color: var(--muted); }
.tool-card .btn { margin-top: auto; align-self: flex-start; }
.btn, button { font: inherit; cursor: pointer; border-radius: 8px; padding: .6rem 1.1rem; border: 2px solid var(--brand); background: var(--surface); color: var(--brand); font-weight: 600; text-decoration: none; display: inline-block; min-height: 2.75rem; }
.btn:hover, button:hover { background: var(--soft); }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover, button.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.link { border: 0; background: none; color: var(--link); text-decoration: underline; padding: .5rem .25rem; min-height: 2.75rem; font-weight: 500; }
button.danger { color: var(--bad); border-color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0; }
form fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 700; padding: 0; }
.global-fields { display: grid; gap: .8rem 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin: .6rem 0 1rem; }
.field { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.field label { font-size: .9rem; font-weight: 600; }
.field .hint { font-size: .8rem; color: var(--muted); }
input, select { font: inherit; padding: .55rem .6rem; border: 1.5px solid #6b7a80; border-radius: 8px; background: var(--surface); color: var(--ink); min-height: 2.75rem; width: 100%; }
@media (prefers-color-scheme: dark) { input, select { border-color: #8497a0; } }
input[type=checkbox] { width: 1.4rem; height: 1.4rem; min-height: 0; accent-color: var(--brand); }
.check { flex-direction: row; align-items: center; gap: .5rem; }
.check label { font-weight: 500; }
.row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; margin: .7rem 0; display: grid; gap: .6rem .8rem; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); align-items: end; }
.row-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.row-title { margin: 0; font-size: 1rem; font-weight: 700; }
.row .remove { padding: .3rem .8rem; min-height: 2.75rem; font-size: .9rem; }
.row [hidden] { display: none !important; }
.errors { border: 2px solid var(--bad); border-radius: var(--radius); padding: .7rem 1rem; background: var(--surface); color: var(--ink); }
.errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.errors strong { color: var(--bad); }
.stats { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.stat .label { font-size: .85rem; color: var(--muted); font-weight: 600; text-transform: none; }
.stat .value { font-size: 1.6rem; font-weight: 800; color: var(--brand); line-height: 1.2; }
.stat .sub { font-size: .9rem; color: var(--muted); }
.stat.best { border: 2px solid var(--brand); }
.table-wrap { position: relative; overflow-x: auto; margin: .6rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
caption { text-align: left; font-weight: 700; padding: .6rem .8rem; }
th, td { padding: .5rem .8rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { border-top: 0; background: var(--soft); font-size: .85rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td, tfoot th { font-weight: 700; background: var(--soft); }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-weight: 700; font-size: .8rem; border: 2px solid currentColor; white-space: nowrap; }
.badge.ok { color: var(--ok); } .badge.tight { color: var(--warn); } .badge.short { color: var(--bad); }
.bar { height: .6rem; background: var(--soft); border-radius: 999px; overflow: hidden; min-width: 5rem; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; background: var(--brand); }
.chart { width: 100%; height: auto; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .axis { stroke: var(--line); } .chart .gridline { stroke: var(--line); stroke-dasharray: 2 4; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; list-style: none; padding: 0; margin: .5rem 0; font-size: .9rem; }
.legend .l1 { border-color: var(--s1); } .legend .l2 { border-color: var(--s2); border-top-style: dashed; } .legend .l3 { border-color: var(--s3); border-top-style: dotted; }
.legend i { display: inline-block; width: 1.6rem; height: 0; border-top: 4px solid; vertical-align: middle; margin-right: .4rem; }
.promo { border: 2px solid var(--accent); background: var(--surface); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 2rem 0; }
.promo h2 { margin-top: 0; }
.promo .fine, .fine { font-size: .85rem; color: var(--muted); }
details { margin: .6rem 0; } summary { cursor: pointer; font-weight: 600; padding: .4rem 0; min-height: 2.75rem; display: flex; align-items: center; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 1.5rem 0 2rem; font-size: .92rem; color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.site-footer a { display: inline-block; padding: .35rem 0; }
.faq h3 { margin-top: 1.1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hero { padding: .5rem 0 1rem; }
ol.order { padding-left: 1.4rem; margin: .3rem 0; }
@media (max-width: 40rem) {
  .row { grid-template-columns: 1fr 1fr; } .row .field.wide { grid-column: 1 / -1; }
  .actions .btn, .actions button { flex: 1 1 100%; text-align: center; }
  th, td { padding: .45rem .55rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .site-footer, .skip, form .actions, .promo, .remove, nav { display: none !important; }
  body { background: #fff; color: #000; } .card, .stat, .row { border-color: #999; }
  .print-note { display: block !important; }
}
.print-note { display: none; font-size: .85rem; }

.bill-list { list-style: none; margin: 0; padding: 0; min-width: 11rem; } .bill-list li { padding: .1rem 0; }
