:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2330;
  --border: #2b3444;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #58a6ff;
  --ok: #3fb950;
  --warn: #d29922;
  --danger: #f85149;
  --tcp: #58a6ff;
  --udp: #3fb950;
  --icmp: #a371f7;
  --arp: #f0b429;
  --other: #8b98a9;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 22px;
  background: linear-gradient(90deg, #121a2b, #161b22);
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}
.title-block { min-width: 0; }
.title-block h1 { margin: 0; font-size: 18px; letter-spacing: .3px; }
.title-link { color: var(--text); text-decoration: none; border-bottom: 1px dashed transparent; transition: .15s; }
.title-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.subtitle { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.byline { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.byline a { color: var(--accent); text-decoration: none; border-bottom: 1px dashed transparent; transition: border-color .15s; }
.byline a:hover { border-bottom-color: var(--accent); }

.controls { display: flex; gap: 8px; align-items: center; }

.btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: .15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); background: #222c3d; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.hidden { display: none; }

/* ---------- Drop zone ---------- */
.dropzone {
  margin: 16px 22px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  transition: .15s;
  cursor: pointer;
}
.dropzone.drag { border-color: var(--accent); background: var(--panel-2); color: var(--text); }
.dropzone strong { color: var(--text); }

/* ---------- Content ---------- */
main { padding: 0 22px 22px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.panel h2 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.summary-row { display: flex; gap: 24px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat .num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* Protocol distribution bar */
.proto-bar { display: flex; height: 28px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); margin-top: 6px; }
.proto-seg { display: flex; align-items: center; justify-content: center; font-size: 10px; color: #0d1117; white-space: nowrap; overflow: hidden; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 5px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--panel); }
td.mono, .mono { font-family: "Cascadia Code", Consolas, monospace; font-variant-numeric: tabular-nums; }
.scroll { max-height: 460px; overflow: auto; }

.proto-tag { padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; }

/* ---------- Footer ---------- */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 16px 22px;
  color: var(--muted);
  font-size: 12px;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-links { display: flex; gap: 14px; }
.footer-links a { color: var(--accent); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-meta { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.footer-dot { color: var(--border); }
