/* Tracearr Edge — styles ported from Tracearr's web app (apps/web/src/styles/globals.css and the
   shadcn/ui components in apps/web/src/components/ui). Same tokens, same component recipes,
   written as plain CSS because this dashboard has no build step. */

@import url('/fonts/inter.css');

/* ------------------------------------------------------------------ tokens (globals.css) */

:root {
  --accent-hue: 187;
  --accent-h: 212;
  --accent-cl: 0.085;
  --accent-cd: 0.128;

  --cyan-core: var(--accent-hue) 80% 50%;
  --blue-core: 213 62% 11%;
  --blue-steel: 213 47% 17%;

  --background: 0.976 0.006 var(--accent-h);
  --foreground: 0.142 0.005 var(--accent-h);
  --card: 1 0 0;
  --card-foreground: 0.142 0.005 var(--accent-h);
  --popover: 1 0 0;
  --popover-foreground: 0.142 0.005 var(--accent-h);
  --primary: 0.5 var(--accent-cl) var(--accent-h);
  --primary-foreground: 0.99 0 0;
  --secondary: 0.92 0.006 var(--accent-h);
  --secondary-foreground: 0.21 0.005 var(--accent-h);
  --muted: 0.92 0.006 var(--accent-h);
  --muted-foreground: 0.499 0.014 var(--accent-h);
  --accent: 0.92 0.006 var(--accent-h);
  --accent-foreground: 0.21 0.005 var(--accent-h);
  --destructive: 0.51 0.2 25;
  --destructive-foreground: 1 0 0;
  --border: 0.895 0.006 var(--accent-h);
  --input: 0.92 0.006 var(--accent-h);
  --control: 0.629 0.014 var(--accent-h);
  --ring: 0.5 var(--accent-cl) var(--accent-h);
  --ring-alpha: 80%;
  --radius: 0.5rem;

  --success: 0.48 0.13 150;
  --warning: 0.5 0.11 65;
  --info: 0.49 0.13 250;
  --card-raised: 0.976 0.006 var(--accent-h);

  --chart-1: 0.55 0.17 255;
  --chart-2: 0.68 0.17 50;
  --chart-3: 0.58 0.19 340;
  --chart-4: 0.6 0.1 200;
  --chart-5: 0.55 0.17 295;
  --chart-6: 0.66 0.13 100;
  --chart-7: 0.6 0.15 150;
  --chart-8: 0.6 0.17 15;
  --seq-1: 0.33 0.14 295;
  --seq-2: 0.39 0.16 285;
  --seq-3: 0.45 0.17 272;
  --seq-4: 0.51 0.16 260;
  --seq-5: 0.57 0.14 248;
  --seq-6: 0.62 0.11 236;
  --seq-7: 0.66 0.08 225;

  --overlay: 240 10% 4%;
  --overlay-foreground: 0 0% 98%;
  --poster-lift: 0 12px 32px hsl(var(--overlay) / 0.2);

  --sidebar: 0.985 0.006 var(--accent-h);
  --sidebar-foreground: 0.21 0.005 var(--accent-h);
  --sidebar-primary: 0.5 var(--accent-cl) var(--accent-h);
  --sidebar-accent: 0.896 0.006 var(--accent-h);
  --sidebar-accent-foreground: 0.21 0.005 var(--accent-h);
  --sidebar-border: 0.89 0.006 var(--accent-h);
  --sidebar-ring: 0.5 var(--accent-cl) var(--accent-h);

  --sidebar-width: 14rem;
  --sidebar-width-icon: 3rem;

  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  --font-sans: 'Inter Variable', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  color-scheme: light;
}

.dark {
  --background: 0.142 0.012 var(--accent-h);
  --foreground: 0.985 0.005 var(--accent-h);
  --card: 0.178 0.012 var(--accent-h);
  --card-foreground: 0.985 0.005 var(--accent-h);
  --popover: 0.222 0.012 var(--accent-h);
  --popover-foreground: 0.985 0.005 var(--accent-h);
  --primary: 0.75 var(--accent-cd) var(--accent-h);
  --primary-foreground: 0.18 0.02 var(--accent-h);
  --secondary: 0.275 0.012 var(--accent-h);
  --secondary-foreground: 0.985 0.005 var(--accent-h);
  --muted: 0.275 0.012 var(--accent-h);
  --muted-foreground: 0.713 0.016 var(--accent-h);
  --accent: 0.275 0.012 var(--accent-h);
  --accent-foreground: 0.985 0.005 var(--accent-h);
  --destructive: 0.68 0.19 25;
  --destructive-foreground: 0.985 0 0;
  --border: 0.295 0.012 var(--accent-h);
  --input: 0.275 0.012 var(--accent-h);
  --control: 0.533 0.016 var(--accent-h);
  --ring: 0.75 var(--accent-cd) var(--accent-h);
  --ring-alpha: 60%;

  --success: 0.76 0.15 150;
  --warning: 0.8 0.15 80;
  --info: 0.74 0.12 250;
  --card-raised: 0.211 0.012 var(--accent-h);
  --poster-lift: 0 12px 32px hsl(var(--overlay) / 0.7);

  --chart-1: 0.72 0.14 255;
  --chart-2: 0.76 0.15 55;
  --chart-3: 0.72 0.16 340;
  --chart-4: 0.74 0.11 200;
  --chart-5: 0.7 0.15 295;
  --chart-6: 0.78 0.13 100;
  --chart-7: 0.74 0.15 150;
  --chart-8: 0.7 0.16 15;
  --seq-1: 0.9 0.04 300;
  --seq-2: 0.83 0.07 290;
  --seq-3: 0.76 0.11 278;
  --seq-4: 0.69 0.15 266;
  --seq-5: 0.62 0.14 254;
  --seq-6: 0.56 0.11 242;
  --seq-7: 0.5 0.08 230;

  --sidebar: 0.166 0.012 var(--accent-h);
  --sidebar-foreground: 0.985 0.005 var(--accent-h);
  --sidebar-primary: 0.75 var(--accent-cd) var(--accent-h);
  --sidebar-accent: 0.275 0.012 var(--accent-h);
  --sidebar-accent-foreground: 0.985 0.005 var(--accent-h);
  --sidebar-border: 0.275 0.012 var(--accent-h);
  --sidebar-ring: 0.75 var(--accent-cd) var(--accent-h);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base (Tailwind preflight subset) */

*, ::before, ::after { box-sizing: border-box; border: 0 solid oklch(var(--border)); margin: 0; padding: 0; }
html { font-family: var(--font-sans); line-height: 1.5; -webkit-text-size-adjust: 100%; tab-size: 4; }
body { background: oklch(var(--background)); color: oklch(var(--foreground)); font-size: 0.875rem; line-height: 1.25rem; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: inherit; }
img, svg { display: block; vertical-align: middle; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; background: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid oklch(var(--ring) / var(--ring-alpha)); outline-offset: 2px; }
table { border-collapse: collapse; }
code, kbd { font-family: var(--font-mono); }
h1, h2, h3, h4 { font-size: inherit; font-weight: inherit; }
ul, ol { list-style: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }

.icon { width: 1rem; height: 1rem; flex-shrink: 0; }
.icon-3 { width: 0.75rem; height: 0.75rem; flex-shrink: 0; }
.icon-5 { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.icon-8 { width: 2rem; height: 2rem; flex-shrink: 0; }

/* typography helpers */
.muted { color: oklch(var(--muted-foreground)); }
.small, .text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-dense { font-size: 0.8125rem; line-height: 1.125rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-success { color: oklch(var(--success)); }
.text-warning { color: oklch(var(--warning)); }
.text-destructive, .error { color: oklch(var(--destructive)); }
.error:empty { display: none; }
.text-primary { color: oklch(var(--primary)); }
.link { color: oklch(var(--primary)); text-underline-offset: 4px; }
.link:hover { text-decoration: underline; }
a.row-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.space-6 > * + * { margin-top: 1.5rem; }
.row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.mt-6 { margin-top: 1.5rem; }
code { font-size: 0.75rem; background: oklch(var(--muted)); padding: 0.125rem 0.375rem; border-radius: calc(var(--radius) - 4px); }
code.select { user-select: all; word-break: break-all; display: block; padding: 0.5rem 0.75rem; font-size: 0.8125rem; }

/* ------------------------------------------------------------------ brand (components/brand/Logo.tsx) */

.logo { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.logo svg { flex-shrink: 0; }
.logo .word { font-weight: 700; letter-spacing: -0.025em; font-size: 1.25rem; line-height: 1.75rem; white-space: nowrap; }
.logo.sm .word { font-size: 1.125rem; line-height: 1.75rem; }
.fill-blue-core { fill: hsl(var(--blue-core)); }
.fill-blue-steel { fill: hsl(var(--blue-steel)); }
.fill-cyan-core { fill: hsl(var(--cyan-core)); }
.stroke-cyan-core { stroke: hsl(var(--cyan-core)); }

/* ------------------------------------------------------------------ sidebar (components/ui/sidebar.tsx, AppSidebar.tsx) */

.app { display: flex; min-height: 100svh; width: 100%; }
.sidebar-gap { width: var(--sidebar-width); flex-shrink: 0; transition: width 200ms linear; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 10; height: 100svh; width: var(--sidebar-width);
  display: flex; flex-direction: column; background: oklch(var(--sidebar)); color: oklch(var(--sidebar-foreground));
  border-right: 1px solid oklch(var(--sidebar-border)); transition: width 200ms linear;
}
.sb-header { display: flex; flex-direction: column; border-bottom: 1px solid oklch(var(--border)); }
.sb-brand { display: flex; height: 3.5rem; align-items: center; gap: 0.5rem; padding: 0 1rem; }
.sb-trigger { margin-left: auto; }
.sb-content { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 0.5rem; overflow: auto; padding: 0.5rem; }
.sb-menu { display: flex; width: 100%; min-width: 0; flex-direction: column; gap: 0.25rem; }
.sb-item { position: relative; }
.sb-btn {
  position: relative; display: flex; width: 100%; height: 2rem; align-items: center; gap: 0.5rem; overflow: hidden;
  border-radius: calc(var(--radius) - 2px); padding: 0.5rem; text-align: left; font-size: 0.875rem; line-height: 1.25rem;
  transition: width 200ms, height 200ms, padding 200ms; outline: none;
}
.sb-btn > span:last-child, .sb-btn > .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-btn:hover, .sb-btn[aria-expanded='true'] { background: oklch(var(--sidebar-accent)); color: oklch(var(--sidebar-accent-foreground)); }
.sb-btn:focus-visible { box-shadow: 0 0 0 2px oklch(var(--sidebar-ring)); }
.sb-btn::before { content: ''; position: absolute; top: 0.5rem; bottom: 0.5rem; left: 0; width: 0.125rem; border-radius: 9999px; }
.sb-btn.active { background: oklch(var(--sidebar-accent)); font-weight: 500; color: oklch(var(--sidebar-accent-foreground)); }
.sb-btn.active > svg { color: oklch(var(--sidebar-primary)); }
.sb-btn.active::before { background: oklch(var(--sidebar-primary)); }
.sb-badge {
  pointer-events: none; position: absolute; right: 0.25rem; top: 0.375rem; display: flex; height: 1.25rem; min-width: 1.25rem;
  align-items: center; justify-content: center; border-radius: calc(var(--radius) - 2px); padding: 0 0.25rem;
  font-size: 0.75rem; font-weight: 500; font-variant-numeric: tabular-nums;
  background: oklch(var(--warning) / 0.1); color: oklch(var(--warning));
}
.sb-dot { display: none; position: absolute; top: 0.375rem; right: 0.375rem; width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: oklch(var(--warning)); }
.sb-sep { height: 1px; margin: 0.5rem; background: oklch(var(--sidebar-border)); }
.sb-footer { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.5rem; }
.sb-user { height: 3rem; border: 1px solid oklch(var(--border)); }
.sb-user .avatar { width: 2rem; height: 2rem; border-radius: var(--radius); }
.sb-user .who { display: grid; flex: 1; text-align: left; line-height: 1.25; min-width: 0; }
.sb-user .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sb-user > svg:last-child { margin-left: auto; }
.sb-version { display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 0.75rem; line-height: 1rem; color: oklch(var(--muted-foreground)); }
.conn-dot { width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: oklch(var(--destructive)); }
.conn-dot.on { background: oklch(var(--success)); }
.sb-rail { position: absolute; top: 0; bottom: 0; right: -1rem; width: 1rem; transform: translateX(-50%); cursor: w-resize; z-index: 20; }
.sb-rail::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; }
.sb-rail:hover::after { background: oklch(var(--sidebar-border)); }

/* collapsed to the icon rail */
.collapsed .sidebar, .collapsed .sidebar-gap { width: var(--sidebar-width-icon); }
.collapsed .sb-brand { height: auto; flex-direction: column; padding: 0.5rem; }
.collapsed .sb-trigger { margin-left: 0; }
.collapsed .logo .word, .collapsed .sb-btn > span, .collapsed .sb-btn > .who, .collapsed .sb-btn > .label,
.collapsed .sb-badge, .collapsed .sb-version, .collapsed .sb-user > svg:last-child { display: none; }
.collapsed .sb-content { overflow-x: hidden; }
.collapsed .sb-btn { width: 2rem; height: 2rem; padding: 0.5rem; }
.collapsed .sb-user { padding: 0; border: 0; }
.collapsed .sb-user .avatar { width: 2rem; height: 2rem; }
.collapsed .sb-dot { display: block; }
.collapsed .sb-rail { cursor: e-resize; }

.inset { position: relative; display: flex; min-width: 0; flex: 1; flex-direction: column; background: oklch(var(--background)); }
.site-header { display: none; height: 3rem; flex-shrink: 0; align-items: center; gap: 0.5rem; border-bottom: 1px solid oklch(var(--border)); padding: 0 1rem; }
.page { padding: 1.5rem; min-width: 0; }
.scrim { position: fixed; inset: 0; z-index: 40; background: hsl(var(--overlay) / 0.5); }

@media (max-width: 767px) {
  .sidebar-gap { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform 300ms ease; z-index: 50; width: var(--sidebar-width) !important; border-right: 1px solid oklch(var(--border)); }
  .mobile-open .sidebar { transform: none; }
  .collapsed .sidebar .logo .word, .collapsed .sidebar .sb-btn > span, .collapsed .sidebar .sb-btn > .who,
  .collapsed .sidebar .sb-badge, .collapsed .sidebar .sb-version { display: revert; }
  .sb-rail { display: none; }
  .site-header { display: flex; }
}

/* ------------------------------------------------------------------ button (components/ui/button.tsx) */

.btn {
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 0.5rem; white-space: nowrap;
  border-radius: calc(var(--radius) - 2px); font-size: 0.875rem; line-height: 1.25rem; font-weight: 500;
  height: 2.25rem; padding: 0.5rem 1rem; transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1); outline: none;
  background: oklch(var(--primary)); color: oklch(var(--primary-foreground)); border: 1px solid transparent;
}
.btn:hover { background: oklch(var(--primary) / 0.9); }
.btn:focus-visible { border-color: oklch(var(--ring)); box-shadow: 0 0 0 3px oklch(var(--ring) / var(--ring-alpha)); }
.btn:disabled, .btn[aria-disabled='true'] { pointer-events: none; opacity: 0.5; }
.btn > svg { pointer-events: none; width: 1rem; height: 1rem; }
.btn:has(> svg) { padding-left: 0.75rem; padding-right: 0.75rem; }
.btn.outline { border-color: oklch(var(--border)); background: oklch(var(--background)); color: oklch(var(--foreground)); box-shadow: var(--shadow-xs); }
.btn.outline:hover { background: oklch(var(--accent)); color: oklch(var(--accent-foreground)); }
.dark .btn.outline { border-color: oklch(var(--input)); background: oklch(var(--input) / 0.3); }
.dark .btn.outline:hover { background: oklch(var(--input) / 0.5); color: oklch(var(--foreground)); }
.btn.secondary { background: oklch(var(--secondary)); color: oklch(var(--secondary-foreground)); }
.btn.secondary:hover { background: oklch(var(--secondary) / 0.8); }
.btn.ghost { background: transparent; color: inherit; }
.btn.ghost:hover { background: oklch(var(--accent)); color: oklch(var(--accent-foreground)); }
.dark .btn.ghost:hover { background: oklch(var(--accent) / 0.5); color: oklch(var(--foreground)); }
.btn.destructive { background: oklch(var(--destructive)); color: oklch(var(--destructive-foreground)); }
.btn.destructive:hover { background: oklch(var(--destructive) / 0.9); }
.dark .btn.destructive { background: oklch(var(--destructive) / 0.6); }
.btn.link { background: transparent; color: oklch(var(--primary)); height: auto; padding: 0; text-underline-offset: 4px; }
.btn.link:hover { text-decoration: underline; }
.btn.sm { height: 2rem; gap: 0.375rem; padding: 0 0.75rem; }
.btn.sm:has(> svg) { padding: 0 0.625rem; }
.btn.xs { height: 1.5rem; gap: 0.25rem; padding: 0 0.5rem; font-size: 0.75rem; line-height: 1rem; }
.btn.xs > svg { width: 0.75rem; height: 0.75rem; }
.btn.lg { height: 2.5rem; padding: 0 1.5rem; }
.btn.icon { width: 2.25rem; height: 2.25rem; padding: 0; }
.btn.icon-sm { width: 2rem; height: 2rem; padding: 0; }
.btn.icon-xs { width: 1.5rem; height: 1.5rem; padding: 0; }
.btn.icon-7 { width: 1.75rem; height: 1.75rem; padding: 0; }
.btn.w-full { width: 100%; }
.btn.kill:hover { background: oklch(var(--destructive) / 0.1); color: oklch(var(--destructive)); }
.btn .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ card (components/ui/card.tsx) */

.card {
  display: flex; flex-direction: column; gap: 1rem; border-radius: calc(var(--radius) + 4px); border: 1px solid oklch(var(--border));
  background: oklch(var(--card)); color: oklch(var(--card-foreground)); padding: 1.5rem; box-shadow: var(--shadow-sm); min-width: 0;
}
.card .card { background: oklch(var(--card-raised)); box-shadow: none; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card-head { display: grid; gap: 0.5rem; }
.card-head.with-action { grid-template-columns: 1fr auto; align-items: start; }
.card-title { font-size: 1rem; line-height: 1; font-weight: 600; }
.card-title.medium { font-weight: 500; }
.card-desc { color: oklch(var(--muted-foreground)); font-size: 0.875rem; line-height: 1.25rem; }
.card-foot { display: flex; align-items: center; gap: 0.5rem; }
.card-hover { transition: background-color 200ms, border-color 200ms; }
.card-hover:hover { background: oklch(var(--muted) / 0.7); border-color: oklch(var(--foreground) / 0.15); }
.dark .card-hover:hover { background: oklch(var(--card-raised)); }

/* ------------------------------------------------------------------ badge (components/ui/badge.tsx) */

.badge {
  display: inline-flex; width: fit-content; flex-shrink: 0; align-items: center; justify-content: center; gap: 0.25rem; overflow: hidden;
  white-space: nowrap; border-radius: 9999px; border: 1px solid transparent; padding: 0.125rem 0.5rem; font-size: 0.75rem;
  line-height: 1rem; font-weight: 500; background: oklch(var(--primary)); color: oklch(var(--primary-foreground)); vertical-align: middle;
}
.badge > svg { width: 0.75rem; height: 0.75rem; }
.badge.secondary { background: oklch(var(--secondary)); color: oklch(var(--secondary-foreground)); }
.badge.outline { background: transparent; border-color: oklch(var(--border)); color: oklch(var(--foreground)); }
.badge.success { background: oklch(var(--success) / 0.15); color: oklch(var(--success)); }
.badge.warning { background: oklch(var(--warning) / 0.15); color: oklch(var(--warning)); }
.badge.danger { background: oklch(var(--destructive) / 0.15); color: oklch(var(--destructive)); }
.badge.destructive { background: oklch(var(--destructive)); color: oklch(var(--destructive-foreground)); }
.badge.info { background: oklch(var(--info) / 0.15); color: oklch(var(--info)); }
.badge.local { height: 1rem; padding: 0 0.25rem; }
.badge .mono { font-family: var(--font-mono); }
.pill { border-radius: 9999px; background: oklch(var(--muted)); color: oklch(var(--foreground)); padding: 0.125rem 0.5rem; font-size: 0.75rem; line-height: 1rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.pill.quiet { color: oklch(var(--muted-foreground)); font-weight: 400; }

/* ------------------------------------------------------------------ stat card (components/ui/stat-card.tsx) */

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stat-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .stat-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.stat { display: flex; height: 100%; align-items: center; gap: 0.75rem; border-radius: calc(var(--radius) + 4px); border: 1px solid oklch(var(--border)); background: oklch(var(--card)); padding: 0.75rem; min-width: 0; }
.card .stat { background: oklch(var(--card-raised)); }
a.stat { transition: background-color 200ms, border-color 200ms; }
a.stat:hover { background: oklch(var(--muted) / 0.7); border-color: oklch(var(--foreground) / 0.15); }
.dark a.stat:hover { background: oklch(var(--card-raised)); }
.stat-ic { display: flex; width: 2rem; height: 2rem; flex-shrink: 0; align-items: center; justify-content: center; border-radius: var(--radius); background: oklch(var(--primary) / 0.1); color: oklch(var(--primary)); }
.stat-body { min-width: 0; flex: 1; }
.stat-v { font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-v .suffix { margin-left: 0.25rem; font-size: 0.75rem; font-weight: 400; color: oklch(var(--muted-foreground)); }
.stat-l { font-size: 0.8125rem; line-height: 1.125rem; color: oklch(var(--muted-foreground)); }

/* ------------------------------------------------------------------ sections (dashboard/SectionHeading.tsx, layout/SectionTabs.tsx) */

.section + .section { margin-top: 1.5rem; }
.section-h { margin-bottom: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.section-h > svg { width: 1.25rem; height: 1.25rem; color: oklch(var(--primary)); }
.section-h h2 { font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.section-h .caption { font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.section-h .actions { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.page-head { border-bottom: 1px solid oklch(var(--border)); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; column-gap: 1rem; }
.page-head .tabs-wrap { min-width: 0; flex: 1; }
.page-head .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding-bottom: 0.5rem; }
.page-head + .page-body { margin-top: 1.5rem; }
select.sm, input.sm, .toolbar select { height: 2rem; }
.tabs { display: flex; gap: 1.5rem; overflow-x: auto; margin-bottom: -1px; }
.tabs a {
  display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; border-bottom: 2px solid transparent;
  padding: 0.625rem 0.125rem 0.75rem; font-size: 0.875rem; font-weight: 500; color: oklch(var(--muted-foreground));
}
.tabs a:hover { color: oklch(var(--foreground)); }
.tabs a[aria-current='page'] { border-color: oklch(var(--primary)); color: oklch(var(--foreground)); }
.tabs a .pill { color: oklch(var(--muted-foreground)); font-weight: 400; }
.back { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.875rem; color: oklch(var(--muted-foreground)); margin-bottom: 1rem; }
.back:hover { color: oklch(var(--foreground)); }
.detail-title { font-size: 1.5rem; line-height: 2rem; font-weight: 600; letter-spacing: -0.025em; }

/* ------------------------------------------------------------------ toggle group (components/ui/toggle.tsx, toggle-group.tsx) */

.tg { display: inline-flex; width: fit-content; align-items: center; border-radius: calc(var(--radius) - 2px); box-shadow: var(--shadow-xs); }
.tg > a, .tg > button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; white-space: nowrap; height: 2rem; min-width: 2rem;
  padding: 0 0.75rem; font-size: 0.875rem; font-weight: 500; border: 1px solid oklch(var(--input)); border-left-width: 0; background: transparent;
  transition: color 150ms, box-shadow 150ms;
}
.tg > :first-child { border-left-width: 1px; border-radius: calc(var(--radius) - 2px) 0 0 calc(var(--radius) - 2px); }
.tg > :last-child { border-radius: 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0; }
.tg > :hover { background: oklch(var(--accent)); color: oklch(var(--accent-foreground)); }
.tg > .on, .tg > .on:hover { background: oklch(var(--primary) / 0.1); color: oklch(var(--primary)); }
.dark .tg > .on, .dark .tg > .on:hover { background: oklch(var(--primary) / 0.15); }
.tg > svg { width: 1rem; height: 1rem; }

/* ------------------------------------------------------------------ form controls (input.tsx, select.tsx, checkbox.tsx, switch.tsx, label.tsx) */

.input, input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea {
  height: 2.25rem; width: 100%; min-width: 0; border-radius: calc(var(--radius) - 2px); border: 1px solid oklch(var(--control));
  background: transparent; padding: 0.25rem 0.75rem; font-size: 0.875rem; line-height: 1.25rem; box-shadow: var(--shadow-xs);
  transition: color 150ms, box-shadow 150ms; outline: none;
}
.dark input:not([type=checkbox]):not([type=radio]), .dark select, .dark textarea { background: oklch(var(--input) / 0.3); }
input::placeholder, textarea::placeholder { color: oklch(var(--muted-foreground)); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: oklch(var(--ring)); box-shadow: 0 0 0 3px oklch(var(--ring) / var(--ring-alpha)); outline: none; }
input:disabled, select:disabled { cursor: not-allowed; opacity: 0.5; }
textarea { height: auto; min-height: 4rem; padding: 0.5rem 0.75rem; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2rem; cursor: pointer; white-space: nowrap; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.625rem center; background-size: 1rem;
}
.dark select:hover { background-color: oklch(var(--input) / 0.5); }
select option { background: oklch(var(--popover)); color: oklch(var(--popover-foreground)); }
select.sm, input.sm { height: 2rem; }
.w-auto { width: auto !important; }

input[type=checkbox]:not(.switch) {
  appearance: none; -webkit-appearance: none; width: 1rem; height: 1rem; flex-shrink: 0; border-radius: 4px; border: 1px solid oklch(var(--control));
  box-shadow: var(--shadow-xs); cursor: pointer; display: inline-grid; place-content: center; vertical-align: middle;
}
.dark input[type=checkbox]:not(.switch) { background: oklch(var(--input) / 0.3); }
input[type=checkbox]:not(.switch):checked { background: oklch(var(--primary)); border-color: oklch(var(--primary)); color: oklch(var(--primary-foreground)); }
input[type=checkbox]:not(.switch):checked::before {
  content: ''; width: 0.875rem; height: 0.875rem; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
input[type=checkbox]:disabled { cursor: not-allowed; opacity: 0.5; }
input[type=checkbox]:focus-visible { border-color: oklch(var(--ring)); box-shadow: 0 0 0 3px oklch(var(--ring) / var(--ring-alpha)); outline: none; }

input.switch {
  appearance: none; -webkit-appearance: none; position: relative; display: inline-flex; flex-shrink: 0; width: 2rem; height: 18px; cursor: pointer;
  border-radius: 9999px; border: 1px solid oklch(var(--control)); background: oklch(var(--input)); box-shadow: var(--shadow-xs); transition: all 150ms;
}
.dark input.switch { border-color: transparent; background: oklch(var(--input) / 0.8); }
input.switch::before { content: ''; position: absolute; top: 0; left: 0; width: 1rem; height: 1rem; border-radius: 9999px; background: oklch(var(--card)); transition: transform 150ms; }
.dark input.switch::before { background: oklch(var(--foreground)); }
input.switch:checked { background: oklch(var(--primary)); border-color: transparent; }
input.switch:checked::before { transform: translateX(calc(100% - 2px)); }
.dark input.switch:checked::before { background: oklch(var(--primary-foreground)); }

.field { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.field > span:first-child, .label { font-size: 0.875rem; line-height: 1; font-weight: 500; }
.field .hint { font-size: 0.75rem; line-height: 1rem; color: oklch(var(--muted-foreground)); font-weight: 400; }
.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; line-height: 1.25rem; cursor: pointer; }
.check.between { justify-content: space-between; gap: 1rem; }
.check .text { display: grid; gap: 0.25rem; }
.check .text small { font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.form { display: flex; flex-direction: column; gap: 1rem; }
.form.narrow { max-width: 28rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.625rem 1rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.toolbar input:not([type=checkbox]), .toolbar select { width: auto; min-width: 9rem; }
.toolbar .search { position: relative; flex: 1; min-width: 12rem; max-width: 20rem; }
.toolbar .search input:not([type=checkbox]) { width: 100%; padding-left: 2.25rem; height: 2rem; }
.toolbar .search svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: oklch(var(--muted-foreground)); }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; font-size: 0.875rem; }

/* ------------------------------------------------------------------ table (ui/table.tsx, ui/data-table) */

.table-card { border-radius: calc(var(--radius) + 4px); border: 1px solid oklch(var(--border)); background: oklch(var(--card)); overflow: hidden; }
.table-scroll { position: relative; width: 100%; overflow-x: auto; }
table.table { width: 100%; caption-side: bottom; font-size: 0.875rem; line-height: 1.25rem; }
.table thead tr { border-bottom: 1px solid oklch(var(--border)); }
.table tr { border-bottom: 1px solid oklch(var(--border)); transition: background-color 150ms; }
.table tbody tr:last-child { border-bottom: 0; }
.table tbody tr:hover { background: oklch(var(--muted) / 0.5); }
.table th {
  height: 2.5rem; padding: 0 1rem; text-align: left; vertical-align: middle; white-space: nowrap; font-size: 0.75rem; line-height: 1rem;
  font-weight: 500; letter-spacing: 0.025em; text-transform: uppercase; color: oklch(var(--muted-foreground)); background: oklch(var(--card));
}
.table td { padding: 0.75rem 1rem; vertical-align: middle; }
.table td { white-space: nowrap; }
.table td.wrap { white-space: normal; min-width: 16rem; }
.table th.check-col, .table td.check-col { width: 1px; padding-right: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td .sub { display: block; font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.table.kv th { text-transform: none; letter-spacing: 0; font-size: 0.875rem; width: 9rem; background: none; height: auto; padding: 0.5rem 1rem 0.5rem 0; color: oklch(var(--muted-foreground)); font-weight: 400; vertical-align: top; }
.table.kv td { padding: 0.5rem 0; white-space: normal; overflow-wrap: anywhere; }
.table.kv tr { border: 0; }
.table.kv tr:hover { background: none; }
.table-foot { display: flex; justify-content: center; padding: 0.75rem; border-top: 1px solid oklch(var(--border)); }
.user-cell { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.user-cell .name { font-weight: 500; }

/* ------------------------------------------------------------------ avatar (ui/avatar.tsx) */

.avatar { position: relative; display: flex; flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; width: 2rem; height: 2rem; border-radius: 9999px; background: oklch(var(--muted)); font-size: 0.75rem; font-weight: 500; }
.avatar.primary { background: oklch(var(--primary) / 0.1); color: oklch(var(--primary)); }
.avatar.lg { width: 4rem; height: 4rem; font-size: 1.25rem; }

/* ------------------------------------------------------------------ now playing (sessions/NowPlayingCard.tsx) */

.np-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .np-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .np-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.np { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 4px); border: 1px solid oklch(var(--border)); background: oklch(var(--card)); cursor: pointer; animation: fade-in 0.3s ease-out; }
.np-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.2; filter: blur(24px); }
.np-body { position: relative; display: flex; gap: 1rem; padding: 1rem; }
.np-poster { position: relative; width: 5rem; height: 7rem; flex-shrink: 0; overflow: hidden; border-radius: var(--radius); background: oklch(var(--muted)); box-shadow: var(--shadow-lg); }
.np-poster img { width: 100%; height: 100%; object-fit: cover; }
.np-poster.square img { object-fit: contain; }
.np-poster .ph { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: oklch(var(--muted-foreground)); }
.np-poster .state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: hsl(var(--overlay) / 0.5); color: hsl(var(--overlay-foreground)); opacity: 0; transition: opacity 150ms; }
.np:hover .np-poster .state, .np-poster .state.paused { opacity: 1; }
.np-info { display: flex; min-width: 0; flex: 1; flex-direction: column; justify-content: space-between; }
.np-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.np-who { display: flex; min-width: 0; align-items: center; gap: 0.5rem; }
.np-who .avatar { width: 1.75rem; height: 1.75rem; border: 2px solid oklch(var(--background)); box-shadow: var(--shadow-sm); }
.np-who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; font-weight: 500; }
.np-icons { display: flex; flex-shrink: 0; align-items: center; gap: 0.375rem; }
.np-icons > span { display: flex; width: 1.5rem; height: 1.5rem; align-items: center; justify-content: center; }
.np-icons .device { color: oklch(var(--muted-foreground)); }
.np-icons .btn { width: 1.5rem; height: 1.5rem; padding: 0; color: oklch(var(--muted-foreground)); }
.np-icons .btn.kill:hover { background: oklch(var(--destructive) / 0.1); color: oklch(var(--destructive)); }
.np-title { margin-top: 0.5rem; min-width: 0; }
.np-title h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; line-height: 1.25; font-weight: 600; }
.np-title p { margin-top: 0.125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; line-height: 1rem; color: oklch(var(--muted-foreground)); }
.np-progress { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; }
.progress { position: relative; height: 0.5rem; width: 100%; overflow: hidden; border-radius: 9999px; background: oklch(var(--primary) / 0.2); }
.progress.thin { height: 0.375rem; }
.progress > i { position: absolute; inset: 0 auto 0 0; background: oklch(var(--primary)); transition: width 300ms; }
.np-times { display: flex; justify-content: space-between; font-size: 0.75rem; line-height: 1rem; color: oklch(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.np-foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; border-top: 1px solid oklch(var(--border)); background: oklch(var(--muted) / 0.5); padding: 0.5rem 1rem; font-size: 0.75rem; line-height: 1rem; color: oklch(var(--muted-foreground)); }
.np-foot > span { display: flex; min-width: 0; align-items: center; gap: 0.375rem; }
.np-foot .sep { color: oklch(var(--muted-foreground) / 0.5); }
@keyframes fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ------------------------------------------------------------------ empty state (ui/empty.tsx, ui/empty-state.tsx) */

.empty-state { display: flex; min-width: 0; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; border-radius: calc(var(--radius) + 4px); border: 1px dashed oklch(var(--border)); padding: 3rem 1.5rem; text-align: center; text-wrap: balance; }
.empty-state.plain { border: 0; }
.empty-state .media { display: flex; width: 4rem; height: 4rem; align-items: center; justify-content: center; border-radius: 9999px; background: oklch(var(--muted)); color: oklch(var(--muted-foreground)); }
.empty-state .media svg { width: 2rem; height: 2rem; }
.empty-state .head { display: flex; max-width: 24rem; flex-direction: column; align-items: center; gap: 0.5rem; }
.empty-state .title { font-size: 1.125rem; line-height: 1.75rem; font-weight: 500; letter-spacing: -0.025em; }
.empty-state .desc { font-size: 0.875rem; line-height: 1.625; color: oklch(var(--muted-foreground)); }
.empty { padding: 2rem 1rem; text-align: center; color: oklch(var(--muted-foreground)); font-size: 0.875rem; }
.loading { display: flex; justify-content: center; padding: 4rem 0; color: oklch(var(--muted-foreground)); }
.loading svg { width: 1.5rem; height: 1.5rem; animation: spin 1s linear infinite; }

/* ------------------------------------------------------------------ alert (ui/alert.tsx) */

.alert { position: relative; display: grid; grid-template-columns: 1rem 1fr; align-items: start; column-gap: 0.75rem; row-gap: 0.125rem; width: 100%; border-radius: var(--radius); border: 1px solid oklch(var(--border)); padding: 0.75rem 1rem; font-size: 0.875rem; line-height: 1.25rem; background: oklch(var(--card)); }
.alert > svg { width: 1rem; height: 1rem; transform: translateY(0.125rem); }
.alert .a-title { grid-column: 2; font-weight: 500; letter-spacing: -0.025em; }
.alert .a-desc { grid-column: 2; display: grid; gap: 0.5rem; color: oklch(var(--muted-foreground)); justify-items: start; }
.alert.warning { background: oklch(var(--warning) / 0.1); color: oklch(var(--warning)); }
.alert.warning .a-desc { color: oklch(var(--foreground)); }
.alert.destructive { background: oklch(var(--destructive) / 0.1); color: oklch(var(--destructive)); }
.alert.destructive .a-desc { color: oklch(var(--destructive)); }
.alert + * { margin-top: 1rem; }

/* ------------------------------------------------------------------ menu / dialog / toast (dropdown-menu.tsx, dialog.tsx, sonner.tsx) */

.menu {
  position: fixed; z-index: 1000; min-width: 8rem; overflow: hidden; border-radius: calc(var(--radius) - 2px); border: 1px solid oklch(var(--border));
  background: oklch(var(--popover)); color: oklch(var(--popover-foreground)); padding: 0.25rem; box-shadow: var(--shadow-md); animation: zoom-in 120ms ease-out;
}
.menu .m-label { padding: 0.375rem 0.5rem; font-size: 0.875rem; font-weight: 500; }
.menu .m-sep { height: 1px; margin: 0.25rem -0.25rem; background: oklch(var(--border)); }
.menu .m-item {
  position: relative; display: flex; width: 100%; cursor: default; align-items: center; gap: 0.5rem; border-radius: 4px;
  padding: 0.375rem 0.5rem; font-size: 0.875rem; line-height: 1.25rem; user-select: none; outline: none; text-align: left;
}
.menu .m-item > svg { width: 1rem; height: 1rem; color: oklch(var(--muted-foreground)); }
.menu .m-item:hover, .menu .m-item:focus-visible { background: oklch(var(--accent)); color: oklch(var(--accent-foreground)); }
.menu .m-item.destructive, .menu .m-item.destructive > svg { color: oklch(var(--destructive)); }
.menu .m-item.destructive:hover { background: oklch(var(--destructive) / 0.1); }
.dark .menu .m-item.destructive:hover { background: oklch(var(--destructive) / 0.2); }
.menu .m-item .dot { margin-left: auto; width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: currentColor; }
.menu .m-radio { padding-left: 2rem; }
.menu .m-radio.on::before { content: ''; position: absolute; left: 0.75rem; top: 50%; width: 0.5rem; height: 0.5rem; margin-top: -0.25rem; border-radius: 9999px; background: currentColor; }
@keyframes zoom-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

dialog.dlg {
  margin: auto; width: 100%; max-width: min(32rem, calc(100% - 2rem)); border-radius: calc(var(--radius) + 4px); border: 1px solid oklch(var(--border));
  background: oklch(var(--card)); color: oklch(var(--card-foreground)); padding: 1.5rem; box-shadow: var(--shadow-lg); animation: zoom-in 200ms ease-out;
}
dialog.dlg::backdrop { background: hsl(var(--overlay) / 0.5); }
dialog.dlg form { display: grid; gap: 1rem; }
dialog.dlg .d-head { display: flex; flex-direction: column; gap: 0.5rem; }
dialog.dlg .d-title { font-size: 1.125rem; line-height: 1; font-weight: 600; }
dialog.dlg .d-desc { font-size: 0.875rem; color: oklch(var(--muted-foreground)); }
dialog.dlg .d-foot { display: flex; flex-direction: column-reverse; gap: 0.5rem; }
@media (min-width: 640px) { dialog.dlg .d-foot { flex-direction: row; justify-content: flex-end; } }

.toaster { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 1100; display: flex; flex-direction: column; gap: 0.5rem; width: 356px; max-width: calc(100vw - 2rem); }
.toast {
  display: flex; align-items: center; gap: 0.375rem; border-radius: var(--radius); border: 1px solid oklch(var(--border));
  background: oklch(var(--popover)); color: oklch(var(--popover-foreground)); padding: 1rem; font-size: 13px; line-height: 1.4;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.1); animation: toast-in 400ms cubic-bezier(0.21, 1.02, 0.73, 1);
}
.toast > svg { width: 1rem; height: 1rem; flex-shrink: 0; margin-right: 0.25rem; }
.toast .t-body { display: grid; gap: 0.125rem; min-width: 0; }
.toast .t-title { font-weight: 500; }
.toast .t-desc { color: oklch(var(--muted-foreground)); overflow-wrap: anywhere; }
.toast.out { animation: toast-out 200ms ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(20%); } }

/* ------------------------------------------------------------------ settings shell (settings/shell/SettingsNav.tsx) */

.settings { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .settings { grid-template-columns: 13rem minmax(0, 48rem); gap: 2.5rem; } }
.settings-nav { display: none; flex-direction: column; gap: 1rem; }
@media (min-width: 900px) { .settings-nav { display: flex; } .settings-select { display: none; } }
.settings-nav .group { display: flex; flex-direction: column; gap: 0.125rem; }
.settings-nav .g-label { display: flex; height: 2rem; align-items: center; padding: 0 0.5rem; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.025em; text-transform: uppercase; color: oklch(var(--muted-foreground)); }
.settings-nav a { position: relative; display: flex; height: 2rem; align-items: center; border-radius: calc(var(--radius) - 2px); padding: 0 0.5rem; font-size: 0.875rem; transition: background-color 150ms; }
.settings-nav a:hover { background: oklch(var(--sidebar-accent)); color: oklch(var(--sidebar-accent-foreground)); }
.settings-nav a.active { background: oklch(var(--sidebar-accent)); font-weight: 500; }
.settings-nav a.active::before { content: ''; position: absolute; top: 0.5rem; bottom: 0.5rem; left: 0; width: 0.125rem; border-radius: 9999px; background: oklch(var(--sidebar-primary)); }
.set-section { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.set-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.set-head h2 { font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.set-head p { margin-top: 0.25rem; font-size: 0.875rem; color: oklch(var(--muted-foreground)); }
.swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.swatch { display: flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border-radius: 9999px; border: 2px solid transparent; background: oklch(0.5 var(--accent-cl) var(--accent-h)); color: oklch(0.99 0 0); }
.dark .swatch { background: oklch(0.75 var(--accent-cd) var(--accent-h)); color: oklch(0.18 0.02 var(--accent-h)); }
.swatch.on { box-shadow: 0 0 0 2px oklch(var(--background)), 0 0 0 4px oklch(var(--ring)); }
.server-row { display: flex; flex-direction: column; gap: 1rem; }
.server-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.server-name { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-weight: 600; font-size: 1rem; }
.split { display: grid; gap: 1rem; }
@media (min-width: 640px) { .split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ grids */

.grid-2 { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-3 { display: grid; gap: 1rem; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rules-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.detail-head { display: flex; gap: 1.5rem; align-items: flex-start; }
@media (max-width: 639px) { .detail-head { flex-direction: column; } }

/* ------------------------------------------------------------------ posters (media-browse/PosterCard.tsx) */

.poster { width: 120px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: calc(var(--radius) - 2px); background: oklch(var(--muted)); display: block; flex-shrink: 0; }
.poster.sm { width: 64px; }
.poster.lg { width: 160px; border-radius: var(--radius); box-shadow: var(--poster-lift); }
.poster.blank { background: oklch(var(--muted)); }
.shelf { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; }
.shelf-item { width: 8rem; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 1.25rem 1rem; }
.poster-card { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
.poster-card .poster, .shelf-item .poster { width: 100%; transition: transform 200ms, box-shadow 200ms; }
.poster-card:hover .poster, .shelf-item:hover .poster { transform: translateY(-2px); box-shadow: var(--poster-lift); }
.poster-card .t, .shelf-item .t { font-size: 0.8125rem; line-height: 1.125rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poster-card .m, .shelf-item .m { font-size: 0.75rem; line-height: 1rem; color: oklch(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ charts (single series take primary, like Tracearr's recharts) */

.cols { display: flex; align-items: flex-end; gap: 3px; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 0.375rem; min-width: 0; }
.col i { display: block; width: 100%; background: oklch(var(--primary)); border-radius: 4px 4px 0 0; min-height: 2px; transition: opacity 150ms; }
.col:hover i { opacity: 0.8; }
.col span { font-size: 0.6875rem; color: oklch(var(--muted-foreground)); white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; height: 1rem; }
.hbars { display: flex; flex-direction: column; gap: 0.625rem; }
.hbar { display: grid; grid-template-columns: minmax(5rem, 34%) 1fr auto; gap: 0.75rem; align-items: center; font-size: 0.8125rem; }
.hbar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .b { height: 0.5rem; background: oklch(var(--muted)); border-radius: 9999px; overflow: hidden; }
.hbar .b i { display: block; height: 100%; background: oklch(var(--primary)); border-radius: 9999px; }
.hbar .v { white-space: nowrap; font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 120px; display: block; }
.spark .grid line { stroke: oklch(var(--border)); stroke-dasharray: 3 3; }
.legend { display: inline-flex; align-items: center; gap: 0.375rem; margin-right: 1rem; font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.legend i { width: 0.625rem; height: 0.625rem; border-radius: 2px; display: inline-block; }
.c1 { color: oklch(var(--chart-1)); } .c2 { color: oklch(var(--chart-2)); }

/* ------------------------------------------------------------------ map (map/StreamMap.tsx look on Leaflet + OSM) */

.map { position: relative; z-index: 0; isolation: isolate; height: 460px; border-radius: calc(var(--radius) + 4px); border: 1px solid oklch(var(--border)); overflow: hidden; background: oklch(var(--muted)); }
.map.dash { height: 320px; border: 0; border-radius: 0; }
.map .leaflet-tile-pane { filter: grayscale(1) contrast(0.9) brightness(1.04); }
.dark .map .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(0.78) contrast(0.92); }
.map .leaflet-container { background: oklch(var(--muted)); font-family: var(--font-sans); }
.map .leaflet-control-attribution { background: oklch(var(--card) / 0.8); color: oklch(var(--muted-foreground)); font-size: 10px; }
.map .leaflet-control-attribution a { color: inherit; }
.map .leaflet-bar a { background: oklch(var(--popover)); color: oklch(var(--popover-foreground)); border-color: oklch(var(--border)); }
.map .leaflet-popup-content-wrapper, .map .leaflet-popup-tip { background: oklch(var(--popover)); color: oklch(var(--popover-foreground)); box-shadow: var(--shadow-md); border-radius: var(--radius); }
.map .leaflet-popup-content { margin: 0.75rem 1rem; font-size: 0.8125rem; line-height: 1.4; }
.map .leaflet-container a.leaflet-popup-close-button { color: oklch(var(--muted-foreground)); }
path.pt { stroke: oklch(var(--primary)); fill: oklch(var(--primary)); fill-opacity: 0.3; stroke-width: 1.5; }
path.pt.live { stroke: oklch(var(--chart-2)); fill: oklch(var(--chart-2)); fill-opacity: 0.75; }

/* ------------------------------------------------------------------ auth (pages/Login.tsx) */

.auth { display: flex; min-height: 100vh; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; background: oklch(var(--background)); }
.auth-brand { margin-bottom: 2rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-brand svg { width: 5rem; height: 5rem; margin-bottom: 1rem; }
.auth-brand h1 { font-size: 2.25rem; line-height: 2.5rem; font-weight: 700; letter-spacing: -0.025em; }
.auth-brand p { margin-top: 0.5rem; color: oklch(var(--muted-foreground)); }
.auth .card { width: 100%; max-width: 28rem; gap: 1.5rem; }
.auth-tagline { margin-top: 1.5rem; text-align: center; font-size: 0.75rem; color: oklch(var(--muted-foreground)); }

@media (max-width: 767px) {
  .page { padding: 1rem; }
  .map { height: 340px; }
}

/* ------------------------------------------------------------------ sheet (ui/sheet.tsx, history/SessionDetailSheet.tsx) */

.sheet-overlay { position: fixed; inset: 0; z-index: 900; background: hsl(var(--overlay) / 0.5); animation: fade 200ms ease-out; }
.sheet {
  position: fixed; inset: 0 0 0 auto; z-index: 901; display: flex; flex-direction: column; gap: 1rem; width: 100%; max-width: 500px; height: 100%;
  overflow-y: auto; background: oklch(var(--card)); color: oklch(var(--card-foreground)); border-left: 1px solid oklch(var(--border));
  box-shadow: var(--shadow-lg); animation: slide-in 300ms ease-out; padding-bottom: 1.5rem;
}
.sheet .s-head { display: flex; flex-direction: column; gap: 0.375rem; padding: 1rem 1rem 0; }
.sheet .s-title { display: flex; align-items: center; gap: 0.5rem; padding-right: 2rem; font-size: 1rem; font-weight: 600; }
.sheet .s-title .badge { margin-left: auto; }
.sheet .s-close { position: absolute; top: 1rem; right: 1rem; opacity: 0.7; border-radius: 4px; }
.sheet .s-close:hover { opacity: 1; }
.sheet .s-body { display: flex; flex-direction: column; gap: 0.75rem; padding: 0 1.25rem; }
.s-sec { border-radius: var(--radius); border: 1px solid oklch(var(--border)); padding: 0.75rem; }
.s-sec-h { margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.s-sec-h .t { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 500; }
.s-sec-h .ic { display: flex; width: 1.5rem; height: 1.5rem; align-items: center; justify-content: center; border-radius: 9999px; background: oklch(var(--primary) / 0.1); color: oklch(var(--primary)); }
.s-sec-h .ic svg { width: 0.875rem; height: 0.875rem; }
.kv-rows { display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.875rem; }
.kv-rows > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.kv-rows > div > span:first-child { color: oklch(var(--muted-foreground)); flex-shrink: 0; }
.kv-rows > div > span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.s-hero { display: flex; gap: 0.75rem; border-radius: var(--radius); border: 1px solid oklch(var(--border)); padding: 0.75rem; }
.s-hero img { width: 3.5rem; height: 5rem; flex-shrink: 0; border-radius: 4px; object-fit: cover; }
.s-user { display: flex; align-items: center; gap: 0.75rem; border-radius: var(--radius); border: 1px solid oklch(var(--border)); padding: 0.75rem; }
a.s-user:hover { background: oklch(var(--muted) / 0.5); }
.seg-table { width: 100%; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.seg-table th { padding: 0 0.75rem 0.375rem 0; text-align: left; font-weight: 500; color: oklch(var(--muted-foreground)); }
.seg-table th:last-child, .seg-table td:last-child { text-align: right; padding-right: 0; }
.seg-table td { padding: 0.25rem 0.75rem 0.25rem 0; }
.collapsible-btn { display: flex; width: 100%; align-items: center; justify-content: space-between; font-size: 0.75rem; color: oklch(var(--muted-foreground)); padding-top: 0.25rem; }
.collapsible-btn:hover { color: oklch(var(--foreground)); }
.collapsible-btn svg { transition: transform 150ms; }
.collapsible-btn[aria-expanded='true'] svg { transform: rotate(180deg); }

/* stream details (history/StreamDetailsPanel.tsx) */
.sd { display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.8125rem; }
.sd-group { display: flex; flex-direction: column; gap: 0.25rem; }
.sd-head { display: grid; grid-template-columns: 6.5rem 1fr 1rem 1fr; gap: 0.5rem; align-items: center; font-size: 0.75rem; font-weight: 500; color: oklch(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.025em; }
.sd-head.solo { display: flex; }
.sd-head .g { white-space: nowrap; display: flex; align-items: center; gap: 0.375rem; color: oklch(var(--foreground)); text-transform: none; letter-spacing: 0; font-size: 0.8125rem; }
.sd-row { display: grid; grid-template-columns: 6.5rem 1fr 1rem 1fr; gap: 0.5rem; align-items: baseline; }
.sd-row .l { color: oklch(var(--muted-foreground)); }
.sd-row .a { text-align: center; color: oklch(var(--muted-foreground)); }
.sd-row .v { min-width: 0; overflow-wrap: anywhere; }
.sd-row .v.changed { color: oklch(var(--warning)); font-weight: 500; }
.sd-note { font-size: 0.75rem; color: oklch(var(--muted-foreground)); }

/* filter chips (history/HistoryFilters.tsx) */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.chip { display: inline-flex; height: 1.75rem; align-items: center; gap: 0.375rem; border-radius: 9999px; background: oklch(var(--secondary)); color: oklch(var(--secondary-foreground)); padding: 0 0.375rem 0 0.625rem; font-size: 0.75rem; }
.chip svg { width: 0.75rem; height: 0.75rem; color: oklch(var(--muted-foreground)); }
.chip .k { color: oklch(var(--muted-foreground)); }
.chip .v { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.chip button { display: flex; border-radius: 9999px; padding: 0.125rem; }
.chip button:hover { background: oklch(var(--muted-foreground) / 0.2); }
.btn .count { margin-left: 0.25rem; display: inline-flex; height: 1.25rem; align-items: center; border-radius: 9999px; background: oklch(var(--secondary)); color: oklch(var(--secondary-foreground)); padding: 0 0.375rem; font-size: 0.75rem; }
.btn .chev { width: 0.875rem !important; height: 0.875rem !important; opacity: 0.5; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 400px; }
.search-box > svg { position: absolute; left: 0.625rem; top: 50%; transform: translateY(-50%); color: oklch(var(--muted-foreground)); pointer-events: none; }
.filter-bar .search-box input:not([type=checkbox]):not([type=radio]) { height: 2rem; padding-left: 2rem; padding-right: 2rem; }
.search-box .clear { position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); color: oklch(var(--muted-foreground)); }
.search-box .clear:hover { color: oklch(var(--foreground)); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.spinner { width: 1rem; height: 1rem; border-radius: 9999px; border: 2px solid oklch(var(--primary)); border-top-color: transparent; animation: spin 1s linear infinite; }

/* menus: checkbox items and sub-menus */
.menu .m-check { padding-left: 2rem; }
.menu .m-check.on::before {
  content: ''; position: absolute; left: 0.625rem; top: 50%; width: 0.875rem; height: 0.875rem; margin-top: -0.4375rem; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.menu .m-sub-trigger .count, .menu .m-item .count { margin-left: auto; border-radius: 9999px; background: oklch(var(--secondary)); padding: 0 0.375rem; font-size: 0.75rem; }
.menu .m-sub-trigger > svg:last-child { margin-left: auto; }
.menu .m-sub-trigger .count + svg { margin-left: 0.25rem; }
.menu .m-sub-trigger.open { background: oklch(var(--accent)); }
.menu.scroll { max-height: 250px; overflow-y: auto; }
.menu .m-item .avatar { width: 1.25rem; height: 1.25rem; font-size: 0.625rem; }
.menu .m-empty { padding: 0.375rem 0.5rem; font-size: 0.8125rem; color: oklch(var(--muted-foreground)); }

/* sortable headers and history cells */
.table th button.sort { display: inline-flex; align-items: center; gap: 0.25rem; text-transform: inherit; letter-spacing: inherit; font: inherit; color: inherit; margin-left: -0.5rem; padding: 0.25rem 0.5rem; border-radius: calc(var(--radius) - 2px); }
.table th button.sort:hover { background: oklch(var(--accent)); color: oklch(var(--accent-foreground)); }
.table th button.sort svg { width: 0.875rem; height: 0.875rem; }
.table th button.sort .dim { opacity: 0.5; }
.table tr.clickable { cursor: pointer; }
.cell-row { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.cell-row > svg { color: oklch(var(--muted-foreground)); }
.cell-main { min-width: 0; flex: 1; }
.cell-main .top { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.cell-main .top > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cell-sub { font-size: 0.75rem; color: oklch(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 0.375rem; }
.state-ic { width: 1rem; height: 1rem; flex-shrink: 0; }
.tier { display: inline-flex; align-items: center; gap: 0.25rem; border-radius: 4px; background: oklch(var(--muted)); color: oklch(var(--muted-foreground)); padding: 0.125rem 0.25rem; font-size: 0.75rem; font-weight: 500; white-space: nowrap; }
.tier i { width: 0.375rem; height: 0.375rem; border-radius: 9999px; flex-shrink: 0; }
.mini-progress { display: flex; align-items: center; gap: 0.5rem; }
.mini-progress .progress { width: 3rem; height: 0.375rem; }
.mini-progress span { font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.mono-sm { font-family: var(--font-mono); font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.history-wrap { max-height: calc(100vh - 17rem); min-height: 20rem; overflow: auto; }
.history-wrap thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 0 oklch(var(--border)); }
.history-wrap .table thead tr { border-bottom: 0; }
.load-sentinel { display: flex; justify-content: center; padding: 1rem; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }

path.pt-line { stroke: oklch(var(--destructive)); stroke-width: 2; stroke-dasharray: 6 6; fill: none; }
.card > .filter-bar + .chips, .card > .chips + .bulk { margin-top: 0; }

.line-chart { position: relative; }
.line-chart .x-ticks { position: relative; height: 1rem; margin-top: -1.25rem; }
.line-chart .x-ticks span { position: absolute; transform: translateX(-50%); font-size: 0.6875rem; color: oklch(var(--muted-foreground)); white-space: nowrap; }
.user-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; }
.user-head .who { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; flex: 1; }
.user-head .meta { font-size: 0.875rem; color: oklch(var(--muted-foreground)); }
.server-pills { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.server-pill { display: inline-flex; align-items: center; gap: 0.25rem; border-radius: 9999px; border: 1px solid oklch(var(--border)); padding: 0 0.5rem; font-size: 0.6875rem; line-height: 1.125rem; color: oklch(var(--muted-foreground)); white-space: nowrap; }
.line-tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid oklch(var(--border)); margin-bottom: 1.5rem; overflow-x: auto; overflow-y: hidden; }
.line-tabs a { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 0.125rem 0.625rem; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 0.875rem; font-weight: 500; color: oklch(var(--muted-foreground)); white-space: nowrap; }
.line-tabs a:hover { color: oklch(var(--foreground)); }
.line-tabs a[aria-current='page'] { color: oklch(var(--foreground)); border-color: oklch(var(--foreground)); }
.grid-5 { display: grid; gap: 1.5rem; }
@media (min-width: 1024px) { .grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .span-3 { grid-column: span 3; } .span-2 { grid-column: span 2; } .grid-3.lg { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .stat-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .stat-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stat-v .delta { margin-left: 0.5rem; font-size: 0.75rem; font-weight: 500; }
.stat-v .delta-l { margin-left: 0.25rem; font-size: 0.75rem; font-weight: 400; color: oklch(var(--muted-foreground)); }
.list-rows { display: flex; flex-direction: column; gap: 0.75rem; }
.list-rows .lr { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.list-rows .lr .grow { min-width: 0; flex: 1; }
.list-rows .lr .t { font-size: 0.875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-rows .lr .s { font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.list-rows .lr .n { font-size: 0.875rem; font-variant-numeric: tabular-nums; }

.sb-server { display: flex; align-items: center; gap: 0.5rem; overflow: hidden; margin: 0 0.5rem 0.5rem; padding: 0.5rem; font-size: 0.875rem; font-weight: 500; color: oklch(var(--muted-foreground)); }
.sb-server span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-server-pick { padding: 0 0.5rem 0.5rem; }
.sb-server-pick .sb-btn { border-left-width: 2px; }
.collapsed .sb-server span, .collapsed .sb-server-pick .label { display: none; }
.collapsed .sb-server { justify-content: center; margin: 0 0 0.5rem; }
.collapsed .sb-server-pick { padding: 0 0 0.5rem; display: flex; justify-content: center; }

.me-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.5rem; margin-top: 1.5rem; }
.me-row:empty { display: none; }
.me-shelf { flex: 1 1 100%; min-width: 0; }
.me-card { flex: 1 1 20rem; max-width: 100%; }
.me-row .section + .section { margin-top: 0; }
.tier-bar { display: flex; height: 0.5rem; overflow: hidden; border-radius: 9999px; }
.tier-bar i { display: block; height: 100%; }

/* map page (pages/Map.tsx) */
.map-page { margin: -1.5rem; height: 100vh; display: flex; flex-direction: column; }
@media (max-width: 767px) { .map-page { margin: -1rem; height: calc(100vh - 3rem); } }
.map-bar { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; border-bottom: 1px solid oklch(var(--border)); background: oklch(var(--card) / 0.5); padding: 0.5rem 1rem; }
.map-bar .tg > a { gap: 0.375rem; font-size: 0.75rem; padding: 0 0.625rem; }
.map-bar .tg svg { width: 0.875rem; height: 0.875rem; }
.vsep { width: 1px; height: 1rem; background: oklch(var(--border)); }
.map-sum { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; }
.map-sum b { font-weight: 600; font-variant-numeric: tabular-nums; }
.map-main { display: flex; min-height: 0; flex: 1; flex-direction: column; }
@media (min-width: 768px) { .map-main { flex-direction: row; } }
.map-canvas { position: relative; min-height: 0; flex: 1; }
.map.full { height: 100%; border: 0; border-radius: 0; min-height: 300px; }
.map-side { position: relative; height: 18rem; flex-shrink: 0; overflow: auto; border-top: 1px solid oklch(var(--border)); background: oklch(var(--card) / 0.5); }
@media (min-width: 768px) { .map-side { height: auto; width: 380px; border-top: 0; border-left: 1px solid oklch(var(--border)); } }
.ml-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; border-bottom: 1px solid oklch(var(--border)); padding: 0.625rem 1rem; }
.ml-head > div { display: flex; align-items: baseline; gap: 0.5rem; }
.ml-none { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; border-bottom: 1px solid oklch(var(--border)); padding: 0.75rem 1rem; }
.ml-row { position: relative; display: flex; width: 100%; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; text-align: left; }
.ml-row:hover { background: oklch(var(--muted) / 0.6); }
.ml-row .rank { width: 1.25rem; flex-shrink: 0; text-align: right; font-size: 0.75rem; color: oklch(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.ml-row .grow { min-width: 0; flex: 1; display: grid; }
.ml-row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; font-weight: 500; }
.ml-row .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.ml-row .faces { display: flex; align-items: center; }
.ml-row .faces .avatar { width: 1.5rem; height: 1.5rem; font-size: 0.625rem; margin-left: -0.375rem; box-shadow: 0 0 0 2px oklch(var(--background)); }
.ml-row .n { width: 3rem; flex-shrink: 0; text-align: right; font-size: 0.875rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.ml-row i { position: absolute; bottom: 0; left: 0; height: 2px; background: oklch(var(--primary) / 0.5); }
.lp { padding: 1rem; }
.lp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 1rem 0; }
.lp-stats > div { display: grid; border-radius: var(--radius); background: oklch(var(--card-raised)); border: 1px solid oklch(var(--border)); padding: 0.5rem 0.75rem; }
.lp-stats b { font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.lp-stats span { font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.lp .lr { width: 100%; border-radius: calc(var(--radius) - 2px); padding: 0.25rem; }
.lp .lr:hover { background: oklch(var(--muted) / 0.6); }
.lp .lr .grow { display: grid; }
path.heat { fill: oklch(var(--chart-2)); filter: blur(10px); }
path.pt.hm { fill-opacity: 0.9; }

/* library, browse and media detail */
.empty-shelf { border: 1px dashed oklch(var(--border)); border-radius: calc(var(--radius) + 4px); padding: 1.5rem; text-align: center; font-size: 0.875rem; color: oklch(var(--muted-foreground)); }
.shelf-item { width: 174px; }
.poster-card { position: relative; }
.poster-wrap { position: relative; display: block; }
.poster-chip { position: absolute; top: 0.375rem; left: 0.375rem; z-index: 1; border-radius: 9999px; background: hsl(var(--overlay) / 0.75); color: hsl(var(--overlay-foreground)); padding: 0 0.5rem; font-size: 0.6875rem; line-height: 1.25rem; font-weight: 600; }
.watched-badge { position: absolute; top: 0.375rem; right: 0.375rem; display: flex; width: 1.5rem; height: 1.5rem; align-items: center; justify-content: center; border-radius: 9999px; background: oklch(var(--success)); color: oklch(var(--background)); }
.watched-badge.partial { background: hsl(var(--overlay) / 0.75); color: hsl(var(--overlay-foreground)); }
.watched-badge svg { width: 0.875rem; height: 0.875rem; }
.server-dots { display: inline-flex; gap: 0.125rem; margin-left: 0.375rem; vertical-align: middle; }
.server-dots i { width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: oklch(var(--primary)); }
.browse { display: flex; gap: 0.75rem; }
.browse #grid { flex: 1; min-width: 0; }
.scrubber { position: sticky; top: 1rem; align-self: flex-start; display: flex; flex-direction: column; font-size: 0.6875rem; }
.scrubber a { padding: 0.0625rem 0.375rem; border-radius: 4px; color: oklch(var(--muted-foreground)); text-align: center; }
.scrubber a:hover, .scrubber a.on { background: oklch(var(--primary) / 0.15); color: oklch(var(--primary)); }
@media (max-width: 639px) { .scrubber { display: none; } }
.filter-panel { border-top: 1px solid oklch(var(--border)); padding-top: 0.75rem; }
.share-bars { display: flex; flex-direction: column; gap: 0.5rem; }
.sb-row { display: grid; grid-template-columns: minmax(5rem, 28%) 1fr auto; gap: 0.75rem; align-items: center; font-size: 0.8125rem; }
.sb-row .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-row .sb { display: grid; gap: 2px; }
.sb-row .sb i { display: block; height: 0.375rem; border-radius: 9999px; }
.sb-row .sb i.items { background: oklch(var(--muted-foreground) / 0.6); }
.sb-row .sb i.plays { background: oklch(var(--primary)); }
.donut-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.donut-wrap .list-rows { flex: 1; min-width: 10rem; }
.donut { position: relative; width: 8rem; height: 8rem; border-radius: 9999px; flex-shrink: 0; }
.donut::after { content: ''; position: absolute; inset: 1.25rem; border-radius: 9999px; background: oklch(var(--card)); }
.donut span { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; font-size: 1.125rem; font-weight: 600; }
.hero { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 4px); border: 1px solid oklch(var(--border)); background: oklch(var(--card)); }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.18; filter: blur(32px); transform: scale(1.1); }
.hero-body { position: relative; display: flex; gap: 1.5rem; padding: 1.5rem; align-items: flex-end; }
@media (max-width: 639px) { .hero-body { flex-direction: column; align-items: flex-start; } }
.heat { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 0.375rem; }
.heat i { width: 1rem; height: 1rem; border-radius: 3px; background: oklch(var(--muted)); }
.heat i.w { background: oklch(var(--primary)); }
.heat i.p { background: oklch(var(--primary) / 0.4); }

/* ------------------------------------------------------------------ automations (components/automations, builder, gallery) */
.min-w-0 { min-width: 0; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.font-normal { font-weight: 400; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.narrow { max-width: 56rem; margin: 0 auto; width: 100%; }
.narrow > .back { margin-left: -0.5rem; }
kbd { display: inline-flex; min-width: 1.25rem; height: 1.25rem; align-items: center; justify-content: center; border-radius: 4px; border: 1px solid oklch(var(--border)); background: oklch(var(--muted)); padding: 0 0.25rem; font: 500 0.6875rem/1 ui-sans-serif, system-ui, sans-serif; color: oklch(var(--muted-foreground)); }
.kbd-hints { display: inline-flex; align-items: center; gap: 0.75rem; }
.kbd-hints > span { display: inline-flex; align-items: center; gap: 0.25rem; }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
.dot { display: inline-block; width: 0.5rem; height: 0.5rem; flex-shrink: 0; border-radius: 9999px; background: oklch(var(--muted-foreground)); }
.dot-success { background: oklch(var(--success)); }
.dot-muted { background: oklch(var(--muted-foreground) / 0.5); }
.dot-danger { background: oklch(var(--destructive)); }
.dot-primary { display: inline-block; width: 0.375rem; height: 0.375rem; border-radius: 9999px; background: oklch(var(--primary)); }
.item-media { display: inline-flex; width: 2rem; height: 2rem; flex-shrink: 0; align-items: center; justify-content: center; border-radius: calc(var(--radius) - 4px); border: 1px solid oklch(var(--border)); background: oklch(var(--muted)); color: oklch(var(--foreground)); }
.item-media > svg { width: 1rem; height: 1rem; }
.item-media.lg { width: 2.5rem; height: 2.5rem; }
.item-media.lg > svg { width: 1.25rem; height: 1.25rem; }
.item-media.dashed { border-style: dashed; background: oklch(var(--muted) / 0.6); }
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group > input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.input-group > .addon { display: inline-flex; align-items: center; padding: 0 0.625rem; border: 1px solid oklch(var(--input)); border-left: 0; border-radius: 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0; font-size: 0.8125rem; color: oklch(var(--muted-foreground)); background: oklch(var(--muted) / 0.4); white-space: nowrap; }
.input-group > input:only-child { border-radius: calc(var(--radius) - 2px); }
.field-err, .field-error { font-size: 0.8125rem; color: oklch(var(--destructive)); }
.row-warning { display: flex; align-items: flex-start; gap: 0.375rem; margin-top: 0.375rem; font-size: 0.75rem; color: oklch(var(--foreground)); }
.row-warning svg { margin-top: 0.125rem; }

/* list */
.auto-name { display: flex; align-items: flex-start; gap: 0.75rem; min-width: 0; }
.auto-name > .min-w-0 { flex: 1; }
.auto-name p { max-width: 42rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#at td:nth-child(2) { width: 100%; max-width: 0; min-width: 16rem; }
#at td:nth-child(n+3) { white-space: nowrap; }
.row.nowrap { flex-wrap: nowrap; }
.auto-name .meta, .gallery-row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.auto-name .meta .sep { opacity: 0.5; }
.table td.end { text-align: right; }
.sort-h { display: inline-flex; align-items: center; gap: 0.375rem; font: inherit; color: inherit; }
.sort-h svg { opacity: 0.5; }
.sort-h.on svg { opacity: 1; }
.table-pager { justify-content: space-between; padding-top: 0.5rem; }
.bulk.floating { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 50; margin: 0; border-radius: calc(var(--radius) + 4px); border: 1px solid oklch(var(--border)); background: oklch(var(--popover)); padding: 0.5rem 0.75rem; box-shadow: var(--shadow-lg); }
.auto-empty { gap: 1rem; }
.auto-empty .es-icon, .empty-state .es-icon { display: flex; width: 3rem; height: 3rem; align-items: center; justify-content: center; border-radius: calc(var(--radius) + 2px); background: oklch(var(--muted)); }
.empty-state .es-icon svg { width: 1.5rem; height: 1.5rem; }
.empty-state h3 { font-size: 1.125rem; font-weight: 500; }
.auto-empty .featured { display: grid; width: 100%; max-width: 42rem; gap: 0.5rem; text-align: left; }
@media (min-width: 640px) { .auto-empty .featured { grid-template-columns: 1fr 1fr; } }
.start-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; }

/* gallery / dialogs */
dialog.dlg.wide { max-width: min(42rem, calc(100% - 2rem)); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
dialog.dlg.wide:not([open]) { display: none; }
dialog.dlg.gallery-dlg { height: min(72vh, 40rem); }
dialog.dlg.export-dlg { max-height: min(86vh, 44rem); }
@media (max-width: 640px) { dialog.dlg.wide { max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; } }
.g-head { position: relative; display: flex; align-items: flex-start; gap: 0.5rem; padding: 1.25rem 3rem 0.75rem 1.5rem; }
.g-head .d-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.125rem; font-weight: 600; }
.g-head .d-desc { margin-top: 0.25rem; font-size: 0.875rem; color: oklch(var(--muted-foreground)); }
.g-head .g-close { position: absolute; right: 0.75rem; top: 0.75rem; }
.g-head > .btn:first-child { margin-left: -0.5rem; }
.builtin-mark { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 400; }
.g-search { position: relative; margin: 0 1rem; border-bottom: 1px solid oklch(var(--border)); }
.g-search > svg { position: absolute; left: 0.5rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: oklch(var(--muted-foreground)); }
.g-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; padding-left: 2rem !important; height: 2.75rem; }
.g-list, .g-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0.5rem 1rem 1rem; }
.g-scroll { padding: 0.25rem 1.5rem 1.5rem; }
.g-group { display: grid; gap: 0.375rem; margin-top: 0.5rem; }
.g-group-h { padding: 0.375rem 0.5rem 0; font-size: 0.75rem; font-weight: 500; color: oklch(var(--muted-foreground)); }
.g-empty { padding: 2.5rem 1rem; text-align: center; }
.g-foot { display: flex; gap: 1rem; border-top: 1px solid oklch(var(--border)); padding: 0.5rem 1rem; font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.g-foot > span { display: inline-flex; align-items: center; gap: 0.25rem; }
@media (max-width: 640px) { .g-foot { display: none; } }
.gallery-row { display: flex; width: 100%; align-items: flex-start; gap: 0.75rem; border-radius: var(--radius); border: 1px solid oklch(var(--border)); background: oklch(var(--card)); padding: 0.625rem 0.75rem; text-align: left; transition: background 120ms, border-color 120ms; }
.dark .gallery-row { background: oklch(var(--card-raised, var(--card))); }
.gallery-row:hover, .gallery-row:focus-visible { border-color: oklch(var(--primary) / 0.4); background: oklch(var(--accent) / 0.4); outline: none; }
.gallery-row .g-body { display: grid; flex: 1; min-width: 0; gap: 0.125rem; }
.gallery-row .g-title { font-size: 0.875rem; font-weight: 500; }
.gallery-row .g-desc { font-size: 0.8125rem; line-height: 1.125rem; color: oklch(var(--muted-foreground)); text-wrap: pretty; }
.gallery-row .chev { align-self: center; color: oklch(var(--muted-foreground)); opacity: 0; transition: opacity 120ms; }
.gallery-row:hover .chev, .gallery-row:focus-visible .chev { opacity: 1; }
@media (max-width: 640px) { .gallery-row .chev { opacity: 0.6; } }
details.raw summary { cursor: pointer; }
details.raw pre { margin-top: 0.5rem; max-height: 16rem; overflow: auto; border-radius: var(--radius); background: oklch(var(--muted) / 0.5); padding: 0.75rem; }

/* sentence + effects */
.sentence-panel { border-radius: var(--radius); border: 1px solid oklch(var(--border)); border-left: 2px solid oklch(var(--primary) / 0.55); background: oklch(var(--muted) / 0.35); padding: 1rem; }
.sentence-panel h2 { display: flex; align-items: center; gap: 0.375rem; margin-bottom: 0.5rem; font-size: 0.75rem; font-weight: 500; color: oklch(var(--muted-foreground)); }
.sentence-panel .sentence { font-size: 1rem; line-height: 1.625; color: oklch(var(--muted-foreground)); }
.sentence .frag { color: oklch(var(--foreground)); text-decoration: underline dotted; text-underline-offset: 4px; border-radius: 2px; }
.sentence .frag:hover { text-decoration-color: oklch(var(--foreground)); }
.sentence .slot { display: inline-flex; align-items: center; gap: 0.25rem; border-radius: 2px; border: 1px dashed oklch(var(--primary) / 0.65); background: oklch(var(--primary) / 0.1); padding: 0.125rem 0.375rem; font-size: 0.9375em; color: oklch(var(--primary)); }
.effects { border-radius: var(--radius); background: oklch(var(--muted) / 0.25); padding: 0.75rem 0.875rem; }
.effects ul { display: flex; flex-direction: column; gap: 0.5rem; }
.effects li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; line-height: 1.375; }
.effects li svg { margin-top: 0.125rem; width: 0.9375rem; height: 0.9375rem; flex-shrink: 0; }

/* binding form, detail form */
.bind, .detail-body { display: flex; flex-direction: column; gap: 1.25rem; }
.detail-form { margin-top: 1.75rem; }
.answers, .this-auto { display: grid; gap: 0.75rem; }
.answers legend, .this-auto legend { display: flex; width: 100%; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; font-size: 0.875rem; font-weight: 500; }
.this-auto legend::after, .answers legend::after { content: ''; height: 1px; flex: 1; background: oklch(var(--border)); }
.answer-grid { display: grid; gap: 1rem 2rem; }
@media (min-width: 640px) { .answer-grid { grid-template-columns: 1fr 1fr; } .answer-grid > .wide { grid-column: 1 / -1; } }
.answer-grid .field, .identity .field, .action-fields .field { display: grid; gap: 0.375rem; align-content: start; }
.answer-grid .field > label, .identity .field > label, .action-fields .field > label { font-size: 0.875rem; font-weight: 500; }
.doors { display: grid; gap: 0.5rem; border-top: 1px solid oklch(var(--border)); padding-top: 1rem; }
.doors.sticky, .bind .doors { position: sticky; bottom: 0; z-index: 5; background: oklch(var(--background) / 0.95); backdrop-filter: blur(6px); padding-bottom: 0.75rem; }
dialog .bind .doors { background: oklch(var(--card) / 0.95); }
.identity { display: grid; gap: 1.25rem; border-radius: calc(var(--radius) + 4px); border: 1px solid oklch(var(--border)); background: oklch(var(--card)); padding: 1.25rem; }
.identity-grid { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 768px) { .identity-grid { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); column-gap: 1.5rem; } }
.auto-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; }
.chooser.select-like { display: inline-flex; width: 100%; height: 2.25rem; align-items: center; justify-content: space-between; gap: 0.5rem; border-radius: calc(var(--radius) - 2px); border: 1px solid oklch(var(--input)); padding: 0 0.75rem; font-size: 0.875rem; text-align: left; box-shadow: var(--shadow-xs); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dark .chooser.select-like { background: oklch(var(--input) / 0.3); }
.chooser.placeholder { color: oklch(var(--muted-foreground)); }
.chooser .chev { width: 1rem; height: 1rem; opacity: 0.5; flex-shrink: 0; }

/* activity + run sheet */
.run-summary { max-width: 28rem; }
.near-misses { display: grid; gap: 0.375rem; margin-top: 0.5rem; }
.near-misses li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.875rem; }
.kv-grid { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; border-radius: var(--radius); background: oklch(var(--muted) / 0.4); padding: 0.75rem; font-size: 0.875rem; }
.kv-grid dt { color: oklch(var(--muted-foreground)); }
.kv-grid dd { min-width: 0; overflow-wrap: anywhere; }
.verdicts { display: grid; gap: 0.5rem; }
.verdicts .step { border-radius: var(--radius); border: 1px solid oklch(var(--border)); padding: 0.75rem; }
.step-h { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.step-h svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.verdicts ul.checks, .lc-list ul.checks { display: grid; gap: 0.25rem; margin-top: 0.5rem; }
ul.checks li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; font-size: 0.8125rem; }

/* builder */
.builder { padding-bottom: 0; }
.b-title { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.flow { margin-top: 2rem; }
.flow-step { position: relative; padding: 0 0 2.25rem 2.75rem; }
.flow-step:last-child { padding-bottom: 0.5rem; }
.flow-line { position: absolute; top: 2.5rem; bottom: 0; left: 1rem; width: 1px; background: oklch(var(--border)); transform: translateX(-50%); }
.flow-step:last-child .flow-line { display: none; }
.flow-h { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; }
.flow-n { position: absolute; top: 0; left: 0; display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 9999px; border: 1px solid oklch(var(--border)); background: oklch(var(--card)); font-size: 0.75rem; font-weight: 600; color: oklch(var(--muted-foreground)); }
.flow-helper { margin: 0.25rem 0 0.875rem; }
.flow section:focus { outline: none; }
@media (max-width: 1023px) { .flow-step { padding-left: 0; padding-bottom: 1.75rem; } .flow-line { display: none; } .flow-n { position: static; width: 1.5rem; height: 1.5rem; } }
.section-empty { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; border-radius: calc(var(--radius) + 4px); border: 1px dashed oklch(var(--border)); background: oklch(var(--muted) / 0.2); padding: 2rem; text-align: center; }
.section-empty .item-media { width: 2.5rem; height: 2.5rem; margin-bottom: 0.25rem; }
.section-empty .btn { margin-top: 0.75rem; }
.section-line { margin-bottom: 0.75rem; }
.b-list { display: grid; gap: 0.5rem; }
.b-row { display: flex; align-items: flex-start; gap: 0.75rem; border-radius: var(--radius); border: 1px solid oklch(var(--border)); background: oklch(var(--card)); padding: 0.625rem 0.75rem; transition: box-shadow 200ms; }
.dark .b-row { background: oklch(var(--card-raised, var(--card))); }
.b-row.cond { align-items: center; }
.b-row.off { opacity: 0.6; }
.b-row.orphaned { border-left: 2px solid oklch(var(--warning)); background: oklch(var(--warning) / 0.05); }
.b-row.pulse, .group-card.pulse, .step-foot.pulse { box-shadow: 0 0 0 2px oklch(var(--primary) / 0.6); }
.b-row:focus-visible { outline: none; box-shadow: 0 0 0 3px oklch(var(--ring) / var(--ring-alpha)); }
.b-row > .item-media { margin-top: 0.125rem; }
.b-content { display: grid; flex: 1; min-width: 0; gap: 0.75rem; }
.b-fields { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-width: 0; }
.b-fields > .cfield { flex: 1 1 10rem; min-width: 10rem; width: auto; }
.b-fields > select.w-auto { flex: 0 0 auto; }
.b-value { flex: 1 1 9rem; min-width: 9rem; }
.b-issues { flex-basis: 100%; }
.b-actions { display: flex; flex-shrink: 0; align-items: center; gap: 0.5rem; }
.trig-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-height: 2rem; font-size: 0.875rem; font-weight: 500; }
input.inline-num { width: 5rem; }
.or-sep, .connective { display: flex; align-items: center; gap: 0.5rem; }
.or-sep::before, .or-sep::after, .connective .line { content: ''; height: 1px; flex: 1; background: oklch(var(--border)); }
.or-sep::before { flex: 0 0 0.75rem; }
.or-sep span { font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.connective select.xs { width: auto; height: 1.5rem; padding: 0 1.75rem 0 0.5rem; font-size: 0.75rem; font-weight: 500; background-position: right 0.375rem center; }
.cparams { display: flex; flex-basis: 100%; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.cparams .chooser { width: auto; min-width: 10rem; height: 2rem; }
.check-label { gap: 0.375rem; font-size: 0.875rem; }
.group-card { display: grid; gap: 0.5rem; border-radius: calc(var(--radius) + 2px); border: 1px solid oklch(var(--border)); padding: 0.75rem; }
.group-top { display: flex; justify-content: flex-end; margin: -0.25rem -0.25rem 0 0; }
.step-foot { display: grid; gap: 1rem; margin-top: 1rem; border-top: 1px dashed oklch(var(--border)); padding-top: 1rem; }
.step-foot:focus { outline: none; }
.step-foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.action-fields { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .action-fields { grid-template-columns: 1fr 1fr; } .action-fields > .wide { grid-column: 1 / -1; } }
.b-row.danger > .item-media { color: oklch(var(--destructive)); }
.send-msg { display: grid; gap: 0.5rem; border-top: 1px solid oklch(var(--border)); padding-top: 0.75rem; }
.send-msg[open] { gap: 0.75rem; }
.send-msg summary { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.send-msg .field { display: grid; gap: 0.375rem; }
.msg-preview { display: grid; gap: 0.25rem; border-radius: var(--radius); background: oklch(var(--muted) / 0.4); padding: 0.625rem 0.75rem; }
.if-toggle { display: flex; width: 100%; min-width: 0; align-items: center; gap: 0.5rem; min-height: 2rem; text-align: left; }
.if-body { display: grid; gap: 0.75rem; }
.branch { display: grid; gap: 0.5rem; border-left: 2px solid oklch(var(--border)); padding-left: 0.75rem; }
.branch-h { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: oklch(var(--muted-foreground)); }
.branch > .btn { justify-self: start; }
.record-as { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.record-as:focus { outline: none; }
.radio-cards { display: grid; gap: 0.5rem; }
@media (min-width: 640px) { .radio-cards { grid-template-columns: 1fr 1fr; } }
.radio-card { display: grid; gap: 0.125rem; cursor: pointer; border-radius: var(--radius); border: 1px solid oklch(var(--border)); padding: 0.625rem 0.75rem; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card.on { border-color: oklch(var(--primary)); background: oklch(var(--primary) / 0.06); }
.radio-card:has(input:focus-visible) { box-shadow: 0 0 0 3px oklch(var(--ring) / var(--ring-alpha)); }
.live-check { display: grid; gap: 0.5rem; }
.live-check:empty { display: none; }
.live-check p { display: flex; align-items: center; gap: 0.375rem; }
.lc-head { display: flex; align-items: center; gap: 0.375rem; color: oklch(var(--muted-foreground)); }
.lc-list { display: grid; gap: 0.25rem; }
.lc-list summary { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; border-radius: calc(var(--radius) - 2px); padding: 0.25rem 0.375rem; }
.lc-list summary:hover { background: oklch(var(--accent) / 0.5); }
.lc-list ul.checks { padding: 0 0.375rem 0.5rem 1.375rem; }
.b-foot { position: sticky; bottom: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1.75rem; border-top: 1px solid oklch(var(--border)); background: oklch(var(--background) / 0.95); padding: 0.75rem 0; backdrop-filter: blur(6px); }
.menu.picker { padding: 0; }
.picker-search { position: relative; }
.picker-search > svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: oklch(var(--muted-foreground)); }
.picker-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; height: 2.5rem; padding-left: 2.25rem !important; }
.picker-list { max-height: 300px; overflow-y: auto; padding: 0.25rem; }
.menu .m-label { font-size: 0.75rem; font-weight: 500; color: oklch(var(--muted-foreground)); }
.picker-item .pk { display: grid; min-width: 0; flex: 1; }
.picker-foot { display: flex; gap: 0.75rem; padding: 0.5rem 0.75rem; font-size: 0.75rem; color: oklch(var(--muted-foreground)); }
.picker-foot > span { display: inline-flex; align-items: center; gap: 0.25rem; }
.picker .m-sep { margin: 0; }

/* ==================================================================================================
   BING BONG theme — the look of the BING BONG uptime site (uptime.mobb.uk): warm paper and charcoal
   neutrals, a terracotta accent, Source Serif 4 headings over Inter, hairline rules instead of
   shadows, pill-shaped segmented controls. Everything above is Tracearr's component structure; this
   section re-skins it, so it comes last and wins.
   ================================================================================================== */

@font-face {
  font-family: 'Source Serif 4 Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('/fonts/source-serif-4-latin-opsz-normal.woff2') format('woff2-variations'), url('/fonts/source-serif-4-latin-opsz-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------ tokens (uptime site palette, as OKLCH) */

:root {
  /* light: bg #faf9f5 · sunk #f3eee4 · surface #fffdfa · ink #1f1e1d · muted #6b675c · line #e9e3d7 · line-strong #d8cfbd */
  --background: 0.982 0.005 95.1;
  --foreground: 0.236 0.002 67.7;
  --ink-2: 0.344 0.027 95.7;
  --card: 0.995 0.005 78.3;
  --card-foreground: 0.236 0.002 67.7;
  --popover: 0.995 0.005 78.3;
  --popover-foreground: 0.236 0.002 67.7;
  --primary: var(--accent-ll, 0.617) var(--accent-cl) var(--accent-h);
  --primary-foreground: 0.995 0.005 78.3;
  --link: calc(var(--accent-ll, 0.617) - 0.1) var(--accent-cl) var(--accent-h);
  --secondary: 0.95 0.014 84.6;
  --secondary-foreground: 0.236 0.002 67.7;
  --muted: 0.95 0.014 84.6;
  --muted-foreground: 0.514 0.018 90.3;
  --accent: 0.95 0.014 84.6;
  --accent-foreground: 0.236 0.002 67.7;
  --destructive: 0.525 0.15 31.9;
  --destructive-foreground: 0.995 0.005 78.3;
  --border: 0.917 0.017 84.6;
  --line-strong: 0.857 0.026 84.6;
  --input: 0.857 0.026 84.6;
  --control: 0.857 0.026 84.6;
  --ring: var(--accent-ll, 0.617) var(--accent-cl) var(--accent-h);
  --ring-alpha: 100%;
  --radius: 0.5rem;

  --success: 0.523 0.073 137.7;
  --success-bar: 0.748 0.05 136.6;
  --warning: 0.489 0.098 75.4;
  --warning-mark: 0.592 0.121 74;
  --info: 0.5 0.06 245;
  --none: 0.615 0.022 87.6;
  --card-raised: 0.982 0.005 95.1;

  --chart-1: 0.617 0.138 39;
  --chart-2: 0.523 0.073 137.7;
  --chart-3: 0.62 0.12 74;
  --chart-4: 0.52 0.06 245;
  --chart-5: 0.5 0.08 330;
  --chart-6: 0.56 0.06 190;
  --chart-7: 0.55 0.05 60;
  --chart-8: 0.55 0.12 15;
  --seq-1: 0.36 0.1 35;
  --seq-2: 0.43 0.12 37;
  --seq-3: 0.5 0.13 38;
  --seq-4: 0.57 0.135 39;
  --seq-5: 0.64 0.12 42;
  --seq-6: 0.71 0.1 48;
  --seq-7: 0.78 0.07 55;

  --overlay: 30 4% 12%;
  --overlay-foreground: 43 47% 94%;
  --poster-lift: 0 14px 30px -12px hsl(30 10% 15% / 0.35);

  --sidebar: 0.982 0.005 95.1;
  --sidebar-foreground: 0.236 0.002 67.7;
  --sidebar-primary: var(--accent-ll, 0.617) var(--accent-cl) var(--accent-h);
  --sidebar-accent: 0.95 0.014 84.6;
  --sidebar-accent-foreground: 0.236 0.002 67.7;
  --sidebar-border: 0.917 0.017 84.6;
  --sidebar-ring: var(--accent-ll, 0.617) var(--accent-cl) var(--accent-h);

  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: 0 12px 32px -14px hsl(30 10% 15% / 0.28);
  --shadow-lg: 0 20px 48px -18px hsl(30 10% 15% / 0.35);

  --font-sans: 'Inter Variable', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif;
  --font-serif: 'Source Serif 4 Variable', 'Source Serif 4', Newsreader, 'Iowan Old Style', Charter, 'Bitstream Charter', 'Palatino Linotype', 'Book Antiqua', P052, 'URW Palladio L', Georgia, serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  --r-control: 9px;
  --r-card: 12px;
}

.dark {
  /* dark: bg #1f1e1d · sunk #31302c · surface #262624 · ink #f5f1e8 · muted #aca597 · line #38362f · line-strong #4d493f */
  --background: 0.236 0.002 67.7;
  --foreground: 0.959 0.013 86.8;
  --ink-2: 0.878 0.02 84.6;
  --card: 0.268 0.004 106.6;
  --card-foreground: 0.959 0.013 86.8;
  --popover: 0.268 0.004 106.6;
  --popover-foreground: 0.959 0.013 86.8;
  --primary: var(--accent-ld, 0.672) var(--accent-cd) var(--accent-h);
  --primary-foreground: 0.236 0.002 67.7;
  --link: calc(var(--accent-ld, 0.672) + 0.08) calc(var(--accent-cd) * 0.8) var(--accent-h);
  --secondary: 0.309 0.007 95.3;
  --secondary-foreground: 0.959 0.013 86.8;
  --muted: 0.309 0.007 95.3;
  --muted-foreground: 0.724 0.021 84.6;
  --accent: 0.309 0.007 95.3;
  --accent-foreground: 0.959 0.013 86.8;
  --destructive: 0.683 0.147 32.8;
  --destructive-foreground: 0.236 0.002 67.7;
  --border: 0.333 0.012 93.8;
  --line-strong: 0.406 0.017 88.8;
  --input: 0.406 0.017 88.8;
  --control: 0.406 0.017 88.8;
  --ring: var(--accent-ld, 0.672) var(--accent-cd) var(--accent-h);
  --ring-alpha: 100%;

  --success: 0.727 0.068 136.8;
  --success-bar: 0.553 0.059 137.5;
  --warning: 0.751 0.128 79.5;
  --warning-mark: 0.751 0.128 79.5;
  --info: 0.74 0.06 245;
  --none: 0.632 0.02 86.2;
  --card-raised: 0.295 0.006 95;
  --poster-lift: 0 14px 30px -12px hsl(0 0% 0% / 0.6);

  --chart-1: 0.672 0.131 38.8;
  --chart-2: 0.727 0.068 136.8;
  --chart-3: 0.76 0.12 80;
  --chart-4: 0.72 0.06 245;
  --chart-5: 0.7 0.08 330;
  --chart-6: 0.74 0.06 190;
  --chart-7: 0.74 0.05 70;
  --chart-8: 0.7 0.11 15;
  --seq-1: 0.9 0.05 55;
  --seq-2: 0.84 0.08 48;
  --seq-3: 0.78 0.11 42;
  --seq-4: 0.72 0.13 39;
  --seq-5: 0.65 0.13 38;
  --seq-6: 0.58 0.12 37;
  --seq-7: 0.5 0.1 35;

  --sidebar: 0.236 0.002 67.7;
  --sidebar-foreground: 0.959 0.013 86.8;
  --sidebar-primary: var(--accent-ld, 0.672) var(--accent-cd) var(--accent-h);
  --sidebar-accent: 0.309 0.007 95.3;
  --sidebar-accent-foreground: 0.959 0.013 86.8;
  --sidebar-border: 0.333 0.012 93.8;
  --sidebar-ring: var(--accent-ld, 0.672) var(--accent-cd) var(--accent-h);

  --shadow-md: 0 14px 36px -14px hsl(0 0% 0% / 0.6);
  --shadow-lg: 0 22px 52px -18px hsl(0 0% 0% / 0.7);
}

/* ------------------------------------------------------------------ base */

html { background: oklch(var(--background)); }
body { font-variant-numeric: tabular-nums lining-nums; text-rendering: optimizeLegibility; }
:focus-visible { outline: 2px solid oklch(var(--ring)); outline-offset: 2px; }
.link, .btn.link, a.link { color: oklch(var(--link)); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: oklch(var(--link) / 0.45); }
.link:hover, .btn.link:hover { text-decoration-color: currentColor; }
.text-warning { color: oklch(var(--warning)); }
code { background: oklch(var(--muted)); font-weight: 600; letter-spacing: 0.02em; border-radius: 5px; }
::selection { background: oklch(var(--primary) / 0.25); }

/* serif display type, as on the uptime site */
.page-title, .detail-title, .section-h h2, .set-head h2, .card-title, dialog.dlg .d-title, .empty-state .title,
.auth-brand h1, .logo .word, .stat-v {
  font-family: var(--font-serif); font-optical-sizing: auto;
}
.page-title { font-size: 2.5rem; line-height: 1.1; font-weight: 400; letter-spacing: -0.012em; text-wrap: balance; margin: 0 0 1.75rem; }
.page-head > .page-title { flex-basis: 100%; margin-bottom: 1rem; }
.detail-title { font-size: 2rem; line-height: 1.15; font-weight: 400; letter-spacing: -0.012em; }
h1.font-semibold[style*='1.25rem'] { font-family: var(--font-serif); font-weight: 400 !important; font-size: 1.875rem !important; line-height: 1.2; letter-spacing: -0.012em; }
.section-h h2, .set-head h2 { font-size: 1.5rem; line-height: 1.25; font-weight: 400; letter-spacing: -0.012em; }
.section-h { margin-bottom: 1.125rem; align-items: flex-end; }
.section-h > svg { display: none; }
.section-h .caption { font-size: 0.8125rem; }
.section + .section { margin-top: 3rem; }
.card-title { font-size: 1.125rem; line-height: 1.3; font-weight: 600; }
.card-title.medium { font-weight: 500; }
.card-desc { font-size: 0.8125rem; }

/* ------------------------------------------------------------------ brand */

.logo { gap: 0.5rem; }
.logo .mark {
  display: none; width: 1.75rem; height: 1.75rem; flex-shrink: 0; align-items: center; justify-content: center; border-radius: 8px;
  border: 1px solid oklch(var(--line-strong)); background: oklch(var(--card)); color: oklch(var(--foreground));
  font: 700 0.95rem/1 var(--font-serif); letter-spacing: 0.02em;
}
.logo .word, .logo.sm .word { display: inline-flex; align-items: baseline; gap: 0.4375rem; font-size: 1.25rem; line-height: 1; font-weight: 400; letter-spacing: 0; }
.logo .word b, .auth-brand h1 b { font-weight: 700; font-size: 0.92em; letter-spacing: 0.025em; }
.logo .word span, .auth-brand h1 span { color: oklch(var(--muted-foreground)); }
.collapsed .logo .mark { display: inline-flex; }
@media (max-width: 767px) { .collapsed .sidebar .logo .mark { display: none; } }

/* ------------------------------------------------------------------ shell: sidebar and page */

.sidebar { background: oklch(var(--background)); border-right-color: oklch(var(--border)); }
.sb-header { border-bottom-color: oklch(var(--border)); }
.sb-brand { height: 4.25rem; padding: 0 0.75rem 0 1.25rem; }
.sb-content { padding: 0.75rem; }
.sb-btn { height: 2.25rem; padding: 0 0.625rem; gap: 0.625rem; border-radius: var(--r-control); color: oklch(var(--muted-foreground)); transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease; }
.sb-btn > svg { width: 1.0625rem; height: 1.0625rem; }
.sb-btn:hover, .sb-btn[aria-expanded='true'] { background: transparent; color: oklch(var(--foreground)); }
.sb-btn.active { background: oklch(var(--muted)); color: oklch(var(--foreground)); box-shadow: inset 0 0 0 1px oklch(var(--line-strong)); font-weight: 500; }
.sb-btn.active > svg { color: oklch(var(--primary)); }
.sb-btn.active::before { display: none; }
.sb-sep { margin: 0.625rem 0.5rem; background: oklch(var(--border)); }
.sb-badge { border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 1px oklch(var(--line-strong)); color: oklch(var(--warning)); top: 0.5rem; right: 0.5rem; }
.sb-dot { background: oklch(var(--warning-mark)); }
.sb-footer { padding: 0.75rem; border-top: 1px solid oklch(var(--border)); }
.sb-user { border-color: oklch(var(--border)); color: oklch(var(--foreground)); }
.sb-user:hover { background: oklch(var(--muted)); }
.sb-version { justify-content: space-between; padding: 0.125rem 0.125rem 0; font-size: 0.75rem; }
.sb-version .conn-dot { margin-left: auto; }
.conn-dot { background: oklch(var(--destructive)); }
.conn-dot.on { background: oklch(var(--success)); }
.collapsed .sb-version { display: none; }
.collapsed .sb-footer { border-top: 0; }
.collapsed .sb-btn { width: 2.25rem; height: 2.25rem; padding: 0; justify-content: center; }
.collapsed .sb-brand { padding: 0.75rem 0.5rem; gap: 0.5rem; }

.site-header { height: 3.75rem; background: oklch(var(--background)); border-bottom-color: oklch(var(--border)); }
.inset { background: oklch(var(--background)); }
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 3rem 2rem 6.5rem; }
.page:has(> .map-page) { max-width: none; padding: 1.5rem; }
@media (max-width: 767px) {
  .page { padding: 2rem 1rem 4.5rem; }
  .page:has(> .map-page) { padding: 1rem; }
  .page-title { font-size: 2.25rem; margin-bottom: 1.25rem; }
  .detail-title { font-size: 1.75rem; }
}

/* the uptime site's light / dark / system switch */
.theme-switch { display: inline-flex; gap: 2px; margin: 0; padding: 2px; min-width: 0; border: 1px solid oklch(var(--border)); border-radius: 999px; }
.theme-switch label { position: relative; display: flex; }
.theme-switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.theme-switch input + span { display: flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.5rem; border-radius: 999px; color: oklch(var(--muted-foreground)); pointer-events: none; transition: background-color 0.18s ease, color 0.18s ease; }
.theme-switch input + span svg { width: 0.9375rem; height: 0.9375rem; }
.theme-switch label:hover input + span { color: oklch(var(--foreground)); }
.theme-switch input:checked + span { background: oklch(var(--muted)); color: oklch(var(--foreground)); box-shadow: inset 0 0 0 1px oklch(var(--line-strong)); }
.theme-switch input:focus-visible + span { outline: 2px solid oklch(var(--ring)); outline-offset: 1px; }

/* ------------------------------------------------------------------ buttons (the uptime site's ink button) */

.btn { border-radius: var(--r-control); font-weight: 500; background: oklch(var(--foreground)); color: oklch(var(--background)); border: 1px solid oklch(var(--foreground)); transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease; }
.btn:hover { background: oklch(var(--foreground) / 0.86); }
.btn:focus-visible { border-color: oklch(var(--ring)); box-shadow: none; outline: 2px solid oklch(var(--ring)); outline-offset: 2px; }
.btn.outline, .dark .btn.outline { border-color: oklch(var(--line-strong)); background: oklch(var(--card)); color: oklch(var(--foreground)); }
.btn.outline:hover, .dark .btn.outline:hover { background: oklch(var(--muted)); color: oklch(var(--foreground)); }
.btn.secondary { background: oklch(var(--muted)); color: oklch(var(--foreground)); border-color: transparent; box-shadow: inset 0 0 0 1px oklch(var(--line-strong)); }
.btn.secondary:hover { background: oklch(var(--muted) / 0.7); }
.btn.ghost { border-color: transparent; background: transparent; color: inherit; }
.btn.ghost:hover, .dark .btn.ghost:hover { background: transparent; border-color: oklch(var(--line-strong)); color: oklch(var(--foreground)); }
.btn.destructive, .dark .btn.destructive { background: oklch(var(--destructive)); border-color: oklch(var(--destructive)); color: oklch(var(--destructive-foreground)); }
.btn.destructive:hover { background: oklch(var(--destructive) / 0.88); }
.btn.link, .btn.link:hover { background: transparent; border: 0; height: auto; padding: 0; }
.btn.kill:hover, .np-icons .btn.kill:hover { background: transparent; border-color: oklch(var(--destructive) / 0.5); color: oklch(var(--destructive)); }
.btn.xs, .btn.icon-xs { border-radius: 7px; }

/* ------------------------------------------------------------------ surfaces */

.card { border-radius: var(--r-card); border-color: oklch(var(--border)); background: oklch(var(--card)); box-shadow: none; }
.card .card { background: oklch(var(--card-raised)); }
.card-hover:hover { background: oklch(var(--muted) / 0.6); border-color: oklch(var(--line-strong)); }
.dark .card-hover:hover { background: oklch(var(--card-raised)); }
.table-card, .np, .map, .empty-state { border-radius: var(--r-card); }
.np { border-color: oklch(var(--border)); }
.np-bg { opacity: 0.12; }
.np-foot { background: transparent; border-top-color: oklch(var(--border)); }
.np-title h3 { font-size: 0.9375rem; }
.progress { background: oklch(var(--border)); }
.progress > i { background: oklch(var(--primary)); }

/* stat cards become the uptime site's ruled figure row */
.stat-grid { gap: 0; border-block: 1px solid oklch(var(--border)); }
.stat, .card .stat { border: 0; border-radius: 0; background: transparent; padding: 1.25rem 1.5rem 1.125rem; border-left: 1px solid oklch(var(--border)); align-items: flex-start; }
.stat-grid > .stat:nth-child(2n + 1) { border-left: 0; padding-left: 0; }
.stat-grid > .stat:nth-child(n + 3) { border-top: 1px solid oklch(var(--border)); }
@media (min-width: 640px) {
  .stat-grid:not(.five) > .stat:nth-child(n) { border-left: 1px solid oklch(var(--border)); padding-left: 1.5rem; border-top: 0; }
  .stat-grid:not(.five) > .stat:nth-child(4n + 1) { border-left: 0; padding-left: 0; }
  .stat-grid:not(.five) > .stat:nth-child(n + 5) { border-top: 1px solid oklch(var(--border)); }
}
@media (min-width: 1024px) {
  .stat-grid.five > .stat:nth-child(n) { border-left: 1px solid oklch(var(--border)); padding-left: 1.5rem; border-top: 0; }
  .stat-grid.five > .stat:nth-child(5n + 1) { border-left: 0; padding-left: 0; }
  .stat-grid.five > .stat:nth-child(n + 6) { border-top: 1px solid oklch(var(--border)); }
}
.card .stat-grid { border-bottom: 0; }
a.stat:hover, .dark a.stat:hover { background: transparent; }
a.stat:hover .stat-l { color: oklch(var(--foreground)); }
.stat-ic { display: none; }
.stat-body { display: flex; flex-direction: column-reverse; gap: 0.375rem; }
.stat-l { font-size: 0.8125rem; line-height: 1.3; }
.stat-v { font-size: 2.25rem; line-height: 1.12; font-weight: 400; letter-spacing: -0.01em; font-variant-numeric: lining-nums proportional-nums; overflow: visible; white-space: nowrap; }
.stat-v .suffix { margin-left: 0.25rem; font: 400 0.9375rem var(--font-sans); letter-spacing: 0; color: oklch(var(--muted-foreground)); }
.stat-v .badge, .stat-v .delta, .stat-v > span:not(.suffix) { font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 0; vertical-align: middle; }
@media (max-width: 767px) { .stat-v { font-size: 1.875rem; } .stat, .card .stat { padding: 1rem 1rem 0.875rem; } }

/* ------------------------------------------------------------------ badges and pills (outlined, like the uptime status pills) */

.badge { border-radius: 999px; background: oklch(var(--foreground)); color: oklch(var(--background)); font-weight: 500; }
.badge.secondary { background: oklch(var(--muted)); color: oklch(var(--foreground)); }
.badge.outline { border-color: oklch(var(--line-strong)); color: oklch(var(--foreground)); }
.badge.success, .badge.warning, .badge.danger, .badge.info { background: transparent; border-color: oklch(var(--line-strong)); font-weight: 600; }
.badge.success { color: oklch(var(--success)); }
.badge.warning { color: oklch(var(--warning)); }
.badge.danger { color: oklch(var(--destructive)); }
.badge.info { color: oklch(var(--info)); }
.badge.destructive { background: oklch(var(--destructive)); color: oklch(var(--destructive-foreground)); }
.pill { background: oklch(var(--muted)); }

/* ------------------------------------------------------------------ tabs and segmented controls */

.page-head { border-bottom-color: oklch(var(--border)); }
.tabs { gap: 1.75rem; }
.tabs a { font-weight: 400; padding: 0.75rem 0 0.875rem; transition: color 0.18s ease; }
.tabs a[aria-current='page'] { border-color: oklch(var(--primary)); }

.tg { gap: 2px; padding: 2px; border: 1px solid oklch(var(--border)); border-radius: 10px; background: oklch(var(--card)); box-shadow: none; }
.tg > a, .tg > button, .tg > :first-child, .tg > :last-child { height: 1.75rem; border: 0; border-radius: 7px; padding: 0 0.75rem; font-size: 0.8125rem; font-weight: 400; color: oklch(var(--muted-foreground)); transition: background-color 0.18s ease, color 0.18s ease; }
.tg > :hover { background: transparent; color: oklch(var(--foreground)); }
.tg > .on, .tg > .on:hover, .dark .tg > .on, .dark .tg > .on:hover { background: oklch(var(--muted)); color: oklch(var(--foreground)); box-shadow: inset 0 0 0 1px oklch(var(--line-strong)); }

/* ------------------------------------------------------------------ form controls */

.input, input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea,
.dark input:not([type=checkbox]):not([type=radio]), .dark select, .dark textarea {
  border-radius: var(--r-control); border-color: oklch(var(--line-strong)); background-color: oklch(var(--card)); box-shadow: none;
}
.dark select:hover, select:hover { background-color: oklch(var(--muted) / 0.6); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: oklch(var(--ring)); box-shadow: 0 0 0 3px oklch(var(--ring) / 0.22); }
input[type=checkbox]:not(.switch), .dark input[type=checkbox]:not(.switch) { border-color: oklch(var(--line-strong)); background: oklch(var(--card)); border-radius: 5px; }
input[type=checkbox]:not(.switch):checked { background: oklch(var(--foreground)); border-color: oklch(var(--foreground)); color: oklch(var(--background)); }
input.switch, .dark input.switch { border: 1px solid oklch(var(--line-strong)); background: oklch(var(--muted)); }
input.switch::before, .dark input.switch::before { top: 1px; left: 1px; width: 14px; height: 14px; background: oklch(var(--card)); box-shadow: 0 0 0 1px oklch(var(--line-strong)); }
input.switch:checked, .dark input.switch:checked { background: oklch(var(--success)); border-color: oklch(var(--success)); }
input.switch:checked::before, .dark input.switch:checked::before { background: oklch(var(--card)); box-shadow: none; transform: translateX(14px); }
.field > span:first-child, .label { font-weight: 500; }

/* ------------------------------------------------------------------ tables (the uptime site's data table) */

.table-card { border-color: oklch(var(--border)); background: oklch(var(--card)); }
.table th { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 0.75rem; background: oklch(var(--card)); color: oklch(var(--muted-foreground)); }
.table tr, .table thead tr { border-bottom-color: oklch(var(--border)); transition: background-color 0.18s ease; }
.table tbody tr:hover { background: oklch(var(--muted) / 0.55); }
.table th:first-child, .table td:first-child { padding-left: 1.125rem; }
.table th:last-child, .table td:last-child { padding-right: 1.125rem; }
.table.kv th:first-child, .table.kv td:first-child { padding-left: 0; }
.table.kv th { font-size: 0.8125rem; }
.table-foot { border-top-color: oklch(var(--border)); }

/* ------------------------------------------------------------------ overlays: menus, dialogs, sheets, toasts */

.menu { border-radius: 10px; border-color: oklch(var(--line-strong)); box-shadow: var(--shadow-md); padding: 0.3125rem; }
.menu .m-item { border-radius: 7px; }
.menu .m-item:hover, .menu .m-item:focus-visible { background: oklch(var(--muted)); color: oklch(var(--foreground)); }
dialog.dlg { border-radius: 14px; border-color: oklch(var(--line-strong)); box-shadow: var(--shadow-lg); }
dialog.dlg .d-title { font-size: 1.5rem; line-height: 1.2; font-weight: 400; letter-spacing: -0.012em; }
dialog.dlg::backdrop, .sheet-overlay, .scrim { background: hsl(var(--overlay) / 0.45); }
.toast { border-radius: 10px; border-color: oklch(var(--line-strong)); box-shadow: var(--shadow-md); }

/* ------------------------------------------------------------------ alerts and empty states */

.alert { border-radius: 10px; border-color: oklch(var(--line-strong)); background: oklch(var(--card)); }
.alert.warning { background: oklch(var(--card)); border-left: 3px solid oklch(var(--warning-mark)); color: oklch(var(--warning)); }
.alert.destructive { background: oklch(var(--card)); border-left: 3px solid oklch(var(--destructive)); }
.empty-state { border: 1px dashed oklch(var(--line-strong)); }
.empty-state .media { background: transparent; border: 1px solid oklch(var(--line-strong)); }
.empty-state .title { font-size: 1.5rem; line-height: 1.25; font-weight: 400; letter-spacing: -0.012em; }

/* ------------------------------------------------------------------ settings */

.settings-nav .g-label { text-transform: none; letter-spacing: 0; font-size: 0.8125rem; font-weight: 400; }
.settings-nav a { height: 2.125rem; border-radius: var(--r-control); color: oklch(var(--muted-foreground)); transition: background-color 0.18s ease, color 0.18s ease; }
.settings-nav a:hover { background: transparent; color: oklch(var(--foreground)); }
.settings-nav a.active { background: oklch(var(--muted)); color: oklch(var(--foreground)); box-shadow: inset 0 0 0 1px oklch(var(--line-strong)); }
.settings-nav a.active::before { display: none; }
.swatch { background: oklch(var(--accent-ll, 0.5) var(--accent-cl) var(--accent-h)); }
.dark .swatch { background: oklch(var(--accent-ld, 0.75) var(--accent-cd) var(--accent-h)); color: oklch(0.236 0.002 67.7); }
.server-name { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; }

/* ------------------------------------------------------------------ charts and map */

.col i { border-radius: 4px 4px 1px 1px; }
.hbar .b { background: oklch(var(--border)); }
.spark .grid line { stroke: oklch(var(--border)); }
.legend i { border-radius: 999px; }
.map { border-color: oklch(var(--border)); background: oklch(var(--muted)); }
.map .leaflet-tile-pane { filter: grayscale(1) sepia(0.28) contrast(0.88) brightness(1.03); }
.dark .map .leaflet-tile-pane { filter: grayscale(1) invert(1) sepia(0.22) brightness(0.74) contrast(0.9); }
.map .leaflet-popup-content-wrapper, .map .leaflet-popup-tip { border-radius: 10px; border: 1px solid oklch(var(--line-strong)); }
.map .leaflet-bar a { border-color: oklch(var(--line-strong)); }

/* ------------------------------------------------------------------ sign-in */

.auth { position: relative; }
.auth-top { position: absolute; top: 1rem; right: 1rem; }
.auth-brand { margin-bottom: 2.25rem; }
.auth-brand h1 { display: inline-flex; align-items: baseline; gap: 0.5rem; font-size: 2.75rem; line-height: 1.1; font-weight: 400; letter-spacing: -0.012em; }
.auth-brand p { margin-top: 0.75rem; font-size: 0.9375rem; }
.auth .card { max-width: 26rem; padding: 1.75rem; }
.auth-tagline { margin-top: 1.75rem; font-size: 0.8125rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
:root { --sidebar-width: 15.5rem; }
.sb-brand .logo { overflow: hidden; }
.sb-brand .logo .word { font-size: 1.1875rem; }
.sb-trigger { color: oklch(var(--muted-foreground)); }

/* ==================================================================================================
   Polish — in the manner of Claude's interface: a tinted sidebar beside a lighter page, raised cards
   with soft two-layer shadows, 8–16px radii, an accent focus ring with a faint glow, quiet alpha hovers,
   and serif display type for titles. Palette stays BING BONG's.
   ================================================================================================== */

:root {
  --page: 0.982 0.005 95.1;            /* #faf9f5 */
  --rail: 0.962 0.01 91;               /* sidebar, a shade deeper than the page */
  --raised: 1 0 0;                     /* cards */
  --hover: 0.236 0.002 67.7 / 0.055;
  --pressed: 0.236 0.002 67.7 / 0.085;
  --card: 1 0 0;
  --popover: 1 0 0;
  --card-raised: 0.975 0.006 90;
  --border: 0.905 0.014 86;
  --line-strong: 0.85 0.02 85;
  --input: 0.85 0.02 85;
  --control: 0.85 0.02 85;
  --sidebar: var(--rail);
  --sidebar-border: 0.9 0.014 86;
  --shadow-xs: 0 1px 2px 0 hsl(30 8% 15% / 0.05);
  --shadow-sm: 0 1px 2px 0 hsl(30 8% 15% / 0.05), 0 2px 10px 0 hsl(30 8% 15% / 0.045);
  --shadow-md: 0 2px 4px 0 hsl(30 8% 15% / 0.06), 0 12px 32px -8px hsl(30 8% 15% / 0.16);
  --shadow-lg: 0 4px 8px 0 hsl(30 8% 15% / 0.06), 0 24px 56px -12px hsl(30 8% 15% / 0.24);
  --glow: 0 0 0 1px oklch(var(--ring)), 0 0 0 4px oklch(var(--ring) / 0.16);
  --r-control: 8px;
  --r-card: 14px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}
.dark {
  --page: 0.268 0.004 106.6;           /* #262624 */
  --rail: 0.236 0.002 67.7;            /* #1f1e1d */
  --background: 0.268 0.004 106.6;
  --raised: 0.305 0.004 100;           /* #30302e */
  --hover: 0.959 0.013 86.8 / 0.055;
  --pressed: 0.959 0.013 86.8 / 0.09;
  --card: 0.305 0.004 100;
  --popover: 0.315 0.004 100;
  --card-raised: 0.335 0.005 98;
  --muted: 0.335 0.005 98;
  --secondary: 0.335 0.005 98;
  --accent: 0.335 0.005 98;
  --border: 0.36 0.006 95;
  --line-strong: 0.42 0.01 92;
  --input: 0.42 0.01 92;
  --control: 0.42 0.01 92;
  --sidebar: var(--rail);
  --sidebar-border: 0.31 0.005 90;
  --shadow-xs: 0 1px 2px 0 hsl(0 0% 0% / 0.2);
  --shadow-sm: 0 1px 2px 0 hsl(0 0% 0% / 0.22), 0 2px 10px 0 hsl(0 0% 0% / 0.12);
  --shadow-md: 0 2px 4px 0 hsl(0 0% 0% / 0.25), 0 12px 32px -8px hsl(0 0% 0% / 0.45);
  --shadow-lg: 0 4px 8px 0 hsl(0 0% 0% / 0.25), 0 24px 56px -12px hsl(0 0% 0% / 0.6);
}

html, body, .inset { background: oklch(var(--page)); }
body { font-size: 0.875rem; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: oklch(var(--line-strong)); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: oklch(var(--muted-foreground) / 0.6); }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-color: oklch(var(--line-strong)) transparent; }

/* page entrance, quick and quiet */
#view > * { animation: page-in 220ms var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ sidebar */

.sidebar { background: oklch(var(--rail)); border-right: 1px solid oklch(var(--sidebar-border)); }
.sb-header, .sb-footer { border-color: oklch(var(--sidebar-border)); }
.sb-header { border-bottom: 0; }
.sb-content { padding: 0.25rem 0.75rem 0.75rem; }
.sb-menu { gap: 1px; }
.sb-btn { height: 2.125rem; border-radius: var(--r-control); color: oklch(var(--foreground) / 0.78); font-weight: 450; }
.sb-btn > svg { color: oklch(var(--muted-foreground)); transition: color 0.15s var(--ease); }
.sb-btn:hover, .sb-btn[aria-expanded='true'] { background: oklch(var(--hover)); color: oklch(var(--foreground)); }
.sb-btn:hover > svg { color: oklch(var(--foreground)); }
.sb-btn.active { background: oklch(var(--pressed)); box-shadow: none; color: oklch(var(--foreground)); font-weight: 550; }
.sb-btn.active > svg { color: oklch(var(--primary)); }
.sb-sep { background: oklch(var(--sidebar-border)); margin: 0.625rem 0.625rem; }
.sb-footer { border-top: 0; padding-top: 0.25rem; }
.sb-user { height: 2.75rem; border: 0; background: transparent; }
.sb-user:hover { background: oklch(var(--hover)); }
.sb-user .avatar { border-radius: 999px !important; background: oklch(var(--foreground)); color: oklch(var(--page)); font-weight: 600; }
#serverSelector { padding: 0 0.75rem 0.5rem; }
#serverSelector .btn, #serverSelector select { background: oklch(var(--raised)); box-shadow: var(--shadow-xs); }

/* ------------------------------------------------------------------ page header */

.page { max-width: 1200px; padding-top: 2.75rem; }
.page-intro { margin-bottom: 2.25rem; }
.page-intro .page-title { margin-bottom: 0.5rem; }
.page-lede { color: oklch(var(--muted-foreground)); font-size: 1rem; line-height: 1.55; max-width: 62ch; }
.page-title { font-size: 2.375rem; letter-spacing: -0.018em; }
.page-head { border-bottom-color: oklch(var(--border)); margin-bottom: 0.25rem; }
.page-head + .page-body { margin-top: 1.75rem; }
.tabs a { color: oklch(var(--foreground) / 0.6); font-weight: 450; }
.tabs a:hover { color: oklch(var(--foreground)); }
.tabs a[aria-current='page'] { color: oklch(var(--foreground)); font-weight: 550; }
.back { font-weight: 450; }

/* ------------------------------------------------------------------ surfaces */

.card, .table-card, .np, dialog.dlg { background: oklch(var(--raised)); border: 1px solid oklch(var(--border)); box-shadow: var(--shadow-sm); }
.card { border-radius: var(--r-card); }
.card .card, .card .table-card { background: oklch(var(--card-raised)); box-shadow: none; }
.table-card, .np, .map, .empty-state { border-radius: var(--r-card); }
.card-hover, a.card, .np { transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease); }
.card-hover:hover, a.card:hover, .np:hover, .dark .card-hover:hover { background: oklch(var(--raised)); border-color: oklch(var(--line-strong)); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.np-foot { border-top-color: oklch(var(--border)); }
.np-poster { border-radius: 10px; box-shadow: var(--shadow-md); }
.empty-state { background: oklch(var(--raised) / 0.5); border: 1px dashed oklch(var(--line-strong)); }
.empty-state .media { background: oklch(var(--raised)); box-shadow: var(--shadow-sm); border-color: oklch(var(--border)); color: oklch(var(--primary)); }
.alert { border-radius: 12px; background: oklch(var(--raised)); box-shadow: var(--shadow-xs); }
.alert.warning, .alert.destructive { background: oklch(var(--raised)); }
.map { box-shadow: var(--shadow-sm); }

/* figures sit on the page, not in boxes */
.stat-grid { border-color: oklch(var(--border)); }
.stat, .card .stat { background: transparent; }
.stat-l { color: oklch(var(--muted-foreground)); font-weight: 450; }
a.stat .stat-l::after { content: ' →'; opacity: 0; transition: opacity 0.15s var(--ease); }
a.stat:hover .stat-l::after { opacity: 1; }

/* ------------------------------------------------------------------ controls */

.btn { height: 2.25rem; border-radius: var(--r-control); font-weight: 500; letter-spacing: 0; box-shadow: var(--shadow-xs); }
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn.outline, .dark .btn.outline { background: oklch(var(--raised)); border-color: oklch(var(--line-strong)); }
.btn.outline:hover, .dark .btn.outline:hover { background: oklch(var(--raised)); border-color: oklch(var(--muted-foreground) / 0.5); }
.btn.ghost, .btn.link { box-shadow: none; }
.btn.ghost:hover, .dark .btn.ghost:hover { background: oklch(var(--hover)); border-color: transparent; }
.btn.secondary { background: oklch(var(--hover)); box-shadow: none; }
.btn.secondary:hover { background: oklch(var(--pressed)); }
.btn.sm { height: 2rem; }
.btn.xs { height: 1.625rem; }
.btn:focus-visible { outline: none; box-shadow: var(--glow); }

.input, input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea,
.dark input:not([type=checkbox]):not([type=radio]), .dark select, .dark textarea {
  background-color: oklch(var(--raised)); border-color: oklch(var(--line-strong)); border-radius: var(--r-control); box-shadow: var(--shadow-xs);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input:hover:not(:focus):not([type=checkbox]):not([type=radio]), select:hover, textarea:hover:not(:focus) { border-color: oklch(var(--muted-foreground) / 0.55); }
input:focus-visible, select:focus-visible, textarea:focus-visible, input:focus:not([type=checkbox]):not([type=radio]), textarea:focus { border-color: oklch(var(--ring)); box-shadow: 0 0 0 3px oklch(var(--ring) / 0.16); outline: none; }

.tg { background: oklch(var(--hover)); border-color: transparent; border-radius: 10px; }
.tg > .on, .tg > .on:hover, .dark .tg > .on, .dark .tg > .on:hover { background: oklch(var(--raised)); box-shadow: var(--shadow-xs), inset 0 0 0 1px oklch(var(--border)); color: oklch(var(--foreground)); font-weight: 500; }
.theme-switch { border-color: transparent; background: oklch(var(--hover)); }
.theme-switch input:checked + span { background: oklch(var(--raised)); box-shadow: var(--shadow-xs), inset 0 0 0 1px oklch(var(--border)); }

.badge.success, .badge.warning, .badge.danger, .badge.info, .badge.outline { background: oklch(var(--raised)); }
.pill { background: oklch(var(--hover)); }

/* ------------------------------------------------------------------ tables */

.table th { background: oklch(var(--raised)); font-weight: 500; color: oklch(var(--muted-foreground)); }
.table tbody tr:hover { background: oklch(var(--hover)); }
.table-card .table thead tr { border-bottom-color: oklch(var(--border)); }

/* ------------------------------------------------------------------ overlays */

.menu { background: oklch(var(--popover)); border-color: oklch(var(--border)); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 0.375rem; }
.menu .m-item { border-radius: var(--r-control); padding: 0.4375rem 0.5rem; }
.menu .m-item:hover, .menu .m-item:focus-visible { background: oklch(var(--hover)); }
dialog.dlg { border-radius: 18px; padding: 1.75rem; box-shadow: var(--shadow-lg); animation: dlg-in 200ms var(--ease) both; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px) scale(0.985); } to { opacity: 1; transform: none; } }
dialog.dlg::backdrop, .sheet-overlay, .scrim { background: hsl(30 6% 10% / 0.38); backdrop-filter: blur(2px); }
.sheet { background: oklch(var(--page)); box-shadow: var(--shadow-lg); border-left-color: oklch(var(--border)); }
.sheet .card { background: oklch(var(--raised)); }
.toast { background: oklch(var(--popover)); border-color: oklch(var(--border)); border-radius: 12px; box-shadow: var(--shadow-lg); }

/* ------------------------------------------------------------------ settings */

.settings-nav a { color: oklch(var(--foreground) / 0.72); font-weight: 450; }
.settings-nav a:hover { background: oklch(var(--hover)); }
.settings-nav a.active { background: oklch(var(--pressed)); box-shadow: none; color: oklch(var(--foreground)); font-weight: 550; }

/* ------------------------------------------------------------------ sign-in */

.auth { justify-content: flex-start; padding: 0 1.25rem 3rem; background: oklch(var(--page)); }
.auth-bar { width: 100%; max-width: 1200px; display: flex; align-items: center; justify-content: space-between; height: 4.5rem; margin-bottom: clamp(2rem, 12vh, 7rem); }
.auth-bar .logo .word { font-size: 1.25rem; }
.auth-brand { margin-bottom: 2rem; }
.auth-brand h1 { display: block; font-size: clamp(2.5rem, 6vw, 3.5rem); line-height: 1.06; letter-spacing: -0.022em; text-wrap: balance; max-width: 16ch; }
.auth-brand p { margin-top: 0.875rem; font-size: 1rem; color: oklch(var(--muted-foreground)); }
.auth .card { max-width: 24rem; padding: 1.5rem; border-radius: 18px; box-shadow: var(--shadow-md); gap: 1.25rem; }
.auth .btn.w-full { height: 2.625rem; font-size: 0.9375rem; }
.auth input:not([type=checkbox]) { height: 2.625rem; font-size: 0.9375rem; }
.auth-tagline { margin-top: 2rem; }

/* detail headers: on phones the actions drop below the name instead of squeezing it */
.user-head .who { flex: 1 1 16rem; }
@media (max-width: 639px) {
  .user-head > .row:last-child { width: 100%; }
  .user-head .avatar.lg { width: 3rem; height: 3rem; font-size: 1rem; }
}

/* ------------------------------------------------------------------ settings additions (autosave fields, jobs, lists) */

.spin { animation: spin 1s linear infinite; }
.autosave-status { display: inline-flex; align-items: center; gap: 0.25rem; margin-left: 0.5rem; font-size: 0.75rem; font-weight: 400; color: oklch(var(--muted-foreground)); vertical-align: middle; }
.autosave-status[data-state='saved'] { color: oklch(var(--success)); }
.autosave-status[data-state='error'] { color: oklch(var(--destructive)); }
.autosave-status .link { color: inherit; text-decoration: underline; font-size: inherit; }
.input-group { display: flex; align-items: stretch; }
.input-group input { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 0.75rem; border: 1px solid oklch(var(--line-strong)); border-left: 0; border-radius: 0 var(--r-control) var(--r-control) 0; background: oklch(var(--hover)); color: oklch(var(--muted-foreground)); font-size: 0.8125rem; }
.note-box { display: grid; gap: 0.5rem; padding: 1rem; border-radius: 10px; background: oklch(var(--hover)); font-size: 0.8125rem; color: oklch(var(--muted-foreground)); }
.note-box strong { color: oklch(var(--foreground)); font-weight: 600; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; }
.kv-grid > div { display: grid; gap: 0.25rem; font-size: 0.8125rem; }
.kv-grid strong { font-size: 0.9375rem; font-weight: 500; }
.job-tabs { width: 100%; }
.job-tabs > a { flex: 1; }
.job-tabs .pill { margin-left: 0.25rem; }
.job-list { display: grid; gap: 0.75rem; }
.job { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: 1rem; align-items: start; padding: 1rem; border: 1px solid oklch(var(--border)); border-radius: 12px; background: oklch(var(--raised)); }
.job.idle { background: transparent; border-style: dashed; }
.job-ic { display: flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; border-radius: 10px; background: oklch(var(--hover)); color: oklch(var(--muted-foreground)); }
.job-name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.job-desc { margin-top: 0.25rem; font-size: 0.8125rem; color: oklch(var(--muted-foreground)); line-height: 1.5; }
.job-result { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin-top: 0.625rem; padding-top: 0.625rem; border-top: 1px solid oklch(var(--border)); font-size: 0.75rem; color: oklch(var(--success)); }
.job-result.bad { color: oklch(var(--destructive)); }
@media (max-width: 639px) { .job { grid-template-columns: minmax(0, 1fr); } .job-ic { display: none; } }
.item-list > .item-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.125rem; }
.item-list > .item-row + .item-row { border-top: 1px solid oklch(var(--border)); }
.item-row .grow { flex: 1; min-width: 0; }
.pick-server { display: grid; gap: 0.375rem; border: 1px solid oklch(var(--border)); border-radius: 10px; padding: 0.75rem; }
.pick-server legend { padding: 0 0.25rem; }
.radio-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8125rem; }
.radio-row.dim { opacity: 0.6; }
.status-page { display: flex; min-height: 50vh; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; text-align: center; }
.status-page .code { font: 400 4.5rem/1 var(--font-serif); color: oklch(var(--muted-foreground)); }
.status-page .code svg { width: 3rem; height: 3rem; color: oklch(var(--destructive)); }
.status-page .page-title { margin: 0; }
.status-page .page-lede { max-width: 40ch; }
.api-ep { gap: 0.625rem; }
.api-line { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; }
.api-path { background: none; padding: 0; font-size: 0.875rem; font-weight: 600; }
.api-out { max-height: 24rem; overflow: auto; padding: 0.875rem 1rem; border-radius: 10px; background: oklch(var(--hover)); font: 0.75rem/1.5 var(--font-mono); white-space: pre-wrap; word-break: break-word; }
.view-as-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.5rem 1rem; background: oklch(var(--primary)); color: oklch(var(--primary-foreground)); font-size: 0.875rem; }
.view-as-bar .btn { background: oklch(var(--primary-foreground)); color: oklch(var(--primary)); border-color: transparent; height: 1.75rem; }
.member-card { margin-top: 1rem; }
.auth .member-card { max-width: 24rem; }
.item-row { display: flex; align-items: center; gap: 0.75rem; }
.item-row .job-ic { flex-shrink: 0; }
.funnel { display: grid; gap: 0.75rem; }
.funnel-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 11rem; gap: 1rem; align-items: center; font-size: 0.875rem; }
.funnel-row .fb { height: 0.75rem; border-radius: 999px; background: oklch(var(--hover)); overflow: hidden; }
.funnel-row .fb i { display: block; height: 100%; border-radius: 999px; background: oklch(var(--primary)); }
.funnel-row .fv { font-variant-numeric: tabular-nums; }
@media (max-width: 639px) { .funnel-row { grid-template-columns: 5rem minmax(0, 1fr); } .funnel-row .fv { grid-column: 2; } }
