/* ============================================================
   AIMFORGE · base design system
   ============================================================ */
@font-face { font-family: 'Barlow Condensed'; src: url('../assets/fonts/barlow-condensed-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../assets/fonts/barlow-condensed-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../assets/fonts/barlow-condensed-800.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('../assets/fonts/space-grotesk-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('../assets/fonts/space-grotesk-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('../assets/fonts/space-grotesk-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('../assets/fonts/space-grotesk-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../assets/fonts/jetbrains-mono-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../assets/fonts/jetbrains-mono-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../assets/fonts/jetbrains-mono-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #07090b;
  --bg-deep: #050708;
  --bg-raised: #0b0f12;
  --panel: rgba(15, 20, 23, 0.82);
  --panel-solid: #0e1316;
  --panel-soft: rgba(255, 255, 255, 0.028);
  --line: rgba(231, 243, 236, 0.08);
  --line-strong: rgba(231, 243, 236, 0.16);
  --text: #eef2e9;
  --text-dim: #b6c0b8;
  --muted: #758079;
  --faint: #4b5550;
  --lime: #d8ff4f;
  --lime-rgb: 216, 255, 79;
  --lime-dim: #9db83a;
  --cyan: #6fe8ee;
  --cyan-rgb: 111, 232, 238;
  --coral: #ff806b;
  --coral-rgb: 255, 128, 107;
  --violet: #b79cff;
  --violet-rgb: 183, 156, 255;
  --danger: #ff5d64;
  --ok: #8dedb0;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'PingFang SC', sans-serif;
  --font-body: 'Space Grotesk', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --sidebar-w: 232px;
  --topbar-h: 58px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --z-sidebar: 60;
  --z-modal: 300;
  --z-game: 500;
  --z-toast: 900;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 46% 38% at 82% -8%, rgba(var(--lime-rgb), 0.07), transparent 68%),
    radial-gradient(ellipse 44% 52% at -6% 88%, rgba(var(--cyan-rgb), 0.045), transparent 70%),
    linear-gradient(180deg, #080b0d 0%, #060809 100%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

::selection { background: rgba(var(--lime-rgb), 0.28); color: #fff; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #232b28; border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #34403b; }

button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mono { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.accent { color: var(--lime); }
.muted { color: var(--muted); }
.no-scroll { overflow: hidden; }

/* ---------- app shell ---------- */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100dvh;
  min-height: 560px;
}
.sidebar {
  position: relative;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 24px 16px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 14, 16, 0.92), rgba(6, 9, 11, 0.86));
  backdrop-filter: blur(22px);
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: -1px; width: 1px; height: 150px;
  background: linear-gradient(180deg, rgba(var(--lime-rgb), 0.6), transparent);
  opacity: 0.6;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 0;
  margin-bottom: 42px;
  border-radius: var(--radius-sm);
}
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  flex: none;
  color: var(--lime);
  border: 1px solid rgba(var(--lime-rgb), 0.32);
  background: rgba(var(--lime-rgb), 0.06);
  border-radius: 10px;
  box-shadow: inset 0 0 18px rgba(var(--lime-rgb), 0.06), 0 0 24px rgba(var(--lime-rgb), 0.06);
}
.brand-mark::before, .brand-mark::after {
  content: '';
  position: absolute;
  width: 3px; height: 3px;
  background: var(--lime);
  opacity: 0.7;
}
.brand-mark::before { left: -2px; top: 6px; }
.brand-mark::after { right: -2px; bottom: 6px; }
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-word strong {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.055em;
  color: var(--text);
}
.brand-word strong em { font-style: normal; color: var(--lime); }
.brand-word span {
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
}
.sidebar-section-label {
  padding: 0 12px;
  margin-bottom: 10px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
}
.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  text-align: left;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: 0.8; }
.nav-label { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.nav-meta {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.032); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(var(--lime-rgb), 0.09), rgba(var(--lime-rgb), 0.015));
  border-color: rgba(var(--lime-rgb), 0.12);
}
.nav-item.active svg { color: var(--lime); opacity: 1; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -1px; top: 12px; bottom: 12px; width: 2px;
  border-radius: 4px;
  background: var(--lime);
  box-shadow: 0 0 12px rgba(var(--lime-rgb), 0.7);
}
.sidebar-spacer { flex: 1; min-height: 24px; }
.sidebar-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
}
.sidebar-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 42px; height: 42px;
  background: linear-gradient(135deg, transparent 48%, rgba(var(--lime-rgb), 0.12) 49%, transparent 70%);
}
.sidebar-card-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.12em; }
.sidebar-card-label i { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px var(--lime); animation: pulse-dot 2.4s infinite; }
.sidebar-card-value { margin: 9px 0 2px; font-family: var(--font-display); font-size: 31px; font-weight: 700; line-height: 1; letter-spacing: 0.015em; }
.sidebar-card-sub { color: var(--faint); font-size: 10px; }
.sidebar-actions { display: flex; gap: 6px; margin-bottom: 12px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255,255,255,0.018);
  transition: 0.2s var(--ease);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,0.05); }
.operator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,0.017);
}
.operator-avatar {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  flex: none;
  border-radius: 8px;
  background: rgba(var(--lime-rgb), 0.12);
  color: var(--lime);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.operator-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.operator-text b { font-size: 11px; font-weight: 600; }
.operator-text span { color: var(--faint); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.11em; margin-top: 3px; }
.operator .status-dot { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(141, 237, 176, 0.7); }

.workspace {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: var(--topbar-h);
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 11, 0.55);
  backdrop-filter: blur(18px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 13px; min-width: 0; }
.topbar-left { color: var(--muted); }
.topbar-left .mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sep { width: 1px; height: 13px; background: var(--line-strong); }
.crumb { color: var(--text-dim); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; white-space: nowrap; }
.system-pill {
  display: flex; align-items: center; gap: 7px;
  height: 25px; padding: 0 9px;
  border: 1px solid rgba(var(--lime-rgb), 0.12);
  border-radius: 20px;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.09em;
  background: rgba(var(--lime-rgb), 0.035);
}
.system-pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 7px var(--lime); animation: pulse-dot 2.4s infinite; }
.topbar-btn {
  display: flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 11px;
  transition: 0.2s var(--ease);
}
.topbar-btn:hover { border-color: var(--line-strong); color: var(--text); }
.topbar-btn svg { width: 13px; height: 13px; }
.view {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 30px clamp(22px, 3vw, 46px) 48px;
  scroll-behavior: smooth;
}
.view-inner { width: 100%; max-width: 1440px; margin: 0 auto; }
.app-footer {
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 32px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  background: rgba(5, 7, 8, 0.55);
}
.app-footer b { color: var(--muted); font-weight: 400; }

/* ---------- common UI ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}
.eyebrow::before { content: ''; width: 18px; height: 1px; background: currentColor; opacity: 0.7; }
.eyebrow.plain::before { display: none; }
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px) scale(0.995); }
.btn-primary {
  background: var(--lime);
  color: #111608;
  box-shadow: 0 0 0 1px rgba(var(--lime-rgb), 0.25), 0 10px 28px -12px rgba(var(--lime-rgb), 0.5);
}
.btn-primary:hover { background: #e4ff80; box-shadow: 0 0 0 1px rgba(var(--lime-rgb), 0.5), 0 14px 38px -14px rgba(var(--lime-rgb), 0.7); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-strong); background: rgba(255,255,255,0.02); color: var(--text-dim); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); color: var(--text); transform: translateY(-1px); }
.btn-quiet { padding: 0 12px; min-height: 36px; color: var(--muted); font-size: 11px; }
.btn-quiet:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 11px; border-radius: 7px; }
.btn-lg { min-height: 54px; padding: 0 27px; font-size: 13px; border-radius: 11px; }
.btn .btn-arrow {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.14);
  transition: transform 0.25s var(--ease);
}
.btn-primary:hover .btn-arrow { transform: translateX(2px); }
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, rgba(255,255,255,0.032), rgba(255,255,255,0.008) 70%), var(--panel);
  backdrop-filter: blur(14px);
}
.card-hover { transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease); }
.card-hover:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip.is-accent { color: var(--lime); border-color: rgba(var(--lime-rgb), 0.22); background: rgba(var(--lime-rgb), 0.055); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-family: var(--font-display); font-size: 27px; font-weight: 700; letter-spacing: 0.015em; line-height: 1; }
.section-head p { margin-top: 7px; color: var(--muted); font-size: 11px; }
.section-head .section-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.09em; transition: color 0.2s; }
.section-head .section-link:hover { color: var(--lime); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(40px, 4.2vw, 58px); font-weight: 700; line-height: 0.92; letter-spacing: 0.005em; margin-top: 12px; }
.page-head .page-head-sub { margin-top: 12px; max-width: 460px; color: var(--muted); font-size: 12px; }
.page-enter { animation: page-in 0.5s var(--ease) both; }
.divider { height: 1px; background: var(--line); }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 58px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
}
.empty-state h3 { color: var(--text); font-family: var(--font-display); font-size: 24px; letter-spacing: 0.02em; }
.empty-state p { max-width: 330px; font-size: 12px; line-height: 1.65; }
.empty-state-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 12px; color: var(--lime); background: rgba(var(--lime-rgb), 0.04); }
.empty-state-icon svg { width: 21px; height: 21px; }

/* ---------- modal / toast ---------- */
.modal-layer { position: fixed; inset: 0; z-index: var(--z-modal); display: none; place-items: center; padding: 24px; }
.modal-layer.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 4, 5, 0.74); backdrop-filter: blur(10px); animation: fade-in 0.25s ease both; }
.modal {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 18px;
  background: linear-gradient(160deg, #101518, #090c0e 70%);
  box-shadow: 0 30px 100px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: modal-in 0.35s var(--ease) both;
}
.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 30px; right: 30px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--lime-rgb), 0.5), transparent);
}
.modal-wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 26px 26px 0; }
.modal-head h2 { font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: 0.01em; }
.modal-head p { margin-top: 9px; color: var(--muted); font-size: 12px; }
.modal-close { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); transition: 0.2s; }
.modal-close:hover { color: var(--text); border-color: var(--line-strong); }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { padding: 22px 26px 26px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.toast-layer { position: fixed; z-index: var(--z-toast); right: 24px; bottom: 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: rgba(14, 19, 22, 0.96);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  font-size: 11px;
  animation: toast-in 0.3s var(--ease) both;
}
.toast.out { animation: toast-out 0.25s ease both; }
.toast::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 7px var(--lime); }
.toast.error::before { background: var(--danger); box-shadow: 0 0 7px var(--danger); }

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-dim); font-size: 11px; }
.field-label output { color: var(--lime); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; }
.field-hint { color: var(--faint); font-size: 10px; line-height: 1.5; }
input[type='range'] { width: 100%; height: 18px; margin: 0; background: transparent; appearance: none; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--lime) var(--fill, 50%), rgba(255,255,255,0.12) var(--fill, 50%)); }
input[type='range']::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -5px; border: 2px solid #0a0d0f; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 1px rgba(var(--lime-rgb), 0.45), 0 0 12px rgba(var(--lime-rgb), 0.3); }
input[type='range']::-moz-range-track { height: 2px; background: rgba(255,255,255,0.12); }
input[type='range']::-moz-range-progress { height: 2px; background: var(--lime); }
input[type='range']::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #0a0d0f; border-radius: 50%; background: var(--lime); }
.seg { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.02); }
.seg button { min-width: 42px; height: 28px; padding: 0 11px; border-radius: 5px; color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em; transition: 0.2s; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'], .seg button.active { color: #141a08; background: var(--lime); font-weight: 600; }
.switch { position: relative; width: 38px; height: 21px; flex: none; border: 1px solid var(--line-strong); border-radius: 20px; background: rgba(255,255,255,0.04); transition: 0.2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--muted); transition: 0.22s var(--ease); }
.switch[aria-pressed='true'] { background: rgba(var(--lime-rgb), 0.15); border-color: rgba(var(--lime-rgb), 0.45); }
.switch[aria-pressed='true']::after { left: 20px; background: var(--lime); box-shadow: 0 0 9px rgba(var(--lime-rgb), 0.45); }
.swatches { display: flex; gap: 8px; }
.swatch { width: 24px; height: 24px; border: 2px solid transparent; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3); }
.swatch[aria-pressed='true'] { border-color: var(--text); }

/* ---------- game host ---------- */
.game-root { position: fixed; inset: 0; z-index: var(--z-game); background: #050808; }
.game-root[hidden] { display: none; }

/* ---------- animations ---------- */
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(5px); } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }

@media (max-width: 1200px) {
  :root { --sidebar-w: 208px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .view { padding-left: 28px; padding-right: 28px; }
  .topbar { padding: 0 22px; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .app-shell { display: block; height: auto; min-height: 100dvh; padding-bottom: 62px; }
  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    flex-direction: row;
    align-items: center;
    height: 62px;
    padding: 0 8px;
    border-right: 0;
    border-top: 1px solid var(--line);
    background: rgba(7, 10, 11, 0.95);
    z-index: var(--z-sidebar);
  }
  .sidebar::after, .brand, .sidebar-section-label, .sidebar-spacer, .sidebar-card, .sidebar-actions, .operator { display: none; }
  .nav { flex: 1; flex-direction: row; gap: 4px; }
  .nav-item { flex: 1; flex-direction: column; justify-content: center; gap: 3px; min-height: 50px; padding: 0 4px; border-radius: 8px; }
  .nav-item svg { width: 17px; height: 17px; }
  .nav-label { font-size: 9px; }
  .nav-meta { display: none; }
  .nav-item.active::before { left: 30%; right: 30%; top: auto; bottom: 0; width: auto; height: 2px; }
  .workspace { min-height: calc(100dvh - 62px); }
  .view { overflow: visible; padding: 22px 20px 32px; }
  .topbar { padding: 0 18px; }
  .topbar-left .mono { display: none; }
  .topbar-sep { display: none; }
  .app-footer { display: none; }
}
@media (max-width: 560px) {
  .view { padding: 18px 14px 28px; }
  .topbar { padding: 0 14px; }
  .topbar .system-pill { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-head h1 { font-size: 42px; }
  .modal { border-radius: 14px; }
  .modal-head { padding: 22px 20px 0; }
  .modal-body { padding: 18px 20px 22px; }
  .toast-layer { right: 14px; bottom: 76px; left: 14px; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* mobile-only topbar brand */
.topbar-brand { display: none; align-items: center; gap: 7px; color: var(--text); font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: 0.06em; line-height: 1; }
.topbar-brand em { color: var(--lime); font-style: normal; }
.topbar-brand-mark { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid rgba(var(--lime-rgb), 0.3); border-radius: 6px; color: var(--lime); background: rgba(var(--lime-rgb), 0.05); }
@media (max-width: 900px) {
  .topbar-brand { display: flex; }
  .topbar-left .crumb { display: none; }
}
.topbar-brand-word { white-space: nowrap; }
