:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --ink: #1c2733;
  --muted: #5a6673;
  --line: #d9ddd6;
  --brand: #1f3b57;
  --brand-soft: #2f5a7a;
  --accent: #c97b3f;
  --good: #3f7d52;
  --watch: #b4781a;
  --risk: #a64a3a;
  --shadow: 0 1px 2px rgba(20, 30, 20, 0.06), 0 6px 18px rgba(20, 30, 20, 0.06);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 40px);
  background: var(--brand);
  color: #fff;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #e9eef3;
  border-radius: 10px;
}
.site-header h1 { font-size: 1.25rem; margin: 0; }
.tagline { margin: 2px 0 0; font-size: 0.9rem; color: #d7e1ea; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.site-nav a {
  color: #fff;
  font-size: 0.95rem;
  padding: 4px 2px;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { border-color: #fff; text-decoration: none; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 32px);
  display: grid;
  gap: 28px;
}

section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow);
}

h2 { margin-top: 0; color: var(--brand); font-size: 1.35rem; }
h3 { color: var(--brand-soft); font-size: 1.05rem; margin-top: 0; }
.section-note { color: var(--muted); margin-top: -4px; }

.intro {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.intro-text p { margin: 0 0 10px; }
.quick-tips {
  background: #eef2f0;
  border-left: 4px solid var(--brand);
  padding: 14px 16px;
  border-radius: 8px;
}
.quick-tips ul { margin: 8px 0 0; padding-left: 18px; }
.quick-tips li { margin: 4px 0; }

.room-form {
  display: grid;
  gap: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
label {
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--ink);
}
label span { color: var(--muted); font-weight: 500; }
input[type="text"], input[type="number"], select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
  outline: 2px solid var(--brand-soft);
  outline-offset: 1px;
  border-color: var(--brand-soft);
}

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}
.checks legend { padding: 0 6px; color: var(--brand); font-weight: 600; }
.checks label { display: flex; align-items: center; gap: 8px; color: var(--ink); }

.vent-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
}
.vent-row .grow { min-width: 0; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
}
button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-soft); border-color: var(--brand-soft); }
.btn-ghost {
  background: #fff;
  color: var(--brand);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--brand); }

.empty-state {
  margin-top: 14px;
  padding: 14px 16px;
  background: #f0f3f1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.room-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.room-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}
.room-card h3 { margin: 0 0 4px; color: var(--brand); }
.room-meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
.room-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7ece9;
  color: var(--brand);
}
.tag.problem { background: #f6e5dc; color: #8a3d28; }
.room-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.room-actions button { padding: 6px 10px; font-size: 0.85rem; }

.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.legend {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.dot-good { background: var(--good); }
.dot-watch { background: var(--watch); }
.dot-risk { background: var(--risk); }

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.map-cell {
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fafbf9;
}
.map-cell h3 { margin: 0 0 4px; }
.map-cell .score { font-size: 0.9rem; color: var(--muted); margin: 0; }
.map-cell.good { background: #e6f1ea; border-color: #cfe3d4; }
.map-cell.watch { background: #fbf2e2; border-color: #f1e1c1; }
.map-cell.risk { background: #f7e3dd; border-color: #ecc6bb; }

.fixes-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.fix-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}
.fix-rank {
  font-weight: 700;
  color: var(--brand);
  text-align: center;
}
.fix-body h3 { margin: 0 0 2px; font-size: 1rem; }
.fix-target {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 4px 8px;
  background: #eef2f0;
  border-radius: 999px;
}

.reference {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.reference > h2,
.reference > .section-note {
  grid-column: 1 / -1;
}
.ref-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fafbf9;
}
.ref-card p { margin: 6px 0 0; }
.ref-card ul { margin: 6px 0 0; padding-left: 18px; }
.ref-card li { margin: 3px 0; }

.save-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.save-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fafbf9;
}
.save-card h3 { margin-top: 0; }
.save-card p { color: var(--muted); margin: 0 0 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.history {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.snapshot-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
}
.snapshot-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
  font-size: 0.9rem;
}
.snapshot-list button { padding: 4px 8px; font-size: 0.8rem; }

.content-area p { margin: 0 0 10px; }
.content-area h3 { margin-top: 16px; }

.site-footer {
  margin-top: 20px;
  padding: 18px clamp(16px, 4vw, 40px);
  background: var(--brand);
  color: #fff;
  text-align: center;
}
.site-footer p { margin: 0 0 6px; font-size: 0.9rem; }
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
}
.site-footer a { color: #fff; font-size: 0.9rem; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .intro { grid-template-columns: 1fr; }
  .vent-row { grid-template-columns: 1fr; }
  .room-card { grid-template-columns: 1fr; }
  .room-actions { flex-direction: row; flex-wrap: wrap; }
  .fix-item { grid-template-columns: 32px 1fr; }
  .fix-target { grid-column: 1 / -1; }
}

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .form-actions, .btn-row, .room-actions button, .snapshot-list button { display: none; }
  section { box-shadow: none; break-inside: avoid; }
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
