/* ══════════════════════════════════════════════════════════════
   CENZO JS — EVENTS PAGE
   Unified design system with Functions page
══════════════════════════════════════════════════════════════ */

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── TOKENS ────────────────────────────────────────────────── */
:root {
  --bg:          #060914;
  --surface:     #0b0e1c;
  --card:        #0f1222;
  --card-hov:    #131627;
  --border:      #181d32;
  --border-hov:  #232945;
  --primary:     #6d77ff;
  --primary-d:   #5561e0;
  --purple:      #9d4edd;
  --gold:        #f0b429;
  --cyan:        #00d4ff;
  --green:       #1dd1a1;
  --red:         #ff5c5c;
  --pink:        #ff6eb4;
  --orange:      #ff8c42;

  --text:        #e8eaf6;
  --text-2:      #7c82a8;
  --text-3:      #363c5e;

  --radius-sm:   6px;
  --radius:      8px;
  --radius-md:   10px;
  --radius-lg:   12px;

  --nav-h:       52px;
  --sidebar-w:   220px;

  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --shadow:      0 4px 20px rgba(0,0,0,.5);
  --shadow-lg:   0 16px 48px rgba(0,0,0,.65);
  --transition:  .15s cubic-bezier(.4,0,.2,1);
}

/* ── BASE ──────────────────────────────────────────────────── */
html { height: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hov); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2e3558; }

/* ══════════════════════════════════════════════════════════════
   LOADER
══════════════════════════════════════════════════════════════ */
.loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .55s ease;
}
.loader.hiding { opacity: 0; pointer-events: none; }

.loader-particles {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden;
}
.loader-particle {
  position: absolute; border-radius: 50%;
  animation: particleDrift linear infinite; opacity: 0;
}
@keyframes particleDrift {
  0%   { opacity: 0; transform: translateY(0) scale(0); }
  10%  { opacity: 1; }
  90%  { opacity: .5; }
  100% { opacity: 0; transform: translateY(-120vh) scale(1.5); }
}

.loader-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; text-align: center;
}
.loader-icon {
  width: 64px; height: 64px; border-radius: 18px;
  animation: iconPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(0,212,255,.45));
}
@keyframes iconPulse {
  0%,100% { transform: scale(1); filter: drop-shadow(0 0 24px rgba(0,212,255,.45)); }
  50%     { transform: scale(1.05); filter: drop-shadow(0 0 44px rgba(0,212,255,.8)); }
}
.loader-sub {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--cyan); opacity: .7;
  margin-top: -6px;
}
.loader-bar-wrap {
  width: 160px; height: 2px;
  background: var(--border); border-radius: 10px; overflow: hidden;
}
.loader-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: 10px; width: 0%;
  transition: width .4s ease;
  box-shadow: 0 0 10px rgba(0,212,255,.6);
}

/* ══════════════════════════════════════════════════════════════
   TOP NAV  (unified with Functions page)
══════════════════════════════════════════════════════════════ */
.topnav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(6,9,20,.9);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  z-index: 200;
}
.topnav::after {
  content: '';
  position: absolute; inset-x: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(0,212,255,.35) 30%, rgba(157,78,221,.2) 70%, transparent 100%);
  pointer-events: none;
}

.topnav-left {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* Sidebar toggle (mobile) */
.sidebar-toggle {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 5px;
  border-radius: var(--radius-sm);
}
.sidebar-toggle span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text-2); border-radius: 2px; transition: var(--transition);
}
.sidebar-toggle:hover span { background: var(--text); }

/* Brand */
.topnav-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
}
.topnav-icon { width: 26px; height: 26px; border-radius: 7px; filter: drop-shadow(0 0 6px rgba(0,212,255,.3)); }
.topnav-brand-text {
  font-size: 15px; font-weight: 800; letter-spacing: -.35px;
  background: linear-gradient(135deg, #c8efff 0%, #00d4ff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topnav-badge {
  font-size: 8px; font-weight: 800; letter-spacing: .9px;
  background: linear-gradient(135deg, #00b8d9, #00d4ff);
  color: #fff; padding: 2px 6px; border-radius: 4px;
  box-shadow: 0 1px 6px rgba(0,212,255,.35);
}

/* Center page tabs */
.topnav-tabs {
  display: flex; align-items: center; gap: 2px;
  flex: 1; justify-content: center;
}
.topnav-page-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius);
  font-size: 12.5px; font-weight: 600;
  color: var(--text-2); text-decoration: none;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap; letter-spacing: -.1px;
}
.topnav-page-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
  border-color: var(--border);
}
.topnav-page-tab.active {
  color: var(--cyan);
  background: rgba(0,212,255,.08);
  border-color: rgba(0,212,255,.22);
}
.topnav-page-tab svg { flex-shrink: 0; }

/* Right */
.topnav-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; margin-left: auto;
}

.topnav-search-wrap {
  position: relative; display: flex; align-items: center;
}
.topnav-search-icon {
  position: absolute; left: 10px; color: var(--text-3); pointer-events: none;
}
.topnav-search {
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 38px 0 32px; height: 34px;
  font-family: var(--font); font-size: 13px; color: var(--text);
  width: 200px; outline: none; transition: var(--transition); cursor: pointer;
}
.topnav-search:focus {
  border-color: rgba(0,212,255,.5);
  background: rgba(0,212,255,.05);
  box-shadow: 0 0 0 3px rgba(0,212,255,.1);
}
.topnav-search::placeholder { color: var(--text-3); }
.search-kbd {
  position: absolute; right: 9px;
  font-family: var(--font); font-size: 10px; font-weight: 600;
  color: var(--text-3); background: var(--border);
  border-radius: 4px; padding: 1.5px 5px; pointer-events: none; letter-spacing: .04em;
}

.topnav-version {
  font-size: 10.5px; font-weight: 700; font-family: var(--mono);
  color: var(--cyan); background: rgba(0,212,255,.07);
  border: 1px solid rgba(0,212,255,.18); border-radius: 6px;
  padding: 3px 8px; letter-spacing: .04em;
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════════════════ */
.layout {
  display: flex;
  height: 100vh;
  padding-top: var(--nav-h);
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  position: fixed; top: var(--nav-h); bottom: 0; left: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-stat {
  font-size: 10px; color: var(--text-3); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}

/* Sidebar search */
.sidebar-search-wrap {
  padding: 10px 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.sidebar-search-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3);
  margin-bottom: 6px; display: flex; align-items: center; gap: 5px;
}
.sidebar-search-inner {
  position: relative; display: flex; align-items: center;
}
.sidebar-search-icon {
  position: absolute; left: 9px; pointer-events: none;
  color: var(--text-3); display: flex; align-items: center;
}
.sidebar-search {
  width: 100%; height: 34px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text); font-family: var(--font); font-size: 12.5px;
  padding: 0 10px 0 30px; outline: none; transition: var(--transition);
  box-sizing: border-box;
}
.sidebar-search:focus {
  border-color: rgba(0,212,255,.4);
  background: rgba(0,212,255,.05);
  box-shadow: 0 0 0 3px rgba(0,212,255,.08);
}
.sidebar-search::placeholder { color: var(--text-3); }
.sidebar-search-clear {
  position: absolute; right: 8px; background: none; border: none;
  color: var(--text-3); cursor: pointer; padding: 2px; display: none;
  align-items: center; border-radius: 3px; transition: var(--transition);
}
.sidebar-search-clear:hover { color: var(--text); background: rgba(255,255,255,.08); }
.sidebar-search-clear.visible { display: flex; }

.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 8px 6px 24px;
}

/* Group headers */
.sidebar-group { margin-bottom: 2px; }

.sidebar-group-header {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 8px 5px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); cursor: pointer; user-select: none;
  border-radius: var(--radius-sm); transition: var(--transition);
}
.sidebar-group-header:hover { color: var(--text-2); background: rgba(255,255,255,.02); }

.sidebar-group-icon {
  width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 13px; line-height: 1;
}

.sidebar-group-label { flex: 1; }

.sidebar-group-count {
  font-size: 9.5px; font-weight: 700; font-family: var(--mono);
  color: var(--text-3); background: var(--border);
  padding: 1px 5px; border-radius: 20px;
}

.sidebar-group-chevron {
  margin-left: auto; transition: transform .18s ease;
  color: var(--text-3); opacity: .5; flex-shrink: 0;
}
.sidebar-group.collapsed .sidebar-group-chevron { transform: rotate(-90deg); }
.sidebar-group.collapsed .sidebar-group-items { display: none; }
.sidebar-group-items { overflow: hidden; }

/* Sidebar items */
.sidebar-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px 6px 12px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: var(--transition); color: var(--text-2);
  font-size: 12.5px; margin-bottom: 1px; position: relative;
}
.sidebar-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.sidebar-item.active {
  color: var(--text);
  background: rgba(109,119,255,.1);
  border: 1px solid rgba(109,119,255,.18);
}
.sidebar-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 60%;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.sidebar-item-name {
  flex: 1; font-family: var(--mono); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-item-type {
  font-size: 9px; font-weight: 700; letter-spacing: .06em;
  padding: 1.5px 5px; border-radius: 4px; text-transform: uppercase; flex-shrink: 0;
}
.type-code  { color: var(--cyan); background: rgba(0,212,255,.08); }
.type-exec  { color: var(--purple); background: rgba(157,78,221,.08); }

.sidebar-item-once {
  font-size: 9px; color: var(--gold); background: rgba(240,180,41,.08);
  border-radius: 3px; padding: 1.5px 4px; font-weight: 700; flex-shrink: 0;
}

.sidebar-empty {
  padding: 20px 12px; text-align: center;
  color: var(--text-3); font-size: 12px;
}

/* Sidebar backdrop (mobile) */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,.55);
}
.sidebar-backdrop.show { display: block; }

/* ══════════════════════════════════════════════════════════════
   MAIN
══════════════════════════════════════════════════════════════ */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  overflow-y: auto;
  min-width: 0;
}

/* ══════════════════════════════════════════════════════════════
   HERO (welcome state)
══════════════════════════════════════════════════════════════ */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.hero-glow {
  position: absolute;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,.05) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: heroGlow 6s ease-in-out infinite;
}
@keyframes heroGlow {
  0%,100% { opacity: .6; transform: translate(-50%,-50%) scale(1); }
  50%     { opacity: 1; transform: translate(-50%,-50%) scale(1.08); }
}

.hero-inner {
  position: relative; z-index: 1;
  max-width: 600px; width: 100%;
  padding: 52px 28px;
  text-align: center;
}

.hero-logo {
  height: 48px; margin-bottom: 20px;
  filter: drop-shadow(0 0 20px rgba(0,212,255,.3));
}

.hero-title {
  font-size: 30px; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(135deg, #fff 30%, var(--cyan) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 12px;
}

.hero-desc {
  font-size: 14px; color: var(--text-2); line-height: 1.7;
  max-width: 460px; margin: 0 auto 28px;
}

.hero-meta-row {
  display: flex; justify-content: center; gap: 10px;
  margin-bottom: 28px; flex-wrap: wrap;
}
.hero-meta-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 20px;
  min-width: 100px; transition: var(--transition);
}
.hero-meta-card:hover {
  border-color: var(--border-hov); background: var(--card-hov);
  transform: translateY(-2px);
}
.hero-meta-num {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--cyan) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 3px;
}
.hero-meta-label {
  font-size: 10.5px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
}

.hero-usage-notes {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px; text-align: left;
}
.hero-usage-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3); margin-bottom: 11px;
}
.hero-usage-note {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 12.5px; color: var(--text-2);
  padding: 5px 0; border-bottom: 1px solid var(--border);
}
.hero-usage-note:last-child { border-bottom: none; padding-bottom: 0; }
.hero-usage-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--cyan); flex-shrink: 0; margin-top: 7px;
}

/* ══════════════════════════════════════════════════════════════
   EVENT DETAIL
══════════════════════════════════════════════════════════════ */
.event-detail {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 28px 80px;
}

/* Header */
.detail-header {
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.detail-header-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.detail-breadcrumb {
  font-size: 11.5px; color: var(--text-3);
  display: flex; align-items: center; gap: 5px;
}
.detail-breadcrumb a { color: var(--text-3); text-decoration: none; transition: color .13s; }
.detail-breadcrumb a:hover { color: var(--cyan); }
.detail-breadcrumb-sep { opacity: .4; }

.detail-actions { display: flex; gap: 6px; }
.detail-action-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 12px; font-weight: 500;
  color: var(--text-2); cursor: pointer; transition: var(--transition);
}
.detail-action-btn:hover { color: var(--text); border-color: var(--border-hov); background: var(--card-hov); }
.detail-action-btn.copied { color: var(--green); border-color: rgba(29,209,161,.25); background: rgba(29,209,161,.05); }

.detail-name {
  font-size: 26px; font-weight: 800;
  font-family: var(--mono); letter-spacing: -.02em;
  color: var(--text); margin-bottom: 8px; line-height: 1.25;
}
.detail-trigger {
  font-size: 14px; color: var(--text-2); line-height: 1.6;
  margin-bottom: 12px; max-width: 640px;
}

.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 5px; letter-spacing: .04em;
}
.badge-code    { color: var(--cyan); background: rgba(0,212,255,.08); border: 1px solid rgba(0,212,255,.18); }
.badge-execute { color: var(--purple); background: rgba(157,78,221,.08); border: 1px solid rgba(157,78,221,.18); }
.badge-once    { color: var(--gold); background: rgba(240,180,41,.08); border: 1px solid rgba(240,180,41,.18); }
.badge-repeating { color: var(--green); background: rgba(29,209,161,.08); border: 1px solid rgba(29,209,161,.18); }
.badge-file    { color: var(--text-2); background: var(--card); border: 1px solid var(--border); font-family: var(--mono); font-size: 11px; }

/* Body sections */
.detail-body { display: flex; flex-direction: column; gap: 16px; }

.section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.section-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.015);
}
.section-hd-icon {
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-2);
}
.section-count {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  color: var(--text-3); background: var(--border);
  border-radius: 20px; padding: 1.5px 7px;
}

.section-body { padding: 16px 18px; }

/* ── FILE PATH ─────────────────────────────────────────────── */
.file-path-block {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 13px;
}
.file-path-code {
  flex: 1; font-family: var(--mono); font-size: 12.5px; color: var(--cyan);
}
.file-copy-btn {
  background: none; border: 1px solid var(--border); border-radius: 5px;
  padding: 4px 10px; font-family: var(--font); font-size: 11.5px; font-weight: 500;
  color: var(--text-2); cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.file-copy-btn:hover { color: var(--text); border-color: var(--border-hov); background: var(--card-hov); }
.file-copy-btn.copied { color: var(--green); border-color: rgba(29,209,161,.25); }

/* ── VARIABLES TABLE ───────────────────────────────────────── */
.vars-table { width: 100%; border-collapse: collapse; }
.vars-table th {
  text-align: left; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); padding: 0 0 9px;
  border-bottom: 1px solid var(--border);
}
.vars-table td {
  padding: 9px 0; border-bottom: 1px solid rgba(24,29,50,.65);
  vertical-align: top; font-size: 13px; color: var(--text-2);
}
.vars-table tr:last-child td { border-bottom: none; }
.vars-table td:first-child { padding-right: 18px; width: 1%; white-space: nowrap; }

.var-name {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--text);
  background: rgba(0,212,255,.06); border: 1px solid rgba(0,212,255,.13);
  border-radius: 4px; padding: 1.5px 7px;
}
.var-get-hint {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-3); margin-top: 2px;
}
.var-desc { color: var(--text-2); line-height: 1.55; }
.vars-empty { color: var(--text-3); font-size: 12.5px; font-style: italic; padding: 6px 0; }

/* ── JS PARAMS ─────────────────────────────────────────────── */
.js-params-list { display: flex; flex-wrap: wrap; gap: 6px; }
.js-param-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 12px;
  color: var(--purple); background: rgba(157,78,221,.07);
  border: 1px solid rgba(157,78,221,.16); border-radius: 5px; padding: 3px 9px;
}
.js-param-index {
  font-size: 9.5px; color: var(--text-3); background: var(--border);
  border-radius: 3px; padding: 1px 4px; font-family: var(--font);
}

/* ── NOTES ─────────────────────────────────────────────────── */
.notes-block {
  display: flex; gap: 10px;
  background: rgba(240,180,41,.03);
  border: 1px solid rgba(240,180,41,.13);
  border-radius: var(--radius); padding: 12px 14px;
}
.notes-icon { flex-shrink: 0; color: var(--gold); margin-top: 1px; }
.notes-text { font-size: 13px; color: var(--text-2); line-height: 1.65; }
.notes-text code {
  font-family: var(--mono); font-size: 11.5px; color: var(--cyan);
  background: rgba(0,212,255,.07); border-radius: 4px; padding: 1px 5px;
}

/* ── EXAMPLE BLOCK ─────────────────────────────────────────── */
.example-desc {
  font-size: 13px; color: var(--text-2);
  margin-bottom: 11px; line-height: 1.6;
}

.code-block-wrap {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.code-block-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 13px;
  background: rgba(255,255,255,.025);
  border-bottom: 1px solid var(--border);
}
.code-lang {
  font-size: 10px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-3);
}
.code-actions { display: flex; gap: 5px; }
.code-copy-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: 1px solid var(--border);
  border-radius: 5px; padding: 3px 9px;
  font-family: var(--font); font-size: 11px; font-weight: 500;
  color: var(--text-2); cursor: pointer; transition: var(--transition);
}
.code-copy-btn:hover { color: var(--text); border-color: var(--border-hov); background: var(--card-hov); }
.code-copy-btn.copied { color: var(--green); border-color: rgba(29,209,161,.25); background: rgba(29,209,161,.04); }

.code-block {
  padding: 14px 16px;
  font-family: var(--mono); font-size: 12.5px; color: var(--text);
  line-height: 1.65; overflow-x: auto; white-space: pre;
  background: var(--surface);
}
.code-block::-webkit-scrollbar { height: 3px; }
.code-block::-webkit-scrollbar-thumb { background: var(--border); }

/* Syntax tokens */
.tok-fn    { color: #6d77ff; }
.tok-kw    { color: #ff6eb4; }
.tok-str   { color: #1dd1a1; }
.tok-num   { color: #f0b429; }
.tok-cmt   { color: var(--text-3); font-style: italic; }
.tok-var   { color: var(--cyan); }
.tok-op    { color: #8b91b8; }

/* ── DETAIL NAV ────────────────────────────────────────────── */
.detail-nav {
  display: flex; gap: 10px; justify-content: space-between;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.detail-nav-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 16px;
  font-family: var(--font); font-size: 12.5px; font-weight: 500;
  color: var(--text-2); cursor: pointer; transition: var(--transition);
  text-decoration: none; flex: 1; max-width: 200px;
}
.detail-nav-btn:hover { color: var(--text); border-color: var(--border-hov); background: var(--card-hov); }
.detail-nav-btn.next { justify-content: flex-end; margin-left: auto; }
.detail-nav-btn svg { flex-shrink: 0; opacity: .6; }

/* ══════════════════════════════════════════════════════════════
   SEARCH OVERLAY
══════════════════════════════════════════════════════════════ */
.search-overlay {
  display: none; position: fixed; inset: 0; z-index: 9000;
  background: rgba(6,9,20,.7); backdrop-filter: blur(6px);
  align-items: flex-start; justify-content: center;
  padding-top: 10vh;
}
.search-overlay.open { display: flex; animation: overlayIn .15s ease; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.search-modal {
  width: 100%; max-width: 540px; margin: 0 16px;
  background: #0e1224; border: 1px solid rgba(0,212,255,.22);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 64px rgba(0,0,0,.7);
  overflow: hidden;
  animation: modalIn .17s cubic-bezier(.32,.72,0,1);
}
@keyframes modalIn {
  from { transform: translateY(-10px) scale(.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.search-modal-hd {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.05);
}
.search-modal-hd svg { color: var(--text-3); flex-shrink: 0; }
.search-modal-hd input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 14px; color: var(--text); font-family: var(--mono);
}
.search-modal-hd input::placeholder { color: var(--text-3); }
.search-close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 14px; padding: 2px 4px;
  transition: color .12s; display: flex; align-items: center;
}
.search-close-btn:hover { color: var(--text); }

.search-results { max-height: 360px; overflow-y: auto; padding: 4px 0; }
.search-results::-webkit-scrollbar { width: 3px; }
.search-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); }

.search-result-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer; transition: background .1s;
}
.search-result-item:hover { background: rgba(109,119,255,.1); }
.search-result-name {
  font-family: var(--mono); font-size: 13px; color: var(--primary);
  flex-shrink: 0; min-width: 120px;
}
.search-result-desc {
  font-size: 12px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-type {
  font-size: 9px; font-weight: 700; letter-spacing: .06em;
  padding: 1.5px 5px; border-radius: 4px; text-transform: uppercase; flex-shrink: 0;
}
.search-empty {
  padding: 28px; text-align: center; color: var(--text-3); font-size: 13px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: flex; }
  .main { margin-left: 0; }
  .topnav-version { display: none; }
  .topnav-page-tab { padding: 5px 10px; font-size: 12px; }
  .event-detail { padding: 20px 18px 60px; }
  .topnav-search-wrap .topnav-search { width: 160px; }
}

@media (max-width: 580px) {
  .topnav { padding: 0 10px; gap: 6px; }
  .topnav-tabs { gap: 1px; }
  .topnav-page-tab { padding: 5px 8px; font-size: 11.5px; }
  .topnav-page-tab svg { display: none; }
  .topnav-search-wrap { display: none; }
  .event-detail { padding: 16px 14px 60px; }
  .detail-name { font-size: 21px; }
  .hero-inner { padding: 40px 20px; }
  .hero-title { font-size: 24px; }
  .section-body { padding: 12px 14px; }
  .vars-table { font-size: 12px; }
}
