:root {
  color-scheme: light;
  --ink: #1f2937;
  --muted: #4b5563;
  --line: #e2e8f0;
  --bg: #f6f8fa;
  --card: #ffffff;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #e6f4f2;
  --accent: #b45309;
  --warn-bg: #fff7ed;
  --bad: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand-dark); }
a:hover { color: var(--brand); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 17px; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.site-nav { display: flex; gap: 18px; font-size: 15px; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--brand); }

/* hero */
.hero { padding-top: 28px; padding-bottom: 8px; }
h1 { font-size: clamp(28px, 4.2vw, 40px); line-height: 1.15; margin: 0 0 10px; letter-spacing: -0.01em; }
.lede { font-size: 18px; color: var(--muted); max-width: 760px; margin: 0; }
.notice { background: var(--warn-bg); border: 1px solid #fed7aa; padding: 12px 16px; border-radius: 10px; }

/* layout */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; padding-top: 18px; padding-bottom: 20px; }
.result-col { position: sticky; top: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
fieldset.card { margin: 0 0 16px; padding: 14px 18px 18px; min-width: 0; }
legend { font-weight: 700; font-size: 17px; padding: 0 6px; display: flex; align-items: center; gap: 8px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; }
.grid { display: grid; gap: 12px 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
label { display: flex; flex-direction: column; justify-content: space-between; gap: 5px; font-size: 14px; font-weight: 600; color: var(--ink); }
label.full { margin-top: 12px; }
.opt { font-weight: 400; color: var(--muted); }
input[type=number], input[type=text], input[type=date], select, textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  border: 1px solid #cbd5e1; border-radius: 9px; padding: 9px 11px; min-height: 42px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .35); outline-offset: 1px; border-color: var(--brand);
}
.check { flex-direction: row; align-items: center; justify-content: flex-start; gap: 9px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); margin: 0; flex: none; }
.checks { margin-bottom: 12px; }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
details.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); margin-bottom: 10px; }
details.more .grid { margin-bottom: 12px; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; justify-content: space-between; }
.btn { font: inherit; font-weight: 600; border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 10px; padding: 10px 16px; cursor: pointer; min-height: 44px; }
.btn:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--brand-dark); }
.btn-ghost:hover { background: var(--brand-soft); }
.row-actions.start { justify-content: flex-start; }
.status { color: var(--brand-dark); font-size: 14px; }

/* result card */
.result { padding: 18px 20px; }
.result-label { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.price { margin: 2px 0 0; font-size: 52px; line-height: 1.1; font-weight: 800; color: var(--brand-dark); letter-spacing: -0.02em; }
.price-sub { margin: 2px 0 10px; color: var(--muted); font-size: 14px; }
.note { font-size: 13.5px; color: var(--muted); margin: 8px 0; }
.note.warn { background: var(--warn-bg); color: #7c2d12; border-radius: 8px; padding: 8px 10px; }
.note.bad { background: #fef2f2; color: var(--bad); border-radius: 8px; padding: 8px 10px; font-weight: 600; }
.field-note { margin: 10px 0 0; }
.stats { margin: 10px 0 6px; display: grid; gap: 8px; }
.stats div { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.stats dt { color: var(--muted); font-size: 14px; }
.stats dd { margin: 0; font-weight: 700; text-align: right; }
.neg { color: var(--bad); }
.small-h { font-size: 14px; margin: 14px 0 6px; color: var(--ink); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 5px 0; vertical-align: top; }
td { text-align: right; white-space: nowrap; padding-left: 10px; font-variant-numeric: tabular-nums; }
th { font-weight: 400; color: var(--muted); }
.freq tr { border-top: 1px solid var(--line); }
.freq tr.current th, .freq tr.current td { color: var(--ink); font-weight: 700; }
details.math { margin-top: 12px; }
details.math > summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); font-size: 14px; }
.breakdown { margin-top: 8px; font-size: 13px; }
.breakdown tr.sub th, .breakdown tr.sub td { border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.breakdown tr.total th, .breakdown tr.total td { border-top: 2px solid var(--ink); color: var(--ink); font-weight: 800; font-size: 14px; }
.errors { margin: 8px 0 0; padding-left: 18px; color: var(--bad); font-size: 14px; }
.cta-mini { display: block; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); text-decoration: none; font-size: 14px; font-weight: 600; color: var(--brand-dark); }
.cta-mini:hover { background: #d3ece8; }

/* client quote */
.quote-maker { padding: 18px 20px 20px; margin-top: 4px; margin-bottom: 28px; }
.quote-maker .fallback { width: 100%; }
.quote-maker h2 { margin-top: 0; }
.quote-sheet { margin-top: 16px; border: 1px dashed #94a3b8; border-radius: 12px; padding: 22px 24px; background: #fff; max-width: 720px; min-width: 0; }
/* long emails, links or unbroken words must wrap instead of widening the page or the printed quote */
.quote-sheet, .quote-sheet * { overflow-wrap: anywhere; word-break: normal; }
.qs-head > * { min-width: 0; max-width: 100%; }
.qs-problems { color: var(--bad); }
.qs-problems p { margin: 0 0 4px; font-weight: 600; }
.qs-problems ul { margin: 0; padding-left: 18px; }
.qs-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.qs-biz { margin: 0; font-weight: 800; font-size: 20px; }
.qs-contact { margin: 0; color: var(--muted); }
.qs-title { margin: 14px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.qs-meta, .qs-lines { margin: 0 0 10px; display: grid; gap: 4px; }
.qs-meta div, .qs-lines div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 10px; }
.qs-meta dd, .qs-lines dd, .qs-meta dt, .qs-lines dt { min-width: 0; }
.qs-meta dt, .qs-lines dt { color: var(--muted); }
.qs-meta dd, .qs-lines dd { margin: 0; }
.qs-price { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; margin: 12px 0; font-size: 18px; }
.qs-price strong { font-size: 26px; }
.qs-notes-h { margin: 0; font-weight: 700; font-size: 14px; }
.qs-notes { margin: 2px 0 10px; white-space: pre-wrap; }
.qs-fine { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.fallback { margin-top: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.quote-maker, .quote-maker .grid > * { min-width: 0; }

/* guide */
.prose { padding-top: 8px; padding-bottom: 12px; }
.prose > * { max-width: 800px; }
.prose h2 { font-size: 26px; margin: 34px 0 10px; line-height: 1.25; }
.prose h3 { font-size: 18px; margin: 20px 0 4px; }
.prose p, .prose li { color: #273444; }
.prose ol { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
details.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 10px 0; }
details.faq > summary { cursor: pointer; font-weight: 700; }
details.faq p { margin: 8px 0 2px; }

/* templates */
.templates { padding-top: 10px; padding-bottom: 36px; }
.templates h2 { font-size: 26px; margin: 24px 0 6px; }
.tpl-grid { margin-top: 14px; }
.tpl { display: block; padding: 16px 18px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.tpl:hover { border-color: var(--brand); transform: translateY(-1px); color: var(--ink); }
.tpl h3 { margin: 0 0 6px; font-size: 18px; }
.tpl p { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.tpl .go { font-weight: 700; color: var(--brand-dark); font-size: 14px; }
.tpl-best { border-color: #99d5cc; background: linear-gradient(180deg, #f2fbf9, #fff); }

/* footer */
.site-footer { background: #fff; border-top: 1px solid var(--line); padding: 18px 0 26px; font-size: 14px; color: var(--muted); }
.site-footer p { margin: 6px 0; }
.fine { font-size: 13px; }

/* simple pages */
.page { max-width: 760px; padding-top: 28px; padding-bottom: 40px; }
.page h1 { font-size: 32px; }
.page h2 { font-size: 21px; margin-top: 26px; }

/* responsive */
@media (max-width: 900px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .result-col { position: static; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .g3, .g2, .g4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-nav { gap: 14px; font-size: 14px; }
  .price { font-size: 44px; }
  .qs-meta div, .qs-lines div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .quote-sheet { padding: 16px; }
  fieldset.card { padding: 12px 14px 16px; }
}
@media (max-width: 380px) {
  .g3, .g2, .g4 { grid-template-columns: minmax(0, 1fr); }
}

/* mobile quote bar */
.mbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--brand-dark); color: #fff; text-decoration: none; box-shadow: 0 -4px 16px rgba(15, 23, 42, .15); }
.mbar:hover, .mbar:focus { color: #fff; }
.mbar strong { font-size: 22px; }
.mbar-go { margin-left: auto; font-size: 14px; font-weight: 600; }
@media (max-width: 900px) {
  .mbar { display: flex; }
  body { padding-bottom: 64px; }
}

/* printing only the client quote */
#print-area { display: none; }
@page { margin: 0.6in; }
@media print {
  body { background: #fff; }
  body.print-quote > *:not(#print-area) { display: none !important; }
  body.print-quote #print-area { display: block; }
  #print-area .quote-sheet { border: none; padding: 0; max-width: none; margin: 0; }
  .site-header, .site-footer, .skip, .mbar { display: none !important; }
  body { padding-bottom: 0; }
}
