:root {
  --bg: #f6f8f7;
  --card: #ffffff;
  --ink: #17221f;
  --muted: #5b6b66;
  --line: #dfe6e3;
  --accent: #0f7b6c;
  --accent-ink: #ffffff;
  --accent-soft: #e3f3ef;
  --warn: #9a5b00;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 40, 34, .06), 0 4px 16px rgba(16, 40, 34, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* header / footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: .92rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.site-footer { margin-top: 56px; padding: 32px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; background: var(--card); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; }
.site-footer a { color: var(--muted); }

/* hero */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.2; margin: 0 0 8px; letter-spacing: -.02em; }
.hero p.lead { color: var(--muted); margin: 0; max-width: 760px; font-size: 1.05rem; }

/* tool layout */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin: 20px 0; align-items: start; }
@media (max-width: 860px) { .tool { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h2 { font-size: 1.1rem; margin: 0 0 12px; }
.result { position: sticky; top: 16px; }
@media (max-width: 860px) { .result { position: static; } }

/* form */
.field { margin-bottom: 14px; }
.field label, .field .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row3 { grid-template-columns: 1fr 1fr; } }
.row > *, .row3 > *, .doc-tool > *, .tool > * { min-width: 0; }
input, select, textarea { min-width: 0; max-width: 100%; }
input[type=number], input[type=text], input[type=email], input[type=tel], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; min-height: 44px;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 500; font-size: .9rem; background: #fff; min-height: 40px; display: inline-flex; align-items: center; }
.seg input:checked + label { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
@media (max-width: 480px) { .checks { grid-template-columns: 1fr; } }
.checks label { font-weight: 400; display: flex; gap: 8px; align-items: center; font-size: .92rem; margin: 0; min-height: 32px; }
.checks label.included { color: var(--muted); }
.checks input { width: 18px; height: 18px; accent-color: var(--accent); }

/* result */
.big { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0; color: var(--accent); }
.sub { color: var(--muted); margin: 0 0 14px; }
.kv { width: 100%; border-collapse: collapse; font-size: .94rem; }
.kv td { padding: 8px 0; border-top: 1px solid var(--line); }
.kv td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 44px; }
.btn.ghost { background: #fff; color: var(--accent); }
.btn.small { padding: 6px 10px; min-height: 34px; font-size: .88rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.callout { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; margin-top: 14px; font-size: .92rem; }
.note { color: var(--muted); font-size: .82rem; margin-top: 12px; }

/* content */
.content { max-width: 760px; }
.content h2 { font-size: 1.35rem; margin: 36px 0 10px; letter-spacing: -.01em; }
.content h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: .94rem; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data th { background: #f0f4f2; font-size: .85rem; color: var(--muted); }
.checklist { columns: 2; column-gap: 24px; padding-left: 18px; }
@media (max-width: 600px) { .checklist { columns: 1; } }
details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 8px 0; }
details summary { font-weight: 600; cursor: pointer; }
details p { margin: 8px 0 0; }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.related a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-decoration: none; color: var(--ink); }
.related a strong { display: block; color: var(--accent); }
.related a span { font-size: .88rem; color: var(--muted); }
.ad-slot { margin: 24px 0; min-height: 90px; }

/* quote / invoice generator */
.doc-tool { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; margin: 20px 0; align-items: start; }
@media (max-width: 960px) { .doc-tool { grid-template-columns: 1fr; } }
.items { width: 100%; border-collapse: collapse; table-layout: fixed; }
.items td:nth-child(2) { width: 18%; } .items td:nth-child(3) { width: 24%; } .items td:nth-child(4) { width: 32px; }
.items input { min-width: 0; }
.items td { padding: 4px 4px 4px 0; vertical-align: top; }
.items input { min-height: 40px; padding: 8px; }
.items .x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; min-height: 40px; padding: 0 6px; }
.doc { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 36px; font-size: 14px; line-height: 1.5; }
@media (max-width: 600px) { .doc { padding: 20px; font-size: 13px; } }
.doc-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.doc-head img { max-height: 64px; max-width: 180px; object-fit: contain; display: block; margin-bottom: 8px; }
.doc-title { font-size: 26px; font-weight: 800; letter-spacing: .04em; color: var(--accent); text-align: right; margin: 0; }
.doc-meta { text-align: right; color: #444; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.doc-parties .lbl, .doc .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #777; margin-bottom: 2px; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.doc th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #666; border-bottom: 2px solid #222; padding: 6px 4px; }
.doc td { border-bottom: 1px solid #e5e5e5; padding: 8px 4px; vertical-align: top; }
.doc .num { text-align: right; white-space: nowrap; }
.doc-totals { margin-left: auto; width: min(280px, 100%); margin-top: 12px; }
.doc-totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.doc-totals .grand { border-top: 2px solid #222; margin-top: 4px; padding-top: 8px; font-weight: 800; font-size: 16px; }
.doc-notes { margin-top: 24px; white-space: pre-wrap; color: #333; }
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 36px; }
.doc-sign div { border-top: 1px solid #999; padding-top: 4px; font-size: 12px; color: #666; }
.doc-brand { margin-top: 28px; font-size: 11px; color: #999; text-align: center; }

@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .site-header, .site-footer, .hero, .no-print, .content, .ad-slot, .doc-tool > .card { display: none !important; }
  .doc-tool { display: block; margin: 0; }
  .doc { border: 0; box-shadow: none; padding: 0; }
  .wrap { max-width: none; padding: 0; }
}
