html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef4fb;
  --bg-deep: #dce8f5;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-soft: rgba(247, 250, 253, 0.95);
  --surface-glass: rgba(255, 255, 255, 0.78);
  --sidebar-bg: linear-gradient(180deg, rgba(251, 253, 255, 0.98), rgba(238, 245, 252, 0.98));
  --sidebar-glow: rgba(14, 165, 233, 0.16);
  --topbar-bg: rgba(255, 255, 255, 0.88);
  --text: #24364a;
  --text-strong: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --text-invert: #24364a;
  --primary: #0ea5e9;
  --primary-strong: #2563eb;
  --primary-soft: rgba(14, 165, 233, 0.12);
  --primary-rgb: 14, 165, 233;
  --secondary-rgb: 37, 99, 235;
  --accent: #10b981;
  --accent-rgb: 16, 185, 129;
  --success: #059669;
  --warning: #d97706;
  --danger: #e11d48;
  --border: rgba(148, 163, 184, 0.22);
  --border-strong: rgba(148, 163, 184, 0.32);
  --shadow: 0 28px 50px rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 16px 30px rgba(15, 23, 42, 0.08);
  --glow: 0 0 0 1px rgba(14, 165, 233, 0.24), 0 14px 30px rgba(14, 165, 233, 0.12);
  --button-neutral-bg: rgba(255, 255, 255, 0.88);
  --button-secondary-bg: rgba(255, 255, 255, 0.96);
  --button-secondary-text: #0f172a;
  --button-light-bg: rgba(14, 165, 233, 0.1);
  --button-light-text: #0284c7;
  --button-outline-bg: rgba(248, 251, 255, 0.96);
  --button-ghost-border: rgba(148, 163, 184, 0.28);
  --button-hover-shadow: 0 10px 18px rgba(14, 165, 233, 0.12);
  --field-bg: rgba(247, 250, 253, 0.96);
  --field-bg-focus: #ffffff;
  --table-head-bg: rgba(241, 246, 252, 0.96);
  --table-row-hover: rgba(14, 165, 233, 0.08);
  --sidebar-brand-bg: rgba(255, 255, 255, 0.86);
  --sidebar-brand-border: rgba(14, 165, 233, 0.18);
  --sidebar-brand-shadow: 0 18px 28px rgba(15, 23, 42, 0.08);
  --nav-hover-bg: rgba(14, 165, 233, 0.1);
  --nav-hover-border: rgba(14, 165, 233, 0.22);
  --empty-icon-bg: rgba(14, 165, 233, 0.1);
  --empty-icon-border: rgba(14, 165, 233, 0.24);
  --toggle-track-bg: rgba(148, 163, 184, 0.38);
  --toggle-track-border: rgba(148, 163, 184, 0.4);
  --toggle-knob: #ffffff;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --primary-rgb: 0, 229, 255;
  --secondary-rgb: 59, 130, 246;
  --accent-rgb: 34, 197, 94;
  --surface-soft: rgba(18, 27, 50, 0.82);
  --button-neutral-bg: rgba(15, 23, 42, 0.6);
  --button-secondary-bg: rgba(30, 41, 59, 0.9);
  --button-secondary-text: #f8fafc;
  --button-light-bg: rgba(0, 229, 255, 0.12);
  --button-light-text: #00e5ff;
  --button-outline-bg: rgba(10, 16, 32, 0.8);
  --button-ghost-border: rgba(148, 163, 184, 0.25);
  --button-hover-shadow: 0 8px 16px rgba(0, 229, 255, 0.12);
  --field-bg: rgba(9, 14, 28, 0.88);
  --field-bg-focus: rgba(9, 14, 28, 0.98);
  --table-head-bg: rgba(9, 15, 30, 0.9);
  --table-row-hover: rgba(0, 229, 255, 0.06);
  --sidebar-brand-bg: rgba(10, 16, 30, 0.75);
  --sidebar-brand-border: rgba(0, 229, 255, 0.2);
  --sidebar-brand-shadow: 0 0 0 1px rgba(0, 229, 255, 0.08), 0 14px 24px rgba(2, 6, 16, 0.5);
  --nav-hover-bg: rgba(0, 229, 255, 0.08);
  --nav-hover-border: rgba(0, 229, 255, 0.28);
  --empty-icon-bg: rgba(0, 229, 255, 0.1);
  --empty-icon-border: rgba(0, 229, 255, 0.25);
  --toggle-track-bg: rgba(148, 163, 184, 0.3);
  --toggle-track-border: rgba(148, 163, 184, 0.3);
  --toggle-knob: var(--text);
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(var(--primary-rgb), 0.12), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(var(--secondary-rgb), 0.12), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(var(--accent-rgb), 0.1), transparent 55%);
}

body.customer-safe {
  background-image: linear-gradient(180deg, rgba(var(--primary-rgb), 0.08), transparent 30%);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-toggle,
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--button-neutral-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-toggle:hover,
.theme-toggle:hover {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.34);
  color: var(--primary);
  box-shadow: var(--button-hover-shadow);
}

.sidebar-toggle:focus-visible,
.theme-toggle:focus-visible,
.btn:focus-visible,
.form input:focus-visible,
.form select:focus-visible,
.form textarea:focus-visible {
  outline: 2px solid rgba(var(--primary-rgb), 0.5);
  outline-offset: 2px;
}

.sidebar-toggle svg,
.theme-toggle svg {
  transition: transform 0.28s ease;
}

.theme-toggle-icons {
  width: 16px;
  height: 16px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-icon {
  position: absolute;
  inset: 0;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.theme-icon-sun {
  opacity: 0;
  transform: scale(0.7) rotate(-20deg);
}

.theme-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

html[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

html[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: scale(0.7) rotate(20deg);
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--text);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.sidebar::before {
  background: radial-gradient(circle at top, var(--sidebar-glow), transparent 55%);
}

.brand {
  border: 1px solid var(--sidebar-brand-border);
  background: var(--sidebar-brand-bg);
  box-shadow: var(--sidebar-brand-shadow);
}

.brand-title {
  color: var(--text-strong);
}

.brand-sub {
  color: var(--text-soft);
}

.brand-meta {
  color: var(--primary);
}

.nav-section-title {
  color: var(--text-soft);
}

.nav-item a {
  color: var(--text);
}

.nav-item.active a,
.nav-item a:hover {
  background: var(--nav-hover-bg);
  color: var(--text-strong);
  border-color: var(--nav-hover-border);
  box-shadow: var(--button-hover-shadow);
}

.nav-item.active a::before,
.nav-item a:hover::before {
  background: var(--primary);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.35);
}

.topbar {
  background: var(--topbar-bg);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.topbar-badge {
  background: var(--primary-soft);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  color: var(--text-strong);
}

.topbar-user,
.topbar-user a {
  color: var(--text);
}

.topbar-user a {
  color: var(--primary);
}

.toolbar {
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.toolbar input,
.toolbar select,
.form-row input,
.form-row select,
.form-row textarea,
.chat-list-search input,
.tag-input-row input,
.interaction-input-row textarea {
  background: var(--field-bg);
  color: var(--text);
}

.toolbar input:focus,
.toolbar select:focus,
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus,
.chat-list-search input:focus,
.tag-input-row input:focus,
.interaction-input-row textarea:focus {
  background: var(--field-bg-focus);
  border-color: rgba(var(--primary-rgb), 0.42);
  box-shadow: var(--glow);
}

.btn {
  border: 1px solid var(--border);
  background: var(--button-neutral-bg);
  color: var(--text);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--button-hover-shadow);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.95), rgba(var(--secondary-rgb), 0.95));
  color: #f8fafc;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(var(--primary-rgb), 0.24);
}

.btn-primary:hover {
  box-shadow: 0 16px 30px rgba(var(--primary-rgb), 0.28);
}

.btn-secondary {
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  border-color: rgba(148, 163, 184, 0.24);
}

.btn-light {
  background: var(--button-light-bg);
  color: var(--button-light-text);
  border-color: rgba(var(--primary-rgb), 0.28);
}

.btn-outline {
  background: var(--button-outline-bg);
  border-color: var(--border);
  color: var(--text);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #ffffff;
  border-color: transparent;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--button-ghost-border);
  color: var(--text-muted);
}

.btn-small {
  padding: 6px 12px;
  font-size: 11px;
}

.table {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.table th {
  background: var(--table-head-bg);
  color: var(--text-strong);
}

.table tbody tr:hover td {
  background: var(--table-row-hover);
}

.badge {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge.strong {
  background: rgba(var(--primary-rgb), 0.16);
  color: var(--primary);
  border-color: rgba(var(--primary-rgb), 0.28);
}

.badge-success {
  background: rgba(34, 197, 94, 0.16);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
}

.badge-danger {
  background: rgba(244, 63, 94, 0.12);
  color: var(--danger);
  border-color: rgba(244, 63, 94, 0.28);
}

.badge-warn {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.28);
}

.btn-warn-outline {
  border-color: rgba(245, 158, 11, 0.32);
  color: var(--warning);
  background: rgba(245, 158, 11, 0.08);
}

.btn-warn-outline:hover {
  background: rgba(245, 158, 11, 0.14);
}

.card,
.stat-card,
.snippet-form,
.wechat-account-card {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.card h3,
.card-title,
.page-heading,
.stat-value,
.wechat-account-title,
.aside-title {
  color: var(--text-strong);
}

.page-heading::after {
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.32), transparent);
}

.gewe-qr-wrap,
.account-checkbox-pill,
.sync-status,
.chat-item a,
.chat-aside .aside-block {
  background: var(--surface-soft);
  border-color: var(--border);
}

.chat-item.active a,
.chat-item a:hover {
  border-color: rgba(var(--primary-rgb), 0.28);
  background: rgba(var(--primary-rgb), 0.08);
}

.chat-avatar {
  background: rgba(var(--primary-rgb), 0.14);
  color: var(--primary-strong);
}

.sync-progress,
.message-status {
  background: rgba(148, 163, 184, 0.16);
}

.chat-messages {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at 0% 0%, rgba(var(--primary-rgb), 0.08), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.94));
}

.chat-input textarea {
  background: var(--field-bg);
  color: var(--text);
  caret-color: var(--text);
}

.chat-input textarea::placeholder {
  color: var(--text-soft);
}

.tag-chip {
  border-color: rgba(var(--primary-rgb), 0.18);
  background: rgba(var(--primary-rgb), 0.08);
}

.tag-chip-remove {
  color: var(--text-muted);
}

.toast {
  background: var(--surface-strong);
}

.toast-info {
  color: var(--primary-strong);
}

.upload-zone-inner {
  border-color: rgba(var(--primary-rgb), 0.24);
}

.upload-zone-inner:hover,
.upload-zone-inner.drag-over {
  background: rgba(var(--primary-rgb), 0.05);
}

.upload-file-info,
.empty-icon,
.file-type-icon {
  background: var(--empty-icon-bg);
  border: 1px solid var(--empty-icon-border);
  color: var(--primary);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.detail-row {
  padding: 12px;
  background: var(--surface-soft);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.detail-row strong {
  display: block;
  color: var(--text);
  margin-top: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-strong);
}

.pill-success {
  border-color: rgba(34, 197, 94, 0.26);
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

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

.empty,
.placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 16px;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--toggle-track-bg);
  border: 1px solid var(--toggle-track-border);
  position: relative;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--toggle-knob);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.toggle-switch input:checked + .toggle-track {
  background: rgba(var(--primary-rgb), 0.24);
  border-color: rgba(var(--primary-rgb), 0.42);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.2);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
  background: var(--primary);
}

html[data-theme="light"] .page-login {
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(236, 244, 252, 0.98), rgba(246, 250, 254, 0.98));
}

html[data-theme="light"] .login-shell {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 26px 54px rgba(15, 23, 42, 0.12);
  color: var(--text);
}

html[data-theme="light"] .login-hero h1,
html[data-theme="light"] .login-card h2,
html[data-theme="light"] .login-support .support-title {
  color: var(--text-strong);
}

html[data-theme="light"] .login-hero .hero-image {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(16, 185, 129, 0.14));
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .login-hero .hero-image img {
  filter: drop-shadow(0 12px 24px rgba(37, 99, 235, 0.14));
}

html[data-theme="light"] .hero-wordmark-kicker {
  color: rgba(2, 132, 199, 0.7);
}

html[data-theme="light"] .hero-wordmark-name {
  color: #0f172a;
  text-shadow: 0 12px 24px rgba(37, 99, 235, 0.1);
}

html[data-theme="light"] .hero-wordmark-sub {
  color: rgba(71, 85, 105, 0.88);
}

html[data-theme="light"] .login-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text);
}

html[data-theme="light"] .login-tabs span,
html[data-theme="light"] .login-tabs button,
html[data-theme="light"] .login-support,
html[data-theme="light"] .page-login .form input::placeholder {
  color: var(--text-muted);
}

html[data-theme="light"] .login-tabs .active {
  color: var(--text-strong);
}

html[data-theme="light"] .form input,
html[data-theme="light"] .form select,
html[data-theme="light"] .form textarea {
  background: var(--field-bg);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

html[data-theme="light"] .form input:focus,
html[data-theme="light"] .form select:focus,
html[data-theme="light"] .form textarea:focus {
  background: var(--field-bg-focus);
  border-color: rgba(var(--primary-rgb), 0.42);
  box-shadow: var(--glow);
}

html[data-theme="light"] .question-list-item,
html[data-theme="light"] .material-list-item {
  border-color: rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.95));
}

html[data-theme="light"] .question-list-item:hover,
html[data-theme="light"] .material-list-item:hover {
  border-color: rgba(var(--primary-rgb), 0.26);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .question-list-item.is-active,
html[data-theme="light"] .material-list-item.is-active {
  border-color: rgba(var(--primary-rgb), 0.34);
  background:
    radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.12), transparent 42%),
    linear-gradient(180deg, rgba(240, 249, 255, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: 0 16px 28px rgba(14, 165, 233, 0.12);
}

html[data-theme="light"] .question-title,
html[data-theme="light"] .material-list-title,
html[data-theme="light"] .empty-title,
html[data-theme="light"] .detail-title,
html[data-theme="light"] .detail-toolbar-title,
html[data-theme="light"] .section-heading,
html[data-theme="light"] .danger-zone-title {
  color: var(--text-strong);
}

html[data-theme="light"] .question-meta,
html[data-theme="light"] .question-footer,
html[data-theme="light"] .material-list-preview,
html[data-theme="light"] .material-list-footer,
html[data-theme="light"] .empty-copy,
html[data-theme="light"] .detail-subtitle,
html[data-theme="light"] .detail-toolbar-hint,
html[data-theme="light"] .section-caption,
html[data-theme="light"] .form-hint,
html[data-theme="light"] .detail-actions-copy,
html[data-theme="light"] .danger-zone-copy {
  color: var(--text-muted);
}

html[data-theme="light"] .list-empty-state,
html[data-theme="light"] .danger-zone {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="light"] .empty-kicker {
  color: var(--primary);
}

html[data-theme="light"] .detail-hero-create,
html[data-theme="light"] .detail-hero-edit {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="light"] .detail-hero-create {
  background:
    radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.18), transparent 42%),
    linear-gradient(135deg, rgba(240, 249, 255, 0.98), rgba(255, 255, 255, 0.98));
}

html[data-theme="light"] .detail-hero-edit {
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(255, 255, 255, 0.98));
}

html[data-theme="light"] .detail-eyebrow {
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary);
}

html[data-theme="light"] .summary-pill,
html[data-theme="light"] .form-section,
html[data-theme="light"] .upload-area {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="light"] .summary-label {
  color: var(--text-soft);
}

html[data-theme="light"] .summary-pill strong {
  color: var(--text-strong);
}

html[data-theme="light"] .form-col label {
  color: var(--text-strong);
}

html[data-theme="light"] .form-hint,
html[data-theme="light"] .form-hint-inline {
  color: var(--text-muted);
}

html[data-theme="light"] .material-format-chip,
html[data-theme="light"] .badge-neutral {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="light"] .upload-placeholder,
html[data-theme="light"] .preview-item,
html[data-theme="light"] .asset-card {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(148, 163, 184, 0.2);
}

html[data-theme="light"] .upload-placeholder:hover,
html[data-theme="light"] .asset-card:hover {
  border-color: rgba(var(--primary-rgb), 0.28);
  background: rgba(248, 251, 255, 0.96);
}

html[data-theme="light"] .upload-icon {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

html[data-theme="light"] .upload-copy,
html[data-theme="light"] .preview-meta,
html[data-theme="light"] .asset-meta {
  color: var(--text-muted);
}

html[data-theme="light"] .upload-copy strong,
html[data-theme="light"] .existing-assets-title {
  color: var(--text-strong);
}

html[data-theme="light"] .preview-item img,
html[data-theme="light"] .preview-item video,
html[data-theme="light"] .asset-card img,
html[data-theme="light"] .asset-card video {
  background: rgba(241, 245, 249, 0.92);
}

html[data-theme="light"] .root-device-card,
html[data-theme="light"] .root-account-card-v2,
html[data-theme="light"] .assistant-draft-card,
html[data-theme="light"] .assistant-chip-card,
html[data-theme="light"] .assistant-reference-card,
html[data-theme="light"] .root-account-row {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

html[data-theme="light"] .root-device-fact,
html[data-theme="light"] .root-detail-item,
html[data-theme="light"] .root-summary-item,
html[data-theme="light"] .root-inline-note,
html[data-theme="light"] .root-task-line,
html[data-theme="light"] .root-conversation-item,
html[data-theme="light"] .root-advanced-panel,
html[data-theme="light"] .assistant-collapsible,
html[data-theme="light"] .assistant-query-chip {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(248, 251, 255, 0.92);
}

html[data-theme="light"] .root-account-row:hover,
html[data-theme="light"] .root-account-card-v2:hover,
html[data-theme="light"] .assistant-draft-card:hover,
html[data-theme="light"] .assistant-chip-card:hover,
html[data-theme="light"] .root-conversation-item:hover,
html[data-theme="light"] .root-conversation-item.is-active {
  border-color: rgba(var(--primary-rgb), 0.32);
  background: rgba(240, 249, 255, 0.96);
  box-shadow: var(--button-hover-shadow);
}

html[data-theme="light"] .root-bind-code-hero,
html[data-theme="light"] .root-progress-card {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.88), rgba(240, 249, 255, 0.98));
}

html[data-theme="light"] .root-bind-code-hero.is-empty {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(248, 251, 255, 0.92);
}

html[data-theme="light"] .root-progress-bar {
  background: rgba(148, 163, 184, 0.2);
}

html[data-theme="light"] .root-conversation-avatar {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.14), rgba(var(--secondary-rgb), 0.14));
}

html[data-theme="light"] .root-chat-header,
html[data-theme="light"] .root-binding-form-shell,
html[data-theme="light"] .root-compose-form,
html[data-theme="light"] .assistant-collapsible[open] summary,
html[data-theme="light"] .root-chat-info-card {
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="light"] .root-column-chat {
  background:
    radial-gradient(circle at top, rgba(var(--primary-rgb), 0.08), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.98));
}

html[data-theme="light"] .root-message-stream {
  background:
    radial-gradient(circle at top, rgba(var(--primary-rgb), 0.08), transparent 42%),
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    rgba(255, 255, 255, 0.94);
  background-size: auto, 26px 26px, 26px 26px, auto;
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="light"] .root-msg-sender {
  background: rgba(248, 250, 252, 0.98);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="light"] .root-msg.is-agent .root-msg-bubble {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.16), rgba(var(--secondary-rgb), 0.14));
  border-color: rgba(var(--primary-rgb), 0.22);
  box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.12);
}

html[data-theme="light"] .root-msg.is-customer .root-msg-bubble,
html[data-theme="light"] .root-msg-quote-card,
html[data-theme="light"] .root-msg-image-placeholder,
html[data-theme="light"] .root-msg-media-placeholder {
  background: rgba(248, 251, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="light"] .root-msg-image-thumb {
  background: rgba(248, 250, 252, 0.98);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .root-compose-form {
  background: linear-gradient(180deg, rgba(238, 245, 252, 0), rgba(238, 245, 252, 0.8) 20%, rgba(238, 245, 252, 0.98));
}

html[data-theme="light"] .root-panel-pill,
html[data-theme="light"] .root-conversation-mode {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.18);
  color: var(--primary);
}

html[data-theme="light"] .root-conversation-tag,
html[data-theme="light"] .root-compose-channel,
html[data-theme="light"] .root-chat-info-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--text);
}

html[data-theme="light"] .root-chat-info-card.is-official,
html[data-theme="light"] .root-compose-channel.is-official {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.2);
  color: #15803d;
}

html[data-theme="light"] .kb-table {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="light"] .kb-table thead th,
html[data-theme="light"] .kb-column-head,
html[data-theme="light"] .kb-table tbody td,
html[data-theme="light"] .kb-table-card .table th,
html[data-theme="light"] .kb-table-card .table td,
html[data-theme="light"] .kb-name-cell strong,
html[data-theme="light"] .kb-name-cell span,
html[data-theme="light"] .kb-table-copy {
  color: var(--text) !important;
}

html[data-theme="light"] .kb-table tbody td {
  border-bottom-color: rgba(148, 163, 184, 0.14);
}

html[data-theme="light"] .kb-table tbody tr:hover td {
  background: rgba(var(--primary-rgb), 0.06);
}

html[data-theme="light"] .kb-table .badge.strong {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.2);
}

html[data-theme="light"] .kb-table .table-actions .btn-outline {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(248, 251, 255, 0.92);
}

html[data-theme="light"] .lab-debug-panel {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-soft);
}

html[data-theme="light"] .debug-panel-title,
html[data-theme="light"] .debug-panel-item strong {
  color: var(--text-strong);
}

html[data-theme="light"] .debug-panel-item {
  color: var(--text-muted);
}

html[data-theme="light"] .login-tip {
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .topbar-actions {
    gap: 8px;
  }
}
