:root {
  --calc-teal: #0d9488;
  --calc-teal-dark: #0f766e;
  --calc-ink: #0f172a;
  --calc-muted: #64748b;
  --calc-line: #e2e8f0;
  --calc-soft: #f8fafc;
  --calc-warning: #fff7ed;
  --calc-warning-line: #fed7aa;
}

body,
button,
input,
select {
  font-family: "General Sans", "DM Sans", system-ui, -apple-system, sans-serif;
}

.site-header {
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.site-header .site-nav {
  max-width: 1240px;
  height: auto;
  padding: 16px 40px;
}

.site-header .nav-logo {
  gap: 10px;
  color: var(--calc-ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-header .nav-logo img {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.site-header .btn-sm {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.site-header a:focus-visible,
.calculator-shell a:focus-visible,
.calculator-shell button:focus-visible,
.calculator-site-footer a:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.35);
  outline-offset: 3px;
}

.calculator-shell {
  padding: 32px 0 56px;
  background: linear-gradient(180deg, #f0fdfa 0, #fff 340px);
}

.calculator-shell .breadcrumb {
  margin-bottom: 18px;
  padding-top: 0;
}

.calculator-shell .breadcrumb a {
  color: var(--calc-teal-dark);
  font-weight: 600;
}

.calculator-heading {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.calculator-heading h1 {
  margin: 10px 0 14px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.calculator-heading p {
  color: var(--calc-muted);
  font-size: 1.1rem;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.72fr);
  gap: 24px;
  align-items: start;
}

.calculator-panel {
  padding: 22px;
  border: 1px solid var(--calc-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.results-panel {
  position: sticky;
  top: 76px;
}

.calc-toolbar,
.room-head,
.wall-head,
.result-head,
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calc-toolbar {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--calc-line);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #f1f5f9;
}

.segmented button {
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.segmented button[aria-pressed="true"] {
  background: #fff;
  color: var(--calc-ink);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.room-card {
  margin: 0 0 16px;
  padding: 18px;
  border: 1px solid var(--calc-line);
  border-radius: 14px;
  background: #fff;
}

.room-head {
  margin-bottom: 14px;
}

.room-head h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.room-name {
  min-width: 170px;
}

.wall-row,
.dimension-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(120px, 1fr) minmax(130px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 0;
  border-top: 1px solid #eef2f7;
}

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

.wall-row:first-of-type {
  border-top: 0;
}

.field label {
  display: block;
  margin-bottom: 5px;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 650;
}

.field .field-label {
  display: block;
  margin-bottom: 5px;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 650;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: var(--calc-ink);
  font: inherit;
}

.field input:focus,
.field select:focus {
  border-color: var(--calc-teal);
  outline: 3px solid rgba(13, 148, 136, 0.14);
}

.field small {
  display: block;
  margin-top: 4px;
  color: var(--calc-muted);
  font-size: 0.72rem;
}

.imperial-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.imperial-pair span {
  position: relative;
}

.imperial-pair em {
  position: absolute;
  top: 10px;
  right: 8px;
  color: #64748b;
  font-size: 0.8rem;
  font-style: normal;
  pointer-events: none;
}

.imperial-pair input {
  padding-right: 28px;
}

.icon-btn,
.text-btn {
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.icon-btn:hover,
.text-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.add-row {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.add-row:hover {
  border-color: var(--calc-teal);
  background: #f0fdfa;
  color: var(--calc-teal-dark);
}

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

.notice {
  padding: 12px 14px;
  border: 1px solid var(--calc-warning-line);
  border-radius: 10px;
  background: var(--calc-warning);
  color: #9a3412;
  font-size: 0.82rem;
  line-height: 1.5;
}

.tiny-note {
  margin-top: 10px;
  color: var(--calc-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.result-total {
  margin: 8px 0 4px;
  font-size: 2.3rem;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.result-sub {
  color: var(--calc-muted);
  font-size: 0.9rem;
}

.result-list {
  margin: 18px 0;
  list-style: none;
}

.result-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--calc-line);
  font-size: 0.9rem;
}

.result-list strong {
  text-align: right;
}

.result-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
}

.result-card h3 {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.plan-cta {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  text-align: center;
}

.source-list {
  padding-left: 18px;
  color: var(--calc-muted);
  font-size: 0.8rem;
}

.source-list li {
  margin: 7px 0;
}

.source-list a {
  text-decoration: underline;
}

.seo-copy {
  padding-top: 64px;
  padding-bottom: 64px;
}

.seo-copy h2 {
  margin: 42px 0 14px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.seo-copy h2:first-child {
  margin-top: 0;
}

.seo-copy h3 {
  margin: 28px 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
}

.seo-copy p,
.seo-copy li {
  color: #475569;
}

.seo-copy p + p {
  margin-top: 16px;
}

.seo-copy ul,
.seo-copy ol {
  margin: 12px 0;
  padding-left: 24px;
}

.seo-copy table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-scroll {
  max-width: 100%;
  margin: 18px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 620px;
  margin: 0;
}

.seo-copy th,
.seo-copy td {
  padding: 10px;
  border: 1px solid var(--calc-line);
  text-align: left;
}

.seo-copy th {
  background: #f8fafc;
}

.tool-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.tool-link {
  padding: 18px;
  border: 1px solid var(--calc-line);
  border-radius: 14px;
  color: var(--calc-ink);
}

.tool-link:hover {
  border-color: var(--calc-teal);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  text-decoration: none;
}

.tool-link strong {
  display: block;
  margin-bottom: 4px;
}

.tool-link span {
  color: var(--calc-muted);
  font-size: 0.85rem;
}

.all-tools-link {
  margin: 4px 0 0;
  text-align: center;
}

.all-tools-link a {
  color: var(--calc-teal-dark);
  font-weight: 700;
}

.hub-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 8px;
}

.hub-actions .btn {
  min-height: 46px;
}

.hub-tools {
  margin-top: 30px;
}

.hub-card {
  display: flex;
  min-height: 210px;
  flex-direction: column;
}

.hub-card .hub-card__eyebrow {
  color: var(--calc-teal-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hub-card h2 {
  margin: 10px 0 8px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.hub-card p {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.65;
}

.hub-card strong {
  margin-top: auto;
  padding-top: 18px;
  color: var(--calc-teal-dark);
}

.hub-planner-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.hub-planner-links a {
  padding: 8px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: var(--calc-teal-dark);
  font-size: 0.9rem;
  font-weight: 650;
}

.hub-planner-links a:hover {
  border-color: var(--calc-teal);
  text-decoration: none;
}

.calculator-site-footer {
  background: #0f172a;
  color: #cbd5e1;
}

.calculator-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 64px 40px 40px;
}

.calculator-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.calculator-footer-brand img {
  width: 32px;
  height: 32px;
}

.calculator-footer-copy {
  max-width: 300px;
  margin: 16px 0 0;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.6;
}

.calculator-footer-title {
  margin-bottom: 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calculator-footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.calculator-footer-links a {
  color: #94a3b8;
  text-decoration: none;
}

.calculator-footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.calculator-footer-bottom {
  border-top: 1px solid #1e293b;
}

.calculator-footer-bottom div {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 40px;
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 860px) {
  .site-header .site-nav {
    gap: 10px;
    padding: 14px 18px;
  }

  .site-header .btn-sm {
    padding: 10px 16px;
    font-size: 14px;
  }

  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .results-panel {
    position: static;
  }

  .wall-row {
    grid-template-columns: 1fr 1fr;
  }

  .assumption-box {
    grid-template-columns: 1fr;
  }

  .tool-links {
    grid-template-columns: 1fr;
  }

  .calculator-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 48px 20px 32px;
  }

  .calculator-footer-grid > div:first-child {
    grid-column: 1 / -1;
  }

  .hub-card {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .site-header .nav-links {
    display: none;
  }

  .site-header .nav-logo span {
    font-size: 15px;
  }

  .calculator-shell {
    padding-top: 22px;
  }

  .calculator-shell .container,
  .seo-copy.container--narrow {
    padding-right: 20px;
    padding-left: 20px;
  }

  .calculator-shell .breadcrumb {
    overflow-x: auto;
    white-space: nowrap;
  }

  .calculator-heading h1 {
    font-size: 36px;
    line-height: 1.06;
  }

  .calculator-panel {
    padding: 14px;
    border-radius: 12px;
  }

  .wall-row,
  .dimension-row {
    grid-template-columns: 1fr;
  }

  .room-name {
    min-width: 0;
  }

  .result-total {
    font-size: 1.9rem;
  }

  .seo-copy.container--narrow {
    padding-top: 48px;
    padding-bottom: 56px;
  }

  .seo-copy h2 {
    font-size: 29px;
    line-height: 1.12;
  }

  .seo-copy h3 {
    line-height: 1.25;
  }

  .seo-copy p,
  .seo-copy li {
    font-size: 16px;
    line-height: 1.7;
  }

  .calculator-footer-grid {
    grid-template-columns: 1fr;
  }

  .calculator-footer-grid > div:first-child {
    grid-column: auto;
  }

  .calculator-footer-bottom div {
    padding: 20px;
  }

  .hub-actions {
    align-items: stretch;
  }

  .hub-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 360px) {
  .site-header .nav-logo span {
    display: none;
  }
}
