/* ===========================================
   Kotoh Portal V2 — Enterprise Design System
   Dark Theme · Electric Indigo #6C5CE7 · Space Grotesk + JetBrains Mono
   =========================================== */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Background scale (deepest → lighter) */
  --bg-0: #0A0A12;
  --bg-1: #12121B;
  --bg-2: #1A1A2E;
  --bg-3: #252540;
  --bg-4: #2E2E4A;
  --bg-5: #383855;

  /* Primary accent — Electric Indigo */
  --accent: #6C5CE7;
  --accent-hover: #7C6FEF;
  --accent-glow: rgba(108, 92, 231, 0.15);
  --accent-subtle: rgba(108, 92, 231, 0.08);

  /* Secondary accent — Cyan */
  --cyan: #22D3EE;
  --cyan-glow: rgba(34, 211, 238, 0.15);

  /* Semantic */
  --green: #10B981;
  --red: #EF4444;
  --yellow: #F59E0B;
  --blue: #60a5fa;

  /* Text */
  --text-primary: #F0F0FF;
  --text-secondary: #9898B8;
  --text-muted: #5A5A78;

  /* Borders — three levels */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(108, 92, 231, 0.3);

  /* Fonts */
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Sidebar */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;

  /* Easings */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-display);
  background: var(--bg-0);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: white;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }

/* ---------- Ambient Background ---------- */
.v2-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(108, 92, 231, 0.04) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 20%, rgba(34, 211, 238, 0.02) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 20% 80%, rgba(16, 185, 129, 0.015) 0%, transparent 70%);
}

/* ---------- Noise Texture ---------- */
.v2-noise::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.v2-data, .font-mono { font-family: var(--font-mono); }
.v2-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Sidebar ---------- */
.v2-sidebar {
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  transition: width 0.3s ease, min-width 0.3s ease;
  overflow: hidden;
  z-index: 50;
}

.v2-sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  min-height: 64px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.v2-sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6C5CE7, #7C3AED);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
  flex-shrink: 0;
}

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

.v2-sidebar-group {
  margin-bottom: 24px;
}

.v2-sidebar-group-label {
  padding: 0 12px;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.v2-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #C8C8E0;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  border-left: 2px solid transparent;
  margin-bottom: 2px;
}
.v2-sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}
.v2-sidebar-link.active {
  color: #A5A6F6;
  background: rgba(108, 92, 231, 0.1);
  border-left-color: var(--accent);
}
.v2-sidebar-link .material-symbols-outlined {
  font-size: 18px;
  width: 18px;
  flex-shrink: 0;
}

.v2-sidebar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-left: auto;
}

.v2-sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}

/* ---------- Top Bar ---------- */
.v2-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  min-height: 64px;
  padding: 0 24px;
  background: rgba(10, 10, 18, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.v2-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.v2-breadcrumb a,
.v2-breadcrumb span.text-muted {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.v2-breadcrumb a:hover {
  color: var(--text-primary);
}
.v2-breadcrumb .separator {
  color: var(--text-muted);
}
.v2-breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ---------- Legacy Nav (kept for non-sidebar pages) ---------- */
.v2-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 18, 0.82);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.v2-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}
.v2-nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}
.v2-nav-link.active {
  color: var(--accent);
  background: var(--accent-subtle);
}
.v2-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.v2-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* ---------- Cards ---------- */
.v2-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.v2-card-interactive:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.v2-card-interactive:hover.v2-card-glow {
  border-color: var(--border-accent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 24px var(--accent-glow);
}

.v2-card-glass {
  background: rgba(18, 18, 25, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.v2-stat-card {
  background: linear-gradient(135deg, rgba(30, 30, 42, 0.9) 0%, rgba(18, 18, 25, 0.9) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.v2-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  border-color: var(--border-accent);
}

/* ---------- Buttons ---------- */
.v2-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-display);
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #5A4BD1 100%);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 12px rgba(108, 92, 231, 0.25);
  text-decoration: none;
}
.v2-btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.35);
  transform: translateY(-1px);
}

.v2-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-display);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.v2-btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

.v2-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-display);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.v2-btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- Form Elements ---------- */
.v2-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-display);
  color: var(--text-primary);
  background: var(--bg-3);
  border: 1px solid var(--border);
  outline: none;
  transition: all 0.15s ease;
}
.v2-input::placeholder { color: var(--text-muted); }
.v2-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}

.v2-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.v2-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-display);
  color: var(--text-primary);
  background: var(--bg-3);
  border: 1px solid var(--border);
  outline: none;
  resize: vertical;
  transition: all 0.15s ease;
}
.v2-textarea::placeholder { color: var(--text-muted); }
.v2-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}

/* ---------- Badges ---------- */
.v2-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.v2-badge-accent  { background: rgba(108, 92, 231, 0.12); color: var(--accent); }
.v2-badge-overlay {
  background: rgba(10, 10, 18, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.v2-badge-green   { background: rgba(16, 185, 129, 0.12); color: var(--green); }
.v2-badge-yellow  { background: rgba(245, 158, 11, 0.12); color: var(--yellow); }
.v2-badge-blue    { background: rgba(96, 165, 250, 0.12); color: var(--blue); }
.v2-badge-red     { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.v2-badge-cyan    { background: rgba(34, 211, 238, 0.12); color: var(--cyan); }

/* ---------- Keyboard Shortcut ---------- */
.v2-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-3);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ---------- Progress Bar ---------- */
.v2-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-4);
  overflow: hidden;
}
.v2-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.4s var(--ease-out);
}

/* ---------- Divider ---------- */
.v2-divider {
  height: 1px;
  background: var(--border);
  border: none;
}

/* ---------- Toast ---------- */
.v2-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(26, 26, 46, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s var(--ease-spring);
  font-size: 14px;
  font-weight: 500;
}
.v2-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ---------- Animations ---------- */
@keyframes v2-fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes v2-slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes v2-scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes v2-cardEnter {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes v2-spin { to { transform: rotate(360deg); } }
@keyframes v2-pulseGlow {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
  50% { box-shadow: 0 0 40px rgba(108, 92, 231, 0.25); }
}

.v2-fade-up   { animation: v2-fadeUp 0.4s var(--ease-out) both; }
.v2-slide-down { animation: v2-slideDown 0.3s var(--ease-out) both; }
.v2-scale-in  { animation: v2-scaleIn 0.3s var(--ease-spring) both; }
.v2-card-enter { animation: v2-cardEnter 0.35s var(--ease-out) both; }
.v2-pulse-glow { animation: v2-pulseGlow 3s ease-in-out infinite; }

/* Stagger delays */
.v2-d1 { animation-delay: 0.05s; }
.v2-d2 { animation-delay: 0.1s; }
.v2-d3 { animation-delay: 0.15s; }
.v2-d4 { animation-delay: 0.2s; }
.v2-d5 { animation-delay: 0.25s; }
.v2-d6 { animation-delay: 0.3s; }
.v2-d7 { animation-delay: 0.35s; }
.v2-d8 { animation-delay: 0.4s; }

/* ---------- Gradient text ---------- */
.v2-gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, #7C6FEF 50%, #A5A6F6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Legacy compat */
.gradient-text {
  background: linear-gradient(135deg, #6C5CE7 0%, #7C6FEF 50%, #A5A6F6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Modal / Overlay ---------- */
.v2-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.v2-modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  max-height: 90vh;
  overflow: visible;
}

/* Preview modal nav arrows */
#preview-modal > button.absolute { display: none; }
@media (min-width: 640px) {
  #preview-modal > button.absolute { display: block; }
}

/* ---------- Utilities ---------- */
.v2-section-pad { padding: 24px; }
.v2-glass {
  background: rgba(18, 18, 25, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.glass { background: rgba(18, 18, 25, 0.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.06); }
.card-hover { transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.4); border-color: rgba(108, 92, 231, 0.3); }
.glow { box-shadow: 0 0 20px rgba(108, 92, 231, 0.15); }
.stat-card { background: linear-gradient(135deg, rgba(30,30,42,0.9) 0%, rgba(18,18,25,0.9) 100%); }

/* ---------- Peer-checked radio/checkbox ---------- */
.peer:checked ~ .peer-checked-card {
  border-color: var(--accent) !important;
  background: var(--accent-glow) !important;
}
.peer:checked ~ .peer-checked-indicator {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}
.peer:checked ~ .peer-checked-indicator svg {
  opacity: 1 !important;
}

/* ---------- Asset tab switcher ---------- */
.asset-tab {
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.asset-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.asset-tab.active {
  color: var(--accent) !important;
  border-color: var(--accent) !important;
  background: var(--accent-glow) !important;
}

/* ---------- Asset filter tabs ---------- */
.asset-filter {
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.asset-filter:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.asset-filter.active {
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* ---------- Asset card ---------- */
.asset-card { border: 1px solid var(--border); }
.asset-card:hover { border-color: var(--border-hover); }

/* ---------- Drive image selector ---------- */
.drive-img-item { border: 2px solid var(--border); }
.drive-img-item:hover:not(.imported) { border-color: var(--accent); }
.drive-img-item.selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.3);
}
.drive-img-item.imported {
  opacity: 0.4;
  border-color: rgba(255,255,255,0.05);
}

/* ---------- Time range selector ---------- */
.time-range-btn {
  background: var(--bg-3);
  color: var(--text-secondary);
}
.time-range-btn:hover {
  background: var(--bg-2);
  color: var(--text-primary);
}
.time-range-btn.active {
  background: var(--accent) !important;
  color: #fff !important;
}

/* Safari aspect-ratio fallback */
@supports not (aspect-ratio: 1 / 1) {
  .aspect-square { padding-bottom: 100%; position: relative; }
  .aspect-square > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
}
img { -webkit-transform: translateZ(0); }

/* ---------- Insight Tabs ---------- */
.insight-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.insight-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-display);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.insight-tab:hover {
  background: var(--bg-3);
  color: var(--text-primary);
}
.insight-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(108, 92, 231, 0.25);
}
.insight-tab svg { width: 16px; height: 16px; flex-shrink: 0; }
.insight-tab-count {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.5;
}
.insight-panel { animation: v2-fadeUp 0.3s var(--ease-out) both; }

.insight-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--accent);
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid rgba(108, 92, 231, 0.15);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.insight-cta:hover {
  background: rgba(108, 92, 231, 0.15);
  border-color: rgba(108, 92, 231, 0.3);
  color: var(--accent-hover);
}
.insight-cta svg { width: 12px; height: 12px; }

/* ---------- Mobile Sidebar ---------- */
.v2-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
}

@media (max-width: 768px) {
  .v2-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 50;
  }
  .v2-sidebar.open {
    transform: translateX(0);
  }
  .v2-sidebar-overlay.open {
    display: block;
  }
  .v2-mobile-toggle {
    display: flex !important;
  }
  .v2-section-pad { padding: 16px; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.75rem !important; }
  h2 { font-size: 1.375rem !important; }
  .insight-tabs { flex-wrap: wrap; }
  .insight-tab { flex: 1 1 calc(50% - 3px); min-width: calc(50% - 3px); font-size: 13px; padding: 10px 12px; }
}

/* ---------- Command Palette ---------- */
.v2-command-palette {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.v2-command-palette.open {
  display: flex;
}
.v2-command-palette-inner {
  width: 560px;
  max-width: 90vw;
  background: var(--bg-2);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.v2-command-palette-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  font-family: var(--font-display);
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
}
.v2-command-palette-input::placeholder {
  color: var(--text-muted);
}
