/* Network Traffic Triage Tool — styles
   SITE BUILD of the standalone tool. Dark palette and type taken from mylesagnew.com's dark theme so the tool
   looks like part of the same family. No external resources: fonts are local
   and fall back to system fonts if a browser blocks them (e.g. some file:// cases). */

@font-face { font-family: 'Inter'; src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-v20-latin-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('/fonts/playfair-display-v40-latin-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0d0f14;
  --bg2: #11141b;
  --surface: #151821;
  --surface2: #1b1f2a;
  --input-bg: #1d212c;
  --text: #e6e8ee;
  --muted: #a3a9b8;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #4d9bff;
  --accent-soft: rgba(77, 155, 255, 0.14);
  --accent-text: #9ec5ff;

  /* Severity = investigative priority. Each colour is always paired with a text label. */
  --sev-info: #a3a9b8;  --sev-info-bg: rgba(163, 169, 184, 0.12);
  --sev-low: #5cc8e6;   --sev-low-bg: rgba(92, 200, 230, 0.12);
  --sev-med: #e9b03b;   --sev-med-bg: rgba(233, 176, 59, 0.13);
  --sev-high: #ff7a6e;  --sev-high-bg: rgba(255, 122, 110, 0.13);
  --ok: #4cc98a;        --ok-bg: rgba(76, 201, 138, 0.12);

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'Cascadia Mono', 'Consolas', 'SFMono-Regular', Menlo, monospace;
  --radius: 10px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
section[id], h3[id] { scroll-margin-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); }
a:hover { color: #fff; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface2); padding: 0.1em 0.35em; border-radius: 4px; }
.mono { font-family: var(--mono); font-size: 0.92em; word-break: break-all; }
.muted { color: var(--muted); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #000; padding: 0.6rem 1rem; z-index: 100; font-weight: 600; }
.skip-link:focus { left: 1rem; top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Site nav (mylesagnew.com markup; /nav-mobile.css adds the burger) ----------
   This page is dark-only on purpose and does not load /theme.css, so the nav is styled here. */
nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 1rem 2rem; background: rgba(12, 14, 20, 0.92); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
.nav-logo { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.05em; color: var(--text); text-decoration: none; }
.nav-logo span { color: var(--accent); }
.nav-links { list-style: none; display: flex; gap: 1.4rem; flex-wrap: wrap; margin: 0; padding: 0; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.82rem; letter-spacing: 0.02em; }
.nav-links a:hover { color: var(--text); }
.nav-cta { color: var(--accent-text) !important; border: 1px solid rgba(77, 155, 255, 0.45); border-radius: 6px; padding: 0.35rem 0.8rem; }
.nav-cta:hover { background: var(--accent-soft); }
.jump-links { font-size: 0.9rem; color: var(--muted); margin: 1rem 0 0; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

main { max-width: var(--wrap); margin: 0 auto; padding: 0 16px 3rem; }

/* ---------- Hero ---------- */
.hero { padding: 2.5rem 0 1.5rem; }
.eyebrow { color: var(--accent-text); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 0.5rem; font-weight: 600; }
h1, h2 { font-family: var(--serif); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 0.75rem; }
h2 { font-size: 1.6rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.75rem; font-weight: 600; }
h4 { font-size: 1.05rem; margin: 0; font-weight: 600; }
h5 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.1rem 0 0.35rem; font-weight: 600; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 52rem; margin: 0 0 1.5rem; }

.notice { display: flex; gap: 0.85rem; align-items: flex-start; border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 0 0 0.75rem; border: 1px solid; }
.notice p { margin: 0; }
.notice-icon { width: 22px; height: 22px; flex: none; margin-top: 2px; fill: currentColor; }
.notice-privacy { background: var(--ok-bg); border-color: rgba(76, 201, 138, 0.35); }
.notice-privacy .notice-icon { color: var(--ok); }
.notice-disclaimer { background: var(--sev-med-bg); border-color: rgba(233, 176, 59, 0.35); }
.notice-disclaimer .notice-icon { color: var(--sev-med); }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; margin: 0 0 1.25rem; }
.panel .panel { background: var(--surface2); }
.help { color: var(--muted); font-size: 0.92rem; margin: 0.4rem 0 0.9rem; }
.empty { color: var(--muted); margin: 0; }
.empty p { margin: 0 0 0.4rem; }
.empty strong { color: var(--text); }

/* ---------- Upload ---------- */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.25rem; }
@media (max-width: 760px) { .upload-grid { grid-template-columns: 1fr; } }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 190px; padding: 1.5rem; border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--bg2); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
/* The real file input is visually hidden; show its keyboard focus on the drop zone. */
.upload-grid div:has(> #file-input:focus-visible) > .dropzone { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.dropzone-icon { width: 40px; height: 40px; fill: var(--accent); margin-bottom: 0.5rem; }
.dropzone-title { font-size: 1.15rem; font-weight: 600; }
.dropzone-hint { color: var(--muted); font-size: 0.9rem; }

.demo-box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.demo-box h3 { margin-bottom: 0.25rem; }
.demo-buttons { display: flex; flex-direction: column; gap: 0.5rem; }
.sample-downloads { margin: 0.75rem 0 0; }
.demo-script { margin-top: 0.9rem; font-size: 0.92rem; }
.demo-script summary { cursor: pointer; color: var(--accent-text); }
.demo-script ol { padding-left: 1.2rem; margin: 0.6rem 0 0; }
.demo-script li { margin-bottom: 0.4rem; }

/* ---------- Buttons & form fields ---------- */
.btn {
  font: inherit; font-weight: 600; font-size: 0.95rem; color: #06101f; background: var(--accent);
  border: 1px solid var(--accent); border-radius: 8px; padding: 0.6rem 1rem; cursor: pointer; text-align: center;
}
.btn:hover { background: #73b1ff; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface2); }
.btn-small { font-size: 0.85rem; padding: 0.4rem 0.75rem; background: transparent; color: var(--accent-text); border-color: rgba(77, 155, 255, 0.45); }
.btn-small:hover { background: var(--accent-soft); color: #fff; }

.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field label { font-size: 0.88rem; font-weight: 600; }
.field input, .field select {
  font: inherit; font-size: 0.95rem; color: var(--text); background: var(--input-bg);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 0.5rem 0.65rem; width: 100%;
}
.field input[aria-invalid="true"] { border-color: var(--sev-high); }
.field-help { font-size: 0.78rem; color: var(--muted); }
.field-actions { justify-content: flex-end; }
.form-error { color: var(--sev-high); font-weight: 600; margin: 0.5rem 0 0; }

.threshold-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.85rem; margin-bottom: 0.75rem; }

/* ---------- Load status ---------- */
.load-status { margin-top: 1.25rem; border-radius: var(--radius); padding: 1rem 1.15rem; border: 1px solid var(--border); background: var(--bg2); }
.load-status p { margin: 0 0 0.4rem; }
.load-status ul { margin: 0.25rem 0 0.5rem; padding-left: 1.2rem; }
.load-status.is-ok { border-color: rgba(76, 201, 138, 0.4); }
.load-status.is-warn { border-color: rgba(233, 176, 59, 0.45); }
.load-status.is-error { border-color: rgba(255, 122, 110, 0.5); background: var(--sev-high-bg); }
.status-title { font-weight: 600; font-size: 1.05rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.is-ok .status-title::before { content: '\2713'; color: var(--ok); }
.is-warn .status-title::before { content: '!'; color: var(--sev-med); font-weight: 700; }
.is-error .status-title::before { content: '\2715'; color: var(--sev-high); }
.label { font-weight: 600; }
.status-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0.5rem 0; font-size: 0.93rem; }
.status-facts dt { color: var(--muted); }
.status-facts dd { margin: 0; word-break: break-word; }
@media (max-width: 560px) { .status-facts { grid-template-columns: 1fr; } .status-facts dd { margin-bottom: 0.4rem; } }

.demo-badge { display: inline-block; background: var(--sev-med); color: #1a1200; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 999px; padding: 0.2rem 0.7rem; }
.demo-badge-inline { font-size: 0.72rem; }

/* ---------- Results ---------- */
.results { margin-top: 2rem; }
.results-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.results-head h2 { margin: 0; }
.key-lesson { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 0.75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; font-weight: 600; margin: 1rem 0 1.25rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.85rem; }
.card { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0.85rem 1rem; min-width: 0; }
.card-label { margin: 0; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.card-value { margin: 0.2rem 0 0; font-size: 1.35rem; font-weight: 600; word-break: break-all; line-height: 1.3; }
.card-sub { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--muted); }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 860px) { .chart-grid { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; max-width: 100%; }
.data-table, .bar-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td, .bar-table th, .bar-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table thead th, .bar-table thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.data-table tbody th, .bar-table tbody th { font-weight: 600; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pct { color: var(--muted); font-size: 0.85em; }

.bar-col { width: 45%; }
.bar-table td.bar-col { vertical-align: middle; }
.bar { display: block; height: 12px; background: var(--bg2); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.bar-fill.is-flagged { background: var(--sev-med); }
.flag-tag { display: inline-block; white-space: nowrap; word-break: normal; margin-left: 0.5rem; font-family: var(--sans); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--sev-med); border: 1px solid currentColor; border-radius: 4px; padding: 0 0.3rem; }

.contrib { list-style: none; margin: 0; padding: 0; }
.score-label { font-weight: 600; }
.score-minor { color: var(--sev-low); }
.score-elevated { color: var(--sev-med); }
.score-high { color: var(--sev-high); }

.status-pill { display: inline-block; font-size: 0.78rem; font-weight: 600; border-radius: 999px; padding: 0.05rem 0.55rem; border: 1px solid; }
.status-pill.is-ran { color: var(--ok); }
.status-pill.is-limited { color: var(--sev-med); }
.status-pill.is-skipped { color: var(--muted); }
.cov-note { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; }

.explorer-scroll { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.packet-table thead th { position: sticky; top: 0; background: var(--surface2); }
.packet-table td { padding: 0.35rem 0.55rem; font-size: 0.85rem; }
.info-cell { word-break: break-word; min-width: 16rem; }
.result-count { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.6rem; }

.raw-protocols { margin-top: 1rem; }
.raw-protocols summary { cursor: pointer; color: var(--accent-text); }

/* ---------- Alerts ---------- */
.alerts { display: flex; flex-direction: column; gap: 0.9rem; }
.alert { background: var(--surface2); border: 1px solid var(--border); border-left: 5px solid var(--sev-info); border-radius: 8px; padding: 1rem 1.15rem; }
.alert.sev-low { border-left-color: var(--sev-low); }
.alert.sev-medium { border-left-color: var(--sev-med); }
.alert.sev-high { border-left-color: var(--sev-high); }
.alert-head { display: flex; align-items: center; gap: 0.6rem 0.85rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.rule-tag { color: var(--muted); font-size: 0.82rem; }

.sev-badge { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; border-radius: 999px; padding: 0.15rem 0.6rem; border: 1px solid currentColor; }
.sev-badge.sev-informational { color: var(--sev-info); background: var(--sev-info-bg); }
.sev-badge.sev-low { color: var(--sev-low); background: var(--sev-low-bg); }
.sev-badge.sev-medium { color: var(--sev-med); background: var(--sev-med-bg); }
.sev-badge.sev-high { color: var(--sev-high); background: var(--sev-high-bg); }

.alert-facts, .evidence { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0; font-size: 0.93rem; }
.alert-facts dt, .evidence dt { color: var(--muted); }
.alert-facts dd, .evidence dd { margin: 0; word-break: break-word; }
@media (max-width: 560px) {
  .alert-facts, .evidence { grid-template-columns: 1fr; }
  .alert-facts dd, .evidence dd { margin-bottom: 0.45rem; }
}
.alert-details { margin-top: 0.8rem; border-top: 1px solid var(--border); padding-top: 0.6rem; }
.alert-details summary { cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: 0.93rem; }
.alert-details p, .alert-details ul, .alert-details ol { margin: 0; font-size: 0.94rem; }
.alert-details ul, .alert-details ol { padding-left: 1.3rem; }
.sev-reason { margin-top: 1rem !important; color: var(--muted); font-size: 0.85rem !important; }
.alert-actions { margin-top: 0.85rem; }

/* ---------- Education sections ---------- */
.prose { font-size: 1rem; }
.prose p, .prose li { max-width: 60rem; }
.steps { padding-left: 1.4rem; }
.steps li { margin-bottom: 0.5rem; }
.prose ul li { margin-bottom: 0.35rem; }

/* ---------- Footer (site style) ---------- */
.page-disclaimer { max-width: var(--wrap); margin: 0 auto; padding: 0 16px 2rem; color: var(--muted); font-size: 0.85rem; text-align: center; }
footer {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 2rem; background: var(--bg2); border-top: 1px solid var(--border);
  font-size: 0.72rem; color: var(--muted); letter-spacing: 0.02em;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent-text); }
.noscript { max-width: var(--wrap); margin: 0 auto 2rem; padding: 1rem; color: var(--sev-med); text-align: center; }

@media (max-width: 560px) {
  .panel { padding: 1.05rem; }
  .nav-links { gap: 0.25rem 0.9rem; }
}
