/* Shared Hub-like styles: light, gray-200 borders, rounded-xl cards, small gray labels. */
:root {
  --gray-50: #f9fafb; --gray-100: #f3f4f6; --gray-200: #e5e7eb; --gray-300: #d1d5db; --gray-400: #9ca3af;
  --gray-500: #6b7280; --gray-600: #4b5563; --gray-700: #374151; --gray-900: #111827;
  --ours: #2563eb; --ours-50: #eff6ff; --light: #ea580c; --light-50: #fff7ed;
  --green: #16a34a; --green-50: #f0fdf4; --amber: #d97706; --amber-50: #fffbeb; --red: #dc2626; --red-50: #fef2f2;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: #fff; color: var(--gray-900); font: 14px/1.5 "Source Sans 3", "Source Sans Pro", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.tabular { font-variant-numeric: tabular-nums; }

/* Hub header */
.hub-header { height: 56px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: #fff; }
.hub-header .crumbs { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--gray-500); white-space: nowrap; }
.hub-header .crumbs b { color: var(--gray-900); font-weight: 600; }
.hub-header .crumbs .sep { color: var(--gray-300); }
.hub-header .emoji { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, #dbeafe, #f3f4f6); display: grid; place-items: center; font-size: 15px; }
.hub-header .spacer { flex: 1; }
.tabs { display: flex; gap: 2px; margin-left: 12px; }
.tabs a { height: 30px; padding: 0 10px; border-radius: 8px; display: inline-flex; align-items: center; color: var(--gray-500); font-size: 14px; }
.tabs a:hover { color: var(--gray-900); background: var(--gray-50); }
.tabs a.on { color: var(--gray-900); background: var(--gray-100); font-weight: 500; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border: 1px solid var(--gray-200); border-radius: 7px; font-size: 12.5px; color: var(--gray-600); background: #fff; white-space: nowrap; }
.tag i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }

/* Controls */
.btn { height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--gray-200); background: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--gray-700); white-space: nowrap; }
.btn:hover { background: var(--gray-50); }
.btn.primary { background: var(--gray-900); border-color: var(--gray-900); color: #fff; }
.btn.primary:hover { background: #1f2937; }
.btn.on { background: var(--gray-100); border-color: var(--gray-300); color: var(--gray-900); }
.seg { display: inline-flex; border: 1px solid var(--gray-200); border-radius: 9px; padding: 2px; gap: 2px; background: var(--gray-50); }
.seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; color: var(--gray-500); font-size: 13px; }
.seg button.on { background: #fff; color: var(--gray-900); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.input { height: 32px; border: 1px solid var(--gray-200); border-radius: 9px; padding: 0 10px; font: inherit; color: var(--gray-900); background: #fff; outline: none; min-width: 0; }
.input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px #dbeafe; }
.label { font-size: 12px; color: var(--gray-500); }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-600); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--gray-900); margin: 0; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.badge.idle { background: var(--gray-100); color: var(--gray-500); }
.badge.loading { background: var(--gray-100); color: var(--gray-600); }
.badge.ok { background: var(--green-50); color: var(--green); border-color: #bbf7d0; }
.badge.warn { background: var(--amber-50); color: var(--amber); border-color: #fde68a; }
.badge.fail { background: var(--red-50); color: var(--red); border-color: #fecaca; }
.spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--gray-300); border-top-color: var(--gray-600); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.libdot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* Viewport surfaces */
.stage { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 35%, #ffffff, #eef0f3 70%); }
.stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.badge.unsupported { background: var(--gray-100); color: var(--gray-700); border-color: var(--gray-300); }
