/* ═══════════════════════════════════════════════════════
   SUDOSOC TOOLBOX — Design System
   v1.0.0 | Monochrome Edition
═══════════════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  /* ── Zone semantic palette — used consistently for nav zones, hex grid, breadcrumbs ── */
  --zone-tools:  #22c55e;
  --zone-blue:   #3b82f6;
  --zone-red:    #ef4444;
  --zone-learn:  #f59e0b;
  /* Backgrounds */
  --bg:          #000000;
  --bg-1:        #0a0a0a;
  --bg-2:        #111111;
  --bg-3:        #161616;
  --bg-4:        #1c1c1c;

  /* Borders */
  --border:      #1e1e1e;
  --border-2:    #2a2a2a;
  --border-3:    #383838;
  --border-focus:#666666;

  /* Text */
  --text:        #f0f0f0;
  --text-2:      #a0a0a0;
  --text-3:      #606060;
  --text-4:      #383838;

  /* Accent (white on dark) */
  --accent:      #ffffff;
  --accent-dim:  #cccccc;

  /* Status */
  --success:     #22c55e;
  --success-dim: #16a34a20;
  --warning:     #f59e0b;
  --warning-dim: #f59e0b20;
  --error:       #ef4444;
  --error-dim:   #ef444420;
  --info:        #6b8cff;
  --info-dim:    #6b8cff20;

  /* Typography */
  --font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, sans-serif;
  --font-mono:  ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  /* Spacing */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px;  --sp-6: 24px;  --sp-8: 32px;  --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* Radii */
  --r-sm: 4px;  --r: 6px;  --r-md: 8px;  --r-lg: 12px;  --r-xl: 16px;

  /* Transitions */
  --t-fast: 120ms ease;
  --t:      200ms ease;
  --t-slow: 350ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.6);
  --shadow:    0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.7);

  /* Sizes */
  --nav-h: 60px;
  --sidebar-w: 260px;
  --max-w: 1280px;
}

[data-theme="light"] {
  --bg:          #f8f8f8;
  --bg-1:        #f0f0f0;
  --bg-2:        #ffffff;
  --bg-3:        #f5f5f5;
  --bg-4:        #ebebeb;
  --border:      #e0e0e0;
  --border-2:    #d0d0d0;
  --border-3:    #bdbdbd;
  --border-focus:#666666;
  --text:        #111111;
  --text-2:      #555555;
  --text-3:      #888888;
  --text-4:      #bbbbbb;
  --accent:      #000000;
  --accent-dim:  #333333;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow:    0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding-top: var(--nav-h);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t), color var(--t);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
img, svg { display: block; }
::selection { background: rgba(255,255,255,0.15); color: var(--text); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--border-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ─── Typography ─── */
.font-mono { font-family: var(--font-mono); }
.text-xs  { font-size: 11px; }
.text-sm  { font-size: 12px; }
.text-base{ font-size: 14px; }
.text-md  { font-size: 16px; }
.text-lg  { font-size: 18px; }
.text-xl  { font-size: 22px; }
.text-2xl { font-size: 28px; }
.text-3xl { font-size: 36px; }
.text-4xl { font-size: 48px; }
.text-5xl { font-size: 64px; }
.text-dim  { color: var(--text-2); }
.text-muted{ color: var(--text-3); }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.font-med  { font-weight: 500; }
.uppercase { text-transform: uppercase; letter-spacing: 0.08em; }

/* ─── Layout ─── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); } .gap-8 { gap: var(--sp-8); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }

/* ─── Skip Link (a11y) ─── */
.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 0; outline: 2px solid #fff; outline-offset: 2px; }

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  transition: background var(--t), border-color var(--t);
}
[data-theme="light"] .nav {
  background: rgba(248,248,248,0.9);
}
/* ── Nav inner — 3-column grid: logo | links centered | utility ── */
.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  gap: 24px;
}
@media (max-width: 768px) {
  .nav-inner { display: flex; justify-content: space-between; gap: 0; padding: 0 16px; }
}

/* ── Logo ── */
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  white-space: nowrap; text-decoration: none; letter-spacing: -.01em;
}
.nav-logo .logo-prompt { color: var(--text-3); font-weight: 400; }
.nav-logo .logo-cmd    { color: var(--accent); }
.nav-logo .logo-suffix { color: var(--text-3); font-weight: 400; font-size: 11px; }

/* ── Nav links (center column) ── */
.nav-links {
  display: flex; align-items: center; justify-content: center; gap: 1px;
}

/* ── Nav link + dropdown button — unified sizing ── */
.nav-link, .nav-dd-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 6px;
  color: var(--text-2); font-size: 13px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: color .12s, background .12s;
  background: none; border: none; cursor: pointer;
}
.nav-link:hover, .nav-dd-btn:hover  { color: var(--text); background: var(--bg-2); }
.nav-link.active                    { color: var(--text); font-weight: 600; }
.nav-link svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Right utility row ── */
.nav-right {
  display: flex; align-items: center; gap: 6px; justify-content: flex-end;
}

/* ── Icon buttons (GitHub, theme toggle) ── */
.nav-action {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  color: var(--text-2); border: 1px solid transparent;
  background: transparent;
  transition: color .12s, background .12s, border-color .12s;
  cursor: pointer; text-decoration: none; flex-shrink: 0;
}
.nav-action:hover { color: var(--text); background: var(--bg-2); border-color: var(--border); }
.nav-action svg { width: 16px; height: 16px; }

/* ── Search Pill (injected by NavExtras.searchPill() into every page's .nav-right) ── */
.g-search-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-2); color: var(--text-3);
  font-size: 12.5px; font-weight: 400; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap; text-decoration: none; height: 32px;
}
.g-search-pill:hover { background: var(--bg-3); border-color: var(--border-2); color: var(--text-2); }
.g-search-pill svg { flex-shrink: 0; opacity: .5; }
.g-search-pill-text { color: var(--text-3); }
.g-search-pill kbd {
  font-size: 10px; padding: 1px 5px;
  border: 1px solid var(--border-2); border-radius: 4px;
  background: var(--bg-3); color: var(--text-3);
  font-family: var(--font-mono); line-height: 1.6; letter-spacing: .02em;
}
@media (max-width: 1024px) { .g-search-pill kbd { display: none; } }
@media (max-width: 900px)  { .g-search-pill-text { display: none; } }
@media (max-width: 768px)  { .g-search-pill { display: none; } }

/* Mobile Menu */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-2);
  cursor: pointer;
}
.nav-hamburger span {
  width: 16px;
  height: 1.5px;
  background: var(--text-2);
  transition: all var(--t-fast);
}
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-4) var(--sp-6);
  z-index: 999;
  flex-direction: column;
  gap: var(--sp-1);
  animation: slideDown 0.2s ease;
}
.mobile-menu.open { display: flex; }
.mobile-nav-link {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--t-fast);
}
.mobile-nav-link:hover { color: var(--text); background: var(--bg-3); }

/* Mobile Menu Accordion Sections */
.mob-section { overflow: hidden; }
.mob-sec-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r);
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: color var(--t-fast), background var(--t-fast);
}
.mob-sec-btn:hover { color: var(--text); background: var(--bg-3); }
.mob-sec-btn.open  { color: var(--text); }
.mob-sec-arrow { width: 14px; height: 14px; flex-shrink: 0; transition: transform .2s; }
.mob-sec-btn.open .mob-sec-arrow { transform: rotate(180deg); }
.mob-sec-body { display: none; padding-left: var(--sp-2); padding-bottom: var(--sp-1); }
.mob-sec-body.open { display: flex; flex-direction: column; }
.mobile-nav-sub {
  padding-left: var(--sp-8) !important;
  font-size: 13px;
  border-left: 1px solid var(--border-2);
  margin-left: var(--sp-4);
}

/* ─── Nav Dropdown ─── */
.nav-dd-wrap { position: relative; }
/* .nav-dd-btn styles merged into .nav-link, .nav-dd-btn ruleset above */
.nav-dd-btn svg:first-child { width: 14px; height: 14px; flex-shrink: 0; }
.nav-dd-chevron { width: 10px; height: 10px; flex-shrink: 0; transition: transform .18s; opacity: .5; }
.nav-dd-wrap.open .nav-dd-chevron { transform: rotate(180deg); opacity: 1; }
.nav-dd-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  min-width: 240px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  z-index: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
.nav-dd-wrap.open .nav-dd-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  text-decoration: none; color: var(--text-2);
  transition: background .12s, color .12s;
}
.nav-dd-item:hover, .nav-dd-item.active { background: var(--bg-3); color: var(--text); }
.nav-dd-icon { font-size: 17px; width: 26px; text-align: center; flex-shrink: 0; }
.nav-dd-text { display: flex; flex-direction: column; gap: 1px; }
.nav-dd-label { font-size: 13px; font-weight: 600; line-height: 1.2; }
.nav-dd-desc { font-size: 11px; color: var(--text-3); line-height: 1.3; }
.nav-dd-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.nav-dd-group { font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); padding: 6px 10px 2px; }


/* ─── Hero ─── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-24) var(--sp-6) var(--sp-16);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 50%,
    transparent 20%, var(--bg) 100%);
}
[data-theme="light"] .hero-bg {
  background-image: radial-gradient(rgba(0,0,0,0.06) 1px, transparent 1px);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--border-3);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-6);
  background: var(--bg-2);
  font-family: var(--font-mono);
  position: relative;
  z-index: 1;
}
.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: blink 2s ease infinite;
}
.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(32px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: var(--sp-4);
  position: relative;
  z-index: 1;
}
.hero-title .prompt {
  color: var(--text-3);
  font-weight: 400;
}
.hero-title .cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1.2s step-end infinite;
}
.hero-sub {
  font-size: clamp(14px, 2vw, 17px);
  color: var(--text-2);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: var(--sp-10);
  position: relative;
  z-index: 1;
}

/* ─── Search Bar ─── */
.search-wrap {
  width: 100%;
  max-width: 620px;
  position: relative;
  z-index: 1;
  margin-bottom: var(--sp-8);
}
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: var(--sp-4);
  color: var(--text-3);
  pointer-events: none;
  width: 16px;
  height: 16px;
}
.search-input {
  width: 100%;
  height: 52px;
  padding: 0 var(--sp-4) 0 44px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  font-family: var(--font-sans);
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}
.search-kbd {
  position: absolute;
  right: var(--sp-4);
  display: flex;
  gap: var(--sp-1);
}
.kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--border-3);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg-3);
}

/* Search Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  display: none;
}
.search-results.open { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  transition: background var(--t-fast);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.focused {
  background: var(--bg-3);
}
.search-result-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
}
.search-result-content { flex: 1; min-width: 0; }
.search-result-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-name mark {
  background: rgba(255,255,255,0.15);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 2px;
}
[data-theme="light"] .search-result-name mark {
  background: rgba(0,0,0,0.1);
  color: var(--accent);
}
.search-result-cat {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}
.search-result-badge {
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--border-3);
  border-radius: var(--r-sm);
  color: var(--text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.search-no-results {
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ─── Quick Pills ─── */
.quick-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  position: relative;
  z-index: 1;
}
.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-full);
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg-2);
  transition: all var(--t-fast);
  cursor: pointer;
  text-decoration: none;
}
.quick-pill:hover {
  color: var(--text);
  border-color: var(--border-3);
  background: var(--bg-3);
}
.quick-pill svg { width: 12px; height: 12px; }

/* ─── Stats ─── */
.stats {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-8) 0;
  background: var(--bg-1);
}
.stats-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}
.stat-item {
  background: var(--bg-1);
  padding: var(--sp-6);
  text-align: center;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--sp-2);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Section Header ─── */
.section {
  padding: var(--sp-16) 0;
}
.section-header {
  margin-bottom: var(--sp-8);
}
.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--sp-3);
}
.section-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3);
}
.section-desc {
  font-size: 15px;
  color: var(--text-2);
  max-width: 500px;
  line-height: 1.7;
}

/* ─── Category Grid ─── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cat-card {
  background: var(--bg-1);
  padding: var(--sp-6);
  cursor: pointer;
  transition: background var(--t-fast);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  position: relative;
  overflow: hidden;
}
.cat-card:hover { background: var(--bg-2); }
.cat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--t-fast);
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}
.cat-card:hover::after { opacity: 1; }
.cat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
  transition: border-color var(--t-fast), color var(--t-fast);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}
.cat-card:hover .cat-icon {
  border-color: var(--border-focus);
  color: var(--text);
}
.cat-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-1);
}
.cat-count {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-bottom: var(--sp-3);
}
.cat-tools {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.cat-tool {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.cat-tool::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-4);
  flex-shrink: 0;
}
.cat-arrow {
  position: absolute;
  bottom: var(--sp-4);
  right: var(--sp-4);
  color: var(--text-4);
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--t-fast);
}
.cat-card:hover .cat-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--text-2);
}

/* ─── Features ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.feature-card {
  background: var(--bg-1);
  padding: var(--sp-8) var(--sp-6);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  margin-bottom: var(--sp-5);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}
.feature-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-2);
}
.feature-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-1);
  padding: var(--sp-10) 0 var(--sp-6);
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  margin-bottom: var(--sp-10);
}
.footer-brand .nav-logo {
  margin-bottom: var(--sp-4);
  display: inline-flex;
}
.footer-tagline {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.7;
  max-width: 240px;
}
.footer-col-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: var(--sp-4);
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.footer-link {
  font-size: 13px;
  color: var(--text-2);
  transition: color var(--t-fast);
  text-decoration: none;
  display: inline-block;
}
.footer-link:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}
.footer-copy {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.footer-badges {
  display: flex;
  gap: var(--sp-2);
}
.footer-badge {
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ═══ TOOLS PAGE ═══ */
.tools-page {
  min-height: 100vh;
  display: flex;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-1);
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--t);
}
.sidebar-header {
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-1);
  z-index: 1;
}
.sidebar-search {
  position: relative;
}
.sidebar-search-icon {
  position: absolute;
  left: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  width: 13px;
  height: 13px;
  pointer-events: none;
}
.sidebar-search-input {
  width: 100%;
  height: 34px;
  padding: 0 var(--sp-3) 0 32px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--t-fast);
}
.sidebar-search-input::placeholder { color: var(--text-4); }
.sidebar-search-input:focus { border-color: var(--border-focus); }

.sidebar-nav { flex: 1; padding: var(--sp-3) 0; }
.sidebar-cat {
  margin-bottom: var(--sp-1);
}
.sidebar-cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  background: none;
  border: none;
  transition: color var(--t-fast);
  text-align: left;
}
.sidebar-cat-btn:hover { color: var(--text); }
.sidebar-cat-btn.expanded { color: var(--text); }
.sidebar-cat-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: inherit;
}
.sidebar-cat-chevron {
  margin-left: auto;
  transition: transform var(--t-fast);
  width: 12px;
  height: 12px;
  color: var(--text-3);
}
.sidebar-cat-btn.expanded .sidebar-cat-chevron {
  transform: rotate(180deg);
}
.sidebar-tools {
  display: none;
  flex-direction: column;
  padding: var(--sp-1) var(--sp-2) var(--sp-2);
}
.sidebar-tools.open { display: flex; }
.sidebar-tool-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
}
.sidebar-tool-link:hover { color: var(--text); background: var(--bg-3); }
.sidebar-tool-link.active {
  color: var(--accent);
  background: var(--bg-3);
  border-left: 2px solid var(--accent);
  padding-left: calc(var(--sp-3) - 2px);
}
.sidebar-tool-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid var(--border-3);
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.sidebar-tool-link:hover .sidebar-tool-dot,
.sidebar-tool-link.active .sidebar-tool-dot {
  background: var(--accent);
  border-color: var(--accent);
}

/* ─── Tool Workspace ─── */
.workspace {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
}
.workspace-inner {
  flex: 1;
  padding: var(--sp-8);
  max-width: 960px;
}
.workspace-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  color: var(--text-3);
}
.workspace-empty-icon {
  font-family: var(--font-mono);
  font-size: 48px;
  margin-bottom: var(--sp-4);
  color: var(--text-4);
}
.workspace-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}
.workspace-empty-desc {
  font-size: 13px;
  color: var(--text-3);
}
.tool-header {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.tool-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: var(--sp-3);
  font-family: var(--font-mono);
}
.tool-breadcrumb-sep { color: var(--text-4); }
.tool-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
}
.tool-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ─── Artifact Reference Cards (Linux + Windows) ─── */
.art-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 560px; overflow-y: auto;
  padding-right: 2px; /* breathing room for scrollbar */
}
.art-card {
  border-radius: 8px; background: var(--bg-2);
  border: 1px solid var(--border);
  cursor: pointer; transition: background .14s, border-color .14s;
  overflow: hidden;
}
.art-card:hover { background: var(--bg-3); border-color: var(--border-2); }
.art-card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  min-height: 38px;
}
.art-cat {
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  background: var(--bg-3); color: #22c55e;
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  flex-shrink: 0; white-space: nowrap; line-height: 1.6;
}
.art-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  flex: 1; min-width: 0;
}
.art-hint {
  font-size: 11px; color: var(--text-3);
  white-space: nowrap; flex-shrink: 0; margin-left: auto; padding-left: 8px;
}
.art-card-body {
  padding: 8px 12px 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.art-path {
  font-size: 11.5px; color: #22c55e; word-break: break-all;
  font-family: var(--font-mono); line-height: 1.5; display: block;
}
.art-desc {
  font-size: 12px; color: var(--text-2); line-height: 1.6;
}

/* ─── Tool Components ─── */
.tool-body { display: flex; flex-direction: column; gap: var(--sp-5); }
.tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
.tool-field { display: flex; flex-direction: column; gap: var(--sp-2); }
.tool-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.tool-label-badge {
  padding: 1px 5px;
  border-radius: var(--r-sm);
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.tool-textarea {
  width: 100%;
  min-height: 140px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.tool-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.04);
}
.tool-textarea.output {
  background: var(--bg-3);
  cursor: default;
  min-height: 140px;
}
.tool-input {
  height: 40px;
  padding: 0 var(--sp-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t-fast);
  width: 100%;
}
.tool-input:focus { border-color: var(--border-focus); }
.tool-select {
  height: 40px;
  padding: 0 var(--sp-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  width: 100%;
  transition: border-color var(--t-fast);
}
.tool-select:focus { border-color: var(--border-focus); }

/* Tool Buttons */
.tool-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 var(--sp-4);
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
  font-family: var(--font-sans);
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dim); }
[data-theme="light"] .btn-primary { background: #111; color: #fff; border-color: #111; }
[data-theme="light"] .btn-primary:hover { background: #333; border-color: #333; }
.btn-secondary {
  background: var(--bg-3);
  color: var(--text-2);
  border-color: var(--border-2);
}
.btn-secondary:hover { color: var(--text); border-color: var(--border-3); background: var(--bg-4); }
.btn-ghost {
  background: transparent;
  color: var(--text-3);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-3); }
.btn-danger {
  background: var(--error-dim);
  color: var(--error);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.15); }
.btn-sm {
  height: 28px;
  padding: 0 var(--sp-3);
  font-size: 12px;
}
.btn-lg {
  height: 44px;
  padding: 0 var(--sp-6);
  font-size: 15px;
}
.btn-icon {
  width: 36px;
  padding: 0;
  justify-content: center;
}
.btn-icon.btn-sm { width: 28px; }

/* Tool Status Bar */
.tool-status {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
.tool-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-4);
  transition: background var(--t-fast);
}
.tool-status-dot.ok    { background: var(--success); box-shadow: 0 0 4px var(--success); }
.tool-status-dot.error { background: var(--error);   box-shadow: 0 0 4px var(--error); }
.tool-status-dot.warn  { background: var(--warning); box-shadow: 0 0 4px var(--warning); }
.tool-status-msg { flex: 1; }
.tool-status-info { color: var(--text-4); }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-5) 0;
}
.divider-label {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
  font-size: 11px;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.divider-label::before, .divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Checkbox & Radio */
.check-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
}
.check-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.check-label input[type="checkbox"],
.check-label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-3);
  border-radius: var(--r-sm);
  background: var(--bg-3);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.check-label input[type="radio"] { border-radius: 50%; }
.check-label input[type="checkbox"]:checked,
.check-label input[type="radio"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
[data-theme="light"] .check-label input:checked {
  background: #111;
  border-color: #111;
}
.check-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 2px;
  width: 5px;
  height: 8px;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  transform: rotate(45deg);
}
.check-label input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #000;
}
[data-theme="light"] .check-label input:checked::after { border-color: #fff; }
[data-theme="light"] .check-label input[type="radio"]:checked::after { background: #fff; }

/* Range Slider */
.range-wrap { display: flex; align-items: center; gap: var(--sp-3); }
.tool-range {
  flex: 1;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-4);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.tool-range::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
}
.range-val {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
  width: 40px;
  text-align: right;
}

/* Progress / Strength Bar */
.strength-bar-wrap {
  display: flex;
  gap: 3px;
  height: 4px;
}
.strength-seg {
  flex: 1;
  border-radius: 2px;
  background: var(--bg-4);
  transition: background var(--t);
}
.strength-seg.s1 { background: var(--error); }
.strength-seg.s2 { background: var(--warning); }
.strength-seg.s3 { background: #90c030; }
.strength-seg.s4 { background: var(--success); }

/* Code Output */
.code-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: auto;
  position: relative;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.code-block-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
}
.code-block pre {
  padding: var(--sp-4);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  overflow-x: auto;
}

/* Info Box */
.info-box {
  padding: var(--sp-4);
  border-radius: var(--r);
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  gap: var(--sp-3);
}
.info-box.info    { background: var(--info-dim);    border: 1px solid rgba(107,140,255,0.2); color: var(--info); }
.info-box.success { background: var(--success-dim); border: 1px solid rgba(34,197,94,0.2);  color: var(--success); }
.info-box.warning { background: var(--warning-dim); border: 1px solid rgba(245,158,11,0.2); color: var(--warning); }
.info-box.error   { background: var(--error-dim);   border: 1px solid rgba(239,68,68,0.2);  color: var(--error); }
.info-box-icon { flex-shrink: 0; font-size: 15px; line-height: 1.6; }

/* Table */
.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tool-table th {
  text-align: left;
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--border-2);
  color: var(--text-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  background: var(--bg-2);
}
.tool-table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.tool-table th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.tool-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
  font-family: var(--font-mono);
  font-size: 12px;
}
.tool-table td:first-child { color: var(--text); font-weight: 500; }
.tool-table tr:last-child td { border-bottom: none; }
.tool-table tr:hover td { background: var(--bg-2); }
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: auto;
  max-height: 480px;
}

/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  border: 1px solid;
}
.tag-default { border-color: var(--border-2); color: var(--text-3); background: var(--bg-3); }
.tag-success { border-color: rgba(34,197,94,0.3);  color: var(--success); background: var(--success-dim); }
.tag-warning { border-color: rgba(245,158,11,0.3); color: var(--warning); background: var(--warning-dim); }
.tag-error   { border-color: rgba(239,68,68,0.3);  color: var(--error);   background: var(--error-dim); }
.tag-info    { border-color: rgba(107,140,255,0.3);color: var(--info);    background: var(--info-dim); }

/* CVSS specific */
.cvss-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}
.cvss-group {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
}
.cvss-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.cvss-score-display {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-6);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.cvss-score-num {
  font-family: var(--font-mono);
  font-size: 56px;
  font-weight: 700;
  color: var(--text-4);
  line-height: 1;
  transition: color var(--t);
}
.cvss-score-num.none     { color: var(--text-3); }
.cvss-score-num.low      { color: #4ade80; }
.cvss-score-num.medium   { color: var(--warning); }
.cvss-score-num.high     { color: #f97316; }
.cvss-score-num.critical { color: var(--error); }
.cvss-score-meta {}
.cvss-score-severity {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: var(--sp-1);
}
.cvss-score-vector {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  word-break: break-all;
}

/* Diff output */
.diff-output {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  padding: var(--sp-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: auto;
  max-height: 400px;
  white-space: pre;
}
.diff-added   { background: rgba(34,197,94,0.08);  color: var(--success); display: block; padding: 0 var(--sp-4); margin: 0 calc(-1 * var(--sp-4)); }
.diff-removed { background: rgba(239,68,68,0.08);  color: var(--error);   display: block; padding: 0 var(--sp-4); margin: 0 calc(-1 * var(--sp-4)); }
.diff-equal   { color: var(--text-2); display: block; }

/* IOC tags */
.ioc-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.ioc-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--font-mono);
  font-size: 12px;
}
.ioc-type {
  padding: 1px 6px;
  border-radius: var(--r-sm);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-3);
  white-space: nowrap;
}
.ioc-value { flex: 1; color: var(--text); word-break: break-all; }
.ioc-copy { flex-shrink: 0; }

/* ═══ RESOURCES PAGE ═══ */
.resources-page {
  min-height: 100vh;
}
.resources-hero {
  padding: var(--sp-16) 0 var(--sp-10);
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}
.resources-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-8);
}
.resource-card {
  background: var(--bg-1);
  padding: var(--sp-6);
  cursor: pointer;
  transition: background var(--t-fast);
  text-decoration: none;
  color: inherit;
}
.resource-card:hover { background: var(--bg-2); }
.resource-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  margin-bottom: var(--sp-4);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}
.resource-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-2);
}
.resource-card-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

/* Cheat Sheet Content */
.cheatsheet {
  max-width: 860px;
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-6);
}
.cheatsheet-section {
  margin-bottom: var(--sp-8);
}
.cheatsheet-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}
.cmd-table {
  width: 100%;
  border-collapse: collapse;
}
.cmd-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 13px;
}
.cmd-table td:first-child {
  font-family: var(--font-mono);
  color: var(--text);
  white-space: nowrap;
  padding-right: var(--sp-6);
  width: 40%;
}
.cmd-table td:last-child { color: var(--text-2); }
.cmd-table tr:last-child td { border-bottom: none; }
.cmd-table tr:hover td { background: var(--bg-2); }

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  animation: fadeIn var(--t-fast);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn var(--t-fast);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--t-fast);
}
.modal-close:hover { color: var(--text); background: var(--bg-3); }
.modal-body { padding: var(--sp-6); }
.modal-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
}

/* ═══ TOAST ═══ */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text);
  min-width: 240px;
  max-width: 360px;
  pointer-events: all;
  animation: slideInRight 0.25s ease;
}
.toast.removing { animation: slideOutRight 0.2s ease forwards; }
.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.toast-dot.success { background: var(--success); }
.toast-dot.error   { background: var(--error); }
.toast-dot.warning { background: var(--warning); }
.toast-dot.info    { background: var(--info); }
.toast-msg { flex: 1; }
.toast-close {
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  transition: color var(--t-fast);
}
.toast-close:hover { color: var(--text); }

/* ═══ ANIMATIONS ═══ */
@keyframes fadeIn    { from { opacity: 0 } to { opacity: 1 } }
@keyframes scaleIn   { from { transform: scale(0.95); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes slideDown { from { transform: translateY(-8px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes slideInRight  { from { transform: translateX(20px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1 } to { transform: translateX(20px); opacity: 0 } }
@keyframes blink { 0%, 100% { opacity: 1 } 50% { opacity: 0 } }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.5 } }

.fade-in  { animation: fadeIn var(--t); }
.scale-in { animation: scaleIn var(--t); }

/* ═══ UTILITIES ═══ */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.break-all { word-break: break-all; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }

/* Sidebar toggle for mobile */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: var(--sp-6);
  left: var(--sp-6);
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: all var(--t-fast);
}
.sidebar-toggle:hover { background: var(--bg-3); color: var(--text); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .hero { min-height: 90vh; padding: var(--sp-20) var(--sp-4) var(--sp-12); }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .categories-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: var(--sp-3); text-align: center; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .tool-row { grid-template-columns: 1fr; }
  .cvss-grid { grid-template-columns: 1fr; }
  .workspace-inner { padding: var(--sp-4); }
  .resources-grid { grid-template-columns: 1fr; }
  .container { padding: 0 var(--sp-4); }
}

@media (max-width: 480px) {
  .stats-inner { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 28px; }
  .section { padding: var(--sp-10) 0; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ─── Print Styles ─── */
@media print {
  :root {
    --bg: #fff; --bg-1: #fff; --bg-2: #f5f5f5; --bg-3: #ebebeb;
    --text: #000; --text-2: #222; --text-3: #555; --text-4: #888;
    --border: #ccc; --border-2: #bbb; --accent: #000;
  }
  html, body { background: #fff !important; color: #000 !important; }

  /* Hide navigation and interactive chrome */
  .nav, .mobile-menu, .sidebar-toggle, .toast-container,
  .modal-overlay, .btn, button, input, textarea, select,
  .sidebar, .res-tabs { display: none !important; }

  /* Show all panels when printing resources */
  .res-panel { display: block !important; margin-bottom: 32pt; }
  .res-panel::before {
    content: attr(id);
    display: block;
    font-size: 16pt;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid #000;
    padding-bottom: 4pt;
    margin-bottom: 12pt;
    letter-spacing: .05em;
  }

  /* Tables */
  .cmd-table, .table-wrap { width: 100% !important; overflow: visible !important; }
  .cmd-table { border-collapse: collapse; font-size: 9pt; page-break-inside: avoid; }
  .cmd-table td, .cmd-table th { border: 1px solid #ccc; padding: 4pt 6pt; }
  .cmd-table thead tr { background: #ebebeb !important; }
  .cheatsheet-section { page-break-inside: avoid; margin-bottom: 20pt; }
  .cheatsheet-section-title { font-weight: 700; font-size: 11pt; margin-bottom: 6pt; }

  /* Playbooks */
  .pb-card-body { display: block !important; }
  .pb-card { border: 1px solid #ccc; margin-bottom: 16pt; page-break-inside: avoid; }
  .pb-card-header { border-bottom: 1px solid #ccc; }
  .pb-card-chevron { display: none; }
  .pb-cmd { border: 1px solid #ccc; background: #f5f5f5; font-size: 8pt; white-space: pre-wrap; }

  /* Changelog */
  .cl-timeline::before { border-left: 2px solid #ccc; }
  .cl-dot { border: 2px solid #000; }
  .cl-dot.latest { background: #000; }

  /* Workspace / tools page */
  .workspace { margin-left: 0 !important; }
  .tools-page { display: block !important; }

  /* Page breaks */
  h1, h2, .section-title { page-break-after: avoid; }
  .cl-entry { page-break-inside: avoid; }

  /* About page */
  .about-page { max-width: 100%; }
  .about-link { border: 1px solid #ccc; text-decoration: none; color: #000; }

  /* Footer */
  a[href]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
  a.nav-link::after, a.mobile-nav-link::after, a.nav-logo::after { content: none; }

  /* Hide floating UI in print */
  .notepad-fab, .notepad-panel, .palette-overlay, .pivot-popup { display: none !important; }
}

/* ── Command Palette ──────────────────────────── */
.palette-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 72px;
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease;
}
.palette-overlay.open { opacity: 1; pointer-events: all; }
.palette-modal {
  width: 100%; max-width: 600px; background: var(--bg-1);
  border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  transform: translateY(-10px) scale(.98);
  transition: transform .15s ease;
  overflow: hidden;
}
.palette-overlay.open .palette-modal { transform: translateY(0) scale(1); }
.palette-search-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4); border-bottom: 1px solid var(--border);
}
.palette-search-icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-3); }
.palette-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 16px; color: var(--text); font-family: var(--font-sans);
  line-height: 1.4;
}
.palette-esc-hint {
  font-size: 10px; font-family: var(--font-mono); color: var(--text-3);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; flex-shrink: 0;
}
.palette-results { max-height: 380px; overflow-y: auto; padding: var(--sp-2) 0; }
.palette-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3);
  padding: var(--sp-2) var(--sp-4) var(--sp-1);
}
.palette-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); cursor: pointer;
  transition: background var(--t-fast);
}
.palette-item:hover, .palette-item.active { background: var(--bg-2); }
.palette-item-left { flex: 1; min-width: 0; }
.palette-item-name { display: block; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item-desc { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.palette-item-cat { font-size: 10px; font-weight: 600; color: var(--text-3); background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r); padding: 2px 7px; flex-shrink: 0; white-space: nowrap; }
.palette-mark { background: rgba(255,255,255,.15); border-radius: 2px; color: inherit; }
.palette-empty { padding: var(--sp-5) var(--sp-4); font-size: 14px; color: var(--text-3); }
.palette-footer {
  display: flex; gap: var(--sp-5); padding: var(--sp-2) var(--sp-4);
  border-top: 1px solid var(--border); font-size: 11px; color: var(--text-3);
}
.palette-footer kbd {
  font-family: var(--font-mono); font-size: 10px;
  border: 1px solid var(--border); border-radius: 3px;
  padding: 1px 4px; color: var(--text-2); margin-right: 2px;
}

/* ── Investigation Notepad ─────────────────────── */
.notepad-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 7000;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--border-2);
  color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  transition: all var(--t-fast);
}
.notepad-fab:hover, .notepad-fab.active {
  background: var(--accent); color: #000; border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(255,255,255,.15);
}
.notepad-panel {
  position: fixed; bottom: 84px; right: 24px; z-index: 7000;
  width: 340px; height: 420px;
  background: var(--bg-1); border: 1px solid var(--border-2);
  border-radius: var(--r-lg); box-shadow: 0 16px 48px rgba(0,0,0,.55);
  display: flex; flex-direction: column;
  transform: translateY(12px) scale(.97); opacity: 0; pointer-events: none;
  transition: all .2s cubic-bezier(.4,0,.2,1);
}
.notepad-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }
.notepad-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notepad-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .05em;
}
.notepad-actions { display: flex; gap: 2px; }
.notepad-btn {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  padding: 5px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t-fast), background var(--t-fast);
}
.notepad-btn:hover { color: var(--text); background: var(--bg-3); }
.notepad-textarea {
  flex: 1; background: none; border: none; outline: none; resize: none;
  padding: var(--sp-4); font-family: var(--font-mono); font-size: 12px;
  line-height: 1.7; color: var(--text); min-height: 0;
}
.notepad-textarea::placeholder { color: var(--text-3); }
.notepad-status {
  font-size: 10px; color: var(--text-3); padding: var(--sp-2) var(--sp-4);
  border-top: 1px solid var(--border); flex-shrink: 0;
}
@media (max-width: 480px) {
  .notepad-panel { width: calc(100vw - 32px); right: 16px; bottom: 80px; }
  .notepad-fab { bottom: 16px; right: 16px; }
}

/* ── Pivot Links ──────────────────────────────── */
.pivot-icon {
  font-size: 9px; opacity: .65; margin-left: 2px;
  vertical-align: super; pointer-events: none;
}
.pivot-popup {
  background: var(--bg-1); border: 1px solid var(--border-2);
  border-radius: var(--r); box-shadow: 0 8px 24px rgba(0,0,0,.5);
  display: flex; flex-direction: column; min-width: 150px; overflow: hidden;
}
.pivot-popup-type {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3);
  padding: 5px var(--sp-3) 3px;
  border-bottom: 1px solid var(--border);
}
.pivot-popup-btn {
  background: none; border: none; padding: var(--sp-2) var(--sp-3);
  font-size: 12px; color: var(--text-2); text-align: left; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.pivot-popup-btn:hover { background: var(--bg-2); color: var(--text); }

/* ── Payload Unwrapper ──────────────────────── */
.unwrap-step {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-4); margin-bottom: var(--sp-3);
}
.unwrap-step-head {
  display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3);
}
.unwrap-layer {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .05em;
}
.unwrap-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: var(--r);
  letter-spacing: .03em;
}
.unwrap-io { display: flex; flex-direction: column; gap: var(--sp-2); }
.unwrap-line {
  font-family: var(--font-mono); font-size: 12px; word-break: break-all;
  padding: 6px 10px; border-radius: var(--r); background: var(--bg-3);
  color: var(--text-2); border: 1px solid var(--border);
}
.unwrap-line.out { color: var(--text); border-color: var(--border-2); }
.unwrap-arrow { font-size: 11px; color: var(--text-3); padding-left: var(--sp-2); }
.unwrap-final {
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--r-md); padding: var(--sp-4); margin-top: var(--sp-4);
}
.unwrap-final-label {
  font-size: 11px; font-weight: 700; color: var(--success);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: var(--sp-3);
}

/* ── SOC Pattern Library ────────────────────── */
.pat-cat-btn {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: var(--r); border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text-3); cursor: pointer;
  transition: all var(--t-fast);
}
.pat-cat-btn:hover { color: var(--text); border-color: var(--border-2); }
.pat-cat-btn.active { background: var(--bg-4); border-color: var(--border-3); color: var(--text); }
.pat-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-4);
  margin-bottom: var(--sp-3); transition: border-color var(--t-fast);
}
.pat-card:hover { border-color: var(--border-2); }
.pat-card-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: 4px; }
.pat-name { font-size: 13px; font-weight: 700; color: var(--text); }
.pat-cat-badge {
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: var(--r);
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-3);
  text-transform: uppercase; letter-spacing: .04em;
}
.pat-desc { font-size: 12px; color: var(--text-3); margin-bottom: var(--sp-3); }
.pat-regex {
  font-size: 11px; color: var(--text-2); background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 6px 10px; margin-bottom: var(--sp-3);
  word-break: break-all; white-space: pre-wrap;
}
.pat-actions { display: flex; gap: var(--sp-2); }
.btn-sm { font-size: 11px; padding: 4px 10px; height: auto; }

/* ── Event Log Parser ───────────────────────── */
.evtx-stats {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-4); margin-bottom: var(--sp-4);
}
.evtx-stat-main { text-align: center; min-width: 60px; padding-right: var(--sp-3); border-right: 1px solid var(--border); }
.evtx-stat-num { font-size: 28px; font-weight: 800; font-family: var(--font-mono); color: var(--text); }
.evtx-stat-lbl { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.evtx-stat-pill {
  display: flex; flex-direction: column; align-items: center;
  border: 1px solid; border-radius: var(--r-md); padding: 6px 14px;
  gap: 2px; min-width: 56px;
}
.evtx-filters { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.evtx-filter {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: var(--r); border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text-3); cursor: pointer;
  transition: all var(--t-fast);
}
.evtx-filter:hover { color: var(--text); border-color: var(--border-2); }
.evtx-filter.active { background: var(--bg-4); border-color: var(--sev-col, var(--border-3)); color: var(--sev-col, var(--text)); }

/* ── YARA Rule Builder ──────────────────────── */
.yara-preview {
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--sp-4);
  min-height: 320px; white-space: pre-wrap; word-break: break-word;
  color: var(--text-2); overflow-x: auto;
}
.yr-kw      { color: #c084fc; font-weight: 700; }
.yr-section { color: #f59e0b; font-weight: 700; }
.yr-builtin { color: #60a5fa; }
.yr-flag    { color: #a78bfa; }
.yr-str     { color: #34d399; }
.yr-lit     { color: #86efac; }
.yr-comment { color: #4b5563; font-style: italic; }
.yara-meta-row {
  display: flex; gap: var(--sp-2); align-items: center;
}
.yara-meta-row .tool-input { flex: 1; }
.yara-str-row {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: var(--sp-3);
}
@media (max-width: 860px) {
  .tool-body > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ══════════════════════════════════════════════════════
   GLOBAL MOTION SYSTEM  —  runs on every page
══════════════════════════════════════════════════════ */

/* ── Page enter ────────────────────────────────────── */
@keyframes g-pagein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
main { animation: g-pagein .45s cubic-bezier(.2,0,.1,1) both; }

/* ── Scroll reveal ─────────────────────────────────── */
[data-reveal] { opacity: 0; transition: opacity .7s ease, transform .7s ease; }
[data-reveal="up"]    { transform: translateY(28px); }
[data-reveal="left"]  { transform: translateX(-18px); }
[data-reveal="scale"] { transform: scale(.96) translateY(10px); }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ── Scroll progress bar ───────────────────────────── */
.g-prog {
  position: fixed; top: var(--nav-h); left: 0; right: 0;
  height: 2px; z-index: 300; pointer-events: none;
}
.g-prog-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #22c55e 0%, #3b82f6 55%, #a855f7 100%);
  transition: width .12s linear;
  border-radius: 0 2px 2px 0;
}

/* ── Nav scrolled shadow ───────────────────────────── */
.nav.is-scrolled { box-shadow: 0 1px 0 var(--border), 0 8px 32px rgba(0,0,0,.2); }

/* ── Micro-interactions ────────────────────────────── */
.btn:active, .tool-btn:active, .nav-action:active,
.rl-nav-btn:active, .mob-sec-btn:active {
  transform: scale(.96) !important;
  transition: transform .08s ease !important;
}

/* ── Tool category card hover (tools.html) ─────────── */
.we-cat-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease !important;
}
.we-cat-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.18) !important;
}

/* ── Playbook / cert card hover ────────────────────── */
.playbook-card, .ct-cert-card {
  transition: transform .2s ease, box-shadow .2s ease !important;
}
.playbook-card:hover, .ct-cert-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.15) !important;
}

/* ── Reduced motion ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  main { animation: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .we-cat-card, .playbook-card, .ct-cert-card { transition: none !important; }
}

/* ── Reference-page hero + search (shared: playbooks.html, resources.html) ── */
.rl-hero{padding:36px 0 28px;border-bottom:1px solid var(--border);margin-bottom:var(--sp-8);}
.rl-hero-tag{font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--accent);margin-bottom:8px;}
.rl-hero h1{font-size:clamp(22px,4vw,34px);font-weight:700;margin-bottom:8px;line-height:1.2;}
.rl-hero p{font-size:14px;color:var(--text-2);line-height:1.6;}
.rl-hero-stats{display:flex;flex-wrap:wrap;gap:20px;margin-top:16px;}
.rl-hero-stat{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--text-2);}
.rl-hero-stat-n{font-size:18px;font-weight:700;color:var(--text);font-family:var(--font-mono);}
@media(max-width:520px){.rl-hero h1{font-size:22px;}}

.rl-search{position:relative;margin-bottom:var(--sp-6);}
.rl-search-icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--text-3);width:15px;height:15px;pointer-events:none;}
.rl-search input{width:100%;height:40px;padding:0 12px 0 38px;background:var(--bg-2);border:1px solid var(--border-2);border-radius:8px;color:var(--text);font-size:13px;outline:none;transition:border-color .15s;}
.rl-search input:focus{border-color:var(--accent);}
.rl-search input::placeholder{color:var(--text-4);}

/* ═══════════════════════════════════════════════════════
   SIDEBAR ENHANCEMENTS — category counts, favorites, recents
═══════════════════════════════════════════════════════ */
.sidebar-cat-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-4);
  font-family: var(--font-mono);
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
  flex-shrink: 0;
}
.sidebar-fav-dot {
  font-size: 9px;
  color: var(--warning);
  margin-left: auto;
  flex-shrink: 0;
}
.sidebar-pinned .sidebar-cat-btn { color: var(--text-2); }
.mob-sec-label {
  display: flex; align-items: center; gap: 7px;
}
.mob-sec-label svg { flex-shrink: 0; opacity: .7; }

/* ═══════════════════════════════════════════════════════
   BREADCRUMBS
═══════════════════════════════════════════════════════ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px var(--sp-4);
  font-size: 12px;
  color: var(--text-3);
  max-width: var(--container-max, 1200px);
  margin: 0 auto;
  padding-left: max(var(--sp-4), env(safe-area-inset-left));
  padding-right: max(var(--sp-4), env(safe-area-inset-right));
}
.bc-link {
  color: var(--text-3);
  text-decoration: none;
  transition: color .15s;
}
.bc-link:hover { color: var(--text); }
.bc-sep { opacity: .4; }
.bc-current { color: var(--text-2); }
@media (max-width: 480px) { .breadcrumb { font-size: 11px; } }

/* ═══════════════════════════════════════════════════════
   PROSE LINE-LENGTH CAP — comfortable reading on wide screens
═══════════════════════════════════════════════════════ */
.gl-term-def,
.ip-qa-a,
.ip-qa-tip,
.cr-step-desc,
.cr-role-desc,
.cr-hero p,
.gl-hero p,
.ip-hero p,
.qz-hero p,
.sc-hero p {
  max-width: 72ch;
}

/* ═══════════════════════════════════════════════════════
   PRINT STYLES — clean playbook printing
═══════════════════════════════════════════════════════ */
@media print {
  .nav, .mobile-menu, .g-prog, .g-search-pill,
  .pb-sidebar, .pb-cat-filter, [data-reveal],
  .skip-link, #menuToggle, .nav-hamburger {
    display: none !important;
  }
  body {
    padding-top: 0 !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 12px !important;
  }
  main { animation: none !important; }
  a { color: inherit !important; text-decoration: none !important; }
  /* Expand all collapsed accordion sections */
  .pb-step-body, .gl-term-body, .ip-qa-body,
  [class*="-body"], [class*="-content"] {
    display: block !important;
    max-height: none !important;
  }
  /* Avoid page breaks inside cards */
  .playbook-card, .pb-step, .cr-step, .ip-qa, .gl-term {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
}
