/* ts-app-state v2 — banner + sync indicators */
.ts-demo-banner {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(720px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 16px;
  background: color-mix(in oklab, #0f172a 90%, transparent);
  color: #f8fafc;
  font: 500 13px/1.3 system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: ts-demo-in 240ms ease-out;
}
.ts-demo-banner.ts-demo-hidden { display: none; }
@keyframes ts-demo-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.ts-demo-banner .ts-demo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
  flex: 0 0 auto;
  transition: background 200ms;
}
.ts-demo-banner .ts-dot-local    { background:#f59e0b; box-shadow:0 0 0 4px rgba(245,158,11,.18); }
.ts-demo-banner .ts-dot-idle,
.ts-demo-banner .ts-dot-ok       { background:#10b981; box-shadow:0 0 0 4px rgba(16,185,129,.18); }
.ts-demo-banner .ts-dot-syncing  { background:#3b82f6; box-shadow:0 0 0 4px rgba(59,130,246,.18); }
.ts-demo-banner .ts-dot-error    { background:#ef4444; box-shadow:0 0 0 4px rgba(239,68,68,.22); }

.ts-demo-banner .ts-demo-text {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ts-demo-banner .ts-demo-status {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #e2e8f0;
}
.ts-demo-banner .ts-demo-status:empty { display: none; }
.ts-demo-banner .ts-demo-actions { display: inline-flex; gap: 6px; flex: 0 0 auto; }
.ts-demo-banner .ts-demo-cta {
  padding: 6px 12px; border-radius: 999px;
  background: #3b82f6; color: #fff; text-decoration: none;
  font-weight: 600; font-size: 12px;
  transition: background 120ms;
}
.ts-demo-banner .ts-demo-cta:hover { background: #2563eb; }
.ts-demo-banner .ts-demo-btn {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06); color: #f1f5f9;
  padding: 5px 10px; border-radius: 999px;
  font: 600 11.5px/1 inherit; cursor: pointer;
}
.ts-demo-banner .ts-demo-btn:hover { background: rgba(255,255,255,.14); }
.ts-demo-banner .ts-demo-btn-ghost { padding: 5px 8px; font-size: 14px; }
.ts-demo-banner .ts-demo-close {
  width: 26px; height: 26px;
  border: none; background: transparent; color: #cbd5e1;
  font-size: 18px; line-height: 1; cursor: pointer; border-radius: 50%;
  flex: 0 0 auto;
}
.ts-demo-banner .ts-demo-close:hover { background: rgba(255,255,255,.08); color: #fff; }

.ts-demo-banner .ts-spin {
  animation: ts-spin 900ms linear infinite;
  vertical-align: -2px;
}
@keyframes ts-spin { to { transform: rotate(360deg); } }

/* History popover */
.ts-demo-history {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  max-width: 320px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
}
.ts-demo-history-title { font-weight: 700; padding: 6px 8px; opacity:.8; }
.ts-demo-history-empty { padding: 10px; text-align:center; opacity:.7; }
.ts-demo-history-item {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 8px; border-radius: 6px;
}
.ts-demo-history-item + .ts-demo-history-item { border-top: 1px solid rgba(255,255,255,.05); }
.ts-demo-history-item.ts-h-ok { color: #6ee7b7; }
.ts-demo-history-item.ts-h-error { color: #fca5a5; }
.ts-demo-history-item.ts-h-syncing { color: #93c5fd; }

@media (max-width: 480px) {
  .ts-demo-banner { bottom: 76px; padding: 8px 10px; gap: 8px; font-size: 12px; flex-wrap: wrap; }
  .ts-demo-banner .ts-demo-text { flex-basis: 100%; order: -1; }
  .ts-demo-banner .ts-demo-cta { padding: 5px 10px; font-size: 11px; }
}
