:root {
  --bg: #07090d;
  --panel: rgba(11, 14, 20, 0.88);
  --panel-strong: rgba(12, 15, 22, 0.96);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f3ef;
  --muted: #858b97;
  --soft: #b8bdc6;
  --orange: #f59e0b;
  --orange-soft: #f7b955;
  --blue: #38bdf8;
  --cyan: #2dd4bf;
  --purple: #8b5cf6;
  --purple-soft: #c4b5fd;
  --green: #34d399;
  --danger: #fb7185;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
input {
  font: inherit;
}

button,
select {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--orange-soft);
  outline-offset: 2px;
}

.app-shell {
  height: 100%;
  display: grid;
  grid-template-rows: 90px minmax(0, 1fr);
}

.topbar {
  position: relative;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) auto minmax(430px, 2fr) minmax(150px, 0.65fr);
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(245, 158, 11, 0.035), transparent 28%),
    rgba(7, 9, 13, 0.98);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.35);
}

.brand-block,
.node-state,
.top-metrics,
.clock-block {
  min-width: 0;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(245, 158, 11, 0.24), rgba(245, 158, 11, 0.03) 65%);
  box-shadow: inset 0 0 22px rgba(245, 158, 11, 0.08), 0 0 30px rgba(245, 158, 11, 0.06);
  color: var(--orange-soft);
}

.brand-mark span {
  font-size: 25px;
  font-weight: 600;
  transform: rotate(10deg);
}

.eyebrow,
.panel-kicker,
.filter-label,
.clock-block span,
.top-metrics dt {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-block h1 {
  margin: 2px 0 0;
  font-size: clamp(18px, 1.55vw, 25px);
  font-weight: 680;
  letter-spacing: 0.075em;
  white-space: nowrap;
}

.brand-block h1 span {
  color: var(--orange);
  font-weight: 300;
}

.node-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(133, 139, 151, 0.08);
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.09), 0 0 16px rgba(52, 211, 153, 0.5);
}

.status-dot.stale {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.09), 0 0 16px rgba(251, 113, 133, 0.4);
}

.node-state div {
  display: grid;
  min-width: 0;
}

.node-state strong {
  font-size: 11px;
  font-weight: 650;
}

.node-state div span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-badge {
  padding: 3px 6px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 4px;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.mode-badge.history {
  border-color: rgba(245, 158, 11, 0.32);
  color: var(--orange-soft);
}

.top-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(64px, 1fr));
  gap: 0;
  margin: 0;
}

.top-metrics div {
  min-width: 0;
  padding: 2px 14px;
  border-left: 1px solid var(--line);
}

.top-metrics dd {
  overflow: hidden;
  margin: 3px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(14px, 1.25vw, 20px);
  font-weight: 600;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clock-block {
  display: grid;
  justify-items: end;
  text-align: right;
}

.clock-block strong {
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
}

.clock-block small {
  color: var(--muted);
  font-size: 9px;
}

.map-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #080b11;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 45%, #121925 0%, #080b11 60%, #06080c 100%);
}

.leaflet-container {
  font-family: inherit;
}

.leaflet-control-zoom {
  overflow: hidden;
  border: 1px solid var(--line-strong) !important;
  border-radius: 9px !important;
  box-shadow: var(--shadow) !important;
}

.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  border-color: var(--line) !important;
  background: var(--panel-strong) !important;
  color: var(--soft) !important;
  font-size: 18px !important;
  line-height: 32px !important;
}

.leaflet-control-zoom a:hover {
  background: #171b23 !important;
  color: var(--orange-soft) !important;
}

.map-vignette,
.map-grid {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.map-vignette {
  background: radial-gradient(ellipse at center, transparent 45%, rgba(5, 7, 10, 0.32) 83%, rgba(5, 7, 10, 0.75) 100%);
}

.map-grid {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 75%);
}

.glass-panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(18, 22, 31, 0.9), rgba(8, 11, 16, 0.86));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(18px) saturate(115%);
}

.filter-console {
  position: absolute;
  z-index: 20;
  top: 18px;
  left: 50%;
  width: min(660px, calc(100% - 700px));
  min-width: 480px;
  padding: 14px 16px 12px;
  border-radius: 13px;
  transform: translateX(-50%);
}

.console-heading,
.rail-heading,
.timeline-heading,
.peer-title-row,
.peer-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.console-heading strong {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.text-button:hover {
  color: var(--orange-soft);
}

.filter-section {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  min-height: 27px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--soft);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  transition: 140ms ease;
}

.filter-chip b {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 600;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.09);
  color: var(--text);
}

.filter-chip.network-tor:hover,
.filter-chip.network-tor.active,
.filter-chip.network-i2p:hover,
.filter-chip.network-i2p.active,
.filter-chip.network-cjdns:hover,
.filter-chip.network-cjdns.active {
  border-color: rgba(139, 92, 246, 0.58);
  background: rgba(139, 92, 246, 0.12);
}

.filter-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.25fr 1.25fr;
  gap: 8px;
  margin-top: 11px;
}

.filter-grid label {
  display: grid;
  gap: 4px;
}

.history-overlay-control {
  display: grid;
  grid-template-columns: 148px 118px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.history-overlay-control label {
  display: grid;
  gap: 4px;
}

.history-overlay-control > span {
  align-self: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-overlay-control .history-track i {
  background: #a8b2c1;
}

.history-overlay-control .mode-toggle[aria-pressed="true"] b {
  color: #d5dbe4;
}

.history-overlay-control .mode-toggle[aria-pressed="true"] .history-track {
  border-color: rgba(203, 213, 225, 0.42);
  background: rgba(148, 163, 184, 0.12);
}

select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11151d;
  color: var(--soft);
  font-size: 10px;
}

.filter-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.mode-toggle > span:last-child {
  display: grid;
}

.mode-toggle b {
  color: var(--soft);
  font-size: 9px;
  font-weight: 600;
}

.mode-toggle small {
  color: var(--muted);
  font-size: 8px;
}

.toggle-track {
  position: relative;
  width: 30px;
  height: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.toggle-track i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange-soft);
  transition: transform 160ms ease;
}

.mode-toggle[aria-pressed="true"] .toggle-track i {
  transform: translateX(14px);
}

.metric-rail {
  position: absolute;
  z-index: 20;
  top: 18px;
  left: 18px;
  width: 218px;
  display: grid;
  gap: 10px;
}

.rail-card {
  overflow: hidden;
  padding: 13px;
  border-radius: 12px;
}

.rail-card.accent-orange {
  border-top-color: rgba(245, 158, 11, 0.45);
}

.split-metric {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 9px;
}

.split-metric div + div {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.split-metric strong {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 23px;
  line-height: 1;
}

.split-metric span,
.quality-grid span {
  color: var(--muted);
  font-size: 8px;
}

.ratio-bar {
  height: 3px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.22);
}

.ratio-bar i {
  display: block;
  width: 50%;
  height: 100%;
  background: var(--orange);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
  transition: width 300ms ease;
}

.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 9px;
  margin-top: 10px;
}

.quality-grid div {
  display: grid;
}

.quality-grid strong {
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 550;
}

.node-traffic {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
  color: var(--muted);
  font: 600 7px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.node-traffic b {
  color: var(--soft);
  font-weight: 550;
}

.own-node-location {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.own-node-location strong {
  overflow: hidden;
  color: var(--soft);
  font: 600 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.own-node-location small {
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.declared-note {
  color: var(--muted);
  font-size: 8px;
}

.bar-list {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}

.bar-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
}

.bar-item button {
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-item button:hover {
  color: var(--orange-soft);
}

.bar-item b {
  color: var(--muted);
  font: 600 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.bar-track {
  grid-column: 1 / -1;
  height: 2px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
}

.bar-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-soft));
}

.peer-panel {
  position: absolute;
  z-index: 22;
  top: 18px;
  right: 18px;
  width: 284px;
  max-height: calc(100% - 174px);
  overflow: auto;
  border-radius: 13px;
  scrollbar-color: #343943 transparent;
  scrollbar-width: thin;
}

.peer-empty {
  display: grid;
  justify-items: center;
  padding: 30px 22px;
  text-align: center;
}

.peer-empty h2 {
  margin: 8px 0 7px;
  font-size: 16px;
}

.peer-empty-copy {
  max-width: 220px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.unlocated-section {
  width: 100%;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.unlocated-peer-list {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.unlocated-peer-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 7px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--soft);
  text-align: left;
  cursor: pointer;
}

.unlocated-peer-list button:hover,
.unlocated-peer-list button:focus-visible {
  border-color: rgba(245, 158, 11, 0.45);
  outline: none;
}

.unlocated-peer-list button.is-dimmed {
  opacity: 0.28;
}

.unlocated-peer-list button b {
  color: var(--muted);
  font: 700 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.unlocated-peer-list button span {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unlocated-peer-list button small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radar-icon {
  position: relative;
  width: 58px;
  height: 58px;
  margin-bottom: 15px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12), transparent 62%);
}

.radar-icon::before,
.radar-icon::after,
.radar-icon i {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.radar-icon::before {
  inset: 12px;
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.radar-icon::after {
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--orange-soft);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px var(--orange);
}

.radar-icon i {
  inset: 4px;
  border-top: 1px solid var(--orange);
  animation: radar 4s linear infinite;
}

@keyframes radar {
  to { transform: rotate(360deg); }
}

.peer-details {
  padding-bottom: 12px;
}

.peer-header {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.96);
  backdrop-filter: blur(18px);
}

.peer-header h2 {
  overflow: hidden;
  margin: 7px 0 4px;
  font: 600 15px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peer-header p {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.network-badge {
  display: inline-flex;
  padding: 3px 6px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: var(--orange-soft);
  font: 700 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.network-badge.tor,
.network-badge.i2p,
.network-badge.cjdns {
  color: var(--purple-soft);
}

.close-peer {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
}

.close-peer:hover {
  color: var(--text);
}

.peer-section {
  padding: 13px 16px 4px;
}

.peer-section + .peer-section {
  margin-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.peer-section-title {
  margin-bottom: 7px;
  color: var(--muted);
  font: 700 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.detail-grid {
  display: grid;
  gap: 1px;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(80px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.055);
  font-size: 9px;
}

.detail-row span {
  color: var(--muted);
}

.detail-row strong {
  overflow-wrap: anywhere;
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 500;
  text-align: right;
}

.service-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.service-chips span {
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--soft);
  font: 600 7px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.privacy-note {
  margin: 8px 0 0;
  padding: 8px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.07);
  color: #aaa0c2;
  font-size: 8px;
  line-height: 1.45;
}

.map-legend {
  position: absolute;
  z-index: 20;
  bottom: 126px;
  left: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 8px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.map-legend .unlocated {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.map-legend .route-note {
  color: #768195;
  font-size: 7px;
}

.route {
  display: inline-block;
  width: 13px;
  height: 0;
  border-top: 1px solid var(--orange);
  opacity: 0.75;
}

.route.inbound { border-color: var(--blue); }
.route.privacy { border-color: var(--purple); border-top-style: dotted; }

.leaflet-tooltip.own-node-tooltip {
  padding: 5px 7px;
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 6px;
  background: rgba(10, 13, 19, 0.92);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.34);
  color: var(--text);
}

.leaflet-tooltip.own-node-tooltip::before {
  border-top-color: rgba(245, 158, 11, 0.38);
}

.own-node-tooltip-content {
  display: grid;
  gap: 1px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.own-node-tooltip-content strong {
  color: var(--orange-soft);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.own-node-tooltip-content span {
  color: var(--soft);
  font-size: 7px;
}

path.own-node-halo {
  animation: own-node-pulse 2.8s ease-in-out infinite;
}

@keyframes own-node-pulse {
  0%, 100% { stroke-opacity: 0.42; fill-opacity: 0.08; }
  50% { stroke-opacity: 0.16; fill-opacity: 0.02; }
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 7px currentColor;
}

.dot.ipv6 { background: var(--blue); }
.dot.tor { background: var(--purple); }
.dot.historical {
  width: 9px;
  height: 9px;
  border: 1px solid rgba(226, 232, 240, 0.62);
  background: rgba(148, 163, 184, 0.55);
  box-shadow: 0 0 9px rgba(148, 163, 184, 0.42);
}
.dot.selected { background: white; }

path.historical-peer {
  mix-blend-mode: screen;
  transition: fill-opacity 120ms ease, stroke-opacity 120ms ease;
}

path.historical-peer:hover {
  fill-opacity: 0.68 !important;
  stroke-opacity: 0.9 !important;
}

.leaflet-tooltip.historical-peer-tooltip {
  padding: 7px 8px;
  border: 1px solid rgba(203, 213, 225, 0.24);
  border-radius: 6px;
  background: rgba(10, 13, 19, 0.95);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.38);
  color: var(--soft);
}

.leaflet-tooltip.historical-peer-tooltip::before {
  border-top-color: rgba(203, 213, 225, 0.24);
}

.historical-tooltip-content {
  display: grid;
  gap: 2px;
  max-width: 245px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.historical-tooltip-content strong {
  color: #d5dbe4;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.historical-tooltip-content span {
  overflow-wrap: anywhere;
  color: var(--soft);
  font-size: 8px;
}

.historical-tooltip-content small {
  color: var(--muted);
  font-size: 7px;
  line-height: 1.35;
}

.privacy-belt-label {
  position: absolute;
  z-index: 8;
  bottom: 142px;
  left: 50%;
  display: grid;
  justify-items: center;
  color: rgba(196, 181, 253, 0.34);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  pointer-events: none;
  transform: translateX(-50%);
}

.privacy-belt-label span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3em;
}

.privacy-belt-label small {
  margin-top: 2px;
  font-size: 7px;
  letter-spacing: 0.08em;
}

.timeline-dock {
  position: absolute;
  z-index: 24;
  right: 18px;
  bottom: 16px;
  left: 18px;
  height: 102px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 210px;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 12px;
}

.timeline-heading {
  align-items: flex-start;
  flex-direction: column;
}

.timeline-heading strong {
  display: block;
  margin-top: 3px;
  font: 600 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.range-buttons {
  display: flex;
  gap: 3px;
}

.range-buttons button {
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 700 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.range-buttons button:hover,
.range-buttons button.active {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.08);
  color: var(--orange-soft);
}

.history-stepper {
  display: flex;
  gap: 4px;
}

.history-stepper button {
  width: 27px;
  height: 23px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
}

.history-stepper button:hover:not(:disabled) {
  border-color: rgba(245, 158, 11, 0.34);
  color: var(--orange-soft);
}

.history-stepper button:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.timeline-chart-wrap {
  position: relative;
  align-self: stretch;
  min-width: 0;
}

#timeline-chart {
  width: 100%;
  height: 56px;
  display: block;
}

#history-slider {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  width: 100%;
  height: 12px;
  margin: 0;
  opacity: 0.7;
  accent-color: var(--orange);
  cursor: pointer;
}

.timeline-footer {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: start;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 8px;
}

.timeline-footer > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.timeline-footer > span:last-child {
  grid-column: 1 / -1;
  max-width: 190px;
  margin-top: 4px;
  line-height: 1.35;
}

.line {
  width: 14px;
  height: 2px;
  background: var(--orange);
}

.line.inbound {
  background: var(--blue);
}

.error-toast {
  position: absolute;
  z-index: 100;
  right: 22px;
  bottom: 130px;
  max-width: 320px;
  padding: 10px 13px;
  border: 1px solid rgba(251, 113, 133, 0.32);
  border-radius: 8px;
  background: rgba(37, 14, 20, 0.94);
  color: #fecdd3;
  box-shadow: var(--shadow);
  font-size: 10px;
}

.privacy-peer {
  animation: privacy-pulse 3.4s ease-in-out infinite;
}

@keyframes privacy-pulse {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(139, 92, 246, 0.6)); }
  50% { filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.95)); }
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: minmax(220px, 1fr) auto minmax(340px, 1.8fr);
  }

  .clock-block {
    display: none;
  }

  .filter-console {
    left: 255px;
    width: min(620px, calc(100% - 580px));
    min-width: 440px;
    transform: none;
  }

  .peer-panel {
    width: 260px;
  }
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-rows: 78px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: minmax(210px, 1fr) auto minmax(310px, 1.4fr);
    padding: 10px 14px;
  }

  .top-metrics div:nth-child(4),
  .top-metrics div:nth-child(5) {
    display: none;
  }

  .top-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .filter-console {
    left: 14px;
    width: calc(100% - 306px);
    min-width: 0;
  }

  .metric-rail {
    display: none;
  }

  .peer-panel {
    top: 14px;
    right: 14px;
    width: 265px;
  }

  .timeline-dock {
    right: 14px;
    bottom: 12px;
    left: 14px;
    grid-template-columns: 145px minmax(0, 1fr);
  }

  .timeline-footer {
    display: none;
  }

  .map-legend {
    display: none;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100%;
    grid-template-rows: auto minmax(760px, 1fr);
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  .eyebrow,
  .node-state,
  .top-metrics {
    display: none;
  }

  .clock-block {
    display: grid;
  }

  .filter-console {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    padding: 11px;
  }

  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter-grid label:last-child {
    grid-column: 1 / -1;
  }

  .filter-section {
    grid-template-columns: 1fr;
  }

  .history-overlay-control {
    grid-template-columns: 1fr 1fr;
  }

  .history-overlay-control > span {
    grid-column: 1 / -1;
    text-align: left;
  }

  .peer-panel {
    top: auto;
    right: 10px;
    bottom: 118px;
    left: 10px;
    width: auto;
    max-height: 300px;
    pointer-events: none;
    transform: translateY(calc(100% + 130px));
    transition: transform 200ms ease;
  }

  .peer-panel.has-selection {
    pointer-events: auto;
    transform: translateY(0);
  }

  .peer-empty {
    display: none;
  }

  .timeline-dock {
    right: 10px;
    bottom: 9px;
    left: 10px;
    height: 98px;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
  }

  .range-buttons {
    flex-wrap: wrap;
  }

  .history-stepper {
    display: none;
  }

  .privacy-belt-label {
    bottom: 122px;
  }

  .error-toast {
    right: 12px;
    bottom: 120px;
    left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Node Atlas 0.4 — czytelniejszy, zwijany układ */

:root {
  --panel-radius: 14px;
  --control-height: 36px;
}

body {
  font-size: 14px;
}

.app-shell {
  grid-template-rows: 96px minmax(0, 1fr);
}

.topbar {
  grid-template-columns: minmax(245px, 1fr) minmax(220px, auto) minmax(440px, 1.8fr) minmax(190px, auto);
  gap: 18px;
  padding: 14px 20px;
}

.eyebrow,
.panel-kicker,
.filter-label,
.clock-block span,
.top-metrics dt {
  font-size: 10px;
}

.node-state strong {
  font-size: 13px;
}

.node-state div span,
.clock-block small {
  font-size: 11px;
}

.mode-badge {
  font-size: 9px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
  min-width: 0;
}

.top-actions form {
  margin: 0;
}

.logout-button,
.primary-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(245, 158, 11, 0.36);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  color: var(--orange-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.logout-button:hover,
.primary-button:hover {
  border-color: rgba(245, 158, 11, 0.68);
  background: rgba(245, 158, 11, 0.14);
}

.map-stage {
  --safe-left: 388px;
  --safe-right: 362px;
  --safe-bottom: 188px;
}

.privacy-lines {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.panel-stack,
.right-panel-workspace {
  position: absolute;
  z-index: 25;
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.panel-stack > *,
.right-panel-workspace > * {
  pointer-events: auto;
}

.left-panel-stack {
  top: 16px;
  bottom: var(--safe-bottom);
  left: 16px;
  width: 360px;
  flex-direction: column;
  align-items: stretch;
}

.left-panel-stack:not(:has(.collapsible-panel:not(.is-collapsed))) {
  width: 46px;
}

.right-panel-workspace {
  top: 16px;
  right: 16px;
  bottom: var(--safe-bottom);
  align-items: stretch;
  justify-content: flex-end;
}

.collapsible-panel {
  min-width: 0;
  border-radius: var(--panel-radius);
  transition: width 180ms ease, height 180ms ease, max-height 180ms ease;
}

.panel-header {
  min-height: 48px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.panel-header > div:first-child {
  min-width: 0;
}

.panel-header strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-actions,
.timeline-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.panel-toggle {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.panel-toggle:hover {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--orange-soft);
}

.collapsible-panel.is-collapsed {
  width: 46px !important;
  min-width: 46px !important;
  height: 48px !important;
  max-height: 48px !important;
  overflow: hidden;
}

.collapsible-panel.is-collapsed > .panel-content,
.collapsible-panel.is-collapsed > .timeline-content,
.collapsible-panel.is-collapsed .panel-header > div:first-child,
.collapsible-panel.is-collapsed .panel-header .text-button,
.timeline-dock.is-collapsed .range-buttons,
.timeline-dock.is-collapsed .history-stepper {
  display: none !important;
}

.collapsible-panel.is-collapsed .panel-header {
  justify-content: center;
  width: 46px;
  min-height: 46px;
  padding: 8px;
  border-bottom: 0;
}

.collapsible-panel.is-collapsed .panel-actions,
.timeline-dock.is-collapsed .timeline-tools {
  gap: 0;
}

.panel-content {
  min-height: 0;
}

.filter-console {
  position: static;
  width: 100%;
  min-width: 0;
  max-height: 52%;
  padding: 0;
  overflow: hidden;
  transform: none;
}

.filter-console > .panel-content {
  max-height: calc(100% - 49px);
  padding: 12px;
  overflow: auto;
  scrollbar-color: #343943 transparent;
  scrollbar-width: thin;
}

.chip-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.filter-chip {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 11px;
  text-align: left;
}

.filter-chip b {
  float: right;
}

.filter-details {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.filter-details summary {
  padding: 10px 0 4px;
  color: var(--soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.filter-details summary::marker {
  color: var(--orange);
}

.filter-grid {
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 7px;
}

.filter-grid label:last-child {
  grid-column: 1 / -1;
}

select {
  height: var(--control-height);
  font-size: 12px;
}

.history-overlay-control {
  grid-template-columns: minmax(135px, 1fr) 112px;
  gap: 9px;
  margin-top: 7px;
  padding-top: 4px;
  border-top: 0;
}

.history-overlay-control > span {
  grid-column: 1 / -1;
  font-size: 10px;
  text-align: left;
  white-space: normal;
}

.filter-footer {
  gap: 12px;
}

.mode-toggle b {
  font-size: 11px;
}

.mode-toggle small {
  font-size: 10px;
}

.text-button {
  font-size: 11px;
}

.metric-rail {
  position: static;
  width: 100%;
  min-height: 0;
  display: block;
  overflow: hidden;
  padding: 0;
}

.metric-rail > .panel-content {
  max-height: calc(100% - 49px);
  overflow: auto;
  scrollbar-color: #343943 transparent;
  scrollbar-width: thin;
}

.metric-content {
  padding: 5px 12px 12px;
}

.rail-card {
  padding: 11px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.rail-card + .rail-card {
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.split-metric strong {
  font-size: 27px;
}

.split-metric span,
.quality-grid span {
  font-size: 10px;
}

.quality-grid strong {
  font-size: 15px;
}

.node-traffic {
  font-size: 9px;
}

.own-node-location strong {
  font-size: 12px;
}

.own-node-location small {
  font-size: 10px;
  line-height: 1.35;
}

.address-with-copy {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.address-with-copy small {
  flex: 1 1 auto;
  white-space: normal;
}

.copy-button {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

.copy-button:hover,
.copy-button.copied {
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--orange-soft);
}

.copy-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.declared-note {
  font-size: 10px;
}

.bar-list {
  max-height: 190px;
  gap: 10px;
  overflow: auto;
  padding-right: 3px;
}

.bar-item button {
  font-size: 11px;
}

.bar-item button.active {
  color: var(--orange-soft);
}

.bar-item b {
  font-size: 11px;
}

.bar-track {
  height: 3px;
}

.peer-list-panel {
  width: 330px;
  max-height: 100%;
  overflow: hidden;
}

.peer-list-content {
  height: calc(100% - 49px);
  overflow: hidden;
}

.peer-list {
  height: 100%;
  overflow: auto;
  padding: 7px;
  scrollbar-color: #343943 transparent;
  scrollbar-width: thin;
}

.peer-list-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 7px 6px;
  color: var(--muted);
  font: 700 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.peer-list-group b {
  color: var(--soft);
}

.peer-list-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) minmax(72px, auto);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  text-align: left;
  transition: opacity 130ms ease, border-color 130ms ease, background 130ms ease;
}

.peer-list-item:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.peer-list-item.is-selected {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.09);
}

.peer-list-item.is-dimmed {
  opacity: 0.25;
}

.peer-network-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px currentColor;
}

.peer-network-dot.ipv6 { background: var(--blue); }
.peer-network-dot.tor,
.peer-network-dot.i2p,
.peer-network-dot.cjdns { background: var(--purple); }
.peer-network-dot.not_publicly_routable { background: #94a3b8; }

.peer-list-identity,
.peer-list-meta {
  display: grid;
  min-width: 0;
}

.peer-list-identity strong {
  overflow: hidden;
  font: 600 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peer-list-identity small,
.peer-list-meta small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peer-list-meta {
  justify-items: end;
  text-align: right;
}

.peer-list-meta b {
  color: var(--muted);
  font: 700 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.peer-list-meta small {
  max-width: 100px;
}

.version-focus-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 8px 0;
  padding: 8px 9px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 7px;
  background: rgba(245, 158, 11, 0.07);
  color: var(--soft);
  font-size: 10px;
}

.version-focus-notice button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--orange-soft);
  cursor: pointer;
  font-size: 10px;
}

.peer-panel {
  position: static;
  width: 390px;
  max-height: 100%;
  overflow: hidden;
}

.peer-panel-content {
  height: calc(100% - 49px);
  overflow: auto;
  scrollbar-color: #343943 transparent;
  scrollbar-width: thin;
}

.peer-empty {
  padding: 28px 24px;
}

.peer-empty h2 {
  font-size: 18px;
}

.peer-empty p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.peer-hero {
  display: grid;
  gap: 7px;
  padding: 15px 16px 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 19, 0.72);
}

.peer-hero h2 {
  overflow: hidden;
  margin: 2px 0;
  font: 650 16px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peer-place {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.detail-address {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.peer-hero > .detail-address {
  justify-content: flex-start;
}

.detail-address code {
  overflow-wrap: anywhere;
  color: var(--soft);
  font: 500 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.network-badge {
  width: max-content;
  font-size: 9px;
}

.peer-section {
  padding: 14px 16px 5px;
}

.peer-section-title {
  font-size: 10px;
}

.detail-row {
  grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.2fr);
  gap: 10px;
  padding: 7px 0;
  font-size: 12px;
}

.service-chips span {
  font-size: 9px;
}

.privacy-note {
  font-size: 11px;
}

.privacy-dock {
  position: absolute;
  z-index: 23;
  right: var(--safe-right);
  bottom: var(--safe-bottom);
  left: var(--safe-left);
  min-height: 50px;
  max-height: 96px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  overflow: hidden;
  padding: 8px 9px;
  border-color: rgba(139, 92, 246, 0.24);
  border-radius: 11px;
}

.privacy-dock-label {
  display: grid;
  align-content: center;
  flex: 0 0 auto;
  padding-right: 9px;
  border-right: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--purple-soft);
  font: 800 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
}

.privacy-dock-label small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
}

.privacy-peer-list {
  display: flex;
  align-content: flex-start;
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  overflow: auto;
  scrollbar-color: #4a3a70 transparent;
  scrollbar-width: thin;
}

.privacy-node {
  min-width: 54px;
  height: 33px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 1px 5px;
  padding: 5px 7px;
  border: 1px solid rgba(139, 92, 246, 0.24);
  border-radius: 7px;
  background: rgba(139, 92, 246, 0.07);
  color: var(--purple-soft);
  cursor: pointer;
}

.privacy-node:hover,
.privacy-node.is-selected {
  border-color: rgba(196, 181, 253, 0.75);
  background: rgba(139, 92, 246, 0.18);
}

.privacy-node.is-dimmed {
  opacity: 0.22;
}

.privacy-node i {
  grid-row: 1 / 3;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.8);
}

.privacy-node.i2p i { background: #c084fc; }
.privacy-node.cjdns i { background: #a78bfa; }

.privacy-node span {
  font: 800 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.privacy-node small {
  color: var(--muted);
  font: 700 8px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.map-legend {
  right: var(--safe-right);
  bottom: calc(var(--safe-bottom) + 62px);
  left: var(--safe-left);
  width: max-content;
  max-width: calc(100% - var(--safe-left) - var(--safe-right));
  font-size: 10px;
}

.map-legend .route-note {
  font-size: 9px;
}

.timeline-dock {
  right: 16px;
  bottom: 16px;
  left: 16px;
  width: auto;
  height: 160px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.timeline-heading {
  flex: 0 0 48px;
  flex-direction: row;
  align-items: center;
}

.timeline-heading strong {
  font-size: 12px;
}

.range-buttons button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 10px;
}

.timeline-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 255px;
  gap: 14px;
  min-height: 0;
  flex: 1 1 auto;
  padding: 7px 12px 10px;
}

.timeline-chart-wrap {
  min-height: 0;
}

#timeline-chart {
  height: 92px;
  cursor: crosshair;
}

#history-slider {
  right: 12px;
  bottom: 1px;
  left: 42px;
  width: calc(100% - 54px);
}

.timeline-side {
  display: grid;
  align-content: center;
  gap: 9px;
  min-width: 0;
}

.timeline-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.timeline-legend button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--soft);
  cursor: pointer;
  font-size: 9px;
  text-align: left;
}

.timeline-legend button.is-muted {
  opacity: 0.32;
}

.timeline-legend i {
  width: 13px;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: var(--blue);
}

.series-clearnet-outbound i { background: var(--orange); }
.series-tor-inbound i { background: #c084fc; }
.series-tor-outbound i { background: var(--purple); }

.timeline-side > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.timeline-tooltip {
  position: absolute;
  z-index: 5;
  width: 200px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(7, 9, 13, 0.96);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.timeline-tooltip time {
  margin-bottom: 2px;
  color: var(--text);
  font: 650 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.timeline-tooltip span {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.timeline-tooltip i {
  width: 7px;
  height: 3px;
}

.timeline-tooltip b {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-tooltip strong {
  color: var(--soft);
}

.leaflet-bottom {
  bottom: calc(var(--safe-bottom) + 62px);
}

.leaflet-right {
  right: var(--safe-right);
}

.leaflet-tooltip .peer-tooltip {
  display: grid;
  gap: 2px;
}

.peer-tooltip strong {
  font-size: 11px;
}

.peer-tooltip span {
  overflow-wrap: anywhere;
  color: var(--soft);
  font: 500 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.peer-tooltip small {
  color: var(--muted);
  font-size: 10px;
}

.own-node-tooltip-content strong,
.own-node-tooltip-content span {
  font-size: 10px;
}

.historical-tooltip-content strong,
.historical-tooltip-content span {
  font-size: 10px;
}

.historical-tooltip-content small {
  font-size: 9px;
}

.error-toast {
  bottom: calc(var(--safe-bottom) + 12px);
  font-size: 12px;
}

/* Logowanie */

.login-page {
  min-height: 100%;
  overflow: auto;
  background:
    radial-gradient(circle at 25% 20%, rgba(245, 158, 11, 0.09), transparent 32%),
    radial-gradient(circle at 78% 68%, rgba(56, 189, 248, 0.055), transparent 36%),
    #07090d;
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.login-card {
  position: relative;
  width: min(440px, 100%);
  padding: 28px;
  border-radius: 18px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.login-brand strong {
  display: block;
  margin-top: 3px;
  font-size: 21px;
  letter-spacing: 0.075em;
}

.login-brand strong i {
  color: var(--orange);
  font-style: normal;
  font-weight: 300;
}

.login-copy {
  margin-top: 25px;
}

.login-copy h1 {
  margin: 6px 0 9px;
  font-size: 25px;
  line-height: 1.18;
}

.login-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-message {
  margin: 17px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(251, 113, 133, 0.32);
  border-radius: 8px;
  background: rgba(251, 113, 133, 0.075);
  color: #fecdd3;
  font-size: 12px;
}

.login-form {
  display: grid;
  gap: 15px;
  margin-top: 23px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 650;
}

.login-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(4, 6, 10, 0.72);
  color: var(--text);
  font-size: 14px;
}

.login-form input:hover {
  border-color: rgba(245, 158, 11, 0.34);
}

.login-form .primary-button {
  height: 44px;
  margin-top: 3px;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.login-footer span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-footer i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

@media (max-width: 1380px) {
  .topbar {
    grid-template-columns: minmax(225px, 1fr) minmax(205px, auto) minmax(330px, 1.5fr) auto;
  }

  .clock-block {
    display: none;
  }

  .left-panel-stack {
    width: 330px;
  }

  .peer-list-panel {
    width: 295px;
  }

  .peer-panel {
    width: 350px;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-rows: 80px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: minmax(220px, 1fr) minmax(210px, auto) minmax(260px, 1fr) auto;
    padding: 10px 14px;
  }

  .top-metrics div:nth-child(4),
  .top-metrics div:nth-child(5) {
    display: none;
  }

  .top-metrics {
    grid-template-columns: repeat(3, minmax(58px, 1fr));
  }

  .left-panel-stack {
    top: 10px;
    left: 10px;
    width: 320px;
  }

  .right-panel-workspace {
    top: 10px;
    right: 10px;
    width: 330px;
    flex-direction: column;
    align-items: stretch;
  }

  .right-panel-workspace > .peer-list-panel,
  .right-panel-workspace > .peer-panel {
    width: 100%;
    min-height: 0;
    max-height: none;
    flex: 1 1 0;
  }

  .right-panel-workspace > .collapsible-panel.is-collapsed {
    flex: 0 0 48px;
    align-self: flex-end;
  }

  .timeline-dock {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .timeline-content {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .map-legend {
    display: none;
  }
}

@media (max-width: 820px) {
  html,
  body {
    overflow: hidden;
  }

  .app-shell {
    min-height: 100%;
    grid-template-rows: 70px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .node-state,
  .top-metrics,
  .clock-block {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-block h1 {
    font-size: 18px;
  }

  .logout-button {
    min-height: 34px;
    padding: 0 10px;
  }

  .left-panel-stack {
    right: 10px;
    bottom: auto;
    width: min(360px, calc(100% - 20px));
    max-height: calc(100% - var(--safe-bottom) - 12px);
  }

  .filter-console {
    max-height: 50vh;
  }

  .metric-rail {
    max-height: 32vh;
  }

  .right-panel-workspace {
    top: auto;
    bottom: var(--safe-bottom);
    left: 10px;
    max-height: 42vh;
    flex-direction: column-reverse;
  }

  .peer-list-panel,
  .peer-panel {
    width: 100%;
    max-height: 42vh;
  }

  .timeline-dock {
    height: 152px;
  }

  .timeline-content {
    grid-template-columns: minmax(0, 1fr) 145px;
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .timeline-side {
    display: grid;
    gap: 4px;
  }

  .timeline-side > span {
    display: none;
  }

  .timeline-legend {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .timeline-legend button {
    padding: 3px 5px;
    font-size: 8px;
  }

  .range-buttons button {
    padding: 4px 5px;
  }

  .privacy-dock {
    right: 10px;
    left: 10px;
  }

  .privacy-dock-label {
    display: none;
  }
}

@media (max-width: 520px) {
  .eyebrow {
    display: none;
  }

  .login-card {
    padding: 22px 18px;
  }

  .login-footer {
    display: grid;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid label:last-child {
    grid-column: auto;
  }

  .chip-row {
    grid-template-columns: 1fr 1fr;
  }

  .history-overlay-control {
    grid-template-columns: 1fr;
  }

  .timeline-heading .range-buttons button[data-range="14d"],
  .timeline-heading .range-buttons button[data-range="30d"] {
    display: none;
  }

  .history-stepper {
    display: none;
  }
}
