:root {
  color-scheme: light;
  --bg: #f6f8f5;
  --surface: #ffffff;
  --soft: #edf3f2;
  --ink: #18201f;
  --muted: #5d6865;
  --line: #cbd6d2;
  --brand: #225c63;
  --brand-dark: #164046;
  --accent: #b6563f;
  --good: #2f7356;
  --watch: #a26b1f;
  --risk: #9b3434;
  --shadow: 0 14px 38px rgba(24, 32, 31, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

a {
  color: var(--brand-dark);
  font-weight: 700;
  text-underline-offset: 0.18em;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 20;
  background: var(--brand-dark);
  color: #ffffff;
  padding: 0.7rem 1rem;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

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

.topbar-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  font-weight: 900;
}

.nav,
.footer nav,
.language-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.language-picker {
  align-items: center;
  border-left: 1px solid var(--line);
  padding-left: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.language-picker select {
  width: auto;
  min-height: 40px;
  padding: 0.4rem 2rem 0.4rem 0.6rem;
}

.nav a,
.footer a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav a[aria-current="page"] {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  padding: 1rem 0 2rem;
}

.workbench,
.compare-main,
.article {
  min-width: 0;
}

.section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.kicker {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.7rem);
  max-width: 780px;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.08rem;
}

.intro-note,
.helper,
.fine-print {
  color: var(--muted);
}

.sheet,
.decision-card,
.saved-preview,
.comparison-panel,
.chooser,
.article,
.empty-state,
.seo-intro {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sheet-section {
  padding: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.sheet-section:last-child {
  border-bottom: 0;
}

.sheet-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.step-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.fields {
  display: grid;
  gap: 1rem;
}

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

label,
legend {
  font-weight: 800;
}

label {
  display: grid;
  gap: 0.35rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #aebbb7;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 0.65rem 0.75rem;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(34, 92, 99, 0.28);
  outline-offset: 2px;
}

.money-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 0.5rem;
}

.score-stack {
  display: grid;
  gap: 0.75rem;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
  padding: 0.85rem;
}

.score-row p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.range-wrap {
  display: grid;
  grid-template-columns: 1fr 2.4rem;
  gap: 0.6rem;
  align-items: center;
}

input[type="range"] {
  accent-color: var(--brand);
}

output {
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  padding: 0.2rem 0.45rem;
  text-align: center;
  font-weight: 900;
}

.renovation-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.segmented button {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.segmented button span {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
}

.segmented button.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.segmented button.active span {
  color: #e9f3f0;
}

.upload-box {
  display: grid;
  place-items: center;
  border: 2px dashed #9baaa6;
  border-radius: var(--radius);
  background: var(--soft);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
}

.photo-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
  padding-bottom: 0.65rem;
}

.photo-card img,
.image-slot {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--soft);
}

.photo-card label,
.photo-card button {
  margin: 0.55rem;
}

.photo-card input {
  min-height: 38px;
}

.photo-card button,
.chooser-actions button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
}

.button,
.link-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 0.65rem 0.9rem;
  font-weight: 900;
  text-decoration: none;
}

.button.primary,
.link-button.primary {
  background: var(--brand);
  color: #ffffff;
}

.button.secondary {
  background: #ffffff;
  color: var(--brand-dark);
}

.button.ghost {
  background: var(--soft);
  color: var(--brand-dark);
}

.bottom-actions {
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.75rem;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.bottom-actions .button {
  flex: 1 1 150px;
}

.decision-column {
  display: grid;
  gap: 1rem;
  align-self: start;
  position: sticky;
  top: 1rem;
}

.decision-card,
.saved-preview {
  padding: 1rem;
}

.score-lockup {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin: 0.3rem 0 0.35rem;
}

.score-lockup span:first-child {
  font-size: 4rem;
  line-height: 0.95;
  font-weight: 900;
}

.score-lockup span:last-child {
  color: var(--muted);
  font-weight: 800;
}

.verdict {
  margin: 0 0 0.75rem;
  color: var(--brand-dark);
  font-weight: 900;
}

.score-bar {
  height: 14px;
  border-radius: 999px;
  background: #dfe7e4;
  overflow: hidden;
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 160ms ease;
}

.score-bar .good {
  background: var(--good);
}

.score-bar .watch {
  background: var(--watch);
}

.score-bar .risk {
  background: var(--risk);
}

.decision-reasons {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0;
}

.decision-reasons p {
  margin: 0;
  border-left: 5px solid var(--brand);
  background: #f8faf9;
  padding: 0.7rem;
  border-radius: 6px;
}

.ad-slot {
  min-height: 86px;
  border: 1px dashed #8a9995;
  border-radius: var(--radius);
  background: #e8efed;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.ad-slot::before {
  content: "Ad slot";
  font-size: 0.9rem;
}

.saved-preview-list {
  display: grid;
  gap: 0.55rem;
}

.saved-preview-list article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem;
  background: #fbfcfb;
}

.saved-preview-list span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.seo-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 2rem;
}

.footer {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

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

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(420px, calc(100vw - 32px));
  transform: translateY(140%);
  transition: transform 160ms ease;
  border-radius: var(--radius);
  background: var(--brand-dark);
  color: #ffffff;
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow);
  z-index: 30;
}

.toast.show {
  transform: translateY(0);
}

.cookie-notice {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 25;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 0.9rem;
  box-shadow: var(--shadow);
}

.cookie-notice p {
  margin: 0 0 0.75rem;
}

.cookie-notice div {
  display: flex;
  gap: 0.5rem;
}

.cookie-notice button {
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: #ffffff;
  color: var(--brand-dark);
  padding: 0.5rem 0.75rem;
}

.cookie-notice button[data-consent="yes"] {
  background: var(--brand);
  color: #ffffff;
}

.compare-layout {
  padding: 1rem 0 2rem;
}

.compare-main > h1,
.article h1 {
  margin-bottom: 0.65rem;
}

.chooser,
.comparison-panel,
.article {
  padding: 1rem;
  margin-top: 1rem;
}

.chooser {
  display: grid;
  gap: 0.75rem;
}

.chooser-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
  padding: 0.75rem;
}

.chooser-card label {
  display: flex;
  align-items: start;
  gap: 0.6rem;
}

.chooser-card input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin-top: 0.15rem;
  accent-color: var(--brand);
}

.chooser-card small {
  display: block;
  color: var(--muted);
  font-weight: 600;
}

.chooser-actions,
.button-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.comparison-table-wrap {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

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

.comparison-table th {
  background: var(--soft);
}

.reflection {
  border-left: 5px solid var(--accent);
  background: #fff8f5;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: 800;
}

.empty-state {
  padding: 1rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  padding: 1rem 0 2rem;
}

.article h2 {
  margin-top: 1.5rem;
}

.article p,
.article li,
.article dd {
  max-width: 76ch;
}

.side-panel {
  position: sticky;
  top: 1rem;
  align-self: start;
  display: grid;
  gap: 1rem;
}

.cta-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.faq-list dt,
.glossary-list dt {
  font-weight: 900;
  margin-top: 1rem;
}

.faq-list dd,
.glossary-list dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.compact-link-list,
.checkbox-list,
.source-list {
  padding-left: 1.2rem;
}

.compact-link-list li,
.source-list li {
  margin: 0.45rem 0;
}

.checkbox-list li {
  margin: 0.55rem 0;
}

.print-checklist {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 1rem;
}

.print-only-note,
.write-lines {
  color: var(--muted);
  font-weight: 700;
}

@media print {
  .topbar,
  .side-panel,
  .ad-slot,
  .cookie-notice {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .wrap,
  .article-layout {
    max-width: none;
    width: 100%;
    display: block;
    padding: 0;
  }

  .article {
    padding: 0;
    margin: 0;
  }

  a {
    color: #000000;
  }
}

@media (max-width: 940px) {
  .topbar-inner,
  .footer-inner,
  .section-title,
  .page-grid,
  .seo-intro,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .topbar-inner,
  .footer-inner {
    display: grid;
  }

  .nav,
  .footer nav,
  .language-picker {
    justify-content: flex-start;
  }

  .language-picker {
    border-left: 0;
    padding-left: 0;
  }

  .decision-column,
  .side-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  .wrap {
    width: min(100% - 20px, 1160px);
  }

  .fields.two,
  .score-row,
  .segmented,
  .chooser-card {
    grid-template-columns: 1fr;
  }

  .sheet-heading {
    display: grid;
  }

  .bottom-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .score-lockup span:first-child {
    font-size: 3.2rem;
  }

  .button,
  .bottom-actions .button {
    width: 100%;
  }
}

@media print {
  .topbar,
  .bottom-actions,
  .ad-slot,
  .footer,
  .cookie-notice,
  .toast {
    display: none !important;
  }

  body {
    background: #ffffff;
  }

  .page-grid,
  .article-layout {
    display: block;
  }

  .sheet,
  .decision-card,
  .saved-preview,
  .article {
    box-shadow: none;
    margin-bottom: 1rem;
  }
}
