/* Auswanderkompass - Mobile First 390px, Desktop als Erweiterung */
:root {
  --teal: #0e7a6d;
  --teal-dark: #0a5c52;
  --teal-light: #e4f2f0;
  --amber: #e8a13d;
  --ink: #1e2a28;
  --muted: #5f7370;
  --bg: #f7faf9;
  --card: #ffffff;
  --border: #dde8e6;
  --good: #2e9e63;
  --mid: #e8a13d;
  --bad: #d05353;
  --radius: 14px;
  --shadow: 0 1px 4px rgba(20, 50, 45, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- Header ---------- */
.topbar {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff;
  padding: 16px 18px 14px;
}
.brand { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.2px; }
.claim { font-size: 0.82rem; opacity: 0.85; margin-top: 2px; }

/* ---------- Haushalt ---------- */
.haushalt {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.haushalt-label { color: var(--muted); font-size: 0.82rem; }
.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}
.step-btn {
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: transparent;
  font-size: 1.15rem;
  color: var(--teal);
  cursor: pointer;
}
.step-btn:active { background: var(--teal-light); }
.step-val { min-width: 62px; text-align: center; font-size: 0.85rem; color: var(--muted); }
.step-val b { color: var(--ink); }

/* ---------- Kriterien ---------- */
.kriterien { padding: 18px 18px 6px; }
.kriterien h1 { font-size: 1.3rem; margin-bottom: 2px; }
.hint { font-size: 0.83rem; color: var(--muted); margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
/* Touch-Target mind. 44px ohne Optik zu sprengen */
.chip::after { content: ""; position: absolute; inset: -5px; }
.chip.vorschlag { border-color: var(--teal); }
.chip.aktiv {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-weight: 600;
}
.mehr-kriterien { margin-top: 10px; }
.mehr-kriterien summary {
  font-size: 0.85rem;
  color: var(--teal);
  cursor: pointer;
  padding: 6px 0;
  list-style: none;
}
.mehr-kriterien summary::before { content: "▸ "; }
.mehr-kriterien[open] summary::before { content: "▾ "; }
.mehr-kriterien .chips { margin-top: 8px; }

/* ---------- Ranking ---------- */
.ranking { padding: 14px 18px; }
.ranking-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.ranking-head h2 { font-size: 1.05rem; }
.reset-btn {
  border: none; background: none;
  color: var(--teal); font-size: 0.82rem;
  cursor: pointer; text-decoration: underline;
}
.laender-liste { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.land-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.land-card:active { transform: scale(0.985); }
.land-rang {
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 22px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.land-flagge { font-size: 1.5rem; line-height: 1; }
.land-mitte { flex: 1; min-width: 0; }
.land-name { font-weight: 650; font-size: 0.98rem; }
.land-staerken {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.land-kosten { font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.land-score {
  font-weight: 700;
  font-size: 1.02rem;
  padding: 6px 10px;
  border-radius: 10px;
  min-width: 46px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.score-hoch { background: #e2f3e9; color: var(--good); }
.score-mittel { background: #faf0dd; color: #b07a1e; }
.score-niedrig { background: #f9e5e5; color: var(--bad); }

/* ---------- Footer ---------- */
.foot { padding: 20px 18px 34px; font-size: 0.75rem; color: var(--muted); }
.foot-note { margin-top: 4px; }

/* ---------- Detail-Sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 35, 32, 0.45);
  z-index: 40;
}
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-height: 88vh;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -6px 30px rgba(15, 35, 32, 0.25);
}
.sheet-close {
  position: sticky;
  top: 10px;
  float: right;
  margin: 10px 14px 0 0;
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
}
.sheet-inner { padding: 18px 18px 40px; }
.sheet-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.sheet-flagge { font-size: 2.2rem; }
.sheet-kopf h3 { font-size: 1.35rem; }
.sheet-score-zeile { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.sheet-fazit {
  font-size: 0.9rem;
  background: var(--teal-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.sheet h4 { font-size: 0.95rem; margin: 18px 0 8px; }
.score-zeile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 30px;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.score-zeile .label { font-size: 0.84rem; }
.score-balken {
  height: 7px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.score-balken > i {
  display: block;
  height: 100%;
  border-radius: 4px;
}
.score-zahl { font-size: 0.82rem; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.score-kommentar {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 4px 0 6px;
}
.kosten-tabelle { width: 100%; font-size: 0.86rem; border-collapse: collapse; }
.kosten-tabelle td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.kosten-tabelle td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.kosten-tabelle .summe td { font-weight: 700; border-bottom: none; }
.premium-teaser {
  margin-top: 20px;
  border: 1.5px dashed var(--amber);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.84rem;
  color: var(--muted);
  background: #fdf8ef;
}
.premium-teaser b { color: var(--ink); }

/* ---------- Desktop ---------- */
@media (min-width: 760px) {
  .topbar, .haushalt, .kriterien, .ranking, .foot { padding-left: max(18px, calc(50vw - 360px)); padding-right: max(18px, calc(50vw - 360px)); }
  .sheet { left: 50%; right: auto; transform: translateX(-50%); width: 640px; }
}
