/*
 AP SYNAPSE — SIGNATURE WHITE
 Review branch only.

 All selectors require an existing light theme.
 No layout, dimensions, animation, or dark-mode changes.
*/

:is(
 body.light-mode,
 body.light,
 body[data-theme="light"],
 html[data-theme="light"] body
) {
    --bg: #fbfbfa;
    --panel: #ffffff;
    --panel-2: #f6f7f5;
    --text: #22272a;
    --muted: #697078;
    --muted-2: #858b91;
    --gold: #b18f57;
    --gold-light: #c3a46b;
    color-scheme: light;
}

body.light-mode .workspace,
body.light .workspace,
html[data-theme="light"] .workspace {
    background: #fdfdfc !important;
    color: #22272a;
}

body.light-mode .sidebar,
body.light .sidebar,
html[data-theme="light"] .sidebar {
    background: #f7f8f6 !important;
    border-color: #e7e9e5 !important;
}

body.light-mode .topbar,
body.light .topbar,
html[data-theme="light"] .topbar {
    background: #ffffff !important;
    border-color: #e9eae7 !important;
}

body.light-mode .command-bar,
body.light .command-bar,
html[data-theme="light"] .command-bar {
    background: #ffffff !important;
    border-color: #e2e5e0 !important;
    box-shadow: 0 10px 35px rgba(30,35,40,.045);
}

body.light-mode input,
body.light-mode textarea,
body.light input,
body.light textarea,
html[data-theme="light"] input,
html[data-theme="light"] textarea {
    caret-color: #9d7b42;
}

body.light-mode ::selection,
body.light ::selection,
html[data-theme="light"] ::selection {
    background: #e9dcc5;
    color: #1f2529;
}
/* AP-WHITE-READABILITY-V2
   LIGHT THEME ONLY
   No changes to positioning, dimensions or dark mode.
*/

:is(body.light-mode,body.light,body[data-theme="light"],
html[data-theme="light"] body)
#heroScreen .hero-title,
:is(body.light-mode,body.light,body[data-theme="light"],
html[data-theme="light"] body)
#heroScreen .hero-title-main {
    color: #20252b !important;
    -webkit-text-fill-color: #20252b !important;
    text-shadow: none !important;
}

:is(body.light-mode,body.light,body[data-theme="light"],
html[data-theme="light"] body)
#heroScreen .hero-title-accent {
    color: #927446 !important;
    -webkit-text-fill-color: #927446 !important;
    background-image: none !important;
    text-shadow: none !important;
}

:is(body.light-mode,body.light,body[data-theme="light"],
html[data-theme="light"] body)
.sidebar .brand,
:is(body.light-mode,body.light,body[data-theme="light"],
html[data-theme="light"] body)
.sidebar .brand-text {
    background: transparent !important;
    box-shadow: none !important;
}

:is(body.light-mode,body.light,body[data-theme="light"],
html[data-theme="light"] body)
.sidebar .brand-text h2 {
    background: transparent !important;
    color: #20252b !important;
    -webkit-text-fill-color: #20252b !important;
}

:is(body.light-mode,body.light,body[data-theme="light"],
html[data-theme="light"] body)
.sidebar .brand-text span,
:is(body.light-mode,body.light,body[data-theme="light"],
html[data-theme="light"] body)
.sidebar .sidebar-group h4 {
    background: transparent !important;
    color: #626a72 !important;
    -webkit-text-fill-color: #626a72 !important;
}

:is(body.light-mode,body.light,body[data-theme="light"],
html[data-theme="light"] body)
.sidebar .new-chat-btn span,
:is(body.light-mode,body.light,body[data-theme="light"],
html[data-theme="light"] body)
.sidebar .ap-install-btn span {
    background: transparent !important;
    color: #252a30 !important;
    -webkit-text-fill-color: #252a30 !important;
}

:is(body.light-mode,body.light,body[data-theme="light"],
html[data-theme="light"] body)
.intelligence-field-label {
    color: #434951 !important;
    -webkit-text-fill-color: #434951 !important;
}

/* ==================================================
   AP-SIGNATURE-WHITE-V3
   REVIEW ENVIRONMENT ONLY
   LIGHT THEME COLOR CORRECTIONS
   No geometry, navigation or behavior changes.
   ================================================== */

/* RECENT CONVERSATIONS */

html body.light-mode .app .sidebar .recent-group,
html body.light-mode .app .sidebar .history-list {
    background: transparent !important;
    background-image: none !important;
    color: #293139 !important;
    box-shadow: none !important;
}

html body.light-mode .app .sidebar .history-list .history-item {
    background: #f5f6f5 !important;
    background-image: none !important;
    color: #303840 !important;
}

html body.light-mode .app .sidebar .history-list .history-item:hover,
html body.light-mode .app .sidebar .history-list .history-item.active {
    background: #ffffff !important;
    background-image: none !important;
    color: #20262c !important;
}

html body.light-mode .app .sidebar .history-item-content {
    background: transparent !important;
    color: #303840 !important;
}

html body.light-mode .app .sidebar .history-title {
    color: #252c33 !important;
    -webkit-text-fill-color: #252c33 !important;
}

html body.light-mode .app .sidebar .history-preview {
    color: #68717a !important;
    -webkit-text-fill-color: #68717a !important;
}

html body.light-mode .app .sidebar .history-time {
    color: #937343 !important;
}

/* SIDEBAR SURFACES */

html body.light-mode .app .sidebar .brand,
html body.light-mode .app .sidebar .brand-text {
    background: transparent !important;
    background-image: none !important;
}

html body.light-mode .app .sidebar .brand-text h2 {
    color: #20262c !important;
    -webkit-text-fill-color: #20262c !important;
}

html body.light-mode .app .sidebar .brand-text span {
    color: #667078 !important;
    -webkit-text-fill-color: #667078 !important;
}

html body.light-mode .app .sidebar .sidebar-group > h4,
html body.light-mode .app .sidebar .version {
    background: transparent !important;
    background-image: none !important;
    color: #667078 !important;
}

/* USER CONVERSATION TEXT */

html body.light-mode .message.user .message-body,
html body.light-mode .user-message .message-body {
    background: #f2f4f3 !important;
    background-image: none !important;
    color: #222b34 !important;
    -webkit-text-fill-color: #222b34 !important;
    text-shadow: none !important;
}

html body.light-mode .message.user .message-body p,
html body.light-mode .message.user .message-body span,
html body.light-mode .user-message .message-body p,
html body.light-mode .user-message .message-body span {
    color: #222b34 !important;
    -webkit-text-fill-color: #222b34 !important;
    text-shadow: none !important;
}

/* ASSISTANT CONVERSATION TEXT */

html body.light-mode .message.ai .message-body {
    color: #29313a !important;
    -webkit-text-fill-color: #29313a !important;
}

/* END AP-SIGNATURE-WHITE-V3 */


/* ====================================================
   AP-SIGNATURE-WHITE-V4
   PEARL TITANIUM - PROTECTED VISUAL REVIEW ONLY
   Light Mode only. No geometry or behavior changes.
   Aprisha, voice and other systems untouched.
   ==================================================== */

/* DESIGN FOUNDATION */

html body.light-mode {
    --ap-pearl: #f5f6f4;
    --ap-paper: #ffffff;
    --ap-titanium: #ecefeb;
    --ap-graphite: #242a30;
    --ap-muted: #66717b;
    --ap-signature: #a58048;
    --ap-hairline: #dee3df;
    color-scheme: light;
}

/* HOME AND CONVERSATION BACKGROUNDS */

html body.light-mode .workspace,
html body.light-mode #assistantPage,
html body.light-mode #heroScreen {
    background-color: #f5f6f4 !important;
    background-image: linear-gradient(
        145deg,
        #f9faf8 0%,
        #f3f5f2 56%,
        #eff1ef 100%
    ) !important;
}

/* MAIN HOMEPAGE TYPOGRAPHY */

html body.light-mode #heroScreen .hero-title-main {
    color: #20272d !important;
    -webkit-text-fill-color: #20272d !important;
    text-shadow: none !important;
}

html body.light-mode #heroScreen .hero-title-accent {
    background: none !important;
    color: #957447 !important;
    -webkit-text-fill-color: #957447 !important;
    text-shadow: none !important;
}

html body.light-mode #heroScreen .hero-description {
    color: #64707a !important;
    -webkit-text-fill-color: #64707a !important;
}

/* HOMEPAGE ACTION BUTTONS */

html body.light-mode #heroScreen .hero-action-btn {
    background: linear-gradient(
        150deg,
        #ffffff,
        #f4f6f3
    ) !important;
    color: #283039 !important;
    -webkit-text-fill-color: #283039 !important;
    border-color: #dce1dc !important;
    box-shadow: 0 5px 14px rgba(31,40,45,.035) !important;
}

html body.light-mode #heroScreen .hero-action-btn:hover {
    background: #ffffff !important;
    border-color: #bba078 !important;
    box-shadow: 0 9px 23px rgba(31,40,45,.075) !important;
}

/* RECENT INTELLIGENCE */

html body.light-mode #heroScreen .recent-intelligence {
    background: linear-gradient(
        145deg,
        #ffffff,
        #f5f6f4
    ) !important;
    border: 1px solid #dde2de !important;
    box-shadow: 0 14px 38px rgba(29,36,43,.045) !important;
}

html body.light-mode #heroScreen .recent-intelligence h2 {
    color: #242b31 !important;
    -webkit-text-fill-color: #242b31 !important;
}

html body.light-mode #heroScreen .recent-card {
    background: #ffffff !important;
    border: 1px solid #e1e5e1 !important;
    color: #29313a !important;
    box-shadow: 0 4px 12px rgba(30,40,45,.035) !important;
}

html body.light-mode #heroScreen .recent-card :is(
    h3, h4, p, span, strong, button, a
) {
    color: #303841 !important;
    -webkit-text-fill-color: #303841 !important;
}

/* AI CHAT RESPONSE - REMOVE DARK NAVY PANEL */

html body.light-mode #chatWindow .message.ai {
    background: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

html body.light-mode #chatWindow .message.ai .message-body {
    background: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: #29323a !important;
    -webkit-text-fill-color: #29323a !important;
}

html body.light-mode #chatWindow .message.ai .message-body :is(
    p, h1, h2, h3, h4, li
) {
    color: #29323a !important;
    -webkit-text-fill-color: #29323a !important;
}

/* SETTINGS - REPAIR INVISIBLE HEADINGS */

html body.light-mode #settingsPage .settings-card {
    background: #ffffff !important;
    background-image: none !important;
    border-color: #e0e4e0 !important;
    box-shadow: 0 8px 22px rgba(28,35,42,.035) !important;
}

html body.light-mode #settingsPage .settings-card h2 {
    color: #252c32 !important;
    -webkit-text-fill-color: #252c32 !important;
}

html body.light-mode #settingsPage .settings-card p {
    color: #64707a !important;
    -webkit-text-fill-color: #64707a !important;
}

html body.light-mode #settingsPage .settings-control,
html body.light-mode #settingsPage .settings-select {
    background: #f6f7f5 !important;
    color: #29313a !important;
    -webkit-text-fill-color: #29313a !important;
    border-color: #dce1dc !important;
}

/* AUTOMATION - COHERENT INPUT AND OUTPUT */

html body.light-mode #automationPage .project-card {
    background: #ffffff !important;
    background-image: none !important;
    border-color: #dde2de !important;
    box-shadow: 0 12px 32px rgba(28,35,42,.04) !important;
}

html body.light-mode #automationPage #automationInput {
    background: #f7f8f6 !important;
    color: #28313a !important;
    -webkit-text-fill-color: #28313a !important;
    border-color: #dce1dc !important;
}

html body.light-mode #automationPage #automationInput::placeholder {
    color: #747e86 !important;
    -webkit-text-fill-color: #747e86 !important;
}

html body.light-mode #automationPage #automationResult {
    background: #f5f6f3 !important;
    background-image: none !important;
    color: #29323a !important;
    -webkit-text-fill-color: #29323a !important;
    border-color: #dce1dc !important;
    box-shadow: none !important;
}

/* END AP-SIGNATURE-WHITE-V4 */

/* =====================================================
   AP-SIGNATURE-WHITE-V5
   Four-component contrast repair.
   Light Mode ONLY.
   No layout, behavior, or Aprisha modifications.
   ===================================================== */

/* CODE STUDIO — keep the editor intentionally dark */

html body.light-mode #codeStudioPage .ap-code-explorer,
html body.light-mode #codeStudioPage .ap-code-editor,
html body.light-mode #codeStudioPage .ap-code-ai-panel {
    background: #12171d !important;
    color: #e7ebef !important;
}

html body.light-mode #codeStudioPage .ap-code-panel-title,
html body.light-mode #codeStudioPage .ap-code-project-name,
html body.light-mode #codeStudioPage .ap-code-tab,
html body.light-mode #codeStudioPage .ap-code-tabs,
html body.light-mode #codeStudioPage .ap-code-editor-status {
    color: #d5dde5 !important;
    -webkit-text-fill-color: #d5dde5 !important;
}

html body.light-mode #codeStudioPage .ap-code-file {
    background: #242c35 !important;
    color: #e1e7ed !important;
    -webkit-text-fill-color: #e1e7ed !important;
    border-color: #35404b !important;
}

html body.light-mode #codeStudioPage .ap-code-file.active {
    background: #303a45 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-color: #ae8950 !important;
}

html body.light-mode #codeStudioPage .ap-code-ai-panel :is(
    h2, h3, p, strong, span
) {
    color: #d7dfe7 !important;
    -webkit-text-fill-color: #d7dfe7 !important;
}

html body.light-mode #codeStudioPage #codeStudioOutput {
    color: #d1dae3 !important;
    -webkit-text-fill-color: #d1dae3 !important;
}

html body.light-mode #codeStudioPage #codeStudioInput {
    background: #0d1116 !important;
    color: #e8edf2 !important;
    -webkit-text-fill-color: #e8edf2 !important;
    caret-color: #d5aa60 !important;
}

/* CANVAS — improve black toolbar icon visibility */

html body.light-mode #canvasPage .whiteboard-toolbar {
    background-color: #191d22 !important;
    color: #eef2f5 !important;
}

html body.light-mode #canvasPage .whiteboard-toolbar button:not(:last-child) {
    color: #edf1f5 !important;
    -webkit-text-fill-color: #edf1f5 !important;
}

html body.light-mode #canvasPage .whiteboard-toolbar button:not(:last-child) svg {
    color: #edf1f5 !important;
    stroke: #edf1f5 !important;
}

/* INTELLIGENCE FIELD — proper light panel contrast */

html body.light-mode #intelligenceFieldPanel .intelligence-field-panel-inner {
    background: linear-gradient(145deg, #ffffff, #f2f4f1) !important;
    border-color: #dce1dc !important;
    color: #252d35 !important;
}

html body.light-mode #intelligenceFieldPanel .intelligence-field-panel-header h2,
html body.light-mode #intelligenceFieldPanel .intelligence-field-live strong,
html body.light-mode #intelligenceFieldPanel .intelligence-field-metrics strong {
    color: #242c34 !important;
    -webkit-text-fill-color: #242c34 !important;
}

html body.light-mode #intelligenceFieldPanel .intelligence-field-live div span,
html body.light-mode #intelligenceFieldPanel .intelligence-field-metrics span {
    color: #68737d !important;
    -webkit-text-fill-color: #68737d !important;
}

html body.light-mode #intelligenceFieldPanel .intelligence-field-metrics > div {
    background: #ffffff !important;
    border-color: #dfe4df !important;
}

html body.light-mode #intelligenceFieldPanel .intelligence-field-footer {
    color: #69747e !important;
    -webkit-text-fill-color: #69747e !important;
    border-color: #dde2de !important;
}

/* IDENTITY — preserve dark header, repair light content */

html body.light-mode #profileCard {
    background: #f5f6f3 !important;
    border-color: #dce1dd !important;
}

html body.light-mode #profileCard .popup-header {
    background: #1b1e22 !important;
    color: #ffffff !important;
}

html body.light-mode #profileCard .popup-header h2 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html body.light-mode #profileCard #profileName,
html body.light-mode #profileCard .profile-identity h3,
html body.light-mode #profileCard .profile-details strong,
html body.light-mode #profileCard .google-identity-section h4 {
    color: #252d35 !important;
    -webkit-text-fill-color: #252d35 !important;
}

html body.light-mode #profileCard #profileEmail,
html body.light-mode #profileCard .profile-details span,
html body.light-mode #profileCard .profile-section-label,
html body.light-mode #profileCard .google-identity-section p {
    color: #65717b !important;
    -webkit-text-fill-color: #65717b !important;
}

html body.light-mode #profileCard .profile-details > div {
    background: #ffffff !important;
    border-color: #dce2dd !important;
}

html body.light-mode #profileCard .profile-capabilities span {
    background: #f1eadc !important;
    color: #745326 !important;
    -webkit-text-fill-color: #745326 !important;
    border-color: #e1d1b4 !important;
}

html body.light-mode #profileCard .authenticated-status {
    color: #805e2d !important;
    -webkit-text-fill-color: #805e2d !important;
}

/* END AP-SIGNATURE-WHITE-V5 */
/* =============================================================
   AP-PEARL-CONSOLIDATED-01
   Protected light-mode review / stylesheet-only adjustment
   Scopes: homepage, chat, Code Studio, Canvas, Automation,
   Settings, Workspace Identity and Intelligence Field.
   No voice or Aprisha selectors. No layout or JS changes.
   ============================================================= */

/* HOME: keep premium near-white surfaces; simplify tiny inner labels */
html body.light-mode #heroScreen .recent-intelligence {
  background: linear-gradient(145deg, #fff, #f5f6f4) !important;
  border-color: #dce2de !important;
  box-shadow: 0 14px 38px rgba(29, 36, 43, .045) !important;
}
html body.light-mode #heroScreen .recent-card {
  background: #fff !important;
  border-color: #dce2de !important;
}
html body.light-mode #heroScreen .recent-card :is(.recent-card-title, .recent-card-meta, .recent-card-action) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
}
html body.light-mode #heroScreen .recent-card .recent-card-title { color: #28313a !important; }
html body.light-mode #heroScreen .recent-card .recent-card-meta { color: #697580 !important; }
html body.light-mode #heroScreen .recent-card .recent-card-action { color: #967044 !important; }

/* CHAT: readable assistant prose; keep code fences styled independently */
html body.light-mode #chatWindow .message.ai,
html body.light-mode #chatWindow .ai-message {
  background: transparent !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html body.light-mode #chatWindow .message.ai .message-body,
html body.light-mode #chatWindow .ai-message .message-body {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #28313a !important;
  -webkit-text-fill-color: #28313a !important;
  text-shadow: none !important;
}
html body.light-mode #chatWindow .message.ai .message-body :is(h1,h2,h3,h4,p,li),
html body.light-mode #chatWindow .ai-message .message-body :is(h1,h2,h3,h4,p,li) {
  color: #28313a !important;
  -webkit-text-fill-color: #28313a !important;
}
html body.light-mode #chatWindow .message.ai .message-body strong {
  color: #8c6934 !important;
  -webkit-text-fill-color: #8c6934 !important;
}

/* SETTINGS: repair near-white headings and faint descriptive text */
html body.light-mode #settingsPage :is(h1,h2,h3,h4,legend,label) {
  color: #263039 !important;
  -webkit-text-fill-color: #263039 !important;
}
html body.light-mode #settingsPage .settings-card {
  background: #fff !important;
  background-image: none !important;
  border-color: #dce2de !important;
  box-shadow: 0 8px 24px rgba(25, 35, 42, .035) !important;
}
html body.light-mode #settingsPage .settings-card :is(h2,h3,h4,strong) {
  color: #263039 !important;
  -webkit-text-fill-color: #263039 !important;
}
html body.light-mode #settingsPage .settings-card :is(p,small,.settings-description,.setting-description) {
  color: #63707c !important;
  -webkit-text-fill-color: #63707c !important;
}
html body.light-mode #settingsPage .settings-control,
html body.light-mode #settingsPage .settings-select {
  background: #f5f6f4 !important;
  color: #28313a !important;
  -webkit-text-fill-color: #28313a !important;
  border-color: #dce2de !important;
}

/* AUTOMATION: retain legibility in results even when empty */
html body.light-mode #automationPage .project-card {
  background: #fff !important;
  border-color: #dce2de !important;
  color: #28313a !important;
}
html body.light-mode #automationPage .project-card :is(h1,h2,h3,p) {
  color: #28313a !important;
  -webkit-text-fill-color: #28313a !important;
}
html body.light-mode #automationPage #automationInput,
html body.light-mode #automationPage #automationResult {
  background: #f6f7f5 !important;
  background-image: none !important;
  border-color: #dce2de !important;
  color: #28313a !important;
  -webkit-text-fill-color: #28313a !important;
  box-shadow: none !important;
}
html body.light-mode #automationPage #automationInput::placeholder {
  color: #707b84 !important;
  -webkit-text-fill-color: #707b84 !important;
}

/* CODE STUDIO: verified dark graphite editor inside light workspace */
html body.light-mode #codeStudioPage .ap-code-header {
  background: #f0f2ef !important;
  border-color: #d8dfdb !important;
}
html body.light-mode #codeStudioPage .ap-code-title :is(h1,p,.workspace-badge) {
  color: #27313a !important;
  -webkit-text-fill-color: #27313a !important;
  opacity: 1 !important;
}
html body.light-mode #codeStudioPage .ap-code-workspace,
html body.light-mode #codeStudioPage :is(.ap-code-explorer,.ap-code-editor,.ap-code-ai-panel) {
  background: #151b22 !important;
  color: #e9edf2 !important;
  border-color: #343e48 !important;
  opacity: 1 !important;
  filter: none !important;
}
html body.light-mode #codeStudioPage :is(.ap-code-panel-title,.ap-code-project-name,.ap-code-tabs,.ap-code-tab,.ap-code-editor-status) {
  color: #e4e9ee !important;
  -webkit-text-fill-color: #e4e9ee !important;
  opacity: 1 !important;
}
html body.light-mode #codeStudioPage .ap-code-file {
  background: #242e38 !important;
  color: #e9edf2 !important;
  -webkit-text-fill-color: #e9edf2 !important;
  border-color: #35414b !important;
  opacity: 1 !important;
  filter: none !important;
}
html body.light-mode #codeStudioPage .ap-code-file.active {
  background: #374350 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border-color: #b7955b !important;
}
html body.light-mode #codeStudioPage .ap-code-editor-body,
html body.light-mode #codeStudioPage #codeStudioInput { background: #0f151b !important; }
html body.light-mode #codeStudioPage #codeStudioInput {
  color: #edf1f5 !important;
  -webkit-text-fill-color: #edf1f5 !important;
  caret-color: #d1a45c !important;
  opacity: 1 !important;
}
html body.light-mode #codeStudioPage #codeStudioInput::placeholder {
  color: #929ea9 !important;
  -webkit-text-fill-color: #929ea9 !important;
}
html body.light-mode #codeStudioPage .ap-code-line-numbers {
  color: #9ca9b5 !important;
  -webkit-text-fill-color: #9ca9b5 !important;
  opacity: 1 !important;
}
html body.light-mode #codeStudioPage .ap-code-ai-panel :is(h2,h3,h4,p,span,strong),
html body.light-mode #codeStudioPage #codeStudioOutput {
  color: #dce4eb !important;
  -webkit-text-fill-color: #dce4eb !important;
}

/* CANVAS: REAL professional toolbar (verified via browser inspection) */
html body.light-mode #canvasPage .whiteboard-toolbar {
  background: #191d22 !important;
  color: #eef2f5 !important;
}
html body.light-mode #canvasPage .ap-wb-pro-toolbar .ap-wb-btn:not(.ap-wb-share) {
  color: #e8edf2 !important;
  -webkit-text-fill-color: #e8edf2 !important;
}
html body.light-mode #canvasPage .ap-wb-pro-toolbar .ap-wb-btn:not(.ap-wb-share) svg,
html body.light-mode #canvasPage .ap-wb-pro-toolbar .ap-wb-btn:not(.ap-wb-share) svg :is(path,line,rect,circle,polyline,polygon,ellipse) {
  color: #e8edf2 !important;
  stroke: #e8edf2 !important;
}
html body.light-mode #canvasPage .ap-wb-pro-toolbar .ap-wb-btn.active:not(.ap-wb-share),
html body.light-mode #canvasPage .ap-wb-pro-toolbar .ap-wb-btn.active:not(.ap-wb-share) svg,
html body.light-mode #canvasPage .ap-wb-pro-toolbar .ap-wb-btn.active:not(.ap-wb-share) svg :is(path,line,rect,circle,polyline,polygon,ellipse) {
  color: #edc781 !important;
  -webkit-text-fill-color: #edc781 !important;
  stroke: #edc781 !important;
}
/* Color swatches, Share, Make Beautiful and disabled opacity unchanged. */

/* WORKSPACE IDENTITY: light cards, legible statuses */
html body.light-mode #synapseIdentityPanel {
  background: #f5f6f3 !important;
  color: #263039 !important;
  border-color: #d9dfd9 !important;
}
html body.light-mode #synapseIdentityPanel :is(.synapse-identity-status,.synapse-identity-stat) {
  background: #fff !important;
  border-color: #dce2dd !important;
}
html body.light-mode #synapseIdentityPanel :is(.synapse-identity-panel-header h3,.synapse-identity-status strong,.synapse-identity-stat strong) {
  color: #253039 !important;
  -webkit-text-fill-color: #253039 !important;
}
html body.light-mode #synapseIdentityPanel :is(.synapse-identity-status div span,.synapse-identity-stat span,.synapse-identity-footer) {
  color: #5e6b74 !important;
  -webkit-text-fill-color: #5e6b74 !important;
}

/* INTELLIGENCE FIELD: near-white shell with readable statistics */
html body.light-mode #intelligenceFieldPanel .intelligence-field-panel-inner {
  background: #f5f6f3 !important;
  color: #263039 !important;
  border-color: #dce2dd !important;
}
html body.light-mode #intelligenceFieldPanel :is(.intelligence-field-live,.intelligence-field-metrics > div) {
  background: #fff !important;
  border-color: #dce2dd !important;
}
html body.light-mode #intelligenceFieldPanel :is(.intelligence-field-panel-header h2,.intelligence-field-live strong,.intelligence-field-metrics strong) {
  color: #263039 !important;
  -webkit-text-fill-color: #263039 !important;
}
html body.light-mode #intelligenceFieldPanel :is(.intelligence-field-live div span,.intelligence-field-metrics span,.intelligence-field-footer,.popup-kicker) {
  color: #606c77 !important;
  -webkit-text-fill-color: #606c77 !important;
}
/* END AP-PEARL-CONSOLIDATED-01 */


/* =====================================================
   AP-HUMAN-INTERFACE-LIGHT-APPROVED-01
   Visual presentation only, light-mode only.
   No Aprisha behavior, layout or runtime changes.
   ===================================================== */

html body.light-mode section[class*="aphi-pan"] {
    background: #eef1ef !important;
    color: #27313a !important;
    border-color: #d6ded9 !important;
}

/* Approved graphite header */

html body.light-mode section[class*="aphi-pan"]
div[class*="aphi-hea"] {
    background: #20252b !important;
    background-image: none !important;
    border-color: #303942 !important;
}

html body.light-mode section[class*="aphi-pan"]
div[class*="aphi-hea"] :is(h1,h2,h3,h4) {
    color: #f6f7f8 !important;
    -webkit-text-fill-color: #f6f7f8 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

html body.light-mode section[class*="aphi-pan"]
div[class*="aphi-hea"] p {
    color: #c2cbd3 !important;
    -webkit-text-fill-color: #c2cbd3 !important;
    opacity: 1 !important;
}

html body.light-mode section[class*="aphi-pan"]
div[class*="aphi-hea"] button {
    color: #edf1f5 !important;
    -webkit-text-fill-color: #edf1f5 !important;
}

/* Readable body headings and labels */

html body.light-mode section[class*="aphi-pan"]
:is(h3,h4,label,small) {
    color: #29343d !important;
    -webkit-text-fill-color: #29343d !important;
    opacity: 1 !important;
}

html body.light-mode section[class*="aphi-pan"]
:is([class*="kpi"],[class*="metric"],[class*="field"],[class*="threshold"])
:is(label,small,span) {
    color: #5d6872 !important;
    -webkit-text-fill-color: #5d6872 !important;
    opacity: 1 !important;
}

/* Header always retains its dark-theme contrast */

html body.light-mode section[class*="aphi-pan"]
div[class*="aphi-hea"] :is(h1,h2,h3,h4,label,small) {
    color: #f6f7f8 !important;
    -webkit-text-fill-color: #f6f7f8 !important;
}

/* Clear form input contrast */

html body.light-mode section[class*="aphi-pan"]
:is(input:not([type="checkbox"]):not([type="radio"]),textarea,select) {
    background-color: #ffffff !important;
    color: #26323c !important;
    -webkit-text-fill-color: #26323c !important;
    border-color: #d3dcd7 !important;
}

html body.light-mode section[class*="aphi-pan"]
:is(input,textarea,select):focus-visible {
    outline-color: #b69253 !important;
}

/* END AP-HUMAN-INTERFACE-LIGHT-APPROVED-01 */

/* =====================================================
   AP-MOBILE-PEARL-SIDEBAR-01
   Mobile Light Mode only.
   Visual contrast fixes; no behavior or layout changes.
   ===================================================== */

@media (max-width: 760px) {

  /* Workspace navigation container */

  html body.light-mode .app aside.sidebar
  .sidebar-group:not(.recent-group),
  html body.light-mode .app aside.sidebar
  .sidebar-group:not(.recent-group) nav {
    color: #29333c !important;
    background: transparent !important;
    background-image: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
  }

  /* Workspace navigation links */

  html body.light-mode .app aside.sidebar
  .sidebar-group:not(.recent-group) nav a {
    color: #34404a !important;
    -webkit-text-fill-color: #34404a !important;
    background: transparent !important;
    background-image: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    text-shadow: none !important;
  }

  html body.light-mode .app aside.sidebar
  .sidebar-group:not(.recent-group) nav a:is(:hover,.active,[aria-current="page"]) {
    background: #ffffff !important;
    color: #202a32 !important;
    -webkit-text-fill-color: #202a32 !important;
    border-color: #ddc9a8 !important;
  }

  /* Workspace headings */

  html body.light-mode .app aside.sidebar
  .sidebar-group > h4 {
    color: #707c85 !important;
    -webkit-text-fill-color: #707c85 !important;
    opacity: 1 !important;
  }

  /* Footer: replace dark strip with pearl surface */

  html body.light-mode .app aside.sidebar
  .sidebar-footer {
    background: #f1f3f0 !important;
    background-image: none !important;
    border-top-color: #dbe1dc !important;
    color: #29333c !important;
    opacity: 1 !important;
    filter: none !important;
  }

  html body.light-mode .app aside.sidebar
  .sidebar-footer nav {
    background: transparent !important;
    background-image: none !important;
    opacity: 1 !important;
    filter: none !important;
  }

  html body.light-mode .app aside.sidebar
  .sidebar-footer nav a,
  html body.light-mode .app aside.sidebar
  .sidebar-footer #sidebarSettingsBtn,
  html body.light-mode .app aside.sidebar
  .sidebar-footer #profileSidebarBtn {
    color: #303a43 !important;
    -webkit-text-fill-color: #303a43 !important;
    background: transparent !important;
    background-image: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    text-shadow: none !important;
  }

  html body.light-mode .app aside.sidebar
  .sidebar-footer nav a :is(span,strong,small),
  html body.light-mode .app aside.sidebar
  .sidebar-footer .ap-real-settings-label {
    color: #303a43 !important;
    -webkit-text-fill-color: #303a43 !important;
    background: transparent !important;
    background-image: none !important;
    opacity: 1 !important;
  }

  html body.light-mode .app aside.sidebar
  .sidebar-footer nav a:is(:hover,.active) {
    background: #ffffff !important;
    border-color: #dfcba9 !important;
  }

  html body.light-mode .app aside.sidebar
  .sidebar-footer .version {
    color: #77818a !important;
    -webkit-text-fill-color: #77818a !important;
  }

  /* Make the history scroll notice light-themed */

  html body.light-mode .app aside.sidebar
  .recent-group::before {
    background: #e9ede8 !important;
    background-image: none !important;
    color: #866d48 !important;
    -webkit-text-fill-color: #866d48 !important;
    border-bottom-color: #d9dfd9 !important;
  }
}

/* END AP-MOBILE-PEARL-SIDEBAR-01 */

/* ===================================================
   AP-MOBILE-FOOTER-LABEL-FIX
   Mobile Light Mode ONLY
   Settings and Profile labels only
   =================================================== */

@media (max-width: 760px) {

  html body.light-mode .app aside.sidebar
  .sidebar-footer #sidebarSettingsBtn {
    color: #29333c !important;
    -webkit-text-fill-color: #29333c !important;
    font-size: 13px !important;
    text-shadow: none !important;
  }

  html body.light-mode .app aside.sidebar
  .sidebar-footer #sidebarSettingsBtn
  .ap-real-settings-label {
    color: #29333c !important;
    -webkit-text-fill-color: #29333c !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-size: 13px !important;
    text-shadow: none !important;
  }

  html body.light-mode .app aside.sidebar
  .sidebar-footer #sidebarSettingsBtn::before {
    color: #46535e !important;
    -webkit-text-fill-color: #46535e !important;
  }

  html body.light-mode .app aside.sidebar
  .sidebar-footer #profileSidebarBtn {
    color: #29333c !important;
    -webkit-text-fill-color: #29333c !important;
    text-align: left !important;
    justify-content: flex-start !important;
    font-size: 13px !important;
  }

}

/* END AP-MOBILE-FOOTER-LABEL-FIX */

/* =====================================================
   AP-MOBILE-COMPOSER-PEARL-01
   Protected mobile Light Mode visual correction only.
   No changes to layout or functional controls.
   ===================================================== */

@media (max-width: 767px) {

  /* Remove the old dark gradient behind the composer */

  html body.light-mode .command-section {
    background: linear-gradient(
      to top,
      #f6f7f5 0%,
      #f6f7f5 55%,
      rgba(246,247,245,0) 100%
    ) !important;
    box-shadow: none !important;
    filter: none !important;
  }

  /* Pearl-titanium composer surface */

  html body.light-mode .command-section .command-bar {
    background: #ffffff !important;
    background-image: none !important;
    border-color: #dee3df !important;
    color: #28323b !important;
    box-shadow:
      0 3px 14px rgba(30,40,46,.07),
      inset 0 1px 0 #ffffff !important;
  }

  /* Replace dark-mode divider colours */

  html body.light-mode .command-section .command-bar::after {
    background: linear-gradient(
      90deg,
      transparent,
      #dfe4e0 14%,
      #dfe4e0 86%,
      transparent
    ) !important;
  }

  /* Text field */

  html body.light-mode .command-section
  .command-bar #userInput {
    color: #27313a !important;
    -webkit-text-fill-color: #27313a !important;
    caret-color: #a17b40 !important;
    text-shadow: none !important;
  }

  html body.light-mode .command-section
  .command-bar #userInput::placeholder {
    color: #727d86 !important;
    -webkit-text-fill-color: #727d86 !important;
    opacity: 1 !important;
  }

  /* Existing tool rail - no layout or display changes */

  html body.light-mode .command-section
  .command-bar .command-tools {
    background: transparent !important;
    background-image: none !important;
    color: #37434d !important;
    box-shadow: none !important;
  }

  /* Make available tools readable */

  html body.light-mode .command-section
  .command-bar .command-tools
  button.command-tool:not(:disabled) {
    color: #37434d !important;
    -webkit-text-fill-color: #37434d !important;
    opacity: 1 !important;
    filter: none !important;
    text-shadow: none !important;
  }

  /* SVG and semantic icons */

  html body.light-mode .command-section
  .command-bar .command-tools
  button.command-tool:not(:disabled)
  :is(svg, .ap-semantic-icon, i) {
    color: #37434d !important;
    -webkit-text-fill-color: #37434d !important;
    opacity: 1 !important;
    filter: none !important;
  }

  html body.light-mode .command-section
  .command-bar .command-tools
  button.command-tool:not(:disabled)
  svg [stroke]:not([stroke="none"]) {
    stroke: #37434d !important;
  }

  /* Active tool - subdued signature gold */

  html body.light-mode .command-section
  .command-bar .command-tools
  button.command-tool.active:not(:disabled) {
    color: #906c37 !important;
    -webkit-text-fill-color: #906c37 !important;
    background: #f5eee1 !important;
    border-color: #e8d8b9 !important;
  }

  html body.light-mode .command-section
  .command-bar .command-tools
  button.command-tool.active:not(:disabled)
  :is(svg, .ap-semantic-icon, i) {
    color: #906c37 !important;
    -webkit-text-fill-color: #906c37 !important;
  }

  html body.light-mode .command-section
  .command-bar .command-tools
  button.command-tool.active:not(:disabled)
  svg [stroke]:not([stroke="none"]) {
    stroke: #906c37 !important;
  }

  /* Send button remains in its existing gold style.
     Hidden/disabled controls retain their behavior. */
}

/* END AP-MOBILE-COMPOSER-PEARL-01 */

/* ===================================================
   AP-SETTINGS-CANVAS-CONTRAST-FINAL-01
   Protected Light Mode styling only
   No behavioral or layout modifications
   =================================================== */

/* SETTINGS — ACTUAL CONTROL CENTER BUTTONS */

html body.light-mode #settingsPage .ultimate-setting {
    color: #28313a !important;
    -webkit-text-fill-color: #28313a !important;
    border-color: #dce2dd !important;
    background-color: #f8f9f7 !important;
}

html body.light-mode #settingsPage .ultimate-setting.enabled {
    background-color: #f5f0e6 !important;
    border-color: #e1d2b7 !important;
}

html body.light-mode #settingsPage
.ultimate-setting .ultimate-setting-main strong {
    color: #26313a !important;
    -webkit-text-fill-color: #26313a !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

html body.light-mode #settingsPage
.ultimate-setting .ultimate-setting-main small {
    color: #64707b !important;
    -webkit-text-fill-color: #64707b !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Preserve clear enabled and disabled labels */

html body.light-mode #settingsPage
.ultimate-setting .ultimate-switch {
    color: #68737b !important;
    -webkit-text-fill-color: #68737b !important;
}

html body.light-mode #settingsPage
.ultimate-setting.enabled .ultimate-switch {
    color: #96713a !important;
    -webkit-text-fill-color: #96713a !important;
    border-color: #dac49f !important;
}

/* MOBILE CANVAS — LEGACY TOOLBAR SURFACE ONLY */

@media (max-width: 767px) {

    html body.light-mode #canvasPage
    .whiteboard-toolbar:not(:has(.ap-wb-pro-toolbar)) {
        background: #f5f7f5 !important;
        background-image: none !important;
        color: #303b44 !important;
        border-color: #dce2de !important;
        box-shadow: none !important;
    }

    html body.light-mode #canvasPage
    .whiteboard-toolbar:not(:has(.ap-wb-pro-toolbar)) > button {
        color: #303b44 !important;
        -webkit-text-fill-color: #303b44 !important;
        text-shadow: none !important;
    }

    html body.light-mode #canvasPage
    .whiteboard-toolbar:not(:has(.ap-wb-pro-toolbar)) > button svg {
        color: #303b44 !important;
        stroke: #303b44 !important;
    }

}

/* END AP-SETTINGS-CANVAS-CONTRAST-FINAL-01 */

/* ====================================================
   AP-CHAT-CANVAS-PEARL-VERIFIED-01
   Protected Light Mode / mobile presentation only
   No JavaScript, Aprisha, or behavioral modifications
   ==================================================== */

@media (max-width: 767px) {

  /* SAVED AND NEW ASSISTANT REPLIES */

  html body.light-mode #chatWindow .message.assistant {
    background: #f7f8f6 !important;
    background-image: none !important;
    color: #27313a !important;
    -webkit-text-fill-color: #27313a !important;
    border-color: #dfe4df !important;
    box-shadow: 0 5px 18px rgba(26,35,42,.045) !important;
    text-shadow: none !important;
  }

  html body.light-mode #chatWindow .message.assistant
  :is(.message-body,.message-content,.message-text,.message-bubble) {
    background: transparent !important;
    background-image: none !important;
    color: #27313a !important;
    -webkit-text-fill-color: #27313a !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html body.light-mode #chatWindow .message.assistant
  :is(p,span,strong,em,li,h1,h2,h3,h4) {
    color: #27313a !important;
    -webkit-text-fill-color: #27313a !important;
    text-shadow: none !important;
  }

  html body.light-mode #chatWindow .message.assistant button {
    background: #ffffff !important;
    color: #36424d !important;
    -webkit-text-fill-color: #36424d !important;
    border-color: #dfe4df !important;
  }

  html body.light-mode #chatWindow .message.assistant button svg {
    color: #36424d !important;
    stroke: #36424d !important;
  }

  /* INFINITE CANVAS ZOOM / NAVIGATION BAR
     Identified by its actual ap-inf-zoom button */

  html body.light-mode #canvasPage
  :is(div,nav,section):has(> button.ap-inf-zoom) {
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid #dce2dd !important;
    box-shadow: 0 5px 18px rgba(29,37,43,.10) !important;
    filter: none !important;
  }

  html body.light-mode #canvasPage
  :is(div,nav,section):has(> button.ap-inf-zoom)
  > :is(button:not(:disabled),span,output) {
    color: #2c3741 !important;
    -webkit-text-fill-color: #2c3741 !important;
    filter: none !important;
  }

  html body.light-mode #canvasPage
  :is(div,nav,section):has(> button.ap-inf-zoom)
  > button:not(:disabled) svg {
    color: #2c3741 !important;
    stroke: #2c3741 !important;
  }
}

/* END AP-CHAT-CANVAS-PEARL-VERIFIED-01 */

/* AP-MOBILE-DUPLICATE-SETTINGS-FIX-01
   Hide only the redundant appended label.
   Keep original Settings text, icon and click behavior. */

@media (max-width: 760px) {
  html body.light-mode .app aside.sidebar
  .sidebar-footer #sidebarSettingsBtn
  .ap-real-settings-label {
    display: none !important;
  }
}

/* END AP-MOBILE-DUPLICATE-SETTINGS-FIX-01 */