/* ============================================
   awedot demo — simulated macOS desktop, 4 pill scenes
   UI mirrors awedot/src (FloatingBall, Panel, rows, constants).
   ============================================ */

#demo {
  position: relative;
  z-index: 10;
  padding: 56px 24px 88px;
}

/* ───────────────────────── macOS desktop "screen" ───────────────────────── */
#demo-stage {
  position: relative;
  margin: 0 auto;
  max-width: 1000px;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  /* layered Sonoma-ish wallpaper */
  background:
    radial-gradient(120% 85% at 50% -12%, rgba(96, 116, 214, 0.30), transparent 58%),
    radial-gradient(95% 95% at 84% 112%, rgba(190, 92, 168, 0.20), transparent 55%),
    radial-gradient(70% 70% at 12% 8%, rgba(72, 178, 196, 0.16), transparent 60%),
    linear-gradient(160deg, #1b1e30 0%, #11121c 55%, #0a0a11 100%);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.85),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
/* soft god-ray + vignette */
#demo-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.04) 46%, transparent 62%),
    radial-gradient(120% 80% at 50% 120%, rgba(0, 0, 0, 0.45), transparent 55%);
  pointer-events: none;
  z-index: 1;
}
/* grain */
#demo-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── menubar ── */
.mac-menubar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  background: rgba(8, 8, 12, 0.42);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 6;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}
.mac-menubar .apple { font-size: 13px; opacity: 0.92; }
.mac-menubar .app-name { font-weight: 700; }
.mac-menubar .menus { display: flex; gap: 15px; color: rgba(255, 255, 255, 0.62); font-weight: 400; }
.mac-menubar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, 0.78); }
.mac-menubar .right svg { width: 15px; height: 15px; display: block; }
.mac-menubar .clock { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
@media (max-width: 680px) { .mac-menubar .menus { display: none; } }

/* ── dock ── */
.mac-dock {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  z-index: 3;
}
.mac-dock .di {
  width: 34px; height: 34px;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 5px rgba(0, 0, 0, 0.3);
}
.mac-dock .di.awe {
  background: radial-gradient(circle at 50% 42%, #2a2a38 0%, #15151e 78%);
  display: grid; place-items: center;
  position: relative;
}
.mac-dock .di.awe::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #6EA7FF; box-shadow: 0 0 8px #6EA7FF;
}
.mac-dock .di.term    { background: linear-gradient(160deg, #2b2b2b, #0a0a0a); position: relative; }
.mac-dock .di.term::after { content: ">_"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 11px 'JetBrains Mono', monospace; color: #4ade80; }
.mac-dock .di.lines   { background: linear-gradient(160deg, #1f1f2a, #14141c); position: relative; }
.mac-dock .di.lines::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 16px; height: 2px; border-radius: 2px;
  background: rgba(241, 234, 217, 0.7);
  box-shadow: 0 -5px 0 rgba(241, 234, 217, 0.7), 0 5px 0 rgba(241, 234, 217, 0.7);
}
.mac-dock .di.ring    { background: linear-gradient(160deg, #1f1f2a, #14141c); position: relative; }
.mac-dock .di.ring::before {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid rgba(241, 234, 217, 0.55);
}
@media (max-width: 680px) { .mac-dock { display: none; } }

/* ───────────────────────── Terminal windows ───────────────────────── */
.tw {
  position: absolute;
  width: 264px;
  background: rgba(16, 16, 20, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  z-index: 4;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.4s ease, box-shadow 0.4s ease;
}
.tw.visible { opacity: 1; transform: translateY(0) scale(1); }
.tw.dim { opacity: 0.32; }
.tw.highlighted {
  border-color: rgba(110, 167, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(110, 167, 255, 0.5),
              0 0 26px rgba(110, 167, 255, 0.28),
              0 18px 44px rgba(0, 0, 0, 0.55);
}
.tw .tw-bar {
  display: flex; align-items: center; height: 26px; padding: 0 10px; gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.tw .tw-bar .td { width: 11px; height: 11px; border-radius: 50%; }
.tw .tw-bar .td-r { background: #ff5f57; }
.tw .tw-bar .td-y { background: #febc2e; }
.tw .tw-bar .td-g { background: #28c840; }
.tw .tw-bar .tw-title {
  flex: 1; text-align: center; padding-right: 33px;
  font: 500 10.5px 'JetBrains Mono', monospace; color: #8b8b94; letter-spacing: 0.01em;
}
.tw .tw-body {
  padding: 10px 12px 12px;
  font: 400 10.5px/1.55 'JetBrains Mono', monospace;
  color: #a7a7b0; min-height: 104px;
}
.tw .tw-body .ln { display: block; }
.tw .tw-body .p { color: #6EA7FF; }
.tw .tw-body .ok { color: #2EC46E; }
.tw .tw-body .warn { color: #F59E0B; }
.tw .tw-body .err { color: #E63D38; }
.tw .tw-body .meta { color: #5b5b63; font-size: 9.5px; }
.tw .tw-body .indent { padding-left: 8px; }
.tw-status {
  display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px;
  font: 500 9.5px 'JetBrains Mono', monospace; color: #71717a; letter-spacing: 0.04em;
}
.tw-status .sd { width: 6px; height: 6px; border-radius: 50%; }
.tw-status .sd.active  { background: #6EA7FF; box-shadow: 0 0 6px #6EA7FF; }
.tw-status .sd.idle    { background: rgba(241, 234, 217, 0.5); }
.tw-status .sd.success { background: #2EC46E; box-shadow: 0 0 6px #2EC46E; }
.tw-status .sd.waiting { background: #F59E0B; box-shadow: 0 0 6px #F59E0B; }

.profile-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 9px;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(217, 119, 6, 0.14);
  border: 1px solid rgba(217, 119, 6, 0.4);
  font: 600 9.5px 'JetBrains Mono', monospace; color: #f0a23c; letter-spacing: 0.02em;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.profile-badge.visible { opacity: 1; transform: translateY(0); }
.profile-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: #F59E0B; box-shadow: 0 0 6px #F59E0B; }

/* ───────────────────────── Floating ball (real glass sphere) ───────────────────────── */
/* 72px window; 58px sphere; 5 numbered glowing dots in Olympic-rings layout. */
.fb {
  position: absolute;
  width: 72px; height: 72px;
  z-index: 10;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fb.visible { opacity: 1; transform: scale(1); }
.fb .fb-sphere {
  position: absolute; width: 58px; height: 58px; top: 7px; left: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,30,42,0.78) 0%, rgba(22,22,32,0.6) 70%, rgba(16,16,22,0.45) 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.06), 0 10px 30px rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.fb .fbd {
  position: absolute; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}
.fb .fbd .num {
  font: 700 13px 'JetBrains Mono', monospace; color: #f1ead9; line-height: 1;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}
.fb .fbd.pulse { animation: dotPulse 1.9s ease-in-out infinite; }
@keyframes dotPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.1); }
}
/* large "atlas" mode for the Five-States scene */
.fb.large {
  transform: scale(1.95);
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.32, 0.72, 0, 1), left 0.5s ease, top 0.5s ease, right 0.5s ease, bottom 0.5s ease;
}
.fb.large.visible { transform: scale(1.95); }

/* ───────────────────────── Quick-Jump toast (NotificationToast.tsx) ───────────────────────── */
.toast {
  position: absolute;
  right: 110px; bottom: 180px;
  width: 280px;
  padding: 14px 16px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 14;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  overflow: hidden;
}
.toast.visible { opacity: 1; transform: translateX(0); }
.toast.collapsing { opacity: 0; transform: translateX(30px); }
.toast-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.toast-title {
  font: 600 12px 'Inter', sans-serif;
  color: rgba(241, 234, 217, 0.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast-body { padding-left: 16px; margin-bottom: 10px; }
.toast-user {
  font: 400 11px 'Inter', sans-serif;
  color: rgba(241, 234, 217, 0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast-ai {
  font: 400 11px 'Inter', sans-serif;
  color: rgba(241, 234, 217, 0.4);
  padding-left: 6px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast-actions { display: flex; gap: 8px; padding-left: 16px; }
.toast-jump, .toast-dismiss {
  font: 500 10px 'Inter', sans-serif;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.toast-jump { background: transparent; border: 1px solid; }
.toast-dismiss {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(241, 234, 217, 0.35);
}
.toast-countdown {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px; width: 100%;
  border-radius: 0 0 12px 12px;
  transform-origin: left;
  transform: scaleX(0);
}
.toast-countdown.running { animation: toast-countdown 5s linear forwards; }
@keyframes toast-countdown {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ───────────────────────── Expanded panel (real Panel) ───────────────────────── */
.ep {
  position: absolute;
  width: 330px; height: 432px;
  max-height: calc(100% - 56px);
  display: flex; flex-direction: column;
  background: #0d0d0f;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 20px 56px rgba(0,0,0,0.7), 0 0 60px rgba(110,167,255,0.04);
  z-index: 14;
  opacity: 0;
  transform: scale(0.2) translateY(8px);
  transform-origin: bottom right;
  transition: opacity 0.42s cubic-bezier(0.32, 0.72, 0, 1), transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}
.ep.visible { opacity: 1; transform: scale(1) translateY(0); }

.ep-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 40px; padding: 0 14px; flex: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.ep-head .name { font: 600 13px 'Inter', sans-serif; color: rgba(241,234,217,0.9); }
.ep-head .tools { display: flex; align-items: center; gap: 5px; }
.ep-head .tools button {
  width: 20px; height: 20px; border-radius: 999px; border: none; background: transparent;
  color: rgba(241,234,217,0.45); display: grid; place-items: center; cursor: default;
  transition: color 0.2s ease, background 0.2s ease;
}
.ep-head .tools button svg { width: 12px; height: 12px; }
.ep-head .tools button:hover { color: rgba(241,234,217,0.9); background: rgba(255,255,255,0.08); }

.ep-tabs { display: flex; align-items: center; height: 36px; padding: 0 12px; gap: 4px; flex: none; }
.ep-tab {
  position: relative; flex: 1; height: 100%; border: none; background: transparent; cursor: default;
  font: 500 11px 'Inter', sans-serif; color: rgba(241,234,217,0.25);
  border-radius: 8px 8px 0 0; transition: color 0.2s ease, background 0.2s ease, font-weight 0.2s ease;
}
.ep-tab.active { color: rgba(241,234,217,0.9); font-weight: 600; background: rgba(255,255,255,0.06); }
.ep-tab.active::after {
  content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 2px; border-radius: 999px;
  background: rgba(241, 234, 217, 0.5);
}

.ep-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ep-view[hidden] { display: none; }

.ep-search { padding: 8px 16px 4px; position: relative; flex: none; }
.ep-search .box {
  display: flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 10px; border-radius: 8px;
  background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.08);
}
.ep-search .box svg { width: 12px; height: 12px; color: rgba(241,234,217,0.3); flex: none; }
.ep-search .q { font: 400 11px 'JetBrains Mono', monospace; color: #e7e1d4; }
.ep-search .q.empty { color: rgba(241,234,217,0.25); }
.ep-search .q .car { color: #6EA7FF; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.ep-cats { display: flex; gap: 6px; padding: 4px 16px 2px; flex: none; flex-wrap: wrap; }
.ep-cat {
  font: 500 10px 'Inter', sans-serif; padding: 3px 9px; border-radius: 999px;
  color: rgba(241,234,217,0.45); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
}
.ep-cat.on { color: #0d0d0f; background: rgba(241,234,217,0.85); border-color: transparent; font-weight: 600; }

.ep-summary { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px 4px; flex: none; }
.ep-pill { font: 500 10px 'JetBrains Mono', monospace; padding: 2px 8px; border-radius: 999px; }

.ep-list { flex: 1; overflow: hidden; padding: 6px 12px 10px; display: flex; flex-direction: column; gap: 6px; }

/* session / bookmark rows — status-colored left border (real app) */
.srow {
  border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--sc, rgba(241,234,217,0.35));
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
}
.srow.fade-out { opacity: 0; transform: translateY(-4px); pointer-events: none; }
.srow .srow-btn { padding: 8px 11px; display: block; }
.srow .srow-top { display: flex; align-items: center; gap: 7px; }
.srow .prov {
  flex: none; font: 600 9px 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 1.5px 6px; border-radius: 999px;
  color: var(--pc); border: 1px solid color-mix(in srgb, var(--pc) 38%, transparent);
  background: color-mix(in srgb, var(--pc) 10%, transparent);
}
.srow .srow-title { flex: 1; min-width: 0; font: 600 12px 'Inter', sans-serif; color: rgba(241,234,217,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .srow-time { flex: none; font: 400 9px 'JetBrains Mono', monospace; color: rgba(241,234,217,0.25); }
.srow .srow-sub { margin-top: 3px; font: 400 10px 'JetBrains Mono', monospace; color: rgba(241,234,217,0.38); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .cat { font: 500 9px 'Inter', sans-serif; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,0.04); color: rgba(241,234,217,0.3); }

/* hover/active action bar on a row */
.srow .acts {
  display: flex; border-top: 1px solid rgba(255,255,255,0.04);
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
}
.srow.show-acts .acts { max-height: 40px; opacity: 1; }
.srow .acts button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 0; border: none; background: transparent; cursor: default;
  font: 500 10px 'Inter', sans-serif;
}
.srow .acts button svg { width: 12px; height: 12px; }
.srow .acts .jump { color: #6EA7FF; }
.srow .acts .save { color: rgba(241,234,217,0.45); }
.srow .acts .save.done { color: #6FB982; }
.srow .acts .resume { color: #6FB982; }
.srow .acts .edit { color: rgba(241,234,217,0.45); }
.srow .acts .del { color: rgba(239,68,68,0.6); }

/* save-as-bookmark modal (mirrors BookmarkConfirmModal.tsx) */
.bm-modal {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.28s ease;
}
.bm-modal.visible { opacity: 1; }
.bm-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.bm-modal-box {
  position: relative; width: 248px; padding: 16px;
  background: rgba(20,20,20,0.97); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  transform: scale(0.92); transition: transform 0.32s cubic-bezier(0.32,0.72,0,1);
}
.bm-modal.visible .bm-modal-box { transform: scale(1); }
.bm-modal-head { display: flex; align-items: center; gap: 7px; margin-bottom: 13px; }
.bm-modal-head .ic { width: 15px; height: 15px; color: #6FB982; }
.bm-modal-head span { font: 600 12.5px 'Inter', sans-serif; color: rgba(241,234,217,0.9); }
.bm-modal label { display: block; font: 500 9px 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(241,234,217,0.4); margin-bottom: 4px; }
.bm-modal .field { margin-bottom: 9px; }
.bm-modal .ip { height: 28px; display: flex; align-items: center; padding: 0 9px; border-radius: 7px; background: #0d0d0f; border: 1px solid rgba(255,255,255,0.1); font: 400 11px 'Inter', sans-serif; color: #e7e1d4; }
.bm-modal .ip .car { color: #6EA7FF; animation: caret 1s steps(1) infinite; }
.bm-modal-meta { display: flex; gap: 10px; margin: 4px 0 13px; font: 400 9.5px 'Inter', sans-serif; color: rgba(241,234,217,0.4); }
.bm-modal-meta .mono { font-family: 'JetBrains Mono', monospace; }
.bm-modal .acts2 { display: flex; gap: 7px; justify-content: flex-end; }
.bm-modal .acts2 button { padding: 6px 12px; border-radius: 999px; border: none; cursor: default; font: 600 10.5px 'Inter', sans-serif; }
.bm-modal .submit { background: #6FB982; color: #052e10; }
.bm-modal .cancel { background: transparent; border: 1px solid rgba(241,234,217,0.15); color: rgba(241,234,217,0.6); }

/* status bar */
.ep-status {
  display: flex; align-items: center; justify-content: space-between;
  height: 28px; padding: 0 16px; flex: none;
  border-top: 1px solid rgba(255,255,255,0.08); background: #0d0d0f;
  font: 400 10.5px 'JetBrains Mono', monospace; color: rgba(241,234,217,0.45);
}
.ep-status .trial { color: #F59E0B; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); border-radius: 5px; padding: 1px 7px; font-size: 10px; }

/* ───────────────────────── Five-states atlas ───────────────────────── */
.states-grid {
  position: absolute; left: 0; right: 0; top: 220px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 0 30px;
  opacity: 0; transition: opacity 0.5s ease; z-index: 5; pointer-events: none;
}
.states-grid.visible { opacity: 1; }
.state-card {
  background: rgba(18, 18, 24, 0.6); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px; padding: 14px 10px 12px; text-align: center;
  opacity: 0; transform: translateY(10px);
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}
.state-card.visible { opacity: 1; transform: translateY(0); }
.state-card.highlighted { border-color: rgba(241, 234, 217, 0.22); background: rgba(28, 28, 34, 0.8); transform: translateY(-3px); }
.state-card .sd { width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 10px; transition: box-shadow 0.3s ease; }
.state-card.highlighted .sd { box-shadow: 0 0 16px 2px var(--sc); }
.state-card .nm { font: 600 11.5px 'JetBrains Mono', monospace; color: #ece6da; margin-bottom: 4px; letter-spacing: 0.02em; }
.state-card .de { font: 400 12px 'Inter', sans-serif; color: #8a8a93; line-height: 1.4; min-height: 44px; }

/* ───────────────────────── Simulated cursor ───────────────────────── */
.cursor {
  position: absolute; width: 15px; height: 19px; pointer-events: none; z-index: 100;
  opacity: 0; transform: translate(-2px, -2px);
  transition: opacity 0.15s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
}
.cursor.visible { opacity: 1; }
.cursor path { fill: #fff; stroke: #000; stroke-width: 0.9; }

/* ───────────────────────── Scene pills + caption ───────────────────────── */
.scene-bar { display: flex; justify-content: center; gap: 6px; margin: 26px auto 0; flex-wrap: wrap; max-width: 1000px; padding: 0 12px; }
.scene-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #a1a1aa; font: 500 13px 'Inter', sans-serif;
  transition: color 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  isolation: isolate;
}
.scene-pill > * { position: relative; z-index: 1; }
.scene-pill:hover { background: rgba(255,255,255,0.08); color: #e5e5e5; }
.scene-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--pill-bg-soft, rgba(110,167,255,0.18)) 0%,
    var(--pill-bg-bright, rgba(110,167,255,0.32)) 100%
  );
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 0;
  pointer-events: none;
}
.scene-pill.filling {
  color: var(--pill-text, #cfe1ff);
  border-color: var(--pill-border, rgba(110,167,255,0.35));
}
.scene-pill.filling::before {
  opacity: 1;
  animation: pill-liquid-fill var(--fill-dur, 8000ms) linear forwards;
}
.scene-pill.filling .num {
  color: var(--pill-text, #cfe1ff);
  background: var(--pill-num-bg, rgba(110,167,255,0.15));
}
@keyframes pill-liquid-fill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.scene-pill[data-scene="0"] {
  --pill-bg-soft:    rgba(110,167,255,0.18);
  --pill-bg-bright:  rgba(110,167,255,0.32);
  --pill-border:     rgba(110,167,255,0.35);
  --pill-text:       #cfe1ff;
  --pill-num-bg:     rgba(110,167,255,0.15);
}
.scene-pill[data-scene="1"] {
  --pill-bg-soft:    rgba(245,158,11,0.18);
  --pill-bg-bright:  rgba(245,158,11,0.32);
  --pill-border:     rgba(245,158,11,0.40);
  --pill-text:       #fde6c2;
  --pill-num-bg:     rgba(245,158,11,0.15);
}
.scene-pill[data-scene="2"] {
  --pill-bg-soft:    rgba(46,196,110,0.18);
  --pill-bg-bright:  rgba(46,196,110,0.32);
  --pill-border:     rgba(46,196,110,0.40);
  --pill-text:       #c4f0d5;
  --pill-num-bg:     rgba(46,196,110,0.15);
}
.scene-pill[data-scene="3"] {
  --pill-bg-soft:    rgba(139,92,246,0.18);
  --pill-bg-bright:  rgba(139,92,246,0.32);
  --pill-border:     rgba(139,92,246,0.40);
  --pill-text:       #ddd0fa;
  --pill-num-bg:     rgba(139,92,246,0.15);
}
.scene-pill .num { font: 500 10px 'JetBrains Mono', monospace; color: #52525b; padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,0.04); transition: color 0.2s ease, background 0.2s ease; }

.scene-caption { text-align: center; margin: 16px auto 0; max-width: 620px; padding: 0 12px; min-height: 46px; }
.scene-caption .title { font: 500 15px 'Inter', sans-serif; color: #ece6da; margin-bottom: 4px; }
.scene-caption .desc { font: 400 12.5px 'Inter', sans-serif; color: #71717a; line-height: 1.5; }

/* ───────────────────────── responsive + reduced motion ───────────────────────── */
@media (max-width: 760px) {
  #demo-stage { aspect-ratio: 3 / 4; }
  .tw { width: 200px; }
  .states-grid { grid-template-columns: repeat(2, 1fr); top: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  .fb .fbd.pulse, .ep-search .q .car, .bm-modal .ip .car { animation: none; }
}
