:root { --muted: var(--ink-2); }
.wrap { max-width: 860px; margin: 0 auto; padding: 40px 20px 72px; }
h1 { font: 600 clamp(30px, 5vw, 42px)/1.1 var(--serif); letter-spacing: -.02em; margin: 0 0 8px; }
h2 { font: 600 24px var(--serif); letter-spacing: -.01em; margin: 0; }
.subtitle { color: var(--muted); margin: 0 0 24px; max-width: 62ch; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select { width: 100%; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; height: 42px; }
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.hint { font-size: 12px; color: var(--muted); margin: 5px 0 0; min-height: 1em; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.full { grid-column: 1 / -1; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.pair select { width: auto; }
.unit { position: relative; }
.unit input { padding-right: 64px; }
.unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips button { font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--field); color: var(--muted); cursor: pointer; }
.chips button[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 600; }
[hidden] { display: none !important; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.seg button { font: inherit; font-size: 14px; background: var(--field); color: var(--muted); border: 0; padding: 8px 16px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); font-weight: 600; }

.totals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.total { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.total.hl { border-color: var(--brand); background: var(--brand-soft); }
.total .n { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.total .v { font: 600 28px var(--serif); margin: 0; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.total .s { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.total .s b { color: var(--ink); }
.verdict { color: var(--muted); margin: 14px 0 0; font-size: 15px; max-width: 70ch; }
.verdict b { color: var(--ink); }

.sched-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 36px 0 14px; }
.ghost { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.ghost:hover { color: var(--brand); border-color: var(--brand); }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
table.sched { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.sched th, .sched td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.sched th:first-child, .sched td:first-child, .sched th:nth-child(2), .sched td:nth-child(2) { text-align: left; }
@media (max-width: 560px) { .sched th, .sched td { font-size: 12.5px; padding: 7px 6px !important; } }
.sched thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg-2); }
.sched tr.up td { color: var(--muted); font-style: italic; }
.sched td.bill { font-weight: 600; }
.sched tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--ink-2); }

.foot { color: var(--muted); font-size: 13px; margin-top: 32px; max-width: 70ch; }
.foot a { color: var(--brand); }
@media (max-width: 560px) {
  .inputs { grid-template-columns: 1fr; }
  .sched th, .sched td { padding: 7px 9px; }
  .sched .hide-sm { display: none; }
}
@media print { .seg, #csv, .chips { display: none !important; } }
