:root {
  /* Operator Console palette — deep cool ink + electric-cyan signature.
     Deliberately not the GitHub #0d1117/green default. */
  --bg: #0a0c12;
  --bg-elevated: #10141e;
  --bg-input: #070910;
  --surface-2: #161b27;
  --border: #1e2431;
  --border-2: #2a3244;
  --text: #e7ecf5;
  --text-dim: #8891a3;
  --text-faint: #5a6273;
  --accent: #46e0d4;
  --accent-dim: #2cc0b5;
  --accent-rgb: 70, 224, 212;
  --accent-glow: rgba(70, 224, 212, 0.14);
  --danger: #ff5c6c;
  --warning: #f0b152;
  --info: #6bb8ff;
  --radius: 8px;
  --radius-lg: 10px; /* section-landing cards only — bigger radius signals "overview", not "tool" */
  --mono: 'SF Mono', 'Consolas', 'Menlo', 'Courier New', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Type scale (v3) — hierarchy fix, no new sizes invented beyond what's below.
     --text-sm/--text-base keep their existing values; named here for reference. */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 19px;
  --text-xl: 26px;
  --text-2xl: 34px;

  /* Spacing scale (v3) — formalizes existing spacing values, none changed. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Motion tokens (v3) — exactly 3 purposeful transitions app-wide; see §4 of the design spec. */
  --transition-fast: background-color 80ms ease, border-color 80ms ease, color 80ms ease;
  --transition-content-enter: opacity 140ms ease-out, transform 140ms ease-out;
  --transition-group-expand: grid-template-rows 150ms ease-out;
  --transition-group-collapse: grid-template-rows 110ms ease-in;

  /* v4: one new z-index for the command palette layer (§2) — nothing in
     v1-v3 needed to stack above the sidebar (z-index: 20) before this. */
  --z-cmdk: 30;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 600;
  font-size: 15px;
}

.sidebar-sub {
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 4px;
}
.sidebar-sub a { color: var(--info); text-decoration: none; }
.sidebar-sub a:hover { text-decoration: underline; }

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-category {
  padding: 10px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 7px 16px;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: var(--text-sm);
  font-family: var(--sans);
  transition: var(--transition-fast);
}

.nav-item:hover { background: rgba(255, 255, 255, 0.04); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); border-right: 2px solid var(--accent); font-weight: 500; }

/* v4 §4a: external-API 🌐 badge is now colored --info wherever it appears
   (sidebar nav, search/palette results, section-landing cards) — was
   colorless before, the one-line fix the spec found. */
.badge {
  font-size: 11px;
  opacity: 0.85;
  color: var(--info);
}

.sidebar-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
}

/* ---------- Pinned Recipe Builder + divider (v3) ---------- */

.nav-pinned { padding: 8px 0 0; }
.nav-pinned .nav-item { font-weight: 500; }
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
}

/* ---------- Quick-search box (v3) ---------- */

.sidebar-search {
  padding: 0 16px 8px;
}
.search-input-wrap { position: relative; }
.nav-search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 40px 7px 10px;
  font-family: var(--sans);
  font-size: var(--text-sm);
  transition: var(--transition-fast);
}
.nav-search-input::placeholder { color: var(--text-dim); }
/* v4 §2 discoverability: teaches the Cmd/Ctrl+K path without a tooltip or
   onboarding tour — the only UI surface that needs to teach the shortcut. */
.cmdk-hint {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  font-size: var(--text-xs);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1px 5px;
  pointer-events: none;
}

/* ---------- Collapsible category groups (v3) ---------- */

.nav-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 4px 16px;
}
.nav-category-label {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  cursor: pointer;
  padding: 4px 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  transition: var(--transition-fast);
}
.nav-category-label:hover { color: var(--text); }
.nav-category-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}
.nav-chevron {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 10px;
  line-height: 1;
  transition: var(--transition-fast), transform 150ms ease-out;
}
.nav-chevron:hover { color: var(--text); }
.nav-chevron.expanded { transform: rotate(90deg); }

.nav-group-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: var(--transition-group-collapse);
}
.nav-group-body.expanded {
  grid-template-rows: 1fr;
  transition: var(--transition-group-expand);
}
.nav-group-body > div { overflow: hidden; }

/* ---------- Search results list (v3) ---------- */

.nav-results { padding: 4px 0; }
.nav-result-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px 16px;
  font-family: var(--sans);
  transition: var(--transition-fast);
}
/* v4 §4b.2: plain mouse hover keeps the neutral tint; the keyboard-
   highlighted row (the one Enter will open) gets the same green tint
   .nav-item.active uses, disambiguating the two states. */
.nav-result-item:hover { background: rgba(255, 255, 255, 0.04); }
.nav-result-item.highlighted { background: var(--accent-glow); }
.nav-result-name { font-size: var(--text-md); font-weight: 500; }
.nav-result-name mark { background: none; color: var(--accent); font-weight: 700; }
.nav-result-section { font-size: var(--text-xs); color: var(--text-dim); margin-top: 2px; }
.nav-result-excerpt { font-size: var(--text-xs); color: var(--text-dim); margin-top: 2px; }
.nav-results-empty { padding: 12px 16px; font-size: var(--text-sm); color: var(--text-dim); }
.nav-results-empty a { color: var(--info); cursor: pointer; text-decoration: none; }
.nav-results-empty a:hover { text-decoration: underline; }

/* ---------- Main ---------- */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 {
  font-size: var(--text-lg);
  margin: 0;
  font-weight: 600;
}

.breadcrumb {
  font-size: var(--text-lg);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.breadcrumb-section {
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.breadcrumb-section.link { color: var(--text-dim); }
.breadcrumb-section.link:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-dim); font-weight: 400; }
.breadcrumb-tool { color: var(--text); }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 4px 8px;
  cursor: pointer;
}

.content {
  padding: 24px;
  max-width: 980px;
}

/* Content swap motion (v3, motion moment #1): 140ms opacity+translateY fade
   on every tool<->tool and tool<->landing swap. */
.content-enter {
  animation: content-fade-in 140ms ease-out;
}
@keyframes content-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .content-enter { animation: content-fade-in-reduced 140ms ease-out; }
  @keyframes content-fade-in-reduced {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

/* ---------- Section landing pages (v3) ---------- */

.section-landing {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.section-eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0;
}
.section-title {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 4px 0 0;
}
.section-intro {
  font-size: var(--text-md);
  color: var(--text-dim);
  max-width: 640px;
  margin: 8px 0 0;
  line-height: 1.6;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
@media (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
}
.landing-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  font-family: var(--sans);
  transition: var(--transition-fast);
}
.landing-card:hover { border-color: var(--accent-dim); }
.landing-card-title {
  font-size: var(--text-md);
  font-weight: 500;
  margin: 0 0 6px;
}
.landing-card-desc {
  font-size: var(--text-sm);
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}
.landing-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 6px;
}
.landing-card-header .landing-card-title { margin: 0; }
.landing-card-count {
  font-size: var(--text-xs);
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Dashboard home page (v4 §1) — reuses .card-grid/.landing-card
   wholesale, adds only these three structural classes, no new colors. ---------- */

.dashboard { display: flex; flex-direction: column; gap: var(--space-6); }
.dashboard-meta { color: var(--text-dim); font-size: var(--text-sm); margin: 0; }
/* Recipe Builder hero: same border-right language .nav-item.active uses,
   mirrored as border-left — the only accent-colored card on the dashboard,
   earned structurally (not a peer of the other 8 sections). */
.dashboard-hero { border-left: 2px solid var(--accent); }
.dashboard-hero .landing-card-title { font-size: var(--text-lg); }
/* Pentest & CTF Reference: the one section where 100% of tools already
   carry an info-blue badge — the only section-level --info border (§4a.4). */
.dashboard-card-info { border-left: 2px solid var(--info); }

/* ---------- Home / welcome view (v3) — --text-2xl used exactly once ---------- */

.home-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

/* ---------- Tool description block: what it does / when to use it (v3) ---------- */

.tool-copy {
  margin-bottom: var(--space-4);
}
.tool-copy-line {
  color: var(--text-dim);
  font-size: var(--text-sm);
  margin: 0 0 4px;
  line-height: 1.5;
}
.tool-copy-line strong {
  color: var(--text);
  font-weight: 500;
}

/* tabular-nums for every mono field showing numbers/hashes/timestamps */
.tabular-nums, textarea.output, .output-box, .result-line .val {
  font-variant-numeric: tabular-nums;
}

/* ---------- Shared tool UI components ---------- */

.tool-desc {
  color: var(--text-dim);
  margin-bottom: 16px;
  font-size: 13px;
}

.external-api-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(210, 153, 34, 0.15);
  color: var(--warning);
  border: 1px solid rgba(210, 153, 34, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin-bottom: 14px;
}

.educational-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(88, 166, 255, 0.15);
  color: var(--info);
  border: 1px solid rgba(88, 166, 255, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin-bottom: 14px;
}

.field-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

label {
  font-size: 12px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 4px;
}

textarea, input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 13px;
  resize: vertical;
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent-dim);
}

/* Accessibility floor (v3): every interactive element gets an explicit,
   consistent --accent focus ring — not just form inputs. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav-item:focus-visible {
  outline-offset: -2px;
}

textarea.output, .output-box {
  background: var(--bg-input);
  color: var(--accent);
}

button.btn {
  background: var(--accent-dim);
  color: #06120a;
  border: none;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
button.btn:hover { background: var(--accent); }
button.btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
button.btn.secondary:hover { border-color: var(--accent-dim); color: var(--accent); }
/* v4 §4b.1: sharper --accent success state for the 1200ms "Copied!" window.
   CSS hook only — toggling this class on copyButton()'s existing 1200ms
   timer is a one-line change in js/ui/helpers.js, out of scope for this
   task (helpers.js isn't in the touch list); flagged for a follow-up edit. */
button.btn.secondary.copied { color: var(--accent); border-color: var(--accent-dim); }
button.btn.danger { background: var(--danger); color: #200; }
button.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.result-line {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.result-line:last-child { border-bottom: none; }
.result-line .key { color: var(--text-dim); }
.result-line .val { font-family: var(--mono); }

.warning-list { margin: 8px 0 0; padding-left: 18px; color: var(--warning); font-size: 12px; }
/* v4 §4c: container upgrade only — still errors-only, reads more clearly
   as a considered alert instead of a stray red sentence. */
.error-box {
  color: var(--danger);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--danger);
  white-space: pre-wrap;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.data-table th, table.data-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
table.data-table th { color: var(--text-dim); font-weight: 600; }
table.data-table td, table.data-table th { font-variant-numeric: tabular-nums; }

/* ---------- Static reference lists (Pentest & CTF, ports reference) ---------- */

.ref-search {
  margin-bottom: 12px;
}
.ref-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ref-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.ref-item-title {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 500;
  margin: 0 0 4px;
}
.ref-item-code {
  display: block;
  background: var(--bg-input);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radius);
  margin: 6px 0;
  white-space: pre-wrap;
  word-break: break-all;
}
.ref-item-note {
  color: var(--text-dim);
  font-size: 12px;
  margin: 4px 0 0;
}
.ref-item-tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--info);
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.3);
  padding: 2px 6px;
  border-radius: 999px;
  margin-bottom: 6px;
}

/* ---------- Recipe builder ---------- */

.recipe-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .recipe-layout { grid-template-columns: 1fr; }
}

.op-picker {
  max-height: 480px;
  overflow-y: auto;
}
.op-picker-category {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 10px 0 4px;
}
.op-picker-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 12px;
  margin-bottom: 4px;
  cursor: pointer;
}
.op-picker-item:hover { border-color: var(--accent-dim); }

.recipe-steps {
  min-height: 60px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 8px;
}
.recipe-step {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: grab;
}
.recipe-step.dragging { opacity: 0.4; }
.recipe-step .drag-handle { color: var(--text-dim); cursor: grab; }
.recipe-step .step-name { flex: 1; font-size: 13px; }
.recipe-step .step-params input {
  width: 70px;
  padding: 3px 6px;
  font-size: 12px;
}
.recipe-step .remove-step {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
}
.recipe-trace {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}
.recipe-trace .step-num { color: var(--info); }

.qr-preview {
  display: grid;
  gap: 0;
  border: 8px solid #fff;
  background: #fff;
  width: fit-content;
}
.qr-row { display: flex; }
.qr-cell { width: 6px; height: 6px; }
.qr-cell.dark { background: #000; }
.qr-cell.light { background: #fff; }

.diff-line { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; padding: 1px 6px; }
.diff-add { background: rgba(var(--accent-rgb), 0.15); color: var(--accent); }
.diff-remove { background: rgba(248, 81, 73, 0.15); color: var(--danger); }
.diff-equal { color: var(--text-dim); }

/* ---------- Command palette (v4 §2) ---------- */

.cmdk-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-cmdk);
}
.cmdk-panel {
  width: calc(100% - 32px);
  max-width: 640px;
  margin: 15vh auto 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cmdk-input {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border); /* the spec's "1px divider" between input and results */
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-lg);
  padding: var(--space-4) var(--space-5);
}
.cmdk-input:focus { outline: none; }
.cmdk-input::placeholder { color: var(--text-dim); }
.cmdk-results { max-height: 400px; overflow-y: auto; padding: 4px 0; }
.cmdk-result {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: var(--space-3) var(--space-5);
  font-family: var(--sans);
  transition: var(--transition-fast);
}
.cmdk-result:hover { background: rgba(255, 255, 255, 0.04); }
/* v4 §4b.2: same earned green as .nav-item.active / .nav-result-item.highlighted. */
.cmdk-result.highlighted { background: var(--accent-glow); }
/* command-palette.js reuses .nav-result-name/-section/-excerpt verbatim for
   its row content (confirmed by reading js/ui/command-palette.js), so no
   separate .cmdk-result-* rules are needed — those existing, unscoped
   selectors already style rows inside .cmdk-result too. */
.cmdk-empty { padding: var(--space-4) var(--space-5); font-size: var(--text-sm); color: var(--text-dim); }

/* ---------- Hover-preview tooltip (v4 §3) ---------- */

.tooltip-popover {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text);
  max-width: 280px;
  z-index: var(--z-cmdk);
  transition: var(--transition-content-enter);
}
.tooltip-popover.visible { opacity: 1; pointer-events: auto; }
.tooltip-line { margin: 0 0 6px; line-height: 1.5; }
.tooltip-line:last-child { margin-bottom: 0; }
.tooltip-line strong { color: var(--text); font-weight: 500; }
/* Doubles as an inline label (nested in a <p>) or a standalone heading
   line (target #3's "TOOLS IN THIS SECTION") — no display forced, so the
   host element's own tag (span vs. p) governs layout. */
.tooltip-usecase-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-right: 6px;
}
.tooltip-tool-list { margin: 4px 0 0; padding-left: 18px; }
.tooltip-tool-list li { margin-bottom: 2px; }
.tooltip-more { margin: 4px 0 0; color: var(--text-dim); font-size: var(--text-xs); }

@media (max-width: 860px) {
  .menu-toggle { display: inline-block; }
  .sidebar {
    position: fixed;
    left: -280px;
    z-index: 20;
    transition: left 0.15s ease;
    box-shadow: 4px 0 16px rgba(0,0,0,0.4);
  }
  .sidebar.open { left: 0; }
}

/* ============================================================
   Password generator — live strength & crack-time meter
   ============================================================ */
.pw-meter {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  /* Per-band accent, defaulting to dim; each band overrides --pw. */
  --pw: var(--text-dim);
}
.pw-band-catastrophic { --pw: #f85149; }
.pw-band-critical     { --pw: #f0883e; }
.pw-band-weak         { --pw: #d29922; }
.pw-band-fair         { --pw: #d4b429; }
.pw-band-strong       { --pw: #3fb950; }
.pw-band-very-strong  { --pw: #2ea043; }
.pw-band-fortress     { --pw: #39d0d8; }

.pw-verdict {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 15px;
  background: color-mix(in srgb, var(--pw) 10%, transparent);
  border-left: 3px solid var(--pw);
}
.pw-verdict-icon { font-size: 22px; line-height: 1.2; flex-shrink: 0; }
.pw-verdict-head { font-weight: 600; color: var(--pw); font-size: var(--text-md); }
.pw-verdict-msg { color: var(--text); font-size: var(--text-sm); margin-top: 3px; line-height: 1.5; }

.pw-bar {
  height: 8px;
  background: var(--bg-input);
  margin: 0;
  position: relative;
  overflow: hidden;
}
.pw-bar-fill {
  height: 100%;
  background: var(--pw);
  transition: width 220ms ease-out, background-color 220ms ease-out;
  box-shadow: 0 0 10px color-mix(in srgb, var(--pw) 55%, transparent);
}

.pw-meter-meta {
  padding: 8px 15px;
  font-size: var(--text-xs);
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.pw-crack { width: 100%; border-collapse: collapse; }
.pw-crack caption {
  text-align: left;
  padding: 10px 15px 6px;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.pw-crack td { padding: 7px 15px; border-top: 1px solid var(--border); vertical-align: top; }
.pw-tier-icon { width: 26px; font-size: 16px; }
.pw-tier-name { font-size: var(--text-sm); color: var(--text); }
.pw-tier-detail { font-size: var(--text-xs); color: var(--text-dim); margin-top: 2px; line-height: 1.45; }
.pw-tier-time {
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
  font-size: var(--text-sm);
}
/* The realistic serious-attacker row — the one the verdict is anchored to. */
.pw-ref-row td { background: color-mix(in srgb, var(--pw) 7%, transparent); }
.pw-ref-row .pw-tier-time { color: var(--pw); }

/* ============================================================
   Classical Cipher Cracker — ranked results
   ============================================================ */
.cc-best { border-left: 3px solid var(--text-dim); }
.cc-best.cc-strong { border-left-color: var(--accent); }
.cc-best.cc-fair   { border-left-color: #d4b429; }
.cc-best.cc-weak   { border-left-color: #f0883e; }
.cc-best.cc-none   { border-left-color: var(--danger); }
.cc-best-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.cc-best-text { font-size: var(--text-lg); font-family: var(--mono); word-break: break-all; margin: 6px 0 10px; color: var(--text); }
.cc-bar { height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden; }
.cc-bar-fill { height: 100%; background: var(--accent); transition: width 200ms ease-out; }
.cc-others-h { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin: 16px 0 6px; }
.cc-table td { vertical-align: top; }
.cc-cipher { color: var(--text-dim); font-size: var(--text-sm); white-space: nowrap; }
.cc-cand { font-family: var(--mono); word-break: break-all; }
.cc-score { text-align: right; font-weight: 600; white-space: nowrap; }
.cc-score.cc-strong { color: var(--accent); }
.cc-score.cc-fair { color: #d4b429; }
.cc-score.cc-weak { color: #f0883e; }
.cc-score.cc-none { color: var(--text-dim); }
.cc-note { margin-top: 14px; padding: 10px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); font-size: var(--text-sm); color: var(--text-dim); line-height: 1.5; }
.field-col { display: flex; flex-direction: column; gap: 4px; }

/* ═══════════════════════════════════════════════════════════════════════
   OPERATOR CONSOLE — home launchpad redesign
   ═══════════════════════════════════════════════════════════════════════ */
.dashboard { max-width: 940px; margin: 0 auto; padding: 8px 0 48px; }

/* ---- Hero ---- */
.hero-eyebrow {
  font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0.18em;
  color: var(--accent); text-transform: uppercase; margin: 8px 0 14px;
}
.hero-title {
  font-size: clamp(28px, 4vw, 44px); line-height: 1.05; letter-spacing: -0.02em;
  font-weight: 700; color: var(--text); margin: 0 0 12px; max-width: 18ch;
}
.hero-sub { font-size: var(--text-md); color: var(--text-dim); line-height: 1.55; max-width: 62ch; margin: 0 0 22px; }

/* ---- Magic box: the signature element ---- */
.magic-box {
  border: 1px solid var(--border-2); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.05), transparent 60%), var(--bg-elevated);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.06), 0 18px 50px -24px rgba(0,0,0,0.7);
  overflow: hidden;
}
.magic-prompt { display: flex; align-items: stretch; gap: 10px; padding: 14px 16px; }
.magic-caret { font-family: var(--mono); font-size: 22px; color: var(--accent); line-height: 1.3; user-select: none; }
.magic-input {
  flex: 1; background: transparent; border: none; outline: none; resize: vertical;
  color: var(--text); font-family: var(--mono); font-size: 15px; line-height: 1.6; min-height: 60px;
}
.magic-input::placeholder { color: var(--text-faint); }

.magic-results:not(:empty) { border-top: 1px solid var(--border); padding: 14px 16px; }
.magic-empty { color: var(--text-dim); font-size: var(--text-sm); line-height: 1.5; }
.magic-best { position: relative; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border-left: 3px solid var(--accent); }
.magic-best-tag { font-family: var(--mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.magic-best-out { font-family: var(--mono); font-size: 18px; color: var(--text); word-break: break-all; margin: 6px 0 0; padding-right: 64px; }
.magic-copy {
  position: absolute; top: 12px; right: 12px; font-size: var(--text-xs); font-family: var(--mono);
  padding: 4px 10px; border-radius: 5px; border: 1px solid var(--border-2); background: var(--bg-input);
  color: var(--text-dim); cursor: pointer; transition: var(--transition-fast);
}
.magic-copy:hover { color: var(--accent); border-color: var(--accent); }
.magic-more { margin-top: 12px; }
.magic-more-h { font-family: var(--mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 6px; }
.magic-row { display: grid; grid-template-columns: minmax(90px, auto) 1fr auto; gap: 12px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--border); font-size: var(--text-sm); }
.magic-row-path { font-family: var(--mono); color: var(--text-dim); white-space: nowrap; }
.magic-row-out { font-family: var(--mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.magic-row-pct { color: var(--text-dim); font-weight: 600; }

/* ---- Rails (recently used / pinned) ---- */
.rail { margin-top: 34px; }
.rail-h { font-family: var(--mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-faint); margin-bottom: 12px; }
.rail-h-browse { margin-top: 40px; }
.rail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rail-card {
  --hue: var(--accent);
  text-align: left; padding: 12px 14px; border-radius: var(--radius);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-left: 2px solid var(--hue); cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; transition: var(--transition-fast), transform 90ms ease;
}
.rail-card:hover { border-color: var(--border-2); border-left-color: var(--hue); transform: translateY(-1px); background: var(--surface-2); }
.rail-card-name { font-family: var(--mono); font-size: var(--text-sm); color: var(--text); font-weight: 600; }
.rail-card-cat { font-size: var(--text-xs); color: var(--text-faint); }

/* ---- Category grid ---- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cat-card {
  --hue: var(--accent);
  text-align: left; padding: 16px 16px 18px; border-radius: var(--radius);
  background: var(--bg-elevated); border: 1px solid var(--border); cursor: pointer;
  position: relative; overflow: hidden; transition: var(--transition-fast), transform 90ms ease;
}
.cat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--hue); opacity: 0.8; }
.cat-card:hover { border-color: var(--hue); transform: translateY(-2px); box-shadow: 0 12px 30px -18px rgba(0,0,0,0.8); }
.cat-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cat-card-name { font-family: var(--mono); font-size: var(--text-md); font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.cat-card-count { font-family: var(--mono); font-size: var(--text-sm); color: var(--hue); font-weight: 700; }
.cat-card-desc { font-size: var(--text-sm); color: var(--text-dim); line-height: 1.5; margin: 8px 0 0; }

@media (max-width: 640px) {
  .cat-grid, .rail-grid { grid-template-columns: 1fr; }
  .magic-row { grid-template-columns: 1fr auto; }
  .magic-row-path { display: none; }
}

/* ---- Shell polish: premium sidebar + topbar ---- */
.sidebar { background: linear-gradient(180deg, var(--bg-elevated), var(--bg)); }
.topbar { backdrop-filter: blur(8px); background: rgba(10, 12, 18, 0.7); }
.nav-category-row:hover { background: var(--surface-2); }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }

/* ---- Hash Cracker results ---- */
.hc-table td { vertical-align: top; font-family: var(--mono); font-size: var(--text-sm); }
.hc-hash { color: var(--text-dim); word-break: break-all; }
.hc-plain { color: var(--text); }
.hc-hit .hc-plain { color: var(--accent); font-weight: 700; }
.hc-miss .hc-plain { color: var(--text-faint); font-style: italic; }
.hc-note { margin-top: 12px; padding: 10px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); font-size: var(--text-sm); color: var(--text-dim); line-height: 1.5; }

/* ---- Favorite (pin) star in the breadcrumb ---- */
.fav-star { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 18px; color: var(--text-faint); line-height: 1; padding: 2px 6px; transition: var(--transition-fast), transform 90ms ease; }
.fav-star:hover { color: var(--warning); transform: scale(1.12); }
.fav-star.on { color: var(--warning); }
.topbar .breadcrumb, .breadcrumb { display: flex; align-items: center; gap: 8px; width: 100%; }

/* ---- Ambient signature: a single faint cyan aurora behind the hero, so the
   console feels lit from within. One quiet flourish; everything else stays
   flat. GPU-cheap fixed gradient, no JS. ---- */
.main { position: relative; }
.main::before {
  content: ''; position: fixed; top: -10%; left: 40%; width: 60vw; height: 55vh;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 72%);
  pointer-events: none; z-index: 0; opacity: 0.7; filter: blur(4px);
}
.content { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .main::before { opacity: 0.5; } }

/* ---- Analysis & Intel: IOC list chips + secret-scanner matches ---- */
.ioc-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ioc-item {
  font-family: var(--mono); font-size: var(--text-sm); color: var(--text);
  background: var(--bg-input); border-radius: var(--radius);
  padding: 5px 8px; word-break: break-all;
}

/* ---- CVSS calculator: 8-metric picker grid ---- */
.cvss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.cvss-field { display: flex; flex-direction: column; gap: 4px; }
.cvss-field label { font-size: var(--text-xs); color: var(--text-dim); }
