/* Screen-only overrides. The five account themes, tenant branding and print remain intact. */
.sidebar-appearance[hidden], .sidebar-appearance [hidden] { display: none; }
.sidebar-appearance { border-top: 1px solid var(--nav-divider); margin-top: 6px; padding-top: 8px; }
.sidebar-appearance__toggle, .sidebar-appearance__reset { font: inherit; color: var(--nav-ink); background: transparent; border: 1px solid transparent; border-radius: 7px; min-height: 44px; padding: 8px 12px; cursor: pointer; width: 100%; }
.sidebar-appearance__toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.sidebar-appearance__toggle:hover, .sidebar-appearance__reset:hover { background: var(--nav-hover-bg); }
.sidebar-appearance button:focus-visible { outline: 3px solid var(--nav-focus); outline-offset: 2px; }
.sidebar-appearance__track { width: 36px; height: 22px; border: 2px solid var(--nav-caption); border-radius: 20px; padding: 2px; flex: none; }
.sidebar-appearance__track::before { content: ''; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--nav-ink); }
.sidebar-appearance__toggle[aria-checked="true"] .sidebar-appearance__track { border-color: #d7bc7a; }
.sidebar-appearance__toggle[aria-checked="true"] .sidebar-appearance__track::before { transform: translateX(10px); background: #d7bc7a; }
.sidebar-appearance__status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sidebar-appearance p { margin: 0 12px; font-size: 11px; color: var(--nav-caption); }
.sidebar-appearance__reset { font-size: 11px; text-align: left; text-decoration: underline; }
@media screen and (forced-colors: none) {
html[data-screen-mode="light"] body.portal-workspace {
  --paper: #ffffff; --card: #ffffff; --text: #162d4c; --quiet: #536278; --line: #e8ecf2; --soft-blue: #f3f7fc;
  --ux-ink: #172b48; --ux-muted: #52637a; --ux-border: #e1e7ef; --ux-surface: #ffffff; --ux-focus: #007dc5;
  --ink: #1f2330; --mid: #5b6474; --light: #66707f; --rule: #e8ecf2; --bg: #ffffff;
  --nav-bg: #fcfdfe; --nav-border: #e8ecf2; --nav-trim: #c9a84c; --nav-rule: #e3d29c; --nav-divider: #e8ecf2;
  --nav-ink: #17395f; --nav-sublink: #3f536c; --nav-caption: #536278;
  --nav-hover-bg: #eff4fa; --nav-hover-ink: #17395f; --nav-open-bg: #f5f8fc;
  --nav-section-bg: #eff4fa; --nav-section-border: #c9d7e8;
  --nav-current-bg: var(--brand-action, #002561); --nav-current-ink: var(--brand-on-action, #ffffff);
  --nav-current-trim: #c9a84c; --nav-focus: #166ab5;
  --nav-logo-tile: transparent; --nav-logo-pad: 0px; --nav-tile-bg: transparent; --nav-badge-ring: transparent;
  color-scheme: light;
}
html[data-screen-mode="dark"] body.portal-workspace {
  --paper: #071e2b; --card: #102f40; --text: #f2f0e8; --quiet: #c2cfda; --line: #526a78; --soft-blue: #183d50;
  --ux-ink: #f2f0e8; --ux-muted: #c2cfda; --ux-border: #526a78; --ux-surface: #071e2b; --ux-focus: #d7bc7a;
  --ink: #f2f0e8; --mid: #c2cfda; --light: #c2cfda; --rule: #526a78; --bg: #071e2b;
  --nav-bg: #082b3b; --nav-border: #082b3b; --nav-trim: #d7bc7a; --nav-rule: #d7bc7a; --nav-divider: #526a78;
  --nav-ink: #f1f5fb; --nav-sublink: #d3deec; --nav-caption: #c5d2e4;
  --nav-hover-bg: #204456; --nav-hover-ink: #ffffff; --nav-open-bg: #16394a;
  --nav-section-bg: #16394a; --nav-section-border: #758c99;
  --nav-current-bg: #d7bc7a; --nav-current-ink: #082b3b; --nav-current-trim: #a8842f; --nav-focus: #d7bc7a;
  --nav-logo-tile: #ffffff; --nav-logo-pad: 8px; --nav-tile-bg: #ffffff; --nav-badge-ring: #d7bc7a;
  --surface: #102f40; --gold: #d7bc7a;
  color-scheme: dark;
}
html[data-screen-mode="dark"] .workspace-bar,
html[data-screen-mode="dark"] .portal-workspace .btn.secondary,
html[data-screen-mode="dark"] .portal-menu-button { background: var(--card); color: var(--text); border-color: var(--line); }
html[data-screen-mode="dark"] .portal-workspace .foot,
html[data-screen-mode="dark"] .portal-workspace .eyebrow { color: var(--quiet); }
html[data-screen-mode="dark"] .portal-workspace main a:not(.btn):not([class]),
html[data-screen-mode="dark"] .portal-workspace .text-link { color: #e1c98d; }
html[data-screen-mode="dark"] .portal-workspace :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), select, textarea) { background: var(--card); color: var(--text); border-color: var(--line); }
html[data-screen-mode="dark"] .portal-workspace :is(th, td) { border-color: var(--line); }
html[data-screen-mode="dark"] .portal-workspace th { background: var(--soft-blue); color: var(--text); }
html[data-screen-mode="dark"] .portal-workspace :is(a, button, input, select, textarea, summary):focus-visible { outline-color: #d7bc7a; }
}
@media screen and (forced-colors: none) {
html[data-screen-mode="dark"] .statements-workspace :is(h2, summary, .sw-button--secondary) { color: #e1c98d; }
html[data-screen-mode="dark"] .portal-workspace :is(.overview-records-card, .statement-history) { background: var(--card); color: var(--text); border-color: var(--line); }
html[data-screen-mode="dark"] .portal-workspace :is(.overview-count, .records-footnote, .statement-history .statement-amount) { color: var(--quiet); }
html[data-screen-mode="dark"] .go-live-card :is(.go-live-card__figure strong, .go-live-card__next-label) { color: var(--quiet); }
/* The parchment bulletin and illustrated hero intentionally retain their own palette. */
html[data-screen-mode="dark"] .home-compact .home-bulletin .eyebrow { color: #6c5833; }
html[data-screen-mode="dark"] .home-compact .home-compact-details > summary { color: var(--text); }
html[data-screen-mode="dark"] .home-compact .home-compact-details__hint { color: var(--quiet); }
}
@media print { .sidebar-appearance { display: none; } }

/* Composed Home and Statements retain component-local tokens. Bridge only the
   surfaces that participate in screen mode; artwork and parchment stay fixed. */
@media screen and (forced-colors: none) {
  html[data-screen-mode="dark"] .dentist-home {
    --dh-ink: #f2f0e8; --dh-muted: #c2cfda; --dh-line: #526a78;
    --dh-panel: #102f40; --dh-soft: #183d50;
  }
  html[data-screen-mode="dark"] .remittance-entry { --re-ink: #f2f0e8; --re-muted: #c2cfda; --re-line: #526a78; }
  html[data-screen-mode="dark"] .platform-workspace th .pw-secondary { color: var(--quiet); }
  html[data-screen-mode="dark"] .dentist-home :is(.dh-card__kicker, .dh-card__action, .dh-edit-link) { color: #e1c98d; }
  html[data-screen-mode="dark"] .statements-workspace .sw-button--quiet { color: #e1c98d; }
  html[data-screen-mode="dark"] .portal-navigation .beta-tag { color: var(--nav-caption); }
  html[data-screen-mode="dark"] .portal-workspace .home-compact .home-bulletin :is(a:not(.btn), .notice-card__date) { color: #264d55; }
  html[data-screen-mode="dark"] .portal-workspace .kudos-practice-badge { color: #37556d; }
}

@media screen and (forced-colors: none) {
  html[data-screen-mode="dark"] .dentist-home :is(.dh-since__link, .dh-edit-link > span[aria-hidden]) { color: #e1c98d; }
  html[data-screen-mode="dark"] .dentist-home .dh-card__arrow { color: #163c60; }
  html[data-screen-mode="dark"] .home-followon--staff .re-pending .btn { color: #e1c98d; border-color: var(--line); }
}
/* The financial chart renderer uses document-root colours. Keep its plotting
   surface light in both modes rather than changing financial rendering logic. */
@media screen and (forced-colors: none) {
  html[data-screen-mode="dark"] .statements-workspace .sw-chart { background: #fff; border-radius: 4px; }
}
@media screen and (forced-colors: none) {
  html[data-screen-mode="dark"] .home-screen-card { background: var(--card); border-color: var(--line); }
}

/* Canonical white/gold identity on the effective dark navigation surface.
   Local mode wins; without an override only saved navy has a dark sidebar.
   Default light identity remains for print/forced colors and non-dark themes. */
.portal-navigation .atlantis-nav-identity { display: block; width: 100%; }
.portal-navigation .atlantis-nav-identity--dark { display: none; }
@media screen and (forced-colors: none) {
  :is(html[data-screen-mode="dark"] body, html:not([data-screen-mode]) body[data-theme="navy"]) .portal-navigation .atlantis-nav-identity--light { display: none; }
  :is(html[data-screen-mode="dark"] body, html:not([data-screen-mode]) body[data-theme="navy"]) .portal-navigation .atlantis-nav-identity--dark { display: block; }
  :is(html[data-screen-mode="dark"] body, html:not([data-screen-mode]) body[data-theme="navy"]) .portal-navigation .portal-logo,
  :is(html[data-screen-mode="dark"] body, html:not([data-screen-mode]) body[data-theme="navy"]) .portal-navigation img.atlantis-wordmark { background: transparent; }
}

/* Dark-mode follow-through: keep selected Education links and all Nerida
   message surfaces paired. Explicit screen mode only; saved navy remains light.
   No geometry, interaction, artwork or forced-colour behaviour changes. */
@media screen and (forced-colors: none) {
  html[data-screen-mode="dark"] body.portal-workspace .education-world .education-nav a[aria-current="page"] {
    background: #e1c98d;
    color: #082b3b;
    border-color: #e1c98d;
  }
  html[data-screen-mode="dark"] body.portal-workspace :is(.nerida, .nerida-page) :is(.nerida-bubble--nerida, .nerida-suggestions, .nerida-form, .nerida-foot, .nerida-typing) {
    background: #102f40;
    color: #f2f0e8;
  }
  html[data-screen-mode="dark"] body.portal-workspace :is(.nerida, .nerida-page) :is(.nerida-foot, .nerida-typing, .nerida-form .help, .nerida-sources__label, .nerida-bubble--nerida .nerida-bubble__meta) {
    color: #c2cfda;
  }
  html[data-screen-mode="dark"] body.portal-workspace :is(.nerida, .nerida-page) :is(.nerida-bubble__body a, .nerida-foot a) {
    color: #e1c98d;
  }
  html[data-screen-mode="dark"] body.portal-workspace :is(.nerida, .nerida-page) :is(.nerida-sources a, .nerida-chip, .nerida-bubble__body code) {
    background: #183d50;
    color: #f2f0e8;
    border-color: #8295a1;
  }
  html[data-screen-mode="dark"] body.portal-workspace :is(.nerida, .nerida-page) .nerida-chip:hover {
    background: #254e62;
  }
  html[data-screen-mode="dark"] body.portal-workspace :is(.nerida, .nerida-page) .nerida-error a {
    color: #9b1c1c;
  }
}
