/* claude-mem-cloud optimizer admin — futuristic dark theme (W5b restyle).
   Near-black blue-tinted background, glassmorphism panels (translucent
   surfaces + backdrop-filter blur + faint luminous borders), and a single
   accent GRADIENT (electric cyan -> violet) used sparingly for active nav,
   primary buttons, focus rings, and key stats. Everything flows through the
   :root custom properties below so a future light theme is a var swap, not a
   rewrite — do not hardcode colors in component files; add a var here
   instead. Respects prefers-reduced-motion (see the media query at the
   bottom, gating all animation/transition). */

:root {
  /* --- Base surfaces -------------------------------------------------- */
  --bg-primary: #0a0e17;
  --bg-secondary: #0d1220;
  --bg-tertiary: #0f1526;
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-input: rgba(255, 255, 255, 0.04);
  --bg-chip: rgba(255, 255, 255, 0.05);

  /* --- Borders (luminous, low-alpha) ------------------------------------ */
  --border-primary: rgba(255, 255, 255, 0.09);
  --border-secondary: rgba(255, 255, 255, 0.16);
  --border-focus: #22d3ee;

  /* --- Text (all pass WCAG AA on --bg-primary) --------------------------- */
  --text-primary: #eef2fb;
  --text-secondary: #b7c0d6;
  --text-tertiary: #8b93ab;
  --text-muted: #6b7390;

  /* --- Accent: electric cyan -> violet gradient, used sparingly --------- */
  --accent-cyan: #22d3ee;
  --accent-violet: #8b5cf6;
  --accent: #22d3ee;
  --accent-hover: #67e0f5;
  --accent-gradient: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  --accent-gradient-diag: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  --accent-text-on: #04141a;
  --accent-soft-bg: rgba(34, 211, 238, 0.12);
  --accent-soft-border: rgba(34, 211, 238, 0.32);
  --accent-glow: rgba(34, 211, 238, 0.35);
  --accent-ring: rgba(34, 211, 238, 0.25);
  --accent-ring-hover: rgba(34, 211, 238, 0.4);
  --violet-soft-bg: rgba(139, 92, 246, 0.12);
  --violet-soft-border: rgba(139, 92, 246, 0.32);
  --violet-text: #c4b5fd;

  /* --- Status colors (WCAG AA on --bg-primary) --------------------------- */
  --success: #34d399;
  --success-soft-bg: rgba(52, 211, 153, 0.12);
  --success-soft-border: rgba(52, 211, 153, 0.32);
  --success-text-on: #04150f;
  --warn: #fbbf24;
  --warn-soft-bg: rgba(251, 191, 36, 0.12);
  --warn-soft-border: rgba(251, 191, 36, 0.32);
  --danger: #f87171;
  --danger-soft-bg: rgba(248, 113, 113, 0.12);
  --danger-soft-border: rgba(248, 113, 113, 0.32);
  --danger-text-on: #1a0505;
  --info: #67e0f5;
  --info-soft-bg: rgba(34, 211, 238, 0.12);
  --info-soft-border: rgba(34, 211, 238, 0.32);

  /* --- Sidebar glass surface (distinct from --bg-card: a touch denser +
     blue-tinted so the nav column reads as its own layer under the blur,
     rather than the same translucency as content cards). --------------- */
  --sidebar-bg: rgba(13, 18, 32, 0.72);

  /* --- Type ------------------------------------------------------------- */
  --font-mono: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;

  /* --- Radius system ------------------------------------------------------ */
  --radius: 12px;
  --radius-sm: 8px;

  /* --- Elevation / glow --------------------------------------------------- */
  --blur-glass: 14px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-glow-primary: 0 0 0 1px rgba(34, 211, 238, 0.4), 0 4px 20px -2px rgba(34, 211, 238, 0.35);
  --shadow-menu: 0 8px 28px rgba(0, 0, 0, 0.45);
  --transition-fast: 0.14s ease;

  /* --- Track/well backgrounds (bar-track, target-list) — subtle surface
     tint one step "into" the background, distinct from --bg-card so a
     progress track reads as recessed rather than another card. ----------- */
  --track-bg: rgba(255, 255, 255, 0.05);
  --track-bg-subtle: rgba(255, 255, 255, 0.03);

  /* --- Modal/overlay scrim ------------------------------------------------ */
  --overlay-scrim: rgba(4, 6, 12, 0.65);
}

/* --- W8.4 light theme --------------------------------------------------- */
/* Same var names as the :root dark block above — every component reads
   through these custom properties, so the light theme is a pure value swap,
   zero className/component forks. Activated via `[data-theme="light"]` on
   <html> (and mirrored onto <body> — see theme.ts's applyTheme) so it wins
   the cascade over :root regardless of which element the app renders under.
   Surfaces are an off-white/blue-grey (~#f5f7fa family, never pure #fff) to
   avoid glare while keeping the same cyan->violet brand gradient, now used
   against light backgrounds — accent hues are darkened slightly versus dark
   mode where needed to hold WCAG AA text contrast on light surfaces. */
[data-theme="light"] {
  /* --- Base surfaces ---------------------------------------------------- */
  --bg-primary: #f5f7fa;
  --bg-secondary: #eef1f6;
  --bg-tertiary: #e8ecf3;
  --bg-card: rgba(15, 23, 42, 0.035);
  --bg-card-hover: rgba(15, 23, 42, 0.06);
  --bg-input: rgba(15, 23, 42, 0.03);
  --bg-chip: rgba(15, 23, 42, 0.045);

  /* --- Borders ------------------------------------------------------------ */
  --border-primary: rgba(15, 23, 42, 0.1);
  --border-secondary: rgba(15, 23, 42, 0.18);
  --border-focus: #0891b2;

  /* --- Text (all pass WCAG AA on --bg-primary) --------------------------- */
  --text-primary: #101828;
  --text-secondary: #3c4658;
  --text-tertiary: #5b6478;
  --text-muted: #737b8c;

  /* --- Accent: same cyan -> violet family, darkened for AA on light bg --- */
  --accent-cyan: #0891b2;
  --accent-violet: #7c3aed;
  --accent: #0891b2;
  --accent-hover: #0e7490;
  --accent-gradient: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  --accent-gradient-diag: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  --accent-text-on: #f5fbfd;
  --accent-soft-bg: rgba(8, 145, 178, 0.1);
  --accent-soft-border: rgba(8, 145, 178, 0.28);
  --accent-glow: rgba(8, 145, 178, 0.25);
  --accent-ring: rgba(8, 145, 178, 0.22);
  --accent-ring-hover: rgba(8, 145, 178, 0.34);
  --violet-soft-bg: rgba(124, 58, 237, 0.1);
  --violet-soft-border: rgba(124, 58, 237, 0.28);
  --violet-text: #6d28d9;

  /* --- Status colors (WCAG AA on --bg-primary) --------------------------- */
  --success: #15803d;
  --success-soft-bg: rgba(21, 128, 61, 0.1);
  --success-soft-border: rgba(21, 128, 61, 0.28);
  --success-text-on: #f2fbf6;
  --warn: #b45309;
  --warn-soft-bg: rgba(180, 83, 9, 0.1);
  --warn-soft-border: rgba(180, 83, 9, 0.28);
  --danger: #b91c1c;
  --danger-soft-bg: rgba(185, 28, 28, 0.1);
  --danger-soft-border: rgba(185, 28, 28, 0.28);
  --danger-text-on: #fdf2f2;
  --info: #0e7490;
  --info-soft-bg: rgba(8, 145, 178, 0.1);
  --info-soft-border: rgba(8, 145, 178, 0.28);

  /* --- Sidebar glass surface — a light, slightly denser tint of the base
     surface (mirrors the dark theme's own denser-than-card treatment). ---- */
  --sidebar-bg: rgba(255, 255, 255, 0.6);

  /* --- Elevation — softer shadows read correctly on a light surface ------ */
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-glow-primary: 0 0 0 1px rgba(8, 145, 178, 0.3), 0 4px 20px -2px rgba(8, 145, 178, 0.22);
  --shadow-menu: 0 8px 28px rgba(15, 23, 42, 0.18);

  /* --- Track/well backgrounds — dark tint instead of white on light bg --- */
  --track-bg: rgba(15, 23, 42, 0.07);
  --track-bg-subtle: rgba(15, 23, 42, 0.045);

  /* --- Modal/overlay scrim — same near-black scrim works on both themes
     (it's a dimming layer over content, not a surface color), kept as its
     own var for clarity/consistency rather than because the value differs. */
  --overlay-scrim: rgba(15, 23, 42, 0.4);
}

/* Light theme: the faint dark-mode scanline grid inverts to a barely-there
   dark tint instead of white, and the login glow blobs get a lighter alpha
   so they don't muddy the near-white surface. */
[data-theme="light"] body {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
}

[data-theme="light"] .login-shell::before {
  background:
    radial-gradient(600px circle at 20% 20%, rgba(8, 145, 178, 0.08), transparent 60%),
    radial-gradient(600px circle at 80% 80%, rgba(124, 58, 237, 0.08), transparent 60%);
}

/* .btn-primary/.btn-danger/.btn-success hover states read "text on filled
   accent" colors through --accent-text-on/--danger-text-on/--success-text-on
   (migrated off hardcoded hex literals during W8.4 so hover states stay
   legible against this theme's mid-tone danger/success fills, which are
   darker than the dark theme's fills and need a light (not near-black) text
   color on top). */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Extremely faint scanline/grid texture on the app background — purely
   decorative, never affects contrast of any foreground text since it sits
   behind everything at ~2-3% alpha. */
body {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  background-attachment: fixed;
}

#root {
  min-height: 100vh;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--accent-hover);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Tabular numerals for anything metric-like (stat values, usage bars, audit
   timestamps) so digits don't jitter horizontally as they update. */
.stat-value,
.bar-row-count,
.chip-count,
.observation-date,
.proposal-meta {
  font-variant-numeric: tabular-nums;
}

/* Letterspaced uppercase micro-labels for section headings + micro chips. */
.section-heading,
.stat-label,
.breakglass-banner-label,
.badge,
.badge-role {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Layout ------------------------------------------------------------ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: relative;
}

.sidebar-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 12px;
}

/* Logo + two-line title/sub lockup (additive — the title/sub text block
   itself is unchanged, just wrapped alongside the logo in a flex row). No
   background behind the logo: it sits directly on the sidebar's own glass
   surface (--sidebar-bg) on both themes, since the mark is gradient-on-
   transparent by design (see Logo.tsx / cmem-logo.svg). */
.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand-logo {
  flex-shrink: 0;
}

.sidebar-brand-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-brand-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  /* NW-2: nav items are real <a href> now (deep-linkable, cmd-clickable) —
     kill the browser's default anchor underline in every state and keep the
     old <button> box metrics (the <li> wrappers below are zeroed too). */
  text-decoration: none;
  line-height: 1.35;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  text-align: left;
  cursor: pointer;
  font-size: 13.5px;
  width: 100%;
  position: relative;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item:focus,
.nav-item:visited,
.nav-item.active {
  text-decoration: none;
}

/* NW-2: each nav <a> sits in a semantic <li>; make the wrapper zero-impact
   so item spacing is governed only by .nav-list's gap. */
.nav-list > li {
  margin: 0;
  padding: 0;
  display: block;
}

.nav-item:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -2px;
}

/* Gradient left-edge indicator on the active nav item (per design contract),
   drawn as a pseudo-element rather than the plain border so it can carry the
   two-hue gradient instead of a flat accent color. */
.nav-item.active {
  background: var(--accent-soft-bg);
  color: var(--text-primary);
  border-left-color: transparent;
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-gradient);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 20px 0;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 36px 60px;
  max-width: 1200px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0 0 24px;
}

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-header h1, .page-header p { margin-top: 0; }
.metrics-recompute { display: flex; align-items: center; justify-content: flex-end; gap: 12px; text-align: right; }

/* --- Cards / generic ----------------------------------------------------- */

/* All future card stacks inherit this — do not hand-space cards. */
.page-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-stack > .page-subtitle,
.page-stack > .stat-grid {
  margin-bottom: 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  padding: 16px 18px;
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  box-shadow: var(--shadow-card);
}

.section {
  margin-bottom: 28px;
}

.section-heading {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 12px;
  font-weight: 600;
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-secondary);
  background: var(--bg-chip);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary actions: gradient fill + soft glow (per design contract's
   "soft glow on primary actions" micro-polish note). */
.btn-primary {
  background: var(--accent-gradient);
  border-color: transparent;
  color: var(--accent-text-on);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--accent-ring), 0 2px 12px -2px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 0 0 1px var(--accent-ring-hover), 0 4px 18px -2px var(--accent-glow);
}

.btn-danger {
  background: var(--danger-soft-bg);
  border-color: var(--danger-soft-border);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: var(--danger-text-on);
}

.btn-success {
  background: var(--success-soft-bg);
  border-color: var(--success-soft-border);
  color: var(--success);
}

.btn-success:hover:not(:disabled) {
  background: var(--success);
  color: var(--success-text-on);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* --- Forms ---------------------------------------------------------------- */

.field {
  margin-bottom: 16px;
  max-width: 420px;
}

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.field input, .field select {
  width: 100%;
  padding: 9px 11px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft-bg);
}

.field-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 5px;
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

/* Inline agreement/option checkbox — .field's input rules (width:100%, padding,
   bg) wreck a native checkbox, so checkbox rows get their own wrapper. Used by
   the T&C acknowledgement on the register form and the accept-terms gate. */
.checkbox-field {
  margin-bottom: 16px;
}

.checkbox-field label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

.checkbox-field input[type="checkbox"] {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* --- Banners / status ------------------------------------------------------ */

.banner {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
}

.banner-error {
  background: var(--danger-soft-bg);
  border-color: var(--danger-soft-border);
  color: var(--danger);
}

.banner-success {
  background: var(--success-soft-bg);
  border-color: var(--success-soft-border);
  color: var(--success);
}

.banner-info {
  background: var(--info-soft-bg);
  border-color: var(--info-soft-border);
  color: var(--info);
}

/* --- Dashboard stat cards --------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  padding: 14px 16px;
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  box-shadow: var(--shadow-card);
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-value.accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.06em;
}

/* --- Bar lists (byCategory / byProject) ------------------------------------- */

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr minmax(90px, auto);
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.bar-row-label {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row-selectable {
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.bar-row-selectable:hover,
.bar-row-selectable:focus-visible {
  background: var(--bg-card-hover);
  outline: none;
}

.info-hint {
  position: relative;
  display: inline-block;
  margin-left: 5px;
  color: var(--text-muted);
  cursor: help;
  overflow: visible;
}

.info-hint > [role="tooltip"] {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: 280px;
  transform: translateX(-50%);
  padding: 7px 9px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  white-space: normal;
  visibility: hidden;
  opacity: 0;
  transition: opacity 120ms ease 800ms, visibility 0s linear 920ms;
}

.info-hint:hover > [role="tooltip"],
.info-hint:focus > [role="tooltip"] {
  visibility: visible;
  opacity: 1;
  transition-delay: 800ms;
}

.bar-track {
  background: var(--track-bg);
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
}

.bar-row-count {
  text-align: right;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* --- Chips ------------------------------------------------------------------ */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-chip);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: default;
}

.chip button, .chip.chip-clickable {
  cursor: pointer;
  background: var(--bg-chip);
  border: 1px solid var(--border-primary);
}

.chip.chip-active {
  background: var(--accent-soft-bg);
  border-color: var(--accent-soft-border);
  color: var(--accent-hover);
}

/* Status-tinted chip variants — used by ApiKeysPage (chip-success/chip-danger)
   and ConflictsPage (chip-trust-*), added here rather than inline styles so
   they stay theme-consistent. */
.chip-success {
  background: var(--success-soft-bg);
  border-color: var(--success-soft-border);
  color: var(--success);
}

.chip-danger {
  background: var(--danger-soft-bg);
  border-color: var(--danger-soft-border);
  color: var(--danger);
}

/* Warning-tinted chip — used by the tenant lifecycle status chip (disabled). */
.chip-warn {
  background: var(--warn-soft-bg);
  border-color: var(--warn-soft-border);
  color: var(--warn);
}

.chip-trust-high {
  background: var(--success-soft-bg);
  border-color: var(--success-soft-border);
  color: var(--success);
}

.chip-trust-medium {
  background: var(--warn-soft-bg);
  border-color: var(--warn-soft-border);
  color: var(--warn);
}

.chip-trust-low {
  background: var(--danger-soft-bg);
  border-color: var(--danger-soft-border);
  color: var(--danger);
}

.chip-count {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 11px;
}

/* Generalized tag chips (post-NW-6 wave item 3, Browse page) — violet tint so
   they read as visually distinct from the cyan category/type chips.
   "cowork-memory" is the common case today but the style is generic (any
   metadata.tags string). chip-clickable (the toggle button variant) still
   gets .chip-active's cyan treatment when selected — same convention as
   every other toggle chip in this app. */
.chip-tag {
  background: var(--violet-soft-bg);
  border-color: var(--violet-soft-border);
  color: var(--violet-text);
}

/* Per-project "last contacted" line (Sean's explicit request, Browse page) —
   same small/muted treatment as .observation-provenance, just at page scope
   instead of per-card. */
.last-contacted {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: -6px 0 18px;
}

/* --- Sparkline / activity columns ------------------------------------------- */

.sparkline-wrap {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 90px;
  padding-top: 8px;
}

.sparkline-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.sparkline-bar {
  width: 100%;
  max-width: 22px;
  background: var(--accent-gradient-diag);
  border-radius: 2px 2px 0 0;
  opacity: 0.9;
}

.sparkline-label {
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  writing-mode: horizontal-tb;
  white-space: nowrap;
}

/* --- Proposals -------------------------------------------------------------- */

.proposal-group {
  margin-bottom: 22px;
}

.proposal-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: 10px;
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
}

.proposal-row.optimistic {
  opacity: 0.55;
}

.proposal-main {
  flex: 1;
  min-width: 0;
}

.proposal-title {
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.proposal-title code {
  background: var(--bg-chip);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.proposal-reason {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.proposal-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.proposal-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.proposal-detail-toggle {
  background: none;
  border: none;
  color: var(--info);
  font-size: 11.5px;
  cursor: pointer;
  padding: 0;
  margin-top: 6px;
  text-decoration: underline;
}

.proposal-target-list {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--track-bg-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-tertiary);
  max-height: 160px;
  overflow-y: auto;
}

.proposal-target-list div {
  padding: 2px 0;
}

/* --- Proposal snippet cards (W5a hydration) --------------------------------- */

.snippet-card {
  opacity: 1;
}

.snippet-card.snippet-missing {
  opacity: 0.6;
}

.snippet-card-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.snippet-card-excerpt {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.snippet-card-result {
  border-style: dashed;
}

.snippet-card-result-body {
  font-size: 12.5px;
  white-space: pre-wrap;
  color: var(--text-secondary);
}

/* --- Conflict snippet picker (Conflicts page) -------------------------------- */

.conflict-snippet {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.conflict-snippet-selected {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 1px var(--accent-ring), 0 0 16px -4px var(--accent-glow);
}

.conflict-snippet-winner-hint {
  margin-top: 6px;
  color: var(--accent-hover);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
}

.badge-housekeep {
  background: var(--info-soft-bg);
  color: var(--info);
}

.badge-categorise {
  background: var(--violet-soft-bg);
  color: var(--violet-text);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.toolbar-spacer {
  flex: 1;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.segmented button {
  padding: 7px 14px;
  background: var(--bg-chip);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12.5px;
  border-right: 1px solid var(--border-primary);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.segmented button:last-child {
  border-right: none;
}

.segmented button.active {
  background: var(--accent-soft-bg);
  color: var(--accent-hover);
  font-weight: 600;
}

/* --- Browse ------------------------------------------------------------------ */

.observation-card {
  border: 1px solid var(--border-primary);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 14px 16px;
  margin-bottom: 10px;
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
}

.observation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.observation-title {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
  margin: 0 0 6px;
}

.observation-date {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: auto;
}

.observation-provenance {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.observation-preview {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.observation-preview.expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.observation-expand-btn {
  background: none;
  border: none;
  color: var(--info);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 0 0;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner-inline {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-secondary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-row {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.kv-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.kv-chip {
  background: var(--bg-chip);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.kv-chip b {
  color: var(--text-primary);
}

/* --- Login screen -------------------------------------------------------- */

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Soft ambient glow behind the login card — decorative only, sits behind
   the card via z-index/stacking (login-card has no z-index, so its normal
   DOM order painting is enough since this pseudo-element is on the shell
   itself, painted before its children). */
.login-shell::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(600px circle at 20% 20%, rgba(34, 211, 238, 0.08), transparent 60%),
    radial-gradient(600px circle at 80% 80%, rgba(139, 92, 246, 0.08), transparent 60%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 380px;
  position: relative;
}

/* Logo shown above the login-card heading on the pre-session screens
   (sign-in/register, forgot-password, reset-password) — additive, centered,
   no background so the gradient mark sits cleanly on the card surface in
   both themes. */
.login-card-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

/* --- Session header (identity-aware app shell) --------------------------- */

.session-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
}

.session-header-user {
  font-size: 13px;
  color: var(--text-secondary);
}

.badge-role {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--accent-soft-bg);
  border: 1px solid var(--accent-soft-border);
  color: var(--accent-hover);
  cursor: default;
}

/* --- Team switcher --------------------------------------------------------- */

.team-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-switcher-trigger {
  font-family: var(--font-mono);
}

.team-switcher-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  width: 260px;
  max-height: 360px;
  overflow-y: auto;
  padding: 12px 14px;
  box-shadow: var(--shadow-menu);
}

.team-switcher-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.team-switcher-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.team-switcher-item.active {
  background: var(--accent-soft-bg);
  color: var(--accent-hover);
  font-weight: 600;
}

/* A membership whose tenant is disabled/archived — still selectable (the user
   may want to see the disabled state) but visibly de-emphasized. */
.team-switcher-item-muted {
  color: var(--text-muted);
}

.team-switcher-item-muted:hover {
  color: var(--text-secondary);
}

/* --- Break-glass modal ------------------------------------------------------ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal {
  width: 100%;
  max-width: 440px;
}

/* --- Break-glass persistent banner ------------------------------------------ */

.breakglass-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--danger-soft-bg);
  border-bottom: 1px solid var(--danger-soft-border);
  color: var(--danger);
  font-size: 13px;
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
}

.breakglass-banner-label {
  font-weight: 700;
  font-size: 11px;
  font-family: var(--font-mono);
}

/* --- Data tables (Audit, API Keys) ------------------------------------------ */
/* Extracted from what were previously inline `style={}` table styles so the
   theme owns border/color decisions instead of each page hand-rolling them. */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-secondary);
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-secondary);
}

.data-table td.nowrap {
  white-space: nowrap;
}

.data-table td.mono {
  font-family: var(--font-mono);
}

.data-table td.truncate {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table code {
  font-size: 11px;
  color: var(--text-tertiary);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

/* --- W8.4: theme toggle + W8.5: mobile nav toggle/scrim --------------------- */

.theme-toggle {
  white-space: nowrap;
}

/* Hidden on desktop/tablet — only meaningful once the sidebar goes
   off-canvas under the ~768px breakpoint below, where it's switched back to
   `inline-flex` (matching .btn's own display) to open/close the panel. */
.nav-toggle {
  display: none;
}

/* Off-canvas scrim behind the mobile nav panel, shown only while
   `.nav-open` is set on `.app-shell` (see the ~768px breakpoint below,
   which is also where `.sidebar` itself becomes fixed-position). Sits under
   the sidebar (z-index 40) and above the page content. */
.nav-scrim {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  z-index: 40;
}

/* --- W8.5: responsive breakpoints -------------------------------------------
   Three tiers, sensible-default widths per the design contract:
     ~1024px — main content gets tighter side padding (still a two-column
               sidebar+content layout; nothing structurally changes yet).
     ~768px  — the sidebar becomes an off-canvas panel (hamburger-triggered,
               `.nav-toggle` appears), data tables gain horizontal scroll
               wrappers (already `overflow-x: auto` on their `.card` wrapper
               in every page — see AuditPage/ApiKeysPage — so no JSX change
               needed there), and grid-based layouts (stat cards, snippet
               grids) collapse toward single/double column.
     ~480px  — forms and primary buttons stretch full-width, touch targets
               grow to >=40px, remaining paddings tighten further so nothing
               overflows a 375px viewport.
   Kept CSS-only wherever possible per the "minimal JSX churn" directive —
   the one exception is the nav-open boolean already wired in App.tsx, since
   a hamburger genuinely needs JS state. --------------------------------- */

@media (max-width: 1024px) {
  .main {
    padding: 24px 20px 48px;
    max-width: 100%;
  }

  .sidebar {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .app-shell {
    position: relative;
  }

  .nav-toggle {
    display: inline-flex;
  }

  /* Off-canvas sidebar: fixed, translated out of view by default, and
     slid in when the shell carries `.nav-open` (toggled from App.tsx's
     `navOpen` state — see the hamburger button next to the session
     header / legacy toolbar). Transition respects prefers-reduced-motion
     via the global override at the bottom of this file. */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    max-width: 82vw;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-menu);
  }

  .app-shell.nav-open .sidebar {
    transform: translateX(0);
  }

  .main {
    padding: 18px 16px 40px;
  }

  .session-header {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  /* Snippet/conflict-picker grids (ProposalsPage, ConflictsPage) are given
     an explicit inline `gridTemplateColumns: repeat(N, 1fr)` in JSX — this
     override wins on specificity via the `!important` because collapsing
     to a single column on a narrow viewport is a hard requirement (no
     horizontal overflow at 375px) that a per-page JSX change would
     otherwise be needed for; doing it here keeps the JSX untouched. */
  .snippet-card,
  .conflict-snippet {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 480px) {
  .sidebar-brand-title {
    font-size: 14px;
  }

  .sidebar-brand-logo {
    width: 24px;
    height: 24px;
  }

  .main {
    padding: 14px 12px 32px;
  }

  .page-title {
    font-size: 18px;
  }

  /* Forms/fields stretch to fill the narrow viewport instead of stopping
     at their desktop max-width (420px/480px per field/card — several pages
     set that 480px cap via an inline `style={{ maxWidth: 480 }}` on a
     `.card`/`form.card`, e.g. SettingsPage, ApiKeysPage, MembersPage,
     UsageQuotasPage — this `!important` wins over that inline style). */
  .field,
  .card {
    max-width: 100% !important;
  }

  /* Primary actions full-width and >=40px tall on touch, per the design
     contract's touch-target minimum. Scoped to .toolbar buttons (the
     primary action surface on every page) rather than every .btn so
     inline actions like "Copy link"/table row buttons stay compact. */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar > .btn,
  .toolbar > a.btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }

  .toolbar-spacer {
    display: none;
  }

  /* Segmented controls and chip rows still read fine at this width without
     going full-width — only toolbar-level primary actions do — but the
     segmented control's touch targets get the same >=40px floor. */
  .segmented button {
    min-height: 40px;
  }

  .nav-item {
    min-height: 44px;
  }

  /* Proposal approve/reject actions: stack full-width under the proposal
     text instead of squeezing beside it, and grow to the touch-target
     floor — this is the one other "primary action" surface besides
     .toolbar that isn't already covered by the .toolbar > .btn rule above
     (ProposalRow nests its own .toolbar inside .proposal-row, and the
     actions live in a sibling .proposal-actions wrapper, not directly in
     that .toolbar). */
  .proposal-row {
    flex-direction: column;
  }

  .proposal-actions {
    width: 100%;
  }

  .proposal-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 40px;
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
  }

  .stat-value {
    font-size: 21px;
  }

  /* Data tables: the .card wrapper around every <table class="data-table">
     (AuditPage, ApiKeysPage) already sets `overflow-x: auto` inline, so the
     table itself just needs a floor width so cells don't crush illegibly —
     the wrapper's scrollbar takes over from there instead of the page
     overflowing horizontally. */
  .data-table {
    min-width: 560px;
  }

  .login-card {
    max-width: 100%;
  }

  /* bar-row (Dashboard's byCategory/byProject bars, UsageQuotasPage's usage
     bars, which set a wider 110px count column via an inline
     `style={{ gridTemplateColumns: ... }}` — hence `!important` here) —
     narrow the fixed columns so the flexible track keeps a usable width on
     a 375px screen instead of squeezing to near-zero. */
  .bar-row {
    grid-template-columns: 90px 1fr 46px !important;
    gap: 6px;
    font-size: 11.5px;
  }
}

/* Fixed-position theme toggle shown on the pre-session screens (loading /
   login / forgot-password / reset-password), which have no sidebar/header
   chrome to place it in — top-right corner on every viewport size. */
.login-shell-theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 60;
}

@media (max-width: 480px) {
  .login-shell-theme-toggle {
    top: 10px;
    right: 10px;
  }
}

/* --- Reduced motion --------------------------------------------------------- */
/* Gate every animation/transition behind prefers-reduced-motion per the
   design contract. Placed last so it wins the cascade over the individual
   `transition:`/`animation:` declarations above. */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* AUTH REMEDIATION R2: role-scoped nav sections (USER / Admin / Super admin) */
.nav-group { list-style: none; margin: 0 0 4px; padding: 0; }
.nav-section-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
  opacity: 0.55; margin: 14px 12px 4px; font-weight: 600;
}

/* --- OAuth consent page ------------------------------------------------- */
.consent-card { max-width: 460px; text-align: left; }
.consent-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.consent-title { font-size: 1.5rem; font-weight: 650; margin: 0 0 6px; color: var(--text-primary); text-align: center; }
.consent-lead { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; margin: 0 0 18px; text-align: center; }
.consent-lead strong { color: var(--text-primary); font-weight: 600; }
.consent-scopes { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 10px; }
.consent-scope {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--accent-soft-border);
}
.consent-scope-title { font-weight: 600; color: var(--text-primary); font-size: 0.92rem; }
.consent-scope-detail { color: var(--text-tertiary); font-size: 0.82rem; line-height: 1.4; }
.consent-error {
  color: var(--danger, #f87171); font-size: 0.85rem; margin: 0 0 14px;
  padding: 10px 12px; border-radius: 8px;
  background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3);
}
.consent-actions { display: flex; gap: 12px; margin-top: 4px; }
.consent-btn { flex: 1; justify-content: center; padding: 11px 16px; font-size: 0.95rem; }
.consent-btn:disabled { opacity: 0.6; cursor: default; }
.consent-foot { color: var(--text-muted); font-size: 0.78rem; text-align: center; margin: 18px 0 0; }

/* ── Memory graph 3D stage (Sean feedback 2026-07-17 #1: 3D render, Agent OS
   theme). The WebGL canvas is constructed transparent (alpha:true) and floats
   over this pure-CSS indigo nebula; a mask fades the canvas edges into the
   card so no hard rectangle shows if a GPU refuses transparency. */
.graph3d-stage { background: #0a0e1d; }
.graph3d-nebula {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, rgba(138, 164, 255, 0.12) 0%, rgba(138, 164, 255, 0.05) 40%, transparent 72%),
    radial-gradient(ellipse 40% 35% at 72% 70%, rgba(199, 139, 217, 0.07) 0%, transparent 70%);
}
.graph3d-stage canvas {
  -webkit-mask-image: radial-gradient(ellipse 92% 92% at 50% 50%, #000 78%, transparent 100%);
  mask-image: radial-gradient(ellipse 92% 92% at 50% 50%, #000 78%, transparent 100%);
}
.graph3d-hint {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  pointer-events: none;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(200, 210, 240, 0.45);
}
