:root {
  --bg: #f7f7f5; --surface: #ffffff; --text: #1c1d1f; --muted: #5f6368; --line: #e3e3df;
  --accent: #0f766e; --accent-ink: #ffffff; --accent-soft: #e6f3f1; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141517; --surface: #1d1f22; --text: #ececea; --muted: #a2a5a9; --line: #2f3236;
    --accent: #2bb3a4; --accent-ink: #0b1514; --accent-soft: #17312e;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.brand b { color: var(--accent); }
nav a { margin-left: 18px; text-decoration: none; color: var(--muted); font-size: 15px; }
.hero { padding: 36px 0 18px; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.2; margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0; max-width: 720px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.badges span { background: var(--accent-soft); color: var(--accent); font-size: 13px; padding: 4px 10px; border-radius: 99px; }

.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; margin: 18px 0 40px; }
@media (max-width: 900px) { .tool { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 650; margin-bottom: 8px; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
label { display: block; font-size: 13px; color: var(--muted); }
input, textarea, select { width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 3px; }
textarea { min-height: 64px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.item-head, .item-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 92px 92px 28px; gap: 6px; align-items: center; }
.item-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.item-row { margin-bottom: 6px; }
.item-row input { margin: 0; }
.amt { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.del { border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
@media (max-width: 520px) {
  .item-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr 28px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
  .item-row .desc { grid-column: 1 / -1; }
  .item-row .amt { grid-column: 1 / 3; }
}
button.btn { font: inherit; font-weight: 600; border-radius: 8px; padding: 10px 16px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
button.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sticky { position: sticky; top: 12px; }
.small { font-size: 13px; color: var(--muted); }

#preview { background: #fff; color: #1c1d1f; border-radius: 6px; padding: 28px; font-size: 13px; line-height: 1.5; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pv-head { display: flex; justify-content: space-between; gap: 16px; }
.pv-logo { max-height: 48px; max-width: 160px; display: block; margin-bottom: 8px; }
.pv-meta { text-align: right; color: #555; }
.pv-meta h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: .06em; color: #1c1d1f; }
.pv-bill { margin: 22px 0 14px; color: #555; }
.pv-bill span, .pv-notes span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #888; }
.pv-bill strong { color: #1c1d1f; }
.pv-table { width: 100%; border-collapse: collapse; }
.pv-table th { background: #f3f4f6; text-align: left; font-size: 11px; text-transform: uppercase; padding: 6px 8px; color: #555; }
.pv-table td { border-bottom: 1px solid #e5e5e5; padding: 7px 8px; vertical-align: top; }
.pv-table th:not(:first-child), .pv-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.pv-totals { margin: 12px 0 0 auto; max-width: 260px; }
.pv-totals div { display: flex; justify-content: space-between; padding: 3px 8px; }
.pv-total { font-weight: 700; font-size: 15px; border-top: 2px solid #1c1d1f; margin-top: 4px; padding-top: 6px !important; }
.pv-notes { margin-top: 22px; color: #444; }

article.content { max-width: 760px; margin: 0 auto 48px; }
article.content h2 { font-size: 22px; margin-top: 32px; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.links { columns: 3 180px; list-style: none; padding: 0; }
.links li { margin-bottom: 6px; }
.partner { border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 24px 0; font-size: 15px; }
footer.site { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
footer.site a { color: var(--muted); margin-right: 14px; }

@media print {
  body { background: #fff; }
  header.site, footer.site, .hero, form, article.content, .partner, .no-print { display: none !important; }
  .tool { display: block; margin: 0; }
  .card { border: 0; padding: 0; }
  #preview { box-shadow: none; padding: 0; }
}
