:root {
  color-scheme: light;
  --vm-theme-bg: #ffffff;
  --vm-theme-page: #f6f8fc;
  --vm-theme-surface: #ffffff;
  --vm-theme-surface-raised: #fbfcff;
  --vm-theme-surface-soft: #f2f5fb;
  --vm-theme-text: #172035;
  --vm-theme-text-soft: #526078;
  --vm-theme-muted: #7b879b;
  --vm-theme-line: #e2e7ef;
  --vm-theme-accent: #315bfb;
  --vm-theme-accent-soft: #edf2ff;
  --vm-theme-shadow: rgba(31, 45, 75, .08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121212;
  --ink: #f3f4f6;
  --muted: #a3a3a3;
  --line: #333333;
  --blue: #315bfb;
  --soft: #242424;
  --admin-ink: #f3f4f6;
  --admin-muted: #a3a3a3;
  --admin-line: #333333;
  --admin-bg: #121212;
  --admin-blue: #315bfb;
  --ui-layer-bg: #1c1c1c;
  --ui-layer-border: #383838;
  --ui-layer-shadow: 0 30px 90px rgba(0, 0, 0, .48);
  --vm-theme-bg: #121212;
  --vm-theme-page: #151515;
  --vm-theme-surface: #1c1c1c;
  --vm-theme-surface-raised: #222222;
  --vm-theme-surface-soft: #282828;
  --vm-theme-text: #f3f4f6;
  --vm-theme-text-soft: #d4d4d4;
  --vm-theme-muted: #a3a3a3;
  --vm-theme-line: #333333;
  --vm-theme-accent: #5f7cf6;
  --vm-theme-accent-soft: #1b2440;
  --vm-theme-shadow: rgba(0, 0, 0, .32);
}

.vm-theme-toggle {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--vm-theme-line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--vm-theme-surface) 92%, transparent);
  color: var(--vm-theme-text-soft);
  box-shadow: 0 5px 18px var(--vm-theme-shadow);
  transition: border-color .18s, background .18s, color .18s, transform .18s;
}
.vm-theme-toggle:hover { border-color: var(--vm-theme-accent); color: var(--vm-theme-accent); transform: translateY(-1px); }
.vm-theme-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--vm-theme-accent) 28%, transparent); outline-offset: 2px; }
.vm-theme-toggle svg { width: 17px; height: 17px; }
.vm-theme-floating { position: fixed; top: 18px; right: 164px; z-index: 61; backdrop-filter: blur(12px); }
.header-actions .vm-theme-toggle { margin-right: -3px; }
.console-header .vm-theme-toggle { width: 31px; height: 31px; border-radius: 8px; box-shadow: none; }
.admin-header .vm-theme-toggle { width: 32px; height: 32px; box-shadow: none; }

html[data-theme="dark"] body { background: var(--vm-theme-bg); color: var(--vm-theme-text); }
html[data-theme="dark"] ::selection { background: #3658c7; color: #fff; }
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] summary:focus-visible { outline-color: var(--vm-theme-accent); }

/* Landing and documentation */
html[data-theme="dark"] .header,
html[data-theme="dark"] .principles,
html[data-theme="dark"] .memory-showcase,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .faq details,
html[data-theme="dark"] .guide-content section,
html[data-theme="dark"] .api-table th,
html[data-theme="dark"] .api-table td { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .header nav,
html[data-theme="dark"] .hero-description,
html[data-theme="dark"] .hero-note,
html[data-theme="dark"] .text-link,
html[data-theme="dark"] .hero-selfhost,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .connect-ways-heading > p:last-child,
html[data-theme="dark"] .memory-showcase-copy > p,
html[data-theme="dark"] .section-heading > p:last-child,
html[data-theme="dark"] .playground-heading > p,
html[data-theme="dark"] .workflow p,
html[data-theme="dark"] .feature p,
html[data-theme="dark"] .start-card > div > p:not(.eyebrow),
html[data-theme="dark"] .faq details p,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .guide aside > a,
html[data-theme="dark"] .guide-intro,
html[data-theme="dark"] .guide-content p,
html[data-theme="dark"] .api-table td:last-child,
html[data-theme="dark"] .agent-support-heading > p { color: var(--vm-theme-muted); }
html[data-theme="dark"] .nav-cta,
html[data-theme="dark"] .button-outline { border-color: var(--vm-theme-line); background: var(--vm-theme-surface); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .landing-page .hero-actions .button-outline { border-color: var(--vm-theme-line); background: var(--vm-theme-surface); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .nav-cta:hover,
html[data-theme="dark"] .button-outline:hover { background: var(--vm-theme-surface-raised); }
html[data-theme="dark"] .graph-scene { border-color: var(--vm-theme-line); background: radial-gradient(circle at 50% 47%, color-mix(in srgb,var(--vm-theme-accent) 12%,var(--vm-theme-surface-raised)) 0, var(--vm-theme-surface) 45%, var(--vm-theme-bg) 100%); box-shadow: 0 18px 52px rgba(0,0,0,.22); }
html[data-theme="dark"] .orbit { fill: #7898ff08; stroke: #7898ff1e; }
html[data-theme="dark"] .orbit-inner { fill: #7898ff0a; stroke: #7898ff2c; }
html[data-theme="dark"] .graph-line { stroke: #526684; }
html[data-theme="dark"] .graph-signal { stroke: #8ba5ff; }
html[data-theme="dark"] .agent,
html[data-theme="dark"] .memory-core,
html[data-theme="dark"] .floating-label,
html[data-theme="dark"] .life-node,
html[data-theme="dark"] .life-core { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-raised); color: var(--vm-theme-text); box-shadow: 0 8px 25px rgba(0,0,0,.22); }
html[data-theme="dark"] .agent-icon { background: var(--vm-theme-accent-soft); }
html[data-theme="dark"] .agent small,
html[data-theme="dark"] .life-node > small,
html[data-theme="dark"] .life-core small,
html[data-theme="dark"] .scene-top,
html[data-theme="dark"] .scene-count { color: var(--vm-theme-muted); }
html[data-theme="dark"] .scene-bottom { border-color: var(--vm-theme-line); background: rgba(28,28,28,.9); color: var(--vm-theme-muted); }
html[data-theme="dark"] .demo-badge { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .life-graph { border-color: var(--vm-theme-line); background: radial-gradient(circle at center,color-mix(in srgb,var(--vm-theme-accent) 11%,var(--vm-theme-surface-raised)) 0,var(--vm-theme-surface) 42%,var(--vm-theme-bg) 78%); }
html[data-theme="dark"] .life-core { box-shadow: 0 8px 25px rgba(0,0,0,.25), 0 0 0 7px var(--vm-theme-accent-soft); }
html[data-theme="dark"] .playground-section { border-color: var(--vm-theme-line); background: var(--vm-theme-page); }
html[data-theme="dark"] .playground,
html[data-theme="dark"] .feature,
html[data-theme="dark"] .start-card,
html[data-theme="dark"] .setup-code,
html[data-theme="dark"] .connect-way-card,
html[data-theme="dark"] .agent-support-card { border-color: var(--vm-theme-line); background: linear-gradient(145deg,var(--vm-theme-surface-raised),var(--vm-theme-surface)); box-shadow: 0 12px 32px rgba(0,0,0,.16); }
html[data-theme="dark"] .connect-surface-guide { border-color: var(--vm-theme-line); color: var(--vm-theme-muted); }
html[data-theme="dark"] .surface-provider { border-color: var(--vm-theme-line); background: var(--vm-theme-surface); box-shadow: 0 16px 42px rgba(0,0,0,.2); }
html[data-theme="dark"] .surface-provider-heading { border-color: var(--vm-theme-line); background: linear-gradient(135deg,var(--vm-theme-surface-raised),var(--vm-theme-surface)); }
html[data-theme="dark"] .surface-provider-heading h3,
html[data-theme="dark"] .surface-card-title h4 { color: var(--vm-theme-text); }
html[data-theme="dark"] .surface-provider-heading > a,
html[data-theme="dark"] .surface-card-title p,
html[data-theme="dark"] .surface-note,
html[data-theme="dark"] .surface-support-footnote { color: var(--vm-theme-muted); }
html[data-theme="dark"] .surface-provider-mark { border-color: var(--vm-theme-line); background: var(--vm-theme-surface); }
html[data-theme="dark"] .surface-card { border-color: var(--vm-theme-line); background: linear-gradient(180deg,var(--vm-theme-surface-raised),var(--vm-theme-surface)); }
html[data-theme="dark"] .surface-capabilities > div { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .surface-capabilities dt { color: var(--vm-theme-muted); }
html[data-theme="dark"] .surface-best { border-color: #50679f; background: #17264a; color: #9fb5ff; }
html[data-theme="dark"] .surface-connect-link { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-raised); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .connect-way-mcp { border-color: color-mix(in srgb,var(--vm-theme-accent) 35%,var(--vm-theme-line)); background: linear-gradient(145deg,color-mix(in srgb,var(--vm-theme-accent) 7%,var(--vm-theme-surface-raised)),var(--vm-theme-surface) 62%); }
html[data-theme="dark"] .connect-way-skill { border-color: var(--vm-theme-line); background: linear-gradient(145deg,var(--vm-theme-surface),var(--vm-theme-surface-raised)); }
html[data-theme="dark"] .connect-way-top code,
html[data-theme="dark"] .connect-service-button,
html[data-theme="dark"] .keys-visual > span,
html[data-theme="dark"] .agent-support-icon { border-color: var(--vm-theme-line); background: var(--vm-theme-surface); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .connect-way-card > p,
html[data-theme="dark"] .connect-way-top code,
html[data-theme="dark"] .connect-way-status { color: #a0aec4; }
html[data-theme="dark"] .demo-tabs { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .demo-tabs button { color: var(--vm-theme-muted); }
html[data-theme="dark"] .demo-tabs button[aria-selected="true"],
html[data-theme="dark"] .active-chip,
html[data-theme="dark"] .keyword-chips span { border-color: #304777; background: #1a2a4c; color: #9eb5ff; }
html[data-theme="dark"] .message-icon { border-color: #354d7a; }
html[data-theme="dark"] .demo-kicker,
html[data-theme="dark"] .demo-explanation,
html[data-theme="dark"] .demo-route,
html[data-theme="dark"] .feature-index,
html[data-theme="dark"] .step-number,
html[data-theme="dark"] .step-tag,
html[data-theme="dark"] .agent-support-meta { color: #94a2b9; }
html[data-theme="dark"] .route-line { background: var(--vm-theme-line); }
html[data-theme="dark"] .route-line .svg-icon { background: var(--vm-theme-surface); color: var(--vm-theme-muted); }
html[data-theme="dark"] .muted-chip { border-color: var(--vm-theme-line); color: var(--vm-theme-muted); }
html[data-theme="dark"] .keys-visual b { background: var(--vm-theme-surface-soft); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .setup-top,
html[data-theme="dark"] .setup-code > p { border-color: var(--vm-theme-line); color: var(--vm-theme-muted); }
html[data-theme="dark"] .setup-code pre { color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .agent-capabilities > div,
html[data-theme="dark"] .agent-support-card > a { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .agent-capabilities dt,
html[data-theme="dark"] .agent-hook-map { color: #b5c1d5; }
html[data-theme="dark"] .guide-note { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-raised); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .guide-content p code { background: #1a2a4c; color: #9db4ff; }
html[data-theme="dark"] .guide-content pre,
html[data-theme="dark"] .code-panel { background: #0f0f0f; border-color: var(--vm-theme-line); }

/* Authentication and secure capture */
html[data-theme="dark"] .auth-page { background: var(--vm-theme-bg); color: var(--vm-theme-text); }
html[data-theme="dark"] .auth-story > p:not(.eyebrow),
html[data-theme="dark"] .auth-story > a,
html[data-theme="dark"] .auth-card > p:not(.eyebrow),
html[data-theme="dark"] .auth-note,
html[data-theme="dark"] #approval p { color: var(--vm-theme-muted); }
html[data-theme="dark"] .auth-orbit span,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] #approval,
html[data-theme="dark"] .capture-request { border-color: var(--vm-theme-line); background: var(--vm-theme-surface); box-shadow: 0 24px 70px rgba(0,0,0,.28); }
html[data-theme="dark"] .auth-tabs { background: #171717; }
html[data-theme="dark"] .auth-tabs button { color: var(--vm-theme-muted); }
html[data-theme="dark"] .auth-tabs button[aria-selected="true"] { background: var(--vm-theme-surface-soft); color: var(--vm-theme-accent); box-shadow: none; }
html[data-theme="dark"] label { color: var(--vm-theme-text-soft); }
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select { border-color: var(--vm-theme-line); background: #171717; color: var(--vm-theme-text); }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #6f7d92; }
html[data-theme="dark"] .password-field button { color: #a9b5c9; }
html[data-theme="dark"] .auth-recovery-action { color: #9fb4ff; }
html[data-theme="dark"] .secondary,
html[data-theme="dark"] .secondary-button { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-raised); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .form-error,
html[data-theme="dark"] .console-banner,
html[data-theme="dark"] .admin-error,
html[data-theme="dark"] .admin-form-error { border-color: #6a3541; background: #29151c; color: #f1a6b3; }
html[data-theme="dark"] .auth-footer { border-color: var(--vm-theme-line); color: var(--vm-theme-muted); }

/* Console */
html[data-theme="dark"] .console-page { background: var(--vm-theme-page); color: var(--vm-theme-text); }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .console-header { border-color: var(--vm-theme-line); background: rgba(28,28,28,.94); }
html[data-theme="dark"] .workspace,
html[data-theme="dark"] .sidebar-help-card,
html[data-theme="dark"] .topbar-search,
html[data-theme="dark"] #menu-toggle { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-raised); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .workspace:hover,
html[data-theme="dark"] .topbar-search:hover,
html[data-theme="dark"] .sidebar nav button:hover { border-color: #454545; background: var(--vm-theme-surface-soft); color: var(--vm-theme-text); }
html[data-theme="dark"] .workspace-copy strong,
html[data-theme="dark"] .account-line strong,
html[data-theme="dark"] .breadcrumb strong,
html[data-theme="dark"] .panel-heading h2,
html[data-theme="dark"] .panel-heading-copy h2,
html[data-theme="dark"] .stat-card strong,
html[data-theme="dark"] .record-title,
html[data-theme="dark"] .security-card strong { color: #e8eef9; }
html[data-theme="dark"] .security-event-list > div { border-color: #2d394d; }
html[data-theme="dark"] .security-event-list strong { color: #dfe7f5; }
html[data-theme="dark"] .workspace-copy small,
html[data-theme="dark"] .account-line small,
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .topbar-search,
html[data-theme="dark"] .topbar-actions > a,
html[data-theme="dark"] .service-status,
html[data-theme="dark"] .console-page-heading > div > p:last-child,
html[data-theme="dark"] .stat-card-label,
html[data-theme="dark"] .stat-card small,
html[data-theme="dark"] .panel-heading-copy p,
html[data-theme="dark"] .record-subtitle { color: var(--vm-theme-muted); }
html[data-theme="dark"] .sidebar nav button { color: var(--vm-theme-muted); }
html[data-theme="dark"] .sidebar nav button svg { stroke: var(--vm-theme-muted); }
html[data-theme="dark"] .sidebar nav button[aria-current="page"] { background: #1b2a4b; color: #9eb4ff; }
html[data-theme="dark"] .sidebar nav button[aria-current="page"] svg { stroke: #8ea8ff; }
html[data-theme="dark"] .sidebar-label { color: #858585; }
html[data-theme="dark"] .plan-badge { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-soft); color: var(--vm-theme-muted); }
html[data-theme="dark"] .sidebar-help-icon,
html[data-theme="dark"] .account-popover,
html[data-theme="dark"] .topbar-search kbd { border-color: var(--vm-theme-line); background: #181818; color: var(--vm-theme-muted); }
html[data-theme="dark"] .account-line { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .account-popover { box-shadow: 0 18px 55px rgba(0,0,0,.42); }
html[data-theme="dark"] .account-popover a,
html[data-theme="dark"] .account-popover button { color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .account-popover a:hover,
html[data-theme="dark"] .account-popover button:hover { background: var(--vm-theme-surface-soft); color: #fff; }
html[data-theme="dark"] .welcome-panel { border-color: var(--vm-theme-line); background: linear-gradient(120deg,var(--vm-theme-surface-raised) 0%,var(--vm-theme-surface) 62%,color-mix(in srgb,var(--vm-theme-accent) 9%,var(--vm-theme-surface)) 100%); }
html[data-theme="dark"] .welcome-panel h2,
html[data-theme="dark"] .welcome-panel p { color: #dfe7f5; }
html[data-theme="dark"] .memory-network-card { border-color: var(--vm-theme-line); background: rgba(28,28,28,.9); box-shadow: 0 14px 38px rgba(0,0,0,.2); }
html[data-theme="dark"] .agent-mini-list img,
html[data-theme="dark"] .agent-mini-more { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-soft); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .memory-network-foot { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .quick-actions button,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .console-panel,
html[data-theme="dark"] .security-card,
html[data-theme="dark"] .storage-usage-card,
html[data-theme="dark"] .setup-panel,
html[data-theme="dark"] .install-prompt-card,
html[data-theme="dark"] .mcp-connect-card { border-color: var(--vm-theme-line); background: var(--vm-theme-surface); color: var(--vm-theme-text); }
html[data-theme="dark"] .quick-actions button:first-child { border-color: var(--vm-theme-accent); background: #315bfb; color: #fff; }
html[data-theme="dark"] .stat-card-icon,
html[data-theme="dark"] .security-card-icon,
html[data-theme="dark"] .storage-usage-icon,
html[data-theme="dark"] .empty-icon { background: #1b2a4c; color: #90a9ff; }
html[data-theme="dark"] .setup-progress-bar { background: #253145; }
html[data-theme="dark"] .setup-check.pending { background: #202a3a; color: #9aa8bd; }
html[data-theme="dark"] .agent-brand-grid span,
html[data-theme="dark"] .agent-catalog > span,
html[data-theme="dark"] .graph-node,
html[data-theme="dark"] .empty-state button { border-color: #344158; background: #151d2c; color: #b8c6da; }
html[data-theme="dark"] .panel-heading,
html[data-theme="dark"] .records-table th,
html[data-theme="dark"] .records-table td,
html[data-theme="dark"] .request-table th,
html[data-theme="dark"] .request-table td,
html[data-theme="dark"] .vault-audit-table th,
html[data-theme="dark"] .vault-audit-table td,
html[data-theme="dark"] .console-footer { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .records-table th,
html[data-theme="dark"] .request-table th,
html[data-theme="dark"] .vault-audit-table th { background: #181818; color: var(--vm-theme-muted); }
html[data-theme="dark"] .records-table tbody tr:hover,
html[data-theme="dark"] .request-table tbody tr:hover,
html[data-theme="dark"] .vault-audit-table tbody tr:hover { background: var(--vm-theme-surface-soft); }
html[data-theme="dark"] .list-toolbar,
html[data-theme="dark"] .pager,
html[data-theme="dark"] .relationship-toolbar,
html[data-theme="dark"] .relationship-footer { border-color: var(--vm-theme-line); background: var(--vm-theme-surface); }
html[data-theme="dark"] .list-toolbar input,
html[data-theme="dark"] .list-toolbar select,
html[data-theme="dark"] .pager button,
html[data-theme="dark"] .row-actions button { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-raised); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .tag,
html[data-theme="dark"] .request-status,
html[data-theme="dark"] .permission-toggle,
html[data-theme="dark"] .vault-audit-status { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-soft); color: var(--vm-theme-muted); }
html[data-theme="dark"] .detail-pre,
html[data-theme="dark"] .totp-secret,
html[data-theme="dark"] .recovery-code-grid,
html[data-theme="dark"] .key-once,
html[data-theme="dark"] .recovery-once { border-color: var(--vm-theme-line); background: #0f0f0f; color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .security-note,
html[data-theme="dark"] .vault-note,
html[data-theme="dark"] .key-note,
html[data-theme="dark"] .dialog-help { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-raised); color: var(--vm-theme-muted); }
html[data-theme="dark"] .key-note { border-bottom-color: var(--vm-theme-line); }
html[data-theme="dark"] .security-warning { border-color: #5f4b27; background: #251d10; color: #dfbf7e; }
html[data-theme="dark"] .security-details > div,
html[data-theme="dark"] .dashboard-status-agents span,
html[data-theme="dark"] .request-detail-section,
html[data-theme="dark"] .request-detail-result,
html[data-theme="dark"] .request-detail-meta div,
html[data-theme="dark"] .request-detail-meta div:nth-child(2n),
html[data-theme="dark"] .request-detail-meta div:nth-last-child(-n+2),
html[data-theme="dark"] .vault-grant-list .check-field,
html[data-theme="dark"] .agent-permission-list .check-field { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-raised); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .agent-permission-list .check-field strong,
html[data-theme="dark"] .permission-history strong { color: #c0ccdf; }
html[data-theme="dark"] .permission-history { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .request-detail-result { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-raised); }
html[data-theme="dark"] .request-detail-result.is-empty { background: var(--vm-theme-surface); }
html[data-theme="dark"] .request-detail-meta { background: var(--vm-theme-line); }
html[data-theme="dark"] .security-state { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-soft); color: var(--vm-theme-muted); }
html[data-theme="dark"] .security-state.enabled,
html[data-theme="dark"] .permission-toggle.enabled { border-color: #315f51; background: #122a24; color: #79c8a7; }
html[data-theme="dark"] .vault-approval { border-color: #66552e; background: #251e10; color: #ddbd78; }
html[data-theme="dark"] .danger-button { border-color: #693541; background: #28151c; color: #efa4b0; }
html[data-theme="dark"] .relationship-stats span,
html[data-theme="dark"] .relationship-stats button,
html[data-theme="dark"] .relation-detail-route { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-raised); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .relation-detail-route strong { background: #1b2a4c; color: #9eb5ff; }
html[data-theme="dark"] .relationship-panel,
html[data-theme="dark"] #console-main.is-graph-view .relationship-panel { background: radial-gradient(circle at 50% 48%,rgba(91,126,244,.09),transparent 40%),radial-gradient(circle,#3a3a3a .7px,transparent .75px) 0 0/24px 24px,linear-gradient(180deg,#171717,#121212); }
html[data-theme="dark"] .relationship-graph-meta,
html[data-theme="dark"] .relationship-graph-controls { border-color: var(--vm-theme-line); background: rgba(28,28,28,.92); color: var(--vm-theme-muted); box-shadow: 0 8px 26px rgba(0,0,0,.25); }
html[data-theme="dark"] .relationship-graph-controls button { border-color: var(--vm-theme-line); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .relationship-graph-controls button:hover { background: #1c2a4b; color: #9eb5ff; }
html[data-theme="dark"] .mcp-connect-card { background: linear-gradient(120deg,var(--vm-theme-surface-raised),color-mix(in srgb,var(--vm-theme-accent) 8%,var(--vm-theme-surface))); }
html[data-theme="dark"] .mcp-connect-copy h2 { color: #e7edf8; }
html[data-theme="dark"] .mcp-connect-copy p { color: #a5b2c7; }
html[data-theme="dark"] .mcp-connect-copy code,
html[data-theme="dark"] .mcp-connect-actions > div { border-color: var(--vm-theme-line); background: #181818; color: var(--vm-theme-text-soft); }

/* Admin, modal, flyout, language control */
html[data-theme="dark"] .admin-header,
html[data-theme="dark"] .admin-sidebar,
html[data-theme="dark"] .admin-identity,
html[data-theme="dark"] .admin-stats button,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .admin-pager button,
html[data-theme="dark"] .admin-dialog-actions button,
html[data-theme="dark"] #request-editor,
html[data-theme="dark"] .admin-operator-card { border-color: var(--vm-theme-line); background: var(--vm-theme-surface); color: var(--vm-theme-text); box-shadow: 0 10px 36px rgba(0,0,0,.18); }
html[data-theme="dark"] .admin-header .brand,
html[data-theme="dark"] .admin-heading h1,
html[data-theme="dark"] .admin-toolbar h2,
html[data-theme="dark"] .admin-identity strong,
html[data-theme="dark"] .admin-request-title,
html[data-theme="dark"] .admin-users-table td strong,
html[data-theme="dark"] .admin-operator-card strong,
html[data-theme="dark"] .admin-dialog-heading h2 { color: #edf2ff; }
html[data-theme="dark"] .admin-sidebar-brand,
html[data-theme="dark"] .admin-breadcrumb strong { color: #edf2ff; }
html[data-theme="dark"] .admin-sidebar nav > a,
html[data-theme="dark"] .admin-sidebar-bottom > button { color: #9aa8bf; }
html[data-theme="dark"] .admin-sidebar nav > a:hover,
html[data-theme="dark"] .admin-sidebar-bottom > button:hover { background: var(--vm-theme-surface-soft); color: #fff; }
html[data-theme="dark"] .admin-sidebar nav > a[aria-current="page"] { background: #1c2c52; color: #9db3ff; }
html[data-theme="dark"] .admin-menu-toggle { border-color: var(--vm-theme-line); background: #181818; color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .admin-header nav a,
html[data-theme="dark"] .admin-header nav button,
html[data-theme="dark"] .admin-heading > div > span,
html[data-theme="dark"] .admin-toolbar p,
html[data-theme="dark"] .admin-table td,
html[data-theme="dark"] .admin-result,
html[data-theme="dark"] .admin-pager { color: var(--vm-theme-muted); }
html[data-theme="dark"] .admin-header nav a:hover,
html[data-theme="dark"] .admin-header nav button:hover { background: var(--vm-theme-surface-soft); color: #fff; }
html[data-theme="dark"] .admin-toolbar,
html[data-theme="dark"] .admin-pager,
html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .admin-table td,
html[data-theme="dark"] .admin-operator-notice { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .admin-table th { background: #181818; color: var(--vm-theme-muted); }
html[data-theme="dark"] .admin-table tbody tr:hover { background: var(--vm-theme-surface-soft); }
html[data-theme="dark"] .admin-priority,
html[data-theme="dark"] .admin-status,
html[data-theme="dark"] .admin-role,
html[data-theme="dark"] .admin-operator-status { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-soft); color: var(--vm-theme-muted); }
html[data-theme="dark"] .admin-priority.high,
html[data-theme="dark"] .admin-operator-card > button.danger { border-color: #693541; background: #28151c; color: #efa4b0; }
html[data-theme="dark"] .admin-priority.low,
html[data-theme="dark"] .admin-role.otp-enabled,
html[data-theme="dark"] .admin-operator-status.enabled { border-color: #315f51; background: #122a24; color: #79c8a7; }
html[data-theme="dark"] .admin-status.reviewing,
html[data-theme="dark"] .admin-role.administrator,
html[data-theme="dark"] .admin-edit,
html[data-theme="dark"] .admin-operator-card > button { border-color: #40558a; background: #1a2949; color: #9fb5ff; }
html[data-theme="dark"] .admin-status.planned { border-color: #574979; background: #251e39; color: #c0a6ef; }
html[data-theme="dark"] .admin-status.in-progress { border-color: #66552e; background: #251e10; color: #ddbd78; }
html[data-theme="dark"] .admin-status.completed { border-color: #315f51; background: #122a24; color: #79c8a7; }
html[data-theme="dark"] .admin-status.declined { border-color: #3b4658; background: #171e2a; color: #9ba7b9; }
html[data-theme="dark"] .admin-filters select,
html[data-theme="dark"] .admin-filters input,
html[data-theme="dark"] .admin-filters > button,
html[data-theme="dark"] .admin-operators-panel > .admin-toolbar > button,
html[data-theme="dark"] #request-editor select,
html[data-theme="dark"] #request-editor textarea,
html[data-theme="dark"] #request-editor input { border-color: var(--vm-theme-line); background: #171717; color: var(--vm-theme-text); }
html[data-theme="dark"] .admin-request-context { background: var(--vm-theme-line); }
html[data-theme="dark"] .admin-request-context > div,
html[data-theme="dark"] .admin-operator-card dl > div { background: var(--vm-theme-surface-raised); }
html[data-theme="dark"] #request-editor section,
html[data-theme="dark"] .admin-operator-card dl { border-color: var(--vm-theme-line); background: var(--vm-theme-line); }
html[data-theme="dark"] #request-editor section p,
html[data-theme="dark"] .admin-request-context strong,
html[data-theme="dark"] .admin-operator-card dd { color: #c6d1e3; }
html[data-theme="dark"] .admin-operator-notice { background: #231d12; color: #d6b979; }
html[data-theme="dark"] .ui-modal,
html[data-theme="dark"] .ui-flyout { background: var(--vm-theme-surface); color: var(--vm-theme-text); }
html[data-theme="dark"] .ui-flyout-header,
html[data-theme="dark"] .ui-flyout-footer { border-color: var(--vm-theme-line); background: linear-gradient(180deg,var(--vm-theme-surface-raised),var(--vm-theme-surface)); }
html[data-theme="dark"] .ui-flyout-header h2,
html[data-theme="dark"] .dialog-heading h2 { color: #edf2ff; }
html[data-theme="dark"] .ui-icon-button,
html[data-theme="dark"] .ui-modal .ui-icon-button,
html[data-theme="dark"] .ui-flyout .ui-icon-button { border-color: var(--vm-theme-line); background: var(--vm-theme-surface-raised); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .ui-icon-button:hover { border-color: #526b9d; background: #1b2948; color: #9eb5ff; }
html[data-theme="dark"] .ui-confirm-message { color: #aebbd0; }
html[data-theme="dark"] .ui-choice-card { border-color: var(--vm-theme-line)!important; background: var(--vm-theme-surface)!important; color: var(--vm-theme-text)!important; }
html[data-theme="dark"] .ui-choice-card--sensitive { border-color: #66552e!important; background: linear-gradient(120deg,#19170f,#211b10)!important; }
html[data-theme="dark"] .ui-choice-card--sensitive:has(.ui-choice-input:checked) { border-color: #536cae!important; background: linear-gradient(120deg,var(--vm-theme-surface),var(--vm-theme-accent-soft))!important; }
html[data-theme="dark"] .ui-choice-control { border-color: #8f7943; background: #171717; }
html[data-theme="dark"] .ui-choice-copy strong { color: #e6edf8; }
html[data-theme="dark"] .ui-choice-copy small { color: #a5b2c7; }
html[data-theme="dark"] .ui-choice-state { border-color: #66552e; background: #1d190f; color: #d2b66d; }
html[data-theme="dark"] .ui-choice-input:checked ~ .ui-choice-state { border-color: #40588d; background: #1b2948; color: #9eb5ff; }
html[data-theme="dark"] .vm-language-icon,
html[data-theme="dark"] .vm-language-switcher select,
html[data-theme="dark"] .vm-language-floating { border-color: var(--vm-theme-line); background: rgba(28,28,28,.94); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .handoff-story { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .handoff-agent-card,
html[data-theme="dark"] .handoff-service { border-color: var(--vm-theme-line); background: var(--vm-theme-surface); color: var(--vm-theme-text); box-shadow: none; }
html[data-theme="dark"] .handoff-service {
  background: var(--vm-theme-surface);
  box-shadow: inset 0 2px 0 color-mix(in srgb,var(--blue) 72%,transparent);
}
html[data-theme="dark"] .handoff-service > .svg-icon { color: var(--blue); }
html[data-theme="dark"] .handoff-agent-card li { color: #aab6c9; }
html[data-theme="dark"] .handoff-agent-card li strong { color: #e2e9f5; }
html[data-theme="dark"] .handoff-service small { border-color: #30405a; color: #94a2b8; }
html[data-theme="dark"] .guide-harness-links a { border-color: var(--vm-theme-line); background: var(--vm-theme-surface); color: var(--vm-theme-text-soft); }
html[data-theme="dark"] .guide-harness-links a:hover { border-color: #526b9d; background: var(--vm-theme-accent-soft); color: #a9bcff; }
html[data-theme="dark"] .agent-guide-directory-grid,
html[data-theme="dark"] .agent-guide-directory-card { border-color: var(--vm-theme-line); }
html[data-theme="dark"] .agent-guide-directory-card { background: var(--vm-theme-surface); color: var(--vm-theme-text); }
html[data-theme="dark"] .agent-guide-directory-card:hover { background: var(--vm-theme-surface-raised); }
html[data-theme="dark"] .agent-guide-directory-heading>p { color: var(--vm-theme-muted); }

@media (max-width: 820px) {
  .header-actions .vm-theme-toggle { position: fixed; right: 12px; bottom: 12px; z-index: 61; margin: 0; }
  .console-header .vm-theme-toggle { position: static; }
  .vm-theme-floating { top: 12px; right: 150px; }
}

@media (max-width: 480px) {
  .vm-theme-floating { top: 10px; right: 146px; }
}

@media (prefers-reduced-motion: reduce) {
  .vm-theme-toggle { transition: none; }
}

/* Presentation-deck landing surfaces use neutral charcoal in dark mode. */
html[data-theme="dark"] .landing-page{
  --deck-canvas:#0d0d0e;
  --deck-paper:#171719;
  --deck-line:#303034;
  --deck-shadow:0 22px 64px rgba(0,0,0,.28);
  background:var(--deck-canvas);
}
html[data-theme="dark"] .landing-page .presentation-slide{
  border-color:var(--deck-line);
  border-top-color:#315bfb;
  background:var(--deck-paper);
}
html[data-theme="dark"] .landing-page .presentation-slide::before{color:#8c94a3}
html[data-theme="dark"] .landing-page .presentation-slide::after{color:#666b75}
html[data-theme="dark"] .landing-page .hero.presentation-slide .connect-way-card,
html[data-theme="dark"] .landing-page .features-section.presentation-slide .feature,
html[data-theme="dark"] .landing-page .surface-support-section.presentation-slide .surface-provider-heading,
html[data-theme="dark"] .landing-page .surface-support-section.presentation-slide .surface-card,
html[data-theme="dark"] .landing-page .surface-support-section.presentation-slide .surface-summary-card,
html[data-theme="dark"] .landing-page .agent-guide-directory.presentation-slide .agent-guide-directory-card{
  border-color:#303034;
  background:#1d1d20;
}
html[data-theme="dark"] .landing-page .hero.presentation-slide .connect-way-skill{
  border-color:#304b8d;
  background:#121a2b;
}
html[data-theme="dark"] .landing-page .start-section.presentation-slide .start-card{background:transparent}
html[data-theme="dark"] .landing-page .start-section.presentation-slide .setup-code{border-color:#34343a}
html[data-theme="dark"] .landing-page .surface-summary-card,
html[data-theme="dark"] .landing-page .surface-summary-link{border-color:#303034}
html[data-theme="dark"] .landing-page .surface-summary-link{color:#dce4f2}

@media(max-width:720px){
  html[data-theme="dark"] .landing-page{background:var(--deck-paper)}
}
