:root {
  --ink: #172033;
  --muted: #5b6577;
  --line: #d9dee8;
  --soft: #f4f7fb;
  --paper: #ffffff;
  --teal: #0f766e;
  --blue: #1d4ed8;
  --amber: #b7791f;
  --coral: #c2410c;
  --shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: 156px;
  height: auto;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 8px;
  font-size: 14px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  font-weight: 650;
  font-size: 14px;
}

.hero {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px 20px 34px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 34px;
  align-items: center;
}

.eyebrow {
  color: var(--teal);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 13px;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: 0;
  margin: 0 0 14px;
}

h1 {
  font-size: 46px;
  max-width: 820px;
}

h2 {
  font-size: 30px;
}

h3 {
  font-size: 20px;
}

p {
  margin: 0 0 16px;
}

.lead {
  color: var(--muted);
  font-size: 19px;
  max-width: 760px;
}

.hero-panel,
.calculator,
.content-card,
.service-card,
.note-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 20px;
}

.page-art {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7fb;
}

.hero-stat {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.hero-stat:last-child {
  border-bottom: 0;
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f3f1;
  color: var(--teal);
  font-weight: 900;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.page-grid > *,
.content-stack > *,
.sidebar > *,
.content-card,
.calculator,
.byline {
  min-width: 0;
}

.content-stack {
  display: grid;
  gap: 24px;
}

.sidebar {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 18px;
}

.calculator {
  padding: 22px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  color: var(--ink);
  display: grid;
  gap: 7px;
  font-weight: 700;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bfc7d5;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

textarea {
  min-height: 120px;
}

.result-band {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.result {
  padding: 16px;
  background: #fbfcfe;
  border-right: 1px solid var(--line);
}

.result:last-child {
  border-right: 0;
}

.result strong {
  display: block;
  font-size: 22px;
  color: var(--teal);
}

.result span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.calc-summary {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.calculator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.quote-checker {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.quote-feedback {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 14px;
}

.quote-feedback p {
  margin: 0;
}

.quote-feedback ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.quote-feedback li + li {
  margin-top: 4px;
}

.quote-feedback.ok {
  border-color: #9ed2c9;
  background: #e7f3f1;
  color: #0f5f58;
}

.quote-feedback.caution,
.quote-feedback.high {
  border-color: #f0c4a2;
  background: #fff7ed;
  color: #9a3412;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.service-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-card {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.service-media {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7fb;
}

.service-card h3 {
  margin-bottom: 0;
}

.service-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.content-card {
  padding: 24px;
}

.factor-grid,
.specific-grid,
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.evidence-grid,
.market-reference-grid,
.project-file {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.factor,
.specific-item,
.check-item,
.process-step,
.evidence-item,
.market-reference-card,
.project-file > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.factor b,
.specific-item b,
.check-item b,
.process-step b,
.evidence-item b,
.market-reference-card b,
.project-file b {
  display: block;
  margin-bottom: 5px;
}

.factor p,
.specific-item p,
.check-item p,
.process-step p,
.evidence-item p,
.market-reference-card p,
.project-file p {
  color: var(--muted);
  margin: 0;
}

.local-depth {
  margin-top: 14px;
}

.local-depth span {
  display: block;
  margin-top: 6px;
}

.market-reference-card {
  display: grid;
  gap: 10px;
}

.market-reference-card h3 {
  margin-bottom: 0;
}

.quote-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.quote-status {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.quote-status b,
.quote-status span {
  display: block;
}

.quote-status span,
.quote-empty p {
  color: var(--muted);
}

.maintenance-log {
  display: grid;
  gap: 16px;
}

.maintenance-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.maintenance-heading h2,
.maintenance-heading .eyebrow {
  margin-bottom: 0;
}

.review-pill {
  min-width: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f7fbf7;
}

.review-pill span,
.review-pill time {
  display: block;
}

.review-pill span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.review-pill time {
  color: var(--text);
  font-weight: 800;
}

.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.maintenance-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.maintenance-item b {
  display: block;
  margin-bottom: 5px;
}

.maintenance-item p {
  color: var(--muted);
  margin: 0;
}

.quote-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.consent-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.consent-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 4px;
}

.specific-grid.single {
  grid-template-columns: 1fr;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
}

.price-table th,
.price-table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  overflow-wrap: anywhere;
}

.price-table th {
  background: #eef4fb;
  font-size: 14px;
}

.price-table tr:last-child td {
  border-bottom: 0;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 800;
}

.faq p {
  color: var(--muted);
  margin-top: 10px;
  margin-bottom: 0;
}

.ad-slot {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed #aeb8c8;
  border-radius: 8px;
  color: #697386;
  background: #f8fafc;
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

.note-box {
  padding: 16px;
  color: var(--muted);
}

.note-box strong {
  color: var(--ink);
}

.byline {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #fbfcfe;
}

.byline-header {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
}

.author-initials {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f3f1;
  color: var(--teal);
  font-weight: 900;
}

.byline b,
.byline span {
  display: block;
}

.byline span,
.byline p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.byline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.formula-box {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: #eef6ff;
  overflow-x: auto;
}

.formula-box code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: nowrap;
}

.decision-note {
  margin-top: 14px;
  color: var(--muted);
}

.warning-list {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.warning-list li {
  padding: 12px 14px;
  border: 1px solid #f0c4a2;
  border-left: 4px solid var(--coral);
  border-radius: 8px;
  background: #fff7ed;
}

.source-list {
  display: grid;
  gap: 8px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.contact-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.contact-grid h3 {
  margin-bottom: 8px;
}

.contact-grid p {
  color: var(--muted);
  margin: 0;
}

.worksheet .price-table th,
.worksheet .price-table td {
  vertical-align: top;
}

.worksheet-control-row td {
  background: #fbfcfe;
}

.worksheet-cell {
  min-width: 92px;
  background: #fff;
}

.quote-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.quote-score-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.score-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.score-card-head strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 36px;
  border-radius: 8px;
  background: #eef3f8;
  color: var(--ink);
}

.quote-score-card span,
.quote-score-card p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.quote-score-card.score-good {
  border-color: #9ed2c9;
  background: #f0faf8;
}

.quote-score-card.score-caution {
  border-color: #f0c4a2;
  background: #fff8ef;
}

.quote-score-card.score-high {
  border-color: #efaaa8;
  background: #fff1f1;
}

.worksheet-notes {
  margin-top: 16px;
}

.worksheet-cell input {
  min-width: 120px;
  min-height: 38px;
}

.worksheet-cell select {
  min-width: 132px;
  min-height: 38px;
}

.printable-checklist {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.printable-checklist h3 {
  margin-bottom: 8px;
}

.checklist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.task-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.task-list label {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  font-weight: 650;
}

.task-list input {
  width: 18px;
  min-height: 18px;
  margin-top: 4px;
}

.script-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink);
}

.compact-actions {
  margin-top: 12px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid var(--teal);
  padding: 10px 14px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.button.secondary {
  color: var(--teal);
  background: #fff;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #111827;
  color: #d8dee9;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.footer-inner a {
  color: #eef6ff;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: flex-end;
}

.small {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .hero-inner,
  .page-grid,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 36px;
  }
}

@media (max-width: 640px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-inner {
    padding-top: 36px;
  }

    .service-grid,
    .factor-grid,
    .specific-grid,
    .quote-status-grid,
    .maintenance-grid,
    .quote-score-grid,
    .form-grid,
    .check-grid,
    .process-grid,
    .evidence-grid,
    .market-reference-grid,
    .project-file,
  .contact-grid,
  .calc-grid,
  .result-band {
    grid-template-columns: 1fr;
  }

  .result {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .result:last-child {
    border-bottom: 0;
  }

  .price-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .maintenance-heading {
    display: grid;
  }

  h1 {
    font-size: 31px;
  }

  h2 {
    font-size: 25px;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media print {
  .site-header,
  .site-footer,
  .hero,
  .sidebar,
  .button-row,
  .checklist-actions,
  .ad-slot {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12px;
  }

  .container,
  .page-grid,
  .content-stack {
    display: block;
    max-width: none;
    padding: 0;
  }

  .content-card,
  .calculator,
  .byline {
    box-shadow: none;
    border-color: #999;
    page-break-inside: avoid;
    margin-bottom: 14px;
  }

  body.printing-selected * {
    visibility: hidden !important;
  }

  body.printing-selected .print-target,
  body.printing-selected .print-target * {
    visibility: visible !important;
  }

  body.printing-selected .print-target {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
  }
}
