:root {
  --ink: #1f2a37;
  --muted: #5b6b7c;
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #e2e6eb;
  --accent: #2e5e8e;
  --accent-dark: #1f4266;
  --red: #c0392b;
  --amber: #d08a28;
  --green: #3e7c59;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.25; }

.hero {
  background: linear-gradient(160deg, var(--accent-dark), var(--accent));
  color: white;
  padding: 56px 0 40px;
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; opacity: 0.85; margin: 0 0 8px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 14px; }
.lede { max-width: 640px; opacity: 0.92; margin: 0 0 24px; }
.hero-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-primary { background: white; color: var(--accent-dark); }
.btn-primary:hover { background: #eef3f8; }
.btn-block { width: 100%; margin-top: 8px; }

.badge {
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}
.badge-ok { background: rgba(62, 124, 89, 0.35); }
.badge-warn { background: rgba(192, 57, 43, 0.4); }

.stats { background: var(--card); border-bottom: 1px solid var(--border); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  padding: 28px 24px;
}
.stat { text-align: center; }
.stat-value { display: block; font-size: 1.7rem; font-weight: 700; color: var(--accent-dark); }
.stat-label { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }

main.wrap { padding: 48px 24px 8px; }

.section-note { color: var(--muted); max-width: 680px; margin-top: -8px; font-size: 0.94rem; }

.predictor { margin-bottom: 56px; }

.predictor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 20px;
  align-items: start;
}
@media (max-width: 860px) {
  .predictor-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

fieldset { border: none; padding: 0; margin: 0 0 20px; }
legend { font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 0; margin-bottom: 10px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.9rem; margin-bottom: 6px; }
.field select, .field input[type="range"] { width: 100%; }
.field select { padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border); font-size: 0.92rem; background: white; }
.field-check label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; margin: 0; }
.field-check input { width: 16px; height: 16px; }

.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; margin-bottom: 14px; }
.field-row.addons { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 480px) { .field-row.addons { grid-template-columns: repeat(3, 1fr); } }

.is-disabled { opacity: 0.4; pointer-events: none; }

.result-panel { position: sticky; top: 24px; opacity: 0.5; transition: opacity 0.2s; }
.result-panel.is-visible { opacity: 1; }
.result-headline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.result-probability { font-size: 2.6rem; font-weight: 800; color: var(--accent-dark); }

.risk-badge { padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; color: white; background: var(--muted); }
.risk-high { background: var(--red); }
.risk-medium { background: var(--amber); }
.risk-low { background: var(--green); }

.gauge { height: 10px; border-radius: 999px; background: #eceff2; overflow: hidden; margin-bottom: 20px; }
.gauge-fill { height: 100%; width: 0%; border-radius: 999px; transition: width 0.35s ease; background: var(--muted); }
.gauge-fill.risk-high { background: var(--red); }
.gauge-fill.risk-medium { background: var(--amber); }
.gauge-fill.risk-low { background: var(--green); }

.factors { list-style: none; padding: 0; margin: 0; }
.factor { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; padding-left: 22px; position: relative; }
.factor:last-child { border-bottom: none; }
.factor::before { position: absolute; left: 0; }
.factor-up::before { content: "▲"; color: var(--red); font-size: 0.7rem; top: 11px; }
.factor-down::before { content: "▼"; color: var(--green); font-size: 0.7rem; top: 11px; }
.factor-flat::before { content: "–"; color: var(--muted); top: 8px; }

.gallery { margin: 48px 0 40px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; margin-top: 20px; }
.gallery figure { margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; display: block; }
.gallery figcaption { padding: 12px 16px; font-size: 0.86rem; color: var(--muted); }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; margin-top: 24px; color: var(--muted); font-size: 0.88rem; }
