/* ===== NebulaDesk Official Website — Desktop-Matched Theme ===== */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  /* Exact tokens from internal/app/view.go & internal/graphview/canvas.go */
  --bg: #111318;
  --canvas: #0d1017;
  --surface: #191c24;
  --surface-hover: #232734;
  --surface-pressed: #2c3142;
  --border: #272b38;
  --border-strong: #353b4e;

  --text: #edf0f7;
  --text-secondary: #c0c8da;
  --muted: #8b95ab;
  --subtle: #64708a;

  --accent: #6366f1;
  --accent-hover: #7477f6;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --accent-border: rgba(99, 102, 241, 0.44);

  /* Syntax & Graph palette from internal/app/view.go & internal/graphview/engine.go */
  --indigo: #818cf8;
  --sky: #38bdf8;
  --emerald: #10b981;
  --emerald-light: #34d399;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --pink: #ec4899;
  --pink-light: #f472b6;
  --cyan: #38e8ff;
  --cyan-soft: #67e8f9;
  --violet: #a78bfa;

  --grad: linear-gradient(120deg, #818cf8 0%, #6366f1 42%, #38bdf8 100%);
  --nav-bg: rgba(25, 28, 36, 0.82);
  --nav-bg-scrolled: rgba(25, 28, 36, 0.94);
  --grid-line: rgba(148, 163, 184, 0.045);
  --glow-top: rgba(99, 102, 241, 0.16);
  --glow-side: rgba(56, 189, 248, 0.07);
  --shot-shadow: 0 0 0 1px rgba(17, 19, 24, 0.8), 0 28px 80px -20px rgba(0, 0, 0, 0.72), 0 20px 60px -24px rgba(99, 102, 241, 0.28);
  --card-shadow-hover: 0 14px 36px -16px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(99, 102, 241, 0.25);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

[data-theme="light"] {
  color-scheme: light;
  /* Exact Light Theme tokens from internal/app/view.go & internal/graphview/canvas.go */
  --bg: #ffffff;
  --canvas: #f8fafc;
  --surface: #f4f6f9;
  --surface-hover: #e9edf3;
  --surface-pressed: #dfe3ec;
  --border: #dfe3ec;
  --border-strong: #c8d0df;

  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #556277;
  --subtle: #78849a;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --accent-border: rgba(99, 102, 241, 0.36);

  /* Exact Light syntax tokens from internal/app/view.go */
  --indigo: #4f46e5;
  --sky: #0284c7;
  --emerald: #059669;
  --emerald-light: #059669;
  --amber: #d97706;
  --amber-light: #b45309;
  --pink: #db2777;
  --pink-light: #db2777;
  --cyan: #0891b2;
  --cyan-soft: #0284c7;
  --violet: #7c3aed;

  --grad: linear-gradient(120deg, #4f46e5 0%, #6366f1 48%, #0284c7 100%);
  --nav-bg: rgba(244, 246, 249, 0.84);
  --nav-bg-scrolled: rgba(244, 246, 249, 0.96);
  --grid-line: rgba(15, 23, 42, 0.045);
  --glow-top: rgba(99, 102, 241, 0.1);
  --glow-side: rgba(2, 132, 199, 0.06);
  --shot-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 24px 70px -20px rgba(15, 23, 42, 0.2), 0 12px 36px -18px rgba(99, 102, 241, 0.16);
  --card-shadow-hover: 0 12px 28px -14px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.22);
}

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

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.08em 0.38em;
  border-radius: 5px;
  color: var(--indigo);
  white-space: nowrap;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Graph Canvas Grid + Constellation Backdrop ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 12%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 12%, #000 30%, transparent 100%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(880px 460px at 50% -6%, var(--glow-top), transparent 64%),
    radial-gradient(640px 420px at 90% 24%, var(--glow-side), transparent 60%);
}

#constellation {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.65;
}

main, footer, header.nav {
  position: relative;
  z-index: 1;
}

/* ===== Top Toolbar (Desktop-Matched) ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s, border-color 0.2s;
}

.nav.scrolled {
  background: var(--nav-bg-scrolled);
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  height: 58px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.015em;
  flex-shrink: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(56, 232, 255, 0.35);
  box-shadow: 0 2px 10px -2px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}

.nav-links a {
  transition: color 0.16s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Desktop toolbar pill controls */
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.tool-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.tool-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Segmented Language Switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.lang-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 0.15s, color 0.15s;
}

.lang-opt:hover {
  color: var(--text);
}

.lang-opt.active {
  background: var(--accent-soft);
  color: var(--indigo);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

/* Smart browser language suggestion bar */
.lang-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 60;
  display: none;
  align-items: center;
  gap: 12px;
  max-width: 440px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--accent-border);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.55);
  font-size: 13px;
  color: var(--text-secondary);
}

.lang-banner.visible {
  display: flex;
}

.lang-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.lang-banner-btn {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  transition: background-color 0.15s;
}

.lang-banner-btn:hover {
  background: var(--accent-hover);
}

.lang-banner-close {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
}

.lang-banner-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: transform 0.16s, box-shadow 0.2s, border-color 0.16s, background-color 0.16s;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(99, 102, 241, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -6px rgba(99, 102, 241, 0.68), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* ===== Hero ===== */
.hero {
  padding: 128px 0 56px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.65);
}

.hero h1 {
  font-size: clamp(46px, 7.2vw, 76px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.kicker {
  font-size: clamp(18px, 2.3vw, 23px);
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 14px;
  letter-spacing: -0.015em;
}

.sub {
  max-width: 650px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
  position: relative;
  z-index: 20;
}

/* Split Direct-Download Button & Platform Popover */
.dl-split {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  border-radius: 8px;
}

.dl-split-main {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding-right: 18px;
}

.dl-split-toggle {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 0 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.dl-split-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform 0.16s ease;
}

.dl-split.open .dl-split-toggle svg {
  transform: rotate(180deg);
}

.dl-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 300px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 22px 50px -14px rgba(0, 0, 0, 0.65);
  padding: 6px;
  text-align: left;
  display: none;
  z-index: 40;
}

.dl-split.open .dl-menu {
  display: block;
}

.dl-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.dl-menu-ver {
  font-family: var(--mono);
  color: var(--indigo);
}

.dl-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background-color 0.14s, color 0.14s;
}

.dl-menu-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.dl-menu-item.is-detected {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.dl-menu-size {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  flex-shrink: 0;
}

.dl-menu-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.dl-menu-foot a:hover {
  color: var(--indigo);
}

.hero-dl-meta {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-height: 19px;
}

/* Desktop Tag Legend Pills */
.hero-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}

.tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-indigo { background: #6366f1; }
.dot-emerald { background: #10b981; }
.dot-sky { background: #38bdf8; }
.dot-pink { background: #ec4899; }
.dot-amber { background: #f59e0b; }

/* Desktop App Preview Window */
.hero-shot {
  margin: 48px auto 0;
  max-width: 1020px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #111318;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shot-shadow);
  text-align: left;
}

.shot-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #191c24;
  border-bottom: 1px solid #272b38;
  padding: 9px 14px;
}

.shot-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.shot-bar i:nth-child(1) { background: #ff5f57; }
.shot-bar i:nth-child(2) { background: #febc2e; }
.shot-bar i:nth-child(3) { background: #28c840; }

.shot-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #8b95ab;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-status {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: #34d399;
  white-space: nowrap;
}

.hero-shot img {
  width: 100%;
  height: auto;
}

/* ===== Metrics Strip ===== */
.metrics {
  padding: 20px 0 36px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.metric-item {
  padding: 20px 22px;
  border-right: 1px solid var(--border);
  text-align: left;
}

.metric-item:last-child {
  border-right: none;
}

.metric-val {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.metric-val.accent { color: var(--indigo); }
.metric-val.emerald { color: var(--emerald-light); }
.metric-val.sky { color: var(--sky); }

.metric-lbl {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Sections ===== */
.section {
  padding: 84px 0;
}

.section-alt {
  background: var(--canvas);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--indigo);
  margin-bottom: 10px;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-sub {
  max-width: 680px;
  color: var(--muted);
  font-size: 15.5px;
  margin-bottom: 36px;
}

.section-head {
  margin-bottom: 36px;
}

.section-head h2 {
  margin-bottom: 10px;
}

.section-head .section-sub {
  margin-bottom: 0;
}

/* ===== Grids & Cards ===== */
.grid {
  display: grid;
  gap: 16px;
}

.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: var(--card-shadow-hover);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-ico {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--indigo);
}

.card-ico.emerald {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--emerald-light);
}

.card-ico.sky {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--sky);
}

.card-ico.amber {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--amber-light);
}

.card-ico.pink {
  background: rgba(236, 72, 153, 0.14);
  border-color: rgba(236, 72, 153, 0.35);
  color: var(--pink-light);
}

.card-ico svg {
  width: 19px;
  height: 19px;
}

.card-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}

.card h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.card p {
  font-size: 13.8px;
  color: var(--muted);
  line-height: 1.65;
}

/* ===== Editor + AI Dual-Pane Spotlight (Desktop IDE Style) ===== */
.workbench {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow-hover);
}

.wb-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wb-editor {
  border-right: 1px solid var(--border);
}

.wb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.wb-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
}

.wb-run {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
}

.wb-code {
  flex: 1;
  padding: 18px 16px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  overflow-x: auto;
}

.code-line {
  display: flex;
  gap: 14px;
  white-space: pre;
}

.ln {
  width: 20px;
  text-align: right;
  color: var(--subtle);
  user-select: none;
  flex-shrink: 0;
}

/* Exact syntax tokens from internal/app/view.go:355-365 */
.tok-kw { color: var(--indigo); font-weight: 600; }
.tok-fn { color: var(--sky); }
.tok-type { color: var(--emerald-light); }
.tok-var { color: var(--amber-light); }
.tok-prop { color: var(--pink-light); }
.tok-comment { color: var(--subtle); font-style: italic; }

.wb-autocomplete {
  margin: 0 16px 14px 48px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11.5px;
  max-width: 340px;
}

.ac-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  color: var(--text-secondary);
}

.ac-item.active {
  background: var(--accent-soft);
  color: var(--text);
}

.ac-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(16, 185, 129, 0.16);
  color: var(--emerald-light);
}

.ac-badge.edge {
  background: rgba(56, 189, 248, 0.16);
  color: var(--sky);
}

.ac-meta {
  margin-left: auto;
  color: var(--subtle);
  font-size: 10.5px;
}

.wb-foot {
  padding: 8px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* AI Assistant Pane */
.wb-ai {
  background: var(--surface);
}

.ai-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  color: var(--text);
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.ai-readonly {
  font-size: 11px;
  color: var(--emerald-light);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ai-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.ai-prompt-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
}

.ai-prompt-lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

/* Trace steps mirroring internal/app/ai_panel.go left border accent bars */
.ai-trace {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trace-step {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg);
  border-radius: 0 5px 5px 0;
  border-left: 2px solid var(--sky);
  font-size: 12.2px;
  color: var(--text-secondary);
}

.trace-step.ok {
  border-left-color: var(--emerald);
}

.trace-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--sky);
  flex-shrink: 0;
}

.trace-step.ok .trace-pill {
  background: rgba(16, 185, 129, 0.16);
  color: var(--emerald-light);
}

.ai-result-bar {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.ai-verified {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--emerald-light);
}

.ai-actions {
  display: flex;
  gap: 6px;
}

.mini-btn {
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.mini-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ai-providers {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Keyboard Shortcuts ===== */
.shortcut-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.shortcut-action {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.shortcut-keys {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--indigo);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== Download Section ===== */
.dl-card {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.dl-card.is-detected {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.dl-card h3 {
  font-size: 18px;
  margin-top: 2px;
}

.dl-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rec-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.36);
  color: var(--emerald-light);
}

.dl-btn-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dl-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.14s;
}

.dl-item-btn:hover {
  background: var(--surface-pressed);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.dl-item-btn.is-detected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.dl-item-btn.is-detected:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.dl-item-size {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}

.dl-item-btn.is-detected .dl-item-size {
  color: rgba(255, 255, 255, 0.82);
}

.dl-linux-groups {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dl-linux-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dl-arch-lbl {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.dl-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dl-pkg-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  transition: background-color 0.15s, border-color 0.15s, transform 0.14s;
}

.dl-pkg-pill span {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--muted);
}

.dl-pkg-pill:hover {
  background: var(--surface-pressed);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.dl-pkg-pill.is-detected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.dl-pkg-pill.is-detected span {
  color: rgba(255, 255, 255, 0.82);
}

.dl-meta-bar {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

.dl-meta-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
}

.dl-meta-links a {
  color: var(--indigo);
}

.dl-meta-links a:hover {
  text-decoration: underline;
}

.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 22px;
}

.note-box {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.note-box h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.note-box p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.68;
  margin-bottom: 12px;
}

.note-box em {
  color: var(--text-secondary);
  font-style: normal;
  font-weight: 600;
}

.cmd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.cmd-row code {
  flex: 1;
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  overflow-x: auto;
}

.copy-btn {
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.copy-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--emerald-light);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14.5px;
}

.footer-brand img {
  border-radius: 6px;
}

.footer-tag {
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-sep {
  color: var(--border-strong);
}

/* ===== Scroll Reveal ===== */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s cubic-bezier(0.2, 0.65, 0.3, 1), transform 0.55s cubic-bezier(0.2, 0.65, 0.3, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.noanim .reveal {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== 404 Page ===== */
.page-404 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
}

.card-404 {
  max-width: 480px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
}

.code-404 {
  font-family: var(--mono);
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 8px;
}

.card-404 h1 {
  font-size: 22px;
  margin-bottom: 10px;
}

.card-404 p {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 24px;
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-item:nth-child(2) { border-right: none; }
  .metric-item:nth-child(1),
  .metric-item:nth-child(2) { border-bottom: 1px solid var(--border); }
  .workbench { grid-template-columns: 1fr; }
  .wb-editor { border-right: none; border-bottom: 1px solid var(--border); }
  .notes-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-inner { gap: 10px; padding: 0 16px; }
  .container { padding: 0 16px; }
  .tool-btn .btn-text { display: none; }
  .hero { padding: 104px 0 36px; }
  .section { padding: 60px 0; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-item { border-right: none; border-bottom: 1px solid var(--border); }
  .metric-item:last-child { border-bottom: none; }
  .shot-status { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-links { margin-left: 0; flex-wrap: wrap; }
  .lang-banner { left: 16px; right: 16px; bottom: 16px; flex-direction: column; align-items: flex-start; }
  .dl-menu { left: 50%; transform: translateX(-50%); min-width: min(300px, calc(100vw - 32px)); }
}
