:root {
  --ink: #1e293b;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-soft: #14b8a6;
  --surface: #ffffff;
  --line: rgba(30, 41, 59, 0.12);
  --shadow: 0 12px 36px rgba(15, 23, 42, 0.18);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Syne", "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: #dbe4ea;
  overflow-x: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

@media all and (display-mode: standalone) {
  body {
    overscroll-behavior: none;
  }
}

.map-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #d6e2ea;
}
.map-bg .leaflet-container {
  width: 100%;
  height: 100%;
  font: inherit;
}
.map-bg .leaflet-control-attribution {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.shell {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 24px 16px 40px;
  pointer-events: none;
}
.shell .panel,
.shell .btn {
  pointer-events: auto;
}

.brand-mark {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.brand h1 {
  margin: 8px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}
.sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.panel {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.cam-live {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: cover !important;
  transform: scaleX(-1) !important;
  z-index: -1 !important;
  border-radius: 0;
  background: #000;
  box-shadow: none;
  opacity: 1 !important;
  pointer-events: none !important;
}
.cam-live.cam-min {
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  transform: scaleX(-1) !important;
  z-index: -1 !important;
}
.cam-canvas {
  position: fixed !important;
  left: -9999px !important;
  width: 640px !important;
  height: 480px !important;
}
.cam-live.cam-off {
  display: none !important;
}
.cam-banner,
.cam-banner.show {
  display: none !important;
}

.cam-hint {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.cam-hint.hide {
  display: none;
}

.status {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  min-height: 1.3em;
}
.status.ok { color: var(--accent); }
.status.err { color: #dc2626; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.28);
}
.btn.primary:hover {
  background: var(--accent-soft);
  filter: brightness(0.98);
}
.btn.primary:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.promo-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(2px);
}
.promo-overlay.hide {
  display: none;
}
.promo-card {
  position: relative;
  width: min(360px, 100%);
  padding: 28px 22px 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--ink);
}
.promo-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.promo-tag {
  margin: 0 0 10px;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.promo-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--ink);
}
.promo-text {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}
.promo-card .btn {
  width: 100%;
}
