:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --text: #1d2320;
  --muted: #66706a;
  --accent: #2f7d4f;
  --accent-text: #ffffff;
  --out: #2f7d4f;
  --in: #d0632a;
  --border: #dde3de;
  --error: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --surface: #1c221f;
    --text: #e7ece9;
    --muted: #9aa59f;
    --accent: #4caf74;
    --accent-text: #0d1a12;
    --out: #4caf74;
    --in: #f08a4b;
    --border: #2c3530;
    --error: #ff8a80;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); }
.bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.bar a { text-decoration: none; }
.brand { font-weight: 700; font-size: 1.2rem; color: var(--text); }
main { max-width: 560px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.4rem; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin: 16px 0; color: inherit; text-decoration: none;
}
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.label { display: block; color: var(--muted); }
.big { display: block; font-size: 2.4rem; font-weight: 700; margin: 4px 0 8px; }
input[type=range] { width: 100%; accent-color: var(--accent); height: 32px; }
.scale { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; margin-bottom: 16px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.link { background: none; border: none; color: var(--accent); width: auto; margin: 0 auto; }
.btn:disabled { opacity: .6; }
.stack { display: grid; gap: 10px; margin: 16px 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; }
.dot.out { background: var(--out); }
.dot.in { background: var(--in); }
.hint { color: var(--muted); font-size: .9rem; }
.center { text-align: center; }
.msg { padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.msg-error { color: var(--error); border-color: var(--error); }
.map { height: 55vh; min-height: 280px; border-radius: 14px; border: 1px solid var(--border); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
h2 { font-size: 1.1rem; margin: 24px 0 0; }
.grow { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.icon-btn {
  min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--border);
  background: none; font-size: 1.1rem; cursor: pointer;
}
.thumbs { display: flex; gap: 4px; }
.thumbs img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
