:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #102038;
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #ebf3ff;
  --muted: #9cb0cd;
  --accent: #6ed1ff;
  --chart-aqua: #73e3d4;
  --chart-sky: #7ac8ff;
  --chart-violet: #a78bfa;
  --chart-gold: #ffd166;
  --good: #58c77b;
  --warn: #ffbf4d;
  --bad: #ff6b6b;
  --mixed: #9d8cff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(110, 209, 255, 0.12), transparent 35%),
    linear-gradient(180deg, #091425 0%, #050b15 100%);
  color: var(--text);
}

main {
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(2rem, 3vw, 3rem);
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 58rem;
  line-height: 1.5;
}

.hero__meta {
  margin-bottom: 0.35rem;
}

.hero__link {
  color: var(--accent);
  text-decoration: none;
}

.hero__link:hover,
.hero__link:focus-visible {
  text-decoration: underline;
}

.actions,
.nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.button,
.nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  border-radius: 0.9rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.action-note {
  padding: 0.8rem 1rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  line-height: 1.45;
}

.button {
  background: linear-gradient(135deg, rgba(110, 209, 255, 0.2), rgba(110, 209, 255, 0.12));
  border: 1px solid rgba(110, 209, 255, 0.35);
}

.nav {
  margin: 0 0 1rem;
}

.nav__link {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav__link--active {
  background: rgba(110, 209, 255, 0.16);
  border-color: rgba(110, 209, 255, 0.34);
}

.panel {
  background: rgba(16, 32, 56, 0.88);
  border: 1px solid var(--panel-border);
  border-radius: 1.1rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.filter-bar {
  margin-bottom: 1rem;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.filter-form__label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.filter-form__select {
  min-width: min(30rem, 100%);
  padding: 0.8rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 14, 24, 0.9);
  color: var(--text);
}

.filter-form__select--date {
  min-width: min(8rem, 100%);
  padding: 0.45rem 0.5rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 1rem;
}

.stat {
  padding: 1.1rem 1.2rem;
}

.stat__label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
}

.stat__value {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.stat__meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.content {
  grid-template-columns: 1fr;
  margin-bottom: 1rem;
}

.pattern-tables {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 1.2rem;
}

.pattern-table td:last-child,
.pattern-table th:last-child {
  width: 6rem;
  text-align: right;
}

.section {
  padding: 1.1rem 1.2rem 1.25rem;
}

.section + .section {
  margin-top: 1rem;
}

.section h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.section p {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.45;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chip--usage { color: var(--good); }
.chip--automation { color: var(--warn); }
.chip--intrusion { color: var(--bad); }
.chip--mixed { color: var(--mixed); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.legend__dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  display: inline-block;
}

#map {
  min-height: 760px;
  border-radius: 0.9rem;
  overflow: hidden;
}

.daily-chart {
  margin-top: 1rem;
  padding: 0.8rem 0.5rem 0.2rem 0;
  border-radius: 0.9rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow-x: auto;
}

.daily-chart svg {
  width: 100%;
  min-width: 760px;
  height: auto;
  display: block;
}


table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

th, td {
  padding: 0.7rem 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.classification {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.classification::before {
  content: "";
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  display: inline-block;
}

.classification--website_usage::before { background: var(--good); }
.classification--automation::before { background: var(--warn); }
.classification--intrusion_attempt::before { background: var(--bad); }
.classification--mixed::before { background: var(--mixed); }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-word;
}

.list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.empty,
.error {
  padding: 1.2rem;
  margin-top: 1rem;
}

.error {
  border: 1px solid rgba(255, 107, 107, 0.45);
  color: #ffd8d8;
  background: rgba(255, 107, 107, 0.08);
}

.footnote {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.9rem;
}

.stack {
  display: grid;
  gap: 1rem;
}

@media (max-width: 1080px) {
  .hero {
    flex-direction: column;
  }

  #map {
    min-height: 520px;
  }

  .daily-chart svg {
    min-width: 640px;
  }
}
