/* Optional light skins. Keep every business override inside this explicit scope:
   an absent/default skin, an unknown skin and the existing dark theme stay intact. */
body[data-theme="light"][data-skin="celadon"] {
  --primary: #28766c;
  --soft: #f5f8f7;
  --skin-sidebar: #f0f5f3;
  --primary-soft: #e6f1ed;
  --ink: #263b36;
  --muted: #63756f;
  --line: #dfe8e3;
  --skin-series-2: #657f9a;
  --skin-series-3: #a88759;
  --skin-series-4: #8b7398;
  --skin-series-5: #75864f;
  --skin-series-6: #a66f79;
}

body[data-theme="light"][data-skin="mist"] {
  --primary: #426c91;
  --soft: #f5f7fa;
  --skin-sidebar: #ffffff;
  --primary-soft: #e9f0f7;
  --ink: #293b4b;
  --muted: #657587;
  --line: #e1e7ed;
  --skin-series-2: #558576;
  --skin-series-3: #aa8855;
  --skin-series-4: #8a739f;
  --skin-series-5: #78864f;
  --skin-series-6: #a66e78;
}

body[data-theme="light"][data-skin="sage"] {
  --primary: #62765a;
  --soft: #f8f7f3;
  --skin-sidebar: #f0f1e9;
  --primary-soft: #ebefe5;
  --ink: #333d31;
  --muted: #6d7666;
  --line: #e3e6dc;
  --skin-series-2: #657f9b;
  --skin-series-3: #ac8354;
  --skin-series-4: #94769d;
  --skin-series-5: #478b82;
  --skin-series-6: #a66e78;
}

body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) {
  color-scheme: light;
  --panel: #ffffff;
  --field: #ffffff;
  --topbar: rgba(255, 255, 255, .96);
  --primary-dark: color-mix(in srgb, var(--primary) 83%, #172a25);
  --hover: color-mix(in srgb, var(--primary-soft) 62%, white);
  --nav: var(--skin-sidebar);
  --nav-soft: var(--primary-soft);
  --cyan: var(--primary);
  --blue: var(--primary);
  --shadow: 0 5px 18px color-mix(in srgb, var(--ink) 5%, transparent);
  --skin-shadow: 0 12px 32px color-mix(in srgb, var(--ink) 10%, transparent);
  --skin-focus: color-mix(in srgb, var(--primary) 18%, transparent);
  --skin-question: color-mix(in srgb, var(--primary) 55%, var(--ink));
  /* The teaching modules use these names in addition to the desktop tokens. */
  --bg: var(--soft);
  --text: var(--ink);
  --border: var(--line);
  color: var(--ink);
  background: var(--soft);
  accent-color: var(--primary);
}

/* Navigation and chrome. Logo artwork, type sizes and geometry are untouched. */
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .sidebar {
  color: var(--ink);
  background: var(--skin-sidebar);
  box-shadow: inset -1px 0 var(--line);
}
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .brand strong { color: var(--ink); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.brand span, .nav-group, .version-row, .nav-item) { color: var(--muted); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .nav-item:hover { color: var(--primary); background: var(--hover); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .nav-item.active { color: var(--primary); background: var(--primary-soft); box-shadow: inset 3px 0 var(--primary); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .sidebar-footer { border-color: var(--line); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .version-row i { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.nav-list, .ai-palette-list) { scrollbar-color: color-mix(in srgb, var(--primary) 32%, var(--line)) transparent; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .nav-list::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 32%, var(--line)); background-clip: padding-box; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .nav-list::-webkit-scrollbar-thumb:hover { background: var(--muted); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .utility-rail { box-shadow: -4px 0 18px color-mix(in srgb, var(--ink) 4%, transparent); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.breadcrumb span, .breadcrumb b, .operator-meta span) { color: var(--muted); }

/* Paper surfaces and the quieter inset surfaces used across all four roles. */
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .panel, .metric-card, .table-panel, .summary-strip, .course-card, .project-card, .asset-card,
  .lead-card, .profile-stat, .matrix-card, .diagnostic-list, .external-platform-card,
  .external-job-list > div, .external-proposal, .account-user-list article, .profile-review-card,
  .portal-audit-list, .cloud-connect-panel, .quality-metric, .quality-project-card,
  .quality-phase-strip > div, .modal, .drawer-head, .account-menu, .utility-card,
  .creator-table-wrap, .creator-add-record, .creator-v2-top, .creator-v2-card,
  .creator-desk-module, .creator-flash, .creator-timeline-task, .creator-energy-card,
  .creator-wallet-mini, .creator-review-summary, .creator-review-alerts, .creator-review-good,
  .creator-collab-card, .creator-wallet-card, .role-home-card, .creator-market-hero,
  .market-task-card, .initialization-overview, .incubation-flow-panel,
  .commercial-value-grid article, .external-analysis-model, .feishu-guide-visual,
  .work-preview-meta button, .inspiration-card > button, .kb-shell, .kb-root-line,
  .kb-preview-head, .kb-asset-card, .kb-internal-placeholder, .knowledge-mode-tabs > button,
  .editor-row, .professional-report .modal-body
) { color: var(--ink); border-color: var(--line); background: var(--panel); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) #drawerRoot .drawer { color: var(--ink); border-color: var(--line); background: var(--soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .global-search, .pipeline-column, .growth-plan-focus > div, .channel-score, .asset-meta,
  .matrix-metrics span, .onboarding-drawer-summary > div, .notice-item,
  .external-flow, .external-proposal > p, .external-message-stream article,
  .profile-change-grid > div, .quality-phase-strip, .quality-issue-list > article,
  .desktop-profile-card, .desktop-account-row, .work-sync-banner, .creator-view-bar,
  .creator-sheet-tip, .creator-field-panel, .creator-content-cards > button,
  .creator-work-preview-card, .content-preview-text, .content-preview-block, .work-preview-empty,
  .creator-draft-grid article, .creator-v2-nav, .creator-center-tabs, .creator-detail-button,
  .creator-desk-module.locked, .assessment-evidence-grid span, .access-tabs,
  .task-import-source, .task-recommendation-note, .feishu-guide-nav, .secret-clear-row,
  .incubation-stage-grid article, .external-analysis-model article, .dingtalk-access-grid article,
  .dingtalk-pipeline, .kb-tree-pane, .kb-preview, .kb-list-head, .kb-roadmap article,
  .kb-media-stage, .data-path, .teaching-schedule
) { color: var(--ink); border-color: var(--line); background: var(--soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .creator-desk-hero, .task-ai-assistant, .feishu-guide-card, .portal-mode-banner,
  .portal-mode-banner.cloud, .market-requirement-card, .knowledge-mode-tabs > button.active
) { color: var(--ink); border-color: var(--line); background: var(--primary-soft); box-shadow: none; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.portal-mode-banner, .market-requirement-card, .creator-risk-panel, .task-recommendation-note) { border-left-color: var(--primary); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .panel-head, .card-footer, .activity-item, .setting-row, .matrix-card footer,
  .diagnostic-row, .external-platform-card footer, .quality-project-card footer,
  .portal-audit-list > div, .quality-observation-list > div, .creator-desk-kpis span,
  .creator-wallet-list > article, .creator-collab-row, .creator-project-row, .role-home-item,
  .creator-energy-stat, .creator-timeline-task > p, .creator-work-card footer,
  .creator-review-card, .activity-card > div, .ai-assessment-summary, .kb-row, .kb-summary,
  .kb-preview-meta, .task-ai-preview-head, .task-ai-preview-grid, .task-ai-preview-grid > div,
  .training-unit, .training-roster, .professional-report h2, .professional-report .report-item,
  .professional-report th, .professional-report td, .market-task-card footer
) { border-color: var(--line); }

/* Typography: target component text, so warnings and inline content retain meaning. */
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .data-table td, .creator-cell, .creator-cell strong, .creator-v2-card h2,
  .creator-desk-kpis b, .creator-desk-module > strong, .creator-content-cards strong,
  .creator-draft-preview strong, .creator-work-preview-card strong, .work-preview-empty strong,
  .work-preview-meta strong, .creator-energy-ring strong, .creator-energy-stat b,
  .creator-emergency-item strong, .inspiration-card > button strong, .activity-card > div strong,
  .role-home-card strong, .creator-sheet-tip strong, .creator-field-panel strong,
  .quality-metric > strong, .quality-project-meta b, .quality-phase-strip span,
  .cloud-connect-panel strong, .creator-market-hero h2, .market-task-card h3,
  .market-requirement-card strong, .ai-assessment-summary > strong, .assessment-evidence-grid b,
  .task-ai-preview-grid strong, .external-message-stream article p, .content-preview-text,
  .course-card > p, .training-unit h4, .training-roster strong
) { color: var(--ink); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .metric-foot, .activity-item time, .data-table small, .lead-card footer, .bar-column label,
  .channel-desc, .asset-card > p, .ability-row > div > label, .radar-chart > span,
  .form-field label, .detail-item span, .timeline-item small, .notice-main p,
  .matrix-card > p, .profile-review-card > p, .quality-project-card > p,
  .next-action-cell, .delivery-feedback, .external-flow i, .external-binding-chip button,
  .creator-v2-profile small, .creator-v2-assessment small, .creator-cell small,
  .creator-content-cards span, .creator-content-cards small, .creator-work-preview-card small,
  .creator-view-note, .creator-view-select-label > span, .creator-result-count,
  .creator-field-panel small, .creator-field-list label, .creator-add-record span,
  .creator-desk-hero p, .creator-desk-kpis span, .creator-desk-toolbar > span:last-child,
  .creator-desk-module p, .creator-desk-module.locked > small, .creator-draft-preview small,
  .creator-emergency-item span, .creator-emergency-item small, .creator-timeline-task header small,
  .creator-timeline-task > p, .creator-energy-ring small, .creator-energy-stat span,
  .creator-energy-stat small, .creator-work-cover small, .creator-work-body p,
  .creator-work-body > div, .creator-review-summary span, .creator-review-summary small,
  .creator-review-card span, .creator-review-card small, .creator-review-card p,
  .creator-filter-pills > span, .inspiration-card > button small, .activity-card > div small,
  .role-home-card span, .role-home-card small, .role-home-item small, .role-home-item > span,
  .work-preview-meta span, .content-preview-block p, .work-sync-banner span, .work-sync-banner small,
  .ai-assessment-summary > p, .desktop-account-row small, .portal-mode-banner span,
  .portal-mode-banner p, .task-ai-assistant > div:first-child span, .task-ai-preview-head span,
  .task-ai-preview-grid span, .task-import-source span, .feishu-guide-card p,
  .feishu-guide-visual span, .feishu-guide-nav > small, .secret-clear-row small,
  .initialization-overview p, .incubation-flow-panel > header > span,
  .incubation-stage-grid small, .incubation-stage-grid em, .commercial-value-grid span,
  .external-analysis-model span, .dingtalk-access-grid p, .dingtalk-access-grid em,
  .creator-market-hero p, .market-task-card p, .market-task-card header small,
  .market-task-card footer small, .market-requirement-card span, .market-requirement-card small,
  .training-fields small, .training-roster > small, .training-unit > small,
  .professional-report .report-link, .professional-report footer,
  .kb-root-line code, .kb-breadcrumb, .kb-list-head, .kb-preview-meta, .kb-preview-empty,
  .kb-empty, .empty, .empty b
) { color: var(--muted); }

/* Shared controls. Danger actions are intentionally omitted from normal accents. */
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .filter-input, .filter-select, .mini-select, .form-field input, .form-field select,
  .form-field textarea, .creator-inline-editor input, .creator-inline-editor select,
  .creator-inline-editor textarea, .creator-view-select-label select, .training-fields input,
  .training-fields select, .training-fields textarea, #trainingStudentSelect,
  .task-ai-assistant > textarea, .task-import-textarea, .kb-preview textarea, kbd
) { color: var(--ink); border-color: var(--line); background: var(--field); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .global-search:focus-within, .form-field input:focus, .form-field select:focus,
  .form-field textarea:focus, .filter-input:focus, .filter-select:focus,
  .training-fields input:focus, .training-fields select:focus, .training-fields textarea:focus,
  #trainingStudentSelect:focus, .kb-preview textarea:focus, .ai-input-box:focus-within
) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--skin-focus); outline: none; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(button, a):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.btn, .icon-btn, .kb-view-button) { border-color: var(--line); background: var(--panel); box-shadow: none; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.btn:hover, .icon-btn:hover, .kb-view-button:hover) { border-color: var(--primary); background: var(--hover); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .btn.primary, .top-ai-link, .creator-flash button,
  .creator-countdown button:not(.plain), .creator-timeline-task footer button:last-child,
  .creator-v2-nav button.active, .creator-view-tabs button.active,
  .creator-center-tabs button.active, .kb-view-button.active
) { color: #fff; border-color: var(--primary); background: var(--primary); box-shadow: none; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .btn.primary:hover, .top-ai-link:hover, .creator-flash button:hover,
  .creator-countdown button:not(.plain):hover, .creator-timeline-task footer button:last-child:hover,
  .creator-v2-nav button.active:hover, .creator-view-tabs button.active:hover,
  .creator-center-tabs button.active:hover, .kb-view-button.active:hover
) { color: #fff; border-color: var(--primary-dark); background: var(--primary-dark); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .operator-avatar, .avatar, .avatar.alt, .account-avatar, .status.green, .status.blue, .status.purple,
  .score, .diagnostic-score, .cloud-connect-icon, .external-binding-chip, .market-task-meta b,
  .risk-低, .priority-低,
  .level-badge, .incubation-stage-grid article > span, .setup-step-strip span,
  .creator-desk-module header > span, .activity-card > div span, .creator-work-body .badge,
  .creator-add-row, .creator-energy-card > button, .creator-draft-grid article > div button,
  .creator-review-summary button, .creator-timeline-task footer button:not(:last-child),
  .creator-filter-pills > button.active, .creator-view-tools .link-btn.active,
  .access-tabs button.active, .feishu-guide-nav > button.active, .feishu-guide-visual code,
  .kb-file-icon, .kb-asset-icon, .kb-asset-actions button:not(.danger),
  .knowledge-mode-tabs em, .knowledge-mode-tabs button:last-child em, .kb-preview-meta span,
  .work-preview-empty > span, .invite-result code
) { color: var(--primary); border-color: var(--line); background: var(--primary-soft); box-shadow: none; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .tag, .market-task-tags i, .creator-desk-module.locked header > span, .pipeline-head b
) { color: var(--muted); background: var(--soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .creator-view-tabs button, .creator-center-tabs button, .creator-v2-nav button,
  .access-tabs button, .feishu-guide-nav > button, .kb-tree button, .kb-filter-nav button,
  .creator-countdown button.plain, .row-actions button
):not(.active) { color: var(--muted); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .creator-view-tabs button:hover, .creator-center-tabs button:hover, .creator-v2-nav button:hover,
  .access-tabs button:hover, .feishu-guide-nav > button:hover, .creator-add-row:hover,
  .creator-energy-card > button:hover, .kb-asset-actions button:not(.danger):hover,
  .creator-filter-pills > button:hover, .creator-cell:hover, .creator-detail-button:hover,
  .creator-content-cards > button:hover, .creator-work-preview-card:hover,
  .work-preview-meta button:hover, .inspiration-card > button:hover,
  .kb-row:hover, .kb-asset-card:hover, .lead-card:hover
):not(.active) { color: var(--primary); border-color: var(--primary); background: var(--hover); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(
  .money-positive, .metric-foot strong, .creator-cell.primary-cell strong, .creator-work-preview-card > b,
  .creator-v2-assessment span, .creator-v2-card > header > b, .creator-flash > span,
  .quality-phase-strip b, .quality-project-card header span, .quality-observation-list b,
  .portal-audit-list span, .invite-result strong, .portal-mode-banner strong,
  .task-ai-assistant > div:first-child strong, .task-recommendation-note strong,
  .feishu-guide-card span, .field-help, .incubation-stage-grid button,
  .commercial-value-grid b, .dingtalk-access-grid span, .content-preview-block a,
  .market-task-card header > span, .external-platform-card small, .professional-report h1
) { color: var(--primary); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.proposal-approve, .review-approve) { color: var(--primary) !important; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.external-proposal.approved, .profile-review-card.approved, .quality-metric.good, .market-task-card.eligible) { border-color: var(--line); border-left-color: var(--primary); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .quality-metric.good { border-top-color: var(--primary); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.quality-metric.good header i, .invite-security-note.approve, .feishu-ai-diagnosis.success, .connection-test-result.success) { color: var(--primary); border-color: var(--line); background: var(--primary-soft); }

/* Decorative metric colours are intentionally restrained; red/orange status chips remain. */
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .metric-icon { color: var(--primary); background: var(--primary-soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .metric-card::after { background: var(--primary-soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.channel-icon, .external-platform-card header > span, .knowledge-mode-tabs .mode-icon, .knowledge-mode-tabs .mode-icon.local, .kb-coming-icon, .kb-audio-stage > span, .kb-external-preview > span, .kb-preview-placeholder > span) { color: var(--primary); background: var(--primary-soft); box-shadow: none; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .kb-library-card { color: var(--ink); background: var(--primary-soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .creator-work-cover { color: var(--primary); background: var(--primary-soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .creator-work-card:not(.low-score) { border-color: var(--line); background: var(--panel); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .creator-work-card footer button { color: var(--primary); border-color: var(--line); background: var(--panel); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .creator-work-card footer button:hover { background: var(--hover); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .creator-energy-ring { background: radial-gradient(circle, var(--panel) 58%, transparent 60%), conic-gradient(var(--primary) var(--energy), var(--line) 0); }

/* Tables, including sticky first columns. The existing pinned-task warning is retained. */
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.data-table th, .creator-table-wrap thead th, .creator-multitable thead th:first-child, .creator-freeze-first thead th:first-child, .professional-report th) { color: var(--muted); border-color: var(--line); background: var(--soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.creator-multitable td:first-child, .creator-freeze-first td:first-child) { background: var(--panel); box-shadow: 1px 0 0 var(--line); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .data-table td { border-color: var(--line); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .data-table tbody tr:hover { background: var(--hover); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .data-table tbody tr:hover > td:first-child { background: var(--hover); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .creator-task-pinned td:first-child { background: #fff8e8; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .creator-inline-editor { background: var(--primary-soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) [data-creator-inline-cell]:hover { box-shadow: inset 0 0 0 1px var(--primary); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.creator-column-resizer:hover, .creator-row-resizer:hover) { background: var(--skin-focus); }

/* Charts retain multiple distinguishable series. Widths, scores and data stay untouched. */
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.progress, .growth-track, .quality-project-progress, .initialization-progress, .feishu-progress) { background: var(--line); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.growth-track i, .quality-project-progress i, .initialization-progress i, .feishu-progress i) { background: var(--primary); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .bar-chart { background: repeating-linear-gradient(to bottom, transparent, transparent 42px, var(--line) 43px); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .bar.secondary { background: var(--skin-series-2); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.stage-row, .ability-row, .chart-legend > span) { --skin-series: var(--primary); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.stage-row, .ability-row, .chart-legend > span):nth-child(6n + 2) { --skin-series: var(--skin-series-2); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.stage-row, .ability-row, .chart-legend > span):nth-child(6n + 3) { --skin-series: var(--skin-series-3); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.stage-row, .ability-row, .chart-legend > span):nth-child(6n + 4) { --skin-series: var(--skin-series-4); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.stage-row, .ability-row, .chart-legend > span):nth-child(6n + 5) { --skin-series: var(--skin-series-5); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.stage-row, .ability-row, .chart-legend > span):nth-child(6n) { --skin-series: var(--skin-series-6); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.stage-row, .ability-row) .progress i { background: var(--skin-series); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ability-icon { color: var(--skin-series); background: color-mix(in srgb, var(--skin-series) 12%, white); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .chart-legend > span::before { background: var(--skin-series); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .radar-ring { fill: color-mix(in srgb, var(--primary) 3%, transparent); stroke: var(--line); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .radar-axis { stroke: var(--line); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .radar-area { fill: color-mix(in srgb, var(--primary) 20%, transparent); stroke: var(--primary); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .radar-dot { fill: var(--primary); stroke: var(--panel); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .radar-label { fill: var(--muted); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .skill-wheel { background: repeating-radial-gradient(circle, transparent 0 23px, var(--line) 24px 25px), conic-gradient(from 0deg, var(--primary-soft), color-mix(in srgb, var(--skin-series-2) 18%, white), color-mix(in srgb, var(--skin-series-3) 16%, white), var(--primary-soft)); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .skill-wheel::after { color: var(--primary); border-color: var(--line); background: var(--panel); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .timeline { border-color: var(--line); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .timeline-item::before { border-color: var(--panel); box-shadow: 0 0 0 1px var(--line); }

/* AI: dark question bubbles, light answer bubbles, and readable rich content. */
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-panel { color: var(--ink); border-color: var(--line); background: var(--soft); box-shadow: var(--skin-shadow); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.ai-panel-head, .ai-history-panel, .ai-composer, .ai-input-box, .ai-command-palette, .ai-choice-menu, .ai-sources, .ai-tool-card) { color: var(--ink); border-color: var(--line); background: var(--panel); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-context-bar { border-color: var(--line); background: var(--soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.ai-context-chip, .ai-active-chip, .ai-active-chip.mention, .ai-tool-icon, .ai-palette-tabs button.active, .ai-message-context span) { color: var(--primary); border-color: var(--line); background: var(--primary-soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.ai-history-item, .ai-palette-item, .ai-choice-menu button, .ai-tool-head strong) { color: var(--ink); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.ai-history-item small, .ai-history-item span, .ai-history-empty, .ai-history-delete, .ai-context-label, .ai-palette-item small, .ai-palette-item em, .ai-palette-empty, .ai-tool-head small, .ai-tool-result, .ai-sources span, .ai-control-text, .thinking-indicator) { color: var(--muted); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.ai-history-row:hover, .ai-history-item:hover, .ai-palette-item:hover, .ai-palette-item.selected, .ai-choice-menu button:hover, .ai-choice-menu button.selected) { color: var(--primary); background: var(--hover); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.context-button, .ai-palette-tabs button) { color: var(--muted); border-color: var(--line); background: var(--soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-bubble { color: var(--ink); border-color: var(--line); background: var(--panel); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.ai-message p, .ai-richtext, .ai-richtext h3, .ai-richtext h4, .ai-richtext h5) { color: var(--ink); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.ai-richtext blockquote, .ai-richtext code, .ai-richtext pre, .ai-richtext th) { color: var(--ink); border-color: var(--primary); background: var(--primary-soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-richtext pre code { background: transparent; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.ai-table-scroll, .ai-richtext th, .ai-richtext td, .ai-controls) { border-color: var(--line); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-richtext hr { background: var(--line); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.ai-message a, .ai-sources a) { color: var(--primary); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-message.user .ai-bubble { color: #fff; border-color: var(--skin-question); background: var(--skin-question); box-shadow: none; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-message.user :is(p, .ai-richtext, h3, h4, h5, a) { color: #fff; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-message.user .ai-message-context span { color: #fff; background: rgba(255, 255, 255, .16); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-message.error .ai-bubble { border-color: #f1c9d0; background: #fff5f6; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-tool-card.success { border-color: color-mix(in srgb, var(--primary) 26%, var(--line)); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-tool-card.success .ai-tool-status { color: var(--primary); background: var(--primary-soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-tool-card.failed { border-color: #f3c6cc; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-tool-card.pending { border-color: #ead7a6; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-composer textarea { color: var(--ink); background: var(--field); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-composer textarea::placeholder { color: var(--muted); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-send:not(.is-stop) { color: #fff; background: var(--skin-question); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .ai-send:not(.is-stop):hover:not(:disabled) { background: var(--primary-dark); }
/* Preserve the existing small AI gradient mark in the utility rail. */
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .utility-rail .top-icon-ai { border-color: transparent; background: transparent; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .utility-rail .top-icon-ai:is(:hover, [aria-expanded="true"]) { border-color: transparent; background: transparent; }

/* Light skin login and overlays use the same palette without touching logo sizes. */
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .desktop-auth-root { background: var(--soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .desktop-auth-card { border-color: var(--line); background: var(--panel); box-shadow: var(--skin-shadow); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .desktop-auth-brand { color: var(--ink); background: var(--skin-sidebar); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.desktop-auth-brand > p, .desktop-auth-role-list span, .desktop-auth-form-wrap > p, .desktop-auth-field label) { color: var(--muted); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .desktop-auth-form-wrap h2 { color: var(--ink); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.desktop-auth-role-list i, .desktop-auth-boundary, .desktop-login-modes) { color: var(--muted); background: var(--primary-soft); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.desktop-auth-tabs button, .desktop-auth-field input, .desktop-auth-field select) { color: var(--ink); border-color: var(--line); background: var(--panel); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.desktop-auth-tabs button.active, .desktop-login-modes button.active) { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); box-shadow: none; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .desktop-login-modes button { color: var(--muted); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.desktop-auth-field input:focus, .desktop-auth-field select:focus) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--skin-focus); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .desktop-auth-submit { color: #fff; background: var(--primary); box-shadow: none; }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .desktop-auth-submit:hover { background: var(--primary-dark); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.modal, .account-menu, .ai-history-panel, .ai-command-palette, .ai-choice-menu) { box-shadow: var(--skin-shadow); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) :is(.modal-head button, .drawer-close) { color: var(--muted); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .tutorial-highlight { border-color: var(--primary); box-shadow: 0 0 0 3px var(--skin-focus); }
body[data-theme="light"]:is([data-skin="celadon"], [data-skin="mist"], [data-skin="sage"]) .toast:not(.error) { color: #fff; background: var(--skin-question); }

/* New picker only. Preview tokens belong to each choice, not the active body skin. */
.skin-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
  gap: 12px;
  min-width: 0;
  margin: 14px 0;
}
.skin-choice {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.skin-choice:hover { border-color: var(--primary); background: var(--hover); }
.skin-choice[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-soft); }
.skin-choice:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.skin-preview {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
  height: 78px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--skin-preview-accent, #5b5ce2) 16%, transparent);
  border-radius: 7px;
  background: var(--skin-preview-bg, #f4f7fb);
  isolation: isolate;
}
.skin-preview::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 24%;
  border-right: 1px solid color-mix(in srgb, var(--skin-preview-accent, #5b5ce2) 12%, transparent);
  background: var(--skin-preview-sidebar, #252c38);
}
.skin-preview::after {
  content: "";
  position: absolute;
  inset: 11px 10px 10px 31%;
  border-radius: 4px;
  background:
    linear-gradient(var(--skin-preview-accent, #5b5ce2), var(--skin-preview-accent, #5b5ce2)) 0 0 / 46% 7px no-repeat,
    linear-gradient(color-mix(in srgb, var(--skin-preview-accent, #5b5ce2) 15%, transparent), color-mix(in srgb, var(--skin-preview-accent, #5b5ce2) 15%, transparent)) 0 20px / 100% 16px no-repeat,
    linear-gradient(color-mix(in srgb, var(--skin-preview-accent, #5b5ce2) 10%, transparent), color-mix(in srgb, var(--skin-preview-accent, #5b5ce2) 10%, transparent)) 0 43px / 70% 5px no-repeat;
}
.skin-name { display: block; min-width: 0; color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.skin-description { display: block; min-width: 0; color: var(--muted); font-size: 10px; line-height: 1.65; overflow-wrap: anywhere; }
.skin-selected { position: absolute; top: 15px; right: 15px; z-index: 1; display: inline-flex; align-items: center; padding: 3px 6px; border-radius: 99px; color: var(--panel); background: var(--primary); font-size: 9px; font-weight: 700; line-height: 1.3; }
.skin-choice:not([aria-pressed="true"]) .skin-selected { visibility: hidden; }
.skin-system-option { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.6; color: var(--ink); }
.skin-system-option input { flex: 0 0 auto; accent-color: var(--primary); }
.skin-note { margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
@media (prefers-reduced-motion: reduce) { .skin-choice { transition: none; } }
