:root {
  --bg: #0c1412;
  --surface: #141f1c;
  --surface-2: #1a2824;
  --ink: #e8f0ed;
  --muted: #8fa39a;
  --line: rgba(232, 240, 237, 0.12);
  --petrol: #1a8f72;
  --amber: #e09a2f;
  --danger: #e05a4f;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --touch: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.app {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(12, 20, 18, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-top));
}

.app-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #666;
  flex-shrink: 0;
}

.dot.live {
  background: var(--petrol);
  box-shadow: 0 0 0 3px rgba(26, 143, 114, 0.25);
}

.dot.warn {
  background: var(--amber);
}

.dot.err {
  background: var(--danger);
}

.app-toolbar {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  min-height: var(--touch);
  padding: 0 1rem;
  cursor: pointer;
  flex: 1;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--amber);
  color: #1a1208;
  border-color: transparent;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--touch);
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.85rem;
  white-space: nowrap;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--amber);
}

.hotspot-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.85rem 1rem;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}

.hotspot-bar::-webkit-scrollbar {
  display: none;
}

.hotspot {
  flex: 0 0 auto;
  min-height: var(--touch);
  padding: 0 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hotspot.active {
  border-color: var(--amber);
  background: rgba(224, 154, 47, 0.12);
}

.hotspot .count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.hotspot.high .count {
  color: var(--danger);
}

.main {
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
}

.summary-line {
  font-size: 0.92rem;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--petrol);
  padding: 1rem;
}

.card.high {
  border-left-color: var(--danger);
}

.card.medium {
  border-left-color: var(--amber);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.place {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.15;
}

.badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.badge.high {
  color: var(--danger);
  border-color: rgba(224, 90, 79, 0.45);
}

.hint {
  margin: 0.65rem 0 0;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.35;
}

.more {
  margin-top: 0.65rem;
}

.more summary {
  cursor: pointer;
  color: var(--amber);
  font-weight: 600;
  min-height: var(--touch);
  display: flex;
  align-items: center;
}

.more p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: pre-wrap;
}

.empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
}

.history {
  margin: 0 1rem 1.5rem;
  border-top: 1px solid var(--line);
}

.history summary {
  min-height: var(--touch);
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
  padding: 0.75rem 0;
}

.history-list {
  display: grid;
  gap: 0.65rem;
  padding-bottom: 1rem;
}

.app-footer {
  padding: 0 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (min-width: 720px) {
  .main,
  .history,
  .app-footer {
    max-width: 40rem;
    margin-inline: auto;
  }

  .hotspot-bar {
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
  }
}
