.cost-page {
  padding-bottom: 1.5rem;
}

.cost-skip { position:absolute; left:16px; top:-100px; z-index:100; padding:11px 14px; background:#fffefa; color:#203c32; border:2px solid #b55132; }
.cost-skip:focus-visible { top:8px; }
.cost-page #areas-title { scroll-margin-top:24px; }
.cost-page .cost-journey { margin:24px 0 0; }

.cost-page .cost-visual { max-width:720px; margin:23px auto 0; }
.cost-page .cost-visual img { display:block; width:100%; height:auto; border:1px solid var(--line); border-radius:10px; background:#f7faf7; }
.cost-page .cost-visual figcaption { margin-top:7px; color:var(--muted); font-size:.85rem; line-height:1.5; }

.estimate-notice {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid #d69b2d;
  border-radius: 12px;
  background: #fff9e9;
  color: #543b0d;
  font-weight: 700;
}

.cost-tool-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cost-tool-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
}

.cost-tool-heading h1 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.08;
}

.privacy-note {
  flex: 0 0 auto;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: #edf7ef;
  color: var(--green-dark);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.cost-workbench {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(440px, 1.05fr);
  align-items: start;
}

.cost-inputs,
.cost-results {
  min-width: 0;
  padding: 1.1rem 1.25rem 1.3rem;
}

.cost-results {
  border-left: 1px solid var(--line);
  background: #f7faf7;
}

.cost-section + .cost-section {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.cost-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cost-section-heading h2,
.cost-results h2 {
  margin: 0;
  font-size: 1.15rem;
}

.cost-section-heading p,
.result-intro,
.rate-source,
.field-hint {
  color: var(--muted);
}

.cost-section-heading p,
.result-intro {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}

.project-settings {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  align-items: end;
  gap: 0.8rem;
}

.project-settings .field-hint {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
}

.project-use-fieldset { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:0; padding:0; border:0; }
.project-use-fieldset legend { margin-bottom:8px; font-size:.78rem; font-weight:800; color:var(--ink); }
.project-use-fieldset label { display:grid; grid-template-columns:auto 1fr; gap:2px 8px; align-items:start; padding:12px; border:1px solid var(--line); border-radius:10px; background:#fff; cursor:pointer; }
.project-use-fieldset input { margin-top:3px; accent-color:var(--green); }
.project-use-fieldset span { font-size:.86rem; font-weight:800; }
.project-use-fieldset small { grid-column:2; color:var(--muted); font-size:.72rem; line-height:1.45; }
.project-use-fieldset label:has(input:checked) { border-color:#7fae91; background:var(--green-soft); box-shadow:inset 0 0 0 1px #7fae91; }
.project-client-jump { display:none; margin:.65rem 0 0; color:var(--muted); font-size:.82rem; line-height:1.5; }
.cost-section:has(input[name="project-use"][value="customer"]:checked) .project-client-jump { display:block; }
.project-client-jump a { display:inline-block; min-height:44px; box-sizing:border-box; padding:.35rem 0; color:var(--green-dark); text-underline-offset:.15em; }
.project-client-jump a:focus-visible { outline:3px solid var(--green-dark); outline-offset:2px; }
#contractor-workflow { scroll-margin-top:1rem; }
.site-context-details { border:1px solid var(--line); border-radius:12px; background:#fafbf7; }
.site-context-details summary { padding:15px 16px; cursor:pointer; list-style-position:outside; }
.site-context-details summary span { display:inline-flex; flex-direction:column; gap:3px; margin-left:4px; }
.site-context-details summary small { color:var(--muted); font-weight:500; }
.site-context-details > p, .site-context-grid { margin-left:16px; margin-right:16px; }
.site-context-details > p { color:var(--muted); font-size:.82rem; line-height:1.55; }
.site-context-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; padding-bottom:4px; }
.site-context-grid textarea { width:100%; resize:vertical; padding:11px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--ink); font:inherit; line-height:1.5; }
.site-context-wide { grid-column:1 / -1; }
.context-status { padding-bottom:14px; }

.cost-area-list {
  display: grid;
  gap: 0.75rem;
}

.cost-area {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfb;
}

.cost-area [hidden] {
  display: none !important;
}

.cost-area-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.cost-area-title h3 {
  margin: 0;
  font-size: 1rem;
}

.remove-area {
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 0;
  background: transparent;
  color: #9a3030;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.area-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.area-fields .field {
  min-width: 0;
}

.area-fields .area-name-field {
  grid-column: 1 / -1;
}

.area-name-field small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.area-fields input,
.area-fields select,
.rate-row input,
.project-settings select {
  min-height: 46px;
}

.field.full-row {
  grid-column: 1 / -1;
}

.area-job-details { margin-top:.75rem; border-top:1px solid var(--line); }
.area-job-details summary { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:.35rem 1rem; padding:.8rem 0 .2rem; color:var(--green-dark); font-weight:850; cursor:pointer; }
.area-job-details summary small { color:var(--muted); font-size:.72rem; font-weight:600; }
.area-job-grid { display:grid; grid-template-columns:1fr 1fr; gap:.7rem; padding-top:.75rem; }
.area-job-grid textarea { width:100%; min-height:70px; resize:vertical; padding:.65rem; border:1px solid #cbdcd3; border-radius:10px; background:#fff; color:var(--ink); font:inherit; line-height:1.45; }
.area-job-grid .field > small { color:var(--muted); font-size:.7rem; line-height:1.4; }
.area-job-wide { grid-column:1 / -1; }
.crew-only-note { padding:.7rem; border-left:3px solid #8b6f47; background:#f8f4ec; }
.customer-visible-note { padding:.7rem; border-left:3px solid var(--green); background:#f2f7f3; }

.cost-button {
  min-height: 44px;
}

.cost-area-list + .cost-button { margin-top:12px; }

.rate-grid {
  display: grid;
  gap: 0.75rem;
}

.rate-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.rate-row label {
  font-weight: 800;
}

.rate-input {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  border: 1px solid #cbdcd3;
  border-radius: 10px;
  background: var(--surface);
}

.rate-input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 115, 65, 0.12);
}

.rate-input span {
  padding: 0 0.55rem;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.rate-input input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding-inline: 0.2rem;
}

.rate-source {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.rate-source a {
  font-weight: 700;
}

.result-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.result-topline .privacy-note {
  background: #e8f0e9;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.9rem 0;
}

.summary-card {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.summary-card span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.summary-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--green-dark);
  font-size: 1.25rem;
  line-height: 1.2;
}

.result-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.79rem;
}

.result-table th,
.result-table td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
}

.result-table th:first-child,
.result-table td:first-child {
  text-align: left;
}

.result-table th {
  background: #edf4ee;
  color: var(--green-dark);
  font-size: 0.74rem;
}

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

.result-table small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
  white-space: normal;
}

.missing-value {
  color: #8c5d08;
  font-weight: 800;
}

.result-note {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.cost-next-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #eef5f1; }
.cost-next-action strong,
.cost-next-action span { display: block; }
.cost-next-action span { margin-top: 0.25rem; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.cost-next-action .button { white-space: nowrap; }
.cost-next-action .is-disabled { opacity: 0.5; pointer-events: none; }

.contractor-workflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.43fr);
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 12px;
  background: var(--surface);
}

.contractor-workflow h2 { margin: 0.25rem 0 0.55rem; }
.contractor-workflow p { margin: 0; }
.contractor-workflow-action { min-width: 0; }
.contractor-workflow-action .button {
  display: block;
  width: 100%;
  min-height: 44px;
  white-space: normal;
  text-align: center;
}
.contractor-workflow-action .button:focus-visible { outline: 3px solid var(--green-dark); outline-offset: 3px; }
.contractor-workflow .affiliate-disclosure {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.reference-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.9rem;
}

.reference-table th,
.reference-table td {
  padding: 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.reference-table th {
  background: #edf4ee;
}

.formula-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

.formula-list li {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfb;
}

.formula-list strong {
  display: block;
  margin-bottom: 0.25rem;
}

.quote-checklist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.quote-checklist div {
  padding: 0.9rem;
  border-left: 4px solid var(--green);
  background: #f7faf7;
}

.quote-checklist strong {
  display: block;
  margin-bottom: 0.2rem;
}

@media (max-width: 980px) {
  .cost-workbench {
    grid-template-columns: 1fr;
  }

  .cost-results {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  .contractor-workflow { grid-template-columns: 1fr; padding: 1rem; }
  .cost-next-action { grid-template-columns: 1fr; }
  .cost-next-action .button { width: 100%; white-space: normal; text-align: center; }

  .cost-tool-heading,
  .result-topline {
    display: block;
  }

  .cost-tool-heading .privacy-note,
  .result-topline .privacy-note {
    display: inline-block;
    margin-top: 0.65rem;
  }

  .cost-inputs,
  .cost-results {
    padding-inline: 0.85rem;
  }

  .project-settings,
  .rate-row,
  .formula-list,
  .quote-checklist {
    grid-template-columns: 1fr;
  }

  .cost-page .area-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }

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

  .result-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .result-table,
  .result-table tbody,
  .result-table tr,
  .result-table td {
    display: block;
    width: 100%;
  }

  .result-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .result-table tr {
    margin-bottom: 0.75rem;
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .result-table td,
  .result-table td:first-child {
    display: grid;
    grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.2fr);
    gap: 0.65rem;
    padding: 0.52rem 0;
    text-align: right;
    white-space: normal;
  }

  .result-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-align: left;
  }

  .reference-table,
  .reference-table tbody,
  .reference-table tr,
  .reference-table th,
  .reference-table td {
    display: block;
    width: 100%;
  }

  .reference-table thead {
    display: none;
  }

  .reference-table tr {
    margin-bottom: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
  }

  .reference-table td {
    border: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 560px) {
  .project-use-fieldset, .site-context-grid, .area-job-grid { grid-template-columns:1fr; }
  .site-context-wide, .area-job-wide { grid-column:auto; }
}

@media (max-width: 420px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .site-nav[style] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  .site-nav a[href="/"] {
    background: transparent;
    color: var(--muted);
    box-shadow: none;
  }

  .site-nav a[aria-current="page"] {
    background: var(--green-dark);
    color: #fff;
    box-shadow: 0 4px 10px rgba(31, 89, 55, 0.16);
  }
}


.import-notice {padding:12px 14px;border-left:3px solid #286b4e;background:#f1f5ee;line-height:1.5;overflow-wrap:anywhere;}
#measurement-status {color:#784817;line-height:1.5;}
[hidden] {display:none !important;}

/* The existing opening note is now task guidance, not a small privacy badge. */
.cost-page .cost-tool-card .cost-tool-heading { gap: 12px; }
.cost-page .cost-tool-card .cost-tool-heading .privacy-note { max-width: 72ch; font-size: .9rem; line-height: 1.55; }
