/* === Atom · phishing awareness training simulator === */
:root {
  --atom-bg: #04080a;
  --atom-bg-elev: #0a1216;
  --atom-bg-panel: rgba(10, 22, 28, 0.85);
  --atom-grid: rgba(20, 90, 95, 0.18);
  --atom-fg: #d9e7e8;
  --atom-fg-dim: #7c9295;
  --atom-fg-mute: #4a6164;
  --atom-line: rgba(0, 212, 194, 0.18);
  --atom-line-strong: rgba(0, 212, 194, 0.45);
  --atom-cyan: #00d4c2;
  --atom-cyan-soft: #1ee0d0;
  --atom-cyan-dim: #007a72;
  --atom-amber: #f4b400;
  --atom-red: #ff4d6d;
  --atom-good: #5af2a5;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  --font-mono: ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--atom-fg);
  background: var(--atom-bg);
  background-image:
    radial-gradient(1200px 600px at 20% -10%, rgba(0,212,194,0.07), transparent 60%),
    radial-gradient(1000px 500px at 110% 110%, rgba(0,212,194,0.05), transparent 60%),
    linear-gradient(to right, var(--atom-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--atom-grid) 1px, transparent 1px);
  background-size: auto, auto, 40px 40px, 40px 40px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--atom-cyan); text-decoration: none; }
a:hover { color: var(--atom-cyan-soft); }
code { font-family: var(--font-mono); font-size: 0.85em; color: var(--atom-cyan-soft); }
.atom-mono { font-family: var(--font-mono); font-size: 0.9em; }
.atom-mute { color: var(--atom-fg-dim); }
.atom-link { color: var(--atom-cyan); }
.atom-truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline { display: inline; }

/* ---------- nav ---------- */
.atom-nav {
  display: flex; align-items: center; gap: 24px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--atom-line);
  background: linear-gradient(180deg, rgba(4,16,20,0.92), rgba(4,16,20,0.6));
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
}
.atom-nav__brand { display: flex; align-items: center; gap: 12px; }
.atom-nav__brand strong { letter-spacing: 0.32em; font-size: 14px; }
.atom-nav__tagline { font-size: 11px; color: var(--atom-fg-dim); letter-spacing: 0.06em; }
.atom-nav__links { display: flex; gap: 4px; flex: 1; justify-content: center; }
.atom-nav__links a {
  color: var(--atom-fg-dim);
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.atom-nav__links a:hover { color: var(--atom-cyan); background: rgba(0,212,194,0.05); }
.atom-nav__links a.is-active { color: var(--atom-cyan); background: rgba(0,212,194,0.08); box-shadow: inset 0 -2px 0 var(--atom-cyan); }
.atom-nav__soon { color: var(--atom-fg-mute) !important; cursor: not-allowed; opacity: 0.55; }
.atom-nav__soon:hover { background: transparent !important; color: var(--atom-fg-mute) !important; }
.atom-nav__user { display: flex; align-items: center; gap: 12px; }
.atom-nav__email { color: var(--atom-fg-dim); font-size: 12px; font-family: var(--font-mono); }

/* atom logo */
.atom-logo {
  position: relative; display: inline-block; width: 28px; height: 28px;
}
.atom-logo--lg { width: 56px; height: 56px; }
.atom-logo__ring {
  position: absolute; inset: 0; border: 1.5px solid var(--atom-cyan);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(0,212,194,0.55), inset 0 0 12px rgba(0,212,194,0.25);
  animation: atomspin 14s linear infinite;
}
.atom-logo__ring::before, .atom-logo__ring::after {
  content: ""; position: absolute; inset: 18%;
  border: 1px solid var(--atom-cyan-dim); border-radius: 50%;
  transform: rotate(60deg);
}
.atom-logo__ring::after { transform: rotate(-60deg); border-color: rgba(0,212,194,0.35); }
.atom-logo__nucleus {
  position: absolute; left: 50%; top: 50%;
  width: 30%; height: 30%; transform: translate(-50%, -50%);
  background: var(--atom-cyan); border-radius: 50%;
  box-shadow: 0 0 10px var(--atom-cyan);
}
@keyframes atomspin { to { transform: rotate(360deg); } }

/* ---------- buttons / forms ---------- */
.atom-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--atom-line-strong);
  background: rgba(0,212,194,0.05);
  color: var(--atom-cyan-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  font-family: inherit;
}
.atom-btn:hover { background: rgba(0,212,194,0.12); border-color: var(--atom-cyan); color: var(--atom-cyan); }
.atom-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.atom-btn--primary { background: var(--atom-cyan); color: #002b27; border-color: var(--atom-cyan); }
.atom-btn--primary:hover { background: var(--atom-cyan-soft); color: #002b27; }
.atom-btn--ghost { background: transparent; }
.atom-btn--block { width: 100%; }
.atom-btn--lg { padding: 14px 24px; font-size: 13px; }

.atom-form { display: grid; gap: 14px; }
.atom-form label { display: grid; gap: 6px; font-size: 12px; color: var(--atom-fg-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.atom-form input, .atom-form select, .atom-form textarea {
  background: rgba(2,10,14,0.8);
  border: 1px solid var(--atom-line);
  color: var(--atom-fg);
  padding: 10px 12px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 14px;
}
.atom-form input:focus, .atom-form select:focus, .atom-form textarea:focus {
  outline: none; border-color: var(--atom-cyan); box-shadow: 0 0 0 2px rgba(0,212,194,0.18);
}
.atom-form textarea { font-family: var(--font-mono); }
.atom-form__actions { display: flex; gap: 12px; }
.atom-form--stacked { gap: 18px; }
.atom-form--inset { background: rgba(2,10,14,0.5); padding: 18px; border: 1px dashed var(--atom-line); margin-top: 14px; border-radius: 4px; }
.atom-form--inset h3 { margin-top: 0; }

.atom-checkbox { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; text-transform: none; letter-spacing: 0; color: var(--atom-fg); font-size: 13px; }
.atom-checkbox input { accent-color: var(--atom-cyan); width: 16px; height: 16px; margin-top: 2px; }

.atom-consent {
  border: 1px solid var(--atom-amber); border-radius: 4px; padding: 14px;
  background: rgba(244,180,0,0.04);
}
.atom-consent legend {
  padding: 0 8px; font-size: 11px; letter-spacing: 0.18em; color: var(--atom-amber); text-transform: uppercase;
}

/* ---------- login ---------- */
.theme-login { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.atom-login { width: 100%; max-width: 420px; padding: 24px; }
.atom-login__panel {
  background: var(--atom-bg-panel);
  border: 1px solid var(--atom-line);
  border-radius: 6px;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0,212,194,0.12);
}
.atom-login__brand { text-align: center; margin-bottom: 18px; }
.atom-login__brand h1 { letter-spacing: 0.34em; margin: 12px 0 4px; }
.atom-login__brand p { color: var(--atom-fg-dim); font-size: 12px; margin: 0; }
.atom-login__note { font-size: 11px; color: var(--atom-fg-mute); text-align: center; margin-top: 18px; }
.atom-flash { padding: 10px 12px; border-radius: 4px; margin-bottom: 14px; font-size: 13px; }
.atom-flash--error { background: rgba(255,77,109,0.1); border: 1px solid var(--atom-red); color: #ffb3c0; }

/* ---------- shell ---------- */
.atom-shell { max-width: 1480px; margin: 0 auto; padding: 28px; }
.atom-shell--admin { padding: 22px 28px 60px; }
.atom-shell--prose { max-width: 760px; }
.atom-shell--prose h1 { font-size: 28px; }
.atom-shell--prose h2 { color: var(--atom-cyan); font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; margin-top: 28px; }
.atom-shell--prose ul { padding-left: 18px; }
.atom-shell--prose li { margin: 6px 0; }
.atom-lede { color: var(--atom-fg-dim); font-size: 16px; }

/* ---------- landing ---------- */
.atom-shell--landing { padding-top: 60px; }
.atom-hero { display: grid; gap: 22px; max-width: 880px; margin: 0 auto 60px; text-align: center; }
.atom-hero__badge { justify-self: center; padding: 6px 12px; border: 1px solid var(--atom-line-strong); border-radius: 99px; font-size: 11px; letter-spacing: 0.22em; color: var(--atom-cyan); }
.atom-hero h1 { font-size: 36px; line-height: 1.2; margin: 0; }
.atom-hero__lede { color: var(--atom-fg-dim); font-size: 16px; margin: 0 auto; max-width: 640px; }
.atom-hero__actions { display: flex; gap: 12px; justify-content: center; }
.atom-hero__pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; list-style: none; padding: 0; margin: 18px 0 0; text-align: left; }
.atom-hero__pillars li { background: var(--atom-bg-panel); border: 1px solid var(--atom-line); border-radius: 4px; padding: 14px; font-size: 13px; color: var(--atom-fg-dim); display: grid; gap: 6px; }
.atom-hero__pillars span { font-family: var(--font-mono); font-size: 11px; color: var(--atom-cyan); }
.atom-hero__pillars strong { color: var(--atom-fg); }
.atom-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.atom-card { background: var(--atom-bg-panel); border: 1px solid var(--atom-line); border-radius: 4px; padding: 18px; }
.atom-card h3 { margin: 0 0 6px; font-size: 14px; color: var(--atom-cyan); letter-spacing: 0.1em; text-transform: uppercase; }
.atom-card p { margin: 0; color: var(--atom-fg-dim); font-size: 13px; line-height: 1.5; }

/* ---------- admin panels ---------- */
.atom-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; }
.atom-page-head h1 { font-size: 22px; margin: 6px 0; display: flex; gap: 12px; align-items: center; }
.atom-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.atom-panel {
  background: var(--atom-bg-panel);
  border: 1px solid var(--atom-line);
  border-radius: 4px;
  padding: 16px;
  position: relative;
}
.atom-panel::before, .atom-panel::after,
.atom-panel > .corner { display: none; }
.atom-panel__head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 10px; border-bottom: 1px solid var(--atom-line); margin-bottom: 12px; }
.atom-panel__head h2 { margin: 0; font-size: 12px; color: var(--atom-cyan); letter-spacing: 0.18em; text-transform: uppercase; }
.atom-panel__head span { font-size: 11px; color: var(--atom-fg-mute); letter-spacing: 0.1em; text-transform: uppercase; }
.atom-panel__filters { display: flex; gap: 6px; }
.atom-chip {
  background: transparent; border: 1px solid var(--atom-line);
  padding: 4px 8px; color: var(--atom-fg-dim); font-size: 10px;
  letter-spacing: 0.16em; cursor: pointer; border-radius: 2px;
  font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.atom-chip small { color: var(--atom-fg-mute); font-size: 8px; }
.atom-chip.is-active { border-color: var(--atom-cyan); color: var(--atom-cyan); }

/* dashboard grid */
.atom-admin-grid {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  grid-template-rows: 320px 280px auto auto;
  gap: 14px;
}
.atom-panel--indicators { grid-column: 1; grid-row: 1; }
.atom-panel--network    { grid-column: 2; grid-row: 1 / span 2; }
.atom-panel--traffic    { grid-column: 3; grid-row: 1; }
.atom-panel--suggestions { grid-column: 1; grid-row: 2 / span 2; }
.atom-panel--events     { grid-column: 3; grid-row: 2 / span 2; }
.atom-panel--score      { grid-column: 1; grid-row: 4; }
.atom-panel--campaigns  { grid-column: 2 / span 2; grid-row: 3 / span 2; }
@media (max-width: 1180px) {
  .atom-admin-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .atom-panel--indicators,
  .atom-panel--network,
  .atom-panel--traffic,
  .atom-panel--suggestions,
  .atom-panel--events,
  .atom-panel--score,
  .atom-panel--campaigns { grid-column: auto; grid-row: auto; }
}

/* radar */
.atom-radar { display: flex; justify-content: center; padding-top: 6px; }
.atom-radar svg { width: 100%; max-width: 280px; height: 280px; }
.atom-radar__ring { fill: none; stroke: rgba(0,212,194,0.12); stroke-width: 1; }
.atom-radar__axis { stroke: rgba(0,212,194,0.18); stroke-dasharray: 2 3; stroke-width: 1; }
.atom-radar__value { fill: rgba(0,212,194,0.18); stroke: var(--atom-cyan); stroke-width: 1.4; }
.atom-radar__dot { fill: var(--atom-cyan); }
.atom-radar__label { font-size: 7.5px; fill: var(--atom-fg-dim); letter-spacing: 0.1em; font-family: var(--font-mono); }
.atom-radar__num { fill: var(--atom-cyan); }

/* network */
.atom-network { position: relative; height: 100%; min-height: 360px; overflow: hidden; }
.atom-network canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* traffic */
.atom-traffic { padding: 6px 0; }
.atom-traffic svg { width: 100%; height: 180px; }
.atom-traffic__map path { fill: rgba(0,212,194,0.15); stroke: rgba(0,212,194,0.4); stroke-width: 0.4; }
.atom-traffic__lines path { fill: none; stroke: var(--atom-cyan); stroke-width: 0.8; stroke-dasharray: 2 2; opacity: 0.7; }
.atom-traffic__home { fill: var(--atom-cyan); filter: drop-shadow(0 0 4px var(--atom-cyan)); }
.atom-traffic__node { fill: var(--atom-amber); }

/* events list */
.atom-events { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.atom-events--compact .atom-event { padding: 8px 10px; }
.atom-event {
  background: rgba(2,10,14,0.6); border: 1px solid var(--atom-line);
  border-left: 2px solid var(--atom-cyan-dim);
  padding: 10px 12px; border-radius: 3px;
}
.atom-event--warning { border-left-color: var(--atom-amber); }
.atom-event--good { border-left-color: var(--atom-good); }
.atom-event--error { border-left-color: var(--atom-red); }
.atom-event__head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: 0.14em; color: var(--atom-fg); }
.atom-event__sev { font-size: 10px; color: var(--atom-fg-dim); }
.atom-event__sev--warning { color: var(--atom-amber); }
.atom-event__sev--good { color: var(--atom-good); }
.atom-event__sev--error { color: var(--atom-red); }
.atom-event__body { display: flex; gap: 14px; font-size: 11px; color: var(--atom-fg-mute); margin-top: 4px; flex-wrap: wrap; font-family: var(--font-mono); }
.atom-event__body em { color: var(--atom-fg-dim); font-style: normal; }

/* suggestions */
.atom-suggestions { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.atom-suggestions li { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 8px 0; border-bottom: 1px dashed var(--atom-line); }
.atom-sev { font-family: var(--font-mono); font-size: 14px; padding: 2px 10px; border-radius: 3px; border: 1px solid var(--atom-line); }
.atom-sev--crit { color: var(--atom-red); border-color: var(--atom-red); background: rgba(255,77,109,0.08); }
.atom-sev--high { color: #ff9466; border-color: #ff9466; background: rgba(255,148,102,0.08); }
.atom-sev--med  { color: var(--atom-amber); border-color: var(--atom-amber); background: rgba(244,180,0,0.08); }
.atom-sev--low  { color: var(--atom-cyan); border-color: var(--atom-cyan); background: rgba(0,212,194,0.08); }
.atom-sev--info { color: var(--atom-fg-dim); }
.atom-pill--queued { color: var(--atom-fg-dim); }
.atom-pill--running { color: var(--atom-cyan); border-color: var(--atom-cyan); }
.atom-pill--done { color: var(--atom-good); border-color: var(--atom-good); }
.atom-pill--failed { color: var(--atom-red); border-color: var(--atom-red); }
.atom-pill--cancelled { color: var(--atom-fg-mute); }
.atom-pill--timeout { color: var(--atom-amber); border-color: var(--atom-amber); }
.atom-bar { display: inline-flex; gap: 3px; }
.atom-bar::before { content: ""; }
.atom-bar { width: 60px; height: 8px; background: repeating-linear-gradient(to right, rgba(0,212,194,0.18) 0, rgba(0,212,194,0.18) 10px, transparent 10px, transparent 14px); position: relative; }
.atom-bar[data-fill="1"]::after,
.atom-bar[data-fill="2"]::after,
.atom-bar[data-fill="3"]::after,
.atom-bar[data-fill="4"]::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, var(--atom-cyan), var(--atom-cyan));
  width: calc(var(--w, 4) / 4 * 100%);
}
.atom-bar[data-fill="1"] { --w: 1; }
.atom-bar[data-fill="2"] { --w: 2; }
.atom-bar[data-fill="3"] { --w: 3; }
.atom-bar[data-fill="4"] { --w: 4; }
.atom-bar[data-fill="1"]::after { width: 14px; }
.atom-bar[data-fill="2"]::after { width: 28px; }
.atom-bar[data-fill="3"]::after { width: 42px; }
.atom-bar[data-fill="4"]::after { width: 56px; }

/* score */
.atom-panel--score { display: flex; align-items: center; gap: 18px; }
.atom-score { display: flex; flex-direction: column; align-items: flex-start; }
.atom-score__num { font-size: 38px; color: var(--atom-cyan); font-family: var(--font-mono); }
.atom-score__lbl { font-size: 10px; letter-spacing: 0.2em; color: var(--atom-fg-dim); }
.atom-score-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; flex: 1; }
.atom-score-stats div { padding: 8px; border: 1px solid var(--atom-line); border-radius: 3px; text-align: center; }
.atom-score-stats strong { display: block; font-size: 18px; color: var(--atom-fg); }
.atom-score-stats span { font-size: 9px; letter-spacing: 0.18em; color: var(--atom-fg-mute); }

/* tables */
.atom-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.atom-table th, .atom-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--atom-line); }
.atom-table th { color: var(--atom-fg-mute); font-weight: 500; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.atom-table--full td, .atom-table--full th { padding: 10px 12px; }
.atom-table tbody tr:hover td { background: rgba(0,212,194,0.04); }

.atom-pill {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--atom-line);
}
.atom-pill--draft { color: var(--atom-fg-dim); }
.atom-pill--active { color: var(--atom-cyan); border-color: var(--atom-cyan); }
.atom-pill--paused { color: var(--atom-amber); border-color: var(--atom-amber); }
.atom-pill--archived { color: var(--atom-fg-mute); }
.atom-pill--easy { color: var(--atom-good); border-color: var(--atom-good); }
.atom-pill--medium { color: var(--atom-amber); border-color: var(--atom-amber); }
.atom-pill--hard { color: var(--atom-red); border-color: var(--atom-red); }

/* stat row */
.atom-stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.atom-stat { background: var(--atom-bg-panel); border: 1px solid var(--atom-line); padding: 14px; text-align: center; border-radius: 3px; }
.atom-stat strong { display: block; font-size: 26px; color: var(--atom-cyan); font-family: var(--font-mono); }
.atom-stat span { font-size: 10px; letter-spacing: 0.18em; color: var(--atom-fg-dim); text-transform: uppercase; }
.atom-stat--warn strong { color: var(--atom-amber); }
.atom-stat--good strong { color: var(--atom-good); }

.atom-twocol { display: grid; gap: 14px; grid-template-columns: 1.4fr 1fr; }
@media (max-width: 980px) { .atom-twocol { grid-template-columns: 1fr; } }

/* empty */
.atom-empty { padding: 24px; text-align: center; color: var(--atom-fg-dim); font-size: 13px; }
.atom-empty--small { padding: 14px; font-size: 12px; }

/* template cards */
.atom-template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.atom-template-card { background: var(--atom-bg-panel); border: 1px solid var(--atom-line); padding: 16px; border-radius: 4px; display: grid; gap: 10px; }
.atom-template-card header { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 11px; color: var(--atom-fg-dim); letter-spacing: 0.1em; text-transform: uppercase; }
.atom-template-card h3 { margin: 0; }
.atom-template-card p { margin: 0; font-size: 13px; }

.atom-mail-preview { width: 100%; height: 540px; border: 1px solid var(--atom-line); border-radius: 3px; background: #fff; }

.atom-flags { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: rf; }
.atom-flags li { background: rgba(0,212,194,0.05); border-left: 2px solid var(--atom-cyan); padding: 10px 14px; border-radius: 3px; font-size: 13px; }

.atom-launch-row { display: grid; grid-template-columns: 1.2fr 2fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--atom-line); font-size: 13px; }
.atom-launch-row__link code { word-break: break-all; }

/* ---------- training ---------- */
.theme-training { background: #04080a; }
.theme-training body { background: #04080a; }
.atom-training { min-height: 100vh; padding: 40px 24px; display: flex; justify-content: center; }
.atom-training__shell { max-width: 760px; width: 100%; display: grid; gap: 24px; }
.atom-training__badge {
  display: inline-block; padding: 5px 14px; border-radius: 99px;
  background: rgba(244,180,0,0.12); color: var(--atom-amber);
  font-size: 11px; letter-spacing: 0.24em; border: 1px solid var(--atom-amber);
  text-transform: uppercase;
}
.atom-training__badge--ok { background: rgba(90,242,165,0.1); color: var(--atom-good); border-color: var(--atom-good); }
.atom-training__badge--warn { background: rgba(255,77,109,0.1); color: var(--atom-red); border-color: var(--atom-red); }
.atom-training__hero h1 { margin: 14px 0 6px; font-size: 30px; }
.atom-training__lede { color: var(--atom-fg-dim); font-size: 15px; line-height: 1.6; }
.atom-training__envelope { background: var(--atom-bg-panel); border: 1px solid var(--atom-line); border-radius: 4px; padding: 14px; display: grid; gap: 8px; }
.atom-training__envelope > div { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 12px; font-size: 13px; }
.atom-training__envelope span { font-size: 11px; letter-spacing: 0.12em; color: var(--atom-fg-mute); text-transform: uppercase; }
.atom-flags--training li { display: grid; grid-template-columns: 40px 1fr; align-items: start; }
.atom-flags__num { font-family: var(--font-mono); color: var(--atom-cyan); font-size: 14px; }
.atom-training__rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.atom-training__rules-grid article { background: var(--atom-bg-panel); border: 1px solid var(--atom-line); border-radius: 4px; padding: 14px; }
.atom-training__rules-grid h3 { margin: 0 0 6px; color: var(--atom-cyan); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.atom-training__rules-grid p { margin: 0; font-size: 13px; color: var(--atom-fg-dim); line-height: 1.5; }
.atom-training__actions { display: grid; gap: 10px; justify-items: start; margin-top: 8px; }
.atom-training__foot { font-size: 12px; color: var(--atom-fg-mute); border-top: 1px solid var(--atom-line); padding-top: 14px; }

@media (max-width: 720px) {
  .atom-training__rules-grid { grid-template-columns: 1fr; }
  .atom-stat-row { grid-template-columns: repeat(2, 1fr); }
  .atom-nav { flex-wrap: wrap; }
}

/* ---------- foot ---------- */
.atom-foot {
  display: flex; justify-content: space-between; padding: 14px 28px;
  border-top: 1px solid var(--atom-line);
  color: var(--atom-fg-mute); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 32px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,212,194,0.18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,212,194,0.36); }

/* ---------- flash ---------- */
.atom-flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; border: 1px solid; }
.atom-flash--good    { background: rgba(90,242,165,0.07);  border-color: var(--atom-good);  color: var(--atom-good); }
.atom-flash--error   { background: rgba(255,77,109,0.08);  border-color: var(--atom-red);   color: #ffb3c0; }
.atom-flash--warning { background: rgba(244,180,0,0.07);   border-color: var(--atom-amber); color: var(--atom-amber); }
.atom-flash--info    { background: rgba(0,212,194,0.06);   border-color: var(--atom-cyan);  color: var(--atom-cyan); }

/* ---------- tabs ---------- */
.atom-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--atom-line); margin-bottom: 0; }
.atom-tab {
  padding: 10px 18px;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--atom-fg-mute);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.atom-tab:hover { color: var(--atom-fg); }
.atom-tab.is-active { color: var(--atom-cyan); border-bottom-color: var(--atom-cyan); }

/* ---------- tags ---------- */
.atom-tag {
  display: inline-block;
  padding: 2px 7px; margin: 2px;
  border: 1px solid var(--atom-cyan-dim);
  border-radius: 99px;
  font-size: 10px; letter-spacing: 0.1em;
  color: var(--atom-cyan-dim);
  font-family: var(--font-mono);
}

/* kind pills */
.atom-pill--domain { color: var(--atom-cyan);    border-color: var(--atom-cyan); }
.atom-pill--host   { color: var(--atom-good);    border-color: var(--atom-good); }
.atom-pill--ip     { color: var(--atom-amber);   border-color: var(--atom-amber); }
.atom-pill--cidr   { color: #c084fc;             border-color: #c084fc; }
.atom-pill--url    { color: var(--atom-fg-dim);  border-color: var(--atom-line-strong); }

/* HTTP workbench */
.atom-http-status {
  font-family: var(--font-mono); font-size: 12px;
  padding: 2px 8px; border-radius: 3px;
  border: 1px solid var(--atom-line);
  letter-spacing: .04em;
}
.atom-http-status--2xx { color: var(--atom-good);  border-color: var(--atom-good); background: rgba(90,242,165,0.06); }
.atom-http-status--3xx { color: var(--atom-cyan);  border-color: var(--atom-cyan); background: rgba(0,212,194,0.06); }
.atom-http-status--4xx { color: var(--atom-amber); border-color: var(--atom-amber); background: rgba(244,180,0,0.06); }
.atom-http-status--5xx { color: var(--atom-red);   border-color: var(--atom-red); background: rgba(255,77,109,0.08); }
.atom-http-status--err { color: var(--atom-red);   border-color: var(--atom-red); background: rgba(255,77,109,0.08); }

.atom-http-block {
  background: rgba(2,10,14,0.7);
  border: 1px solid var(--atom-line);
  border-radius: 3px;
  padding: 10px 12px;
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--atom-fg-dim);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 540px;
  overflow: auto;
}

/* finding status pills */
.atom-pill--open     { color: var(--atom-cyan);  border-color: var(--atom-cyan); }
.atom-pill--fixed    { color: var(--atom-good);  border-color: var(--atom-good); }
.atom-pill--wontfix  { color: var(--atom-fg-mute); }
.atom-pill--dup      { color: var(--atom-fg-mute); }

/* select in forms */
.atom-select {
  background: var(--atom-bg-panel);
  color: var(--atom-fg);
  border: 1px solid var(--atom-line-strong);
  border-radius: 3px;
  font-family: var(--font-mono);
}

/* markdown rendered body */
.atom-md { font-size: 13px; line-height: 1.7; color: var(--atom-fg-dim); }
.atom-md h1, .atom-md h2, .atom-md h3 {
  color: var(--atom-fg); margin: 14px 0 6px;
  font-size: 14px; letter-spacing: .04em;
}
.atom-md h1 { font-size: 16px; }
.atom-md p  { margin: 0 0 10px; }
.atom-md ul, .atom-md ol { margin: 0 0 10px 18px; }
.atom-md li { margin-bottom: 3px; }
.atom-md code {
  font-family: var(--font-mono); font-size: 11px;
  background: rgba(0,212,194,0.07); border: 1px solid var(--atom-line);
  padding: 1px 5px; border-radius: 3px; color: var(--atom-cyan);
}
.atom-md pre {
  background: rgba(2,10,14,0.7); border: 1px solid var(--atom-line);
  border-radius: 4px; padding: 12px 14px; overflow-x: auto; margin-bottom: 12px;
}
.atom-md pre code { background: none; border: none; padding: 0; color: var(--atom-fg-dim); }
.atom-md a { color: var(--atom-cyan); text-decoration: underline; }
.atom-md blockquote {
  border-left: 3px solid var(--atom-cyan-dim); margin: 0 0 10px;
  padding: 4px 12px; color: var(--atom-fg-mute);
}
.atom-md hr { border: none; border-top: 1px solid var(--atom-line); margin: 14px 0; }
.atom-md table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 12px; }
.atom-md th, .atom-md td { padding: 5px 10px; border: 1px solid var(--atom-line); text-align: left; }
.atom-md th { color: var(--atom-fg); background: rgba(0,212,194,0.05); }

/* ─── Phase 18 polish ────────────────────────────────────────────────────────── */

kbd {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--atom-line-strong, #2a3a3a);
  border-radius: 3px;
  background: rgba(0,212,194,0.06);
  color: var(--atom-cyan, #00d4c2);
}

/* Focus rings for accessibility */
.atom-btn:focus-visible, .atom-link:focus-visible, .atom-nav__links a:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--atom-cyan, #00d4c2);
  outline-offset: 2px;
}

/* Mobile responsive: stack panels and shrink nav */
@media (max-width: 900px) {
  .atom-nav__links { flex-wrap: wrap; gap: 4px; }
  .atom-nav__links a { font-size: 11px; padding: 3px 6px; }
  .atom-nav__user .atom-nav__email { display: none; }
  .atom-page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .atom-actions { flex-wrap: wrap; }
  .atom-admin-grid { grid-template-columns: 1fr !important; }
  .atom-stat-row { grid-template-columns: repeat(2, 1fr) !important; }
  .atom-form > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 600px) {
  .atom-shell { padding: 10px; }
  .atom-table th, .atom-table td { padding: 6px 8px; font-size: 11px; }
  h1 { font-size: 20px; }
  .atom-stat-row { grid-template-columns: 1fr !important; }
}

/* SVG logo (B1 favicon) used in nav + login (replaces the CSS-built radial logo) */
.atom-logo-svg {
  display: inline-block; vertical-align: middle;
  border-radius: 6px;
  filter: drop-shadow(0 0 8px rgba(0,212,194,0.35));
}
.atom-logo-svg--lg {
  width: 80px; height: 80px;
  filter: drop-shadow(0 0 14px rgba(0,212,194,0.45));
  margin-bottom: 8px;
}

/* ═══ Sidebar layout (replaces top-nav on admin pages) ═══════════════════════ */

.atom-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.atom-layout.is-collapsed { grid-template-columns: 56px 1fr; }

.atom-layout__sidebar {
  background: linear-gradient(180deg, rgba(4,16,20,0.95), rgba(4,16,20,0.7));
  border-right: 1px solid var(--atom-line);
  padding: 18px 0 24px;
  overflow-y: auto;
  position: sticky; top: 0;
  max-height: 100vh;
  display: flex; flex-direction: column;
}
.atom-sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px 18px;
  border-bottom: 1px solid var(--atom-line);
  margin-bottom: 14px;
}
.atom-sidebar__brand img { width: 28px; height: 28px; flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(0,212,194,0.35)); border-radius: 4px; }
.atom-sidebar__brand strong { letter-spacing: 0.32em; font-size: 13px; display: block; }
.atom-sidebar__brand small { display: block; color: var(--atom-fg-mute); font-size: 9px; letter-spacing: 0.08em; margin-top: 2px; line-height: 1.2; }
.is-collapsed .atom-sidebar__brand small,
.is-collapsed .atom-sidebar__brand strong { display: none; }
.is-collapsed .atom-sidebar__brand { justify-content: center; padding: 0 8px 14px; }

.atom-nav-section { margin-bottom: 6px; }
.atom-nav-section__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px 4px;
  font-size: 10px; letter-spacing: 0.18em; color: var(--atom-fg-mute);
  text-transform: uppercase;
  cursor: default;
  user-select: none;
}
.atom-nav-section--collapsible > summary {
  cursor: pointer;
  list-style: none;
}
.atom-nav-section--collapsible > summary::-webkit-details-marker { display: none; }
.atom-nav-section--collapsible .atom-nav-section__chev::before {
  content: '▸';
  font-size: 9px;
  transition: transform 0.15s;
  display: inline-block;
}
.atom-nav-section--collapsible[open] .atom-nav-section__chev::before { transform: rotate(90deg); }
.is-collapsed .atom-nav-section__head {
  font-size: 0; padding: 8px 0 2px; justify-content: center;
}
.is-collapsed .atom-nav-section__head::after { content: '·'; font-size: 14px; color: var(--atom-fg-mute); }
.is-collapsed .atom-nav-section__chev { display: none; }

.atom-nav-section a {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 16px;
  color: var(--atom-fg-dim); text-decoration: none;
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.atom-nav-section a:hover { color: var(--atom-cyan); background: rgba(0,212,194,0.04); }
.atom-nav-section a.is-active {
  color: var(--atom-cyan); background: rgba(0,212,194,0.07);
  border-left-color: var(--atom-cyan);
}
.atom-nav-section__icon {
  display: inline-block; width: 14px; height: 14px;
  color: currentColor; opacity: 0.85;
  flex-shrink: 0;
}
.is-collapsed .atom-nav-section a { justify-content: center; padding: 8px 0; gap: 0; border-left: 2px solid transparent; }
.is-collapsed .atom-nav-section a .label { display: none; }

.atom-sidebar__bottom {
  margin-top: auto;
  padding: 10px 16px 0;
  border-top: 1px solid var(--atom-line);
}
.atom-collapse-btn {
  background: transparent; border: 1px solid var(--atom-line);
  color: var(--atom-fg-dim); padding: 5px 10px;
  border-radius: 3px; cursor: pointer;
  font-size: 11px; font-family: var(--font-mono);
  width: 100%;
}
.atom-collapse-btn:hover { color: var(--atom-cyan); border-color: var(--atom-cyan); }
.is-collapsed .atom-collapse-btn { padding: 5px 2px; }

/* ─── Right column wrapping topbar + main ─────────────────────────────────── */

.atom-layout__col { min-width: 0; display: flex; flex-direction: column; }

.atom-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--atom-line);
  background: rgba(4,16,20,0.5);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 15;
}
.atom-ws-switcher { position: relative; }
.atom-ws-switcher > summary {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--atom-line-strong);
  border-radius: 3px;
  color: var(--atom-cyan);
  font-size: 11px; letter-spacing: 0.08em;
  cursor: pointer; user-select: none; list-style: none;
}
.atom-ws-switcher > summary::-webkit-details-marker { display: none; }
.atom-ws-switcher__menu {
  position: absolute; left: 0; top: calc(100% + 4px);
  background: var(--atom-bg-elev); border: 1px solid var(--atom-line);
  border-radius: 3px; padding: 6px;
  min-width: 240px; z-index: 30;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.atom-ws-switcher__menu form { margin: 0; }
.atom-ws-switcher__menu button[type="submit"] {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  width: 100%; padding: 6px 10px;
  background: transparent; border: none; cursor: pointer;
  color: var(--atom-fg); text-align: left;
  font-family: inherit; font-size: 13px;
}
.atom-ws-switcher__menu button[type="submit"]:hover { background: rgba(0,212,194,0.07); color: var(--atom-cyan); }
.atom-ws-switcher__menu button .atom-mono { font-size: 11px; color: var(--atom-cyan); letter-spacing: 0.04em; }
.atom-ws-switcher__menu button span:last-child { font-size: 11px; color: var(--atom-fg-dim); }
.atom-ws-switcher__manage {
  display: block; padding: 6px 10px; font-size: 11px;
  color: var(--atom-fg-mute); border-top: 1px solid var(--atom-line);
  margin-top: 4px;
}

.atom-topbar__search {
  flex: 1; max-width: 480px; position: relative; margin: 0;
}
.atom-topbar__search input {
  width: 100%;
  background: rgba(2,10,14,0.7); border: 1px solid var(--atom-line);
  color: var(--atom-fg); padding: 6px 10px 6px 30px;
  border-radius: 3px; font-size: 13px; font-family: inherit;
}
.atom-topbar__search input::placeholder { color: var(--atom-fg-mute); }
.atom-topbar__search input:focus { outline: none; border-color: var(--atom-cyan); }
.atom-topbar__search::before {
  content: '/';
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--atom-cyan); font-family: var(--font-mono); font-weight: 600;
}

.atom-topbar__user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.atom-topbar__email { color: var(--atom-fg-dim); font-size: 12px; font-family: var(--font-mono); }
.atom-topbar__signout {
  color: var(--atom-fg-dim); background: transparent;
  border: 1px solid var(--atom-line); padding: 4px 10px;
  border-radius: 3px; cursor: pointer; font-size: 11px;
  font-family: var(--font-sans); letter-spacing: 0.08em;
}
.atom-topbar__signout:hover { color: var(--atom-cyan); border-color: var(--atom-cyan); }

/* ─── Hide the old top-nav inside the new layout ──────────────────────────── */
.atom-layout .atom-nav { display: none; }

/* ─── Adjust the existing main wrapper for the inner column ───────────────── */
/* The legacy .atom-shell has max-width: 1480px + margin: 0 auto that centered
   content under the full-width nav. Inside the sidebar layout we want the main
   to fill the inner column. */
.atom-layout .atom-shell,
.atom-layout .atom-shell--admin {
  max-width: none;
  margin: 0;
  padding: 22px 28px 24px;
}
/* Dashboard grid uses fixed-px side columns; let them flex on narrower
   inner columns so they don't push content off-screen. */
.atom-layout .atom-admin-grid {
  grid-template-columns: minmax(260px, 320px) 1fr minmax(260px, 320px);
}

.atom-foot--inset {
  border-top: 1px solid var(--atom-line);
  padding: 12px 24px;
  margin-top: auto;
  background: rgba(4,16,20,0.4);
}

/* ─── Mobile: auto-collapse sidebar < 900px ───────────────────────────────── */
@media (max-width: 900px) {
  .atom-layout { grid-template-columns: 56px 1fr !important; }
  .atom-layout .atom-sidebar__brand small,
  .atom-layout .atom-sidebar__brand strong { display: none; }
  .atom-layout .atom-sidebar__brand { justify-content: center; padding: 0 8px 14px; }
  .atom-layout .atom-nav-section a { justify-content: center; padding: 8px 0; gap: 0; }
  .atom-layout .atom-nav-section a .label { display: none; }
  .atom-layout .atom-nav-section__head { font-size: 0; padding: 8px 0 2px; justify-content: center; }
  .atom-layout .atom-nav-section__head::after { content: '·'; font-size: 14px; color: var(--atom-fg-mute); }
  .atom-layout .atom-collapse-btn { display: none; }
  .atom-layout .atom-topbar__email { display: none; }
  .atom-layout .atom-shell--admin { padding: 16px 14px 18px; }
}
