/* Luminous command deck: presentation only; existing routes, layouts and controls stay in place. */
body.command-deck {
  --cd-bg: #0b1421;
  --cd-panel: #142335;
  --cd-raised: #1b3045;
  --cd-line: #365069;
  --cd-text: #edf4fb;
  --cd-muted: #b6c9db;
  --cd-orange: #ff9b57;
  --cd-teal: #76e2c9;
  --cd-sky: #9bd7f6;
  --ink: var(--cd-text);
  --navy: var(--cd-text);
  --navy-deep: #0c1726;
  --navy-mid: #263f59;
  --body-text: #ccdae7;
  --mid-gray: var(--cd-muted);
  --muted: var(--cd-muted);
  --surface: var(--cd-panel);
  --solid: var(--cd-panel);
  --canvas: var(--cd-bg);
  --off-white: var(--cd-bg);
  --light-gray: #1c3045;
  --line: var(--cd-line);
  --rule: var(--cd-line);
  --nav: #102030;
  --accent: var(--cd-teal);
  --accent-soft: #193f40;
  --brand: var(--cd-teal);
  --brand-dark: #9cecd9;
  --brand-gold: var(--cd-orange);
  --orange: var(--cd-orange);
  --orange-dk: #ffb77f;
  --teal: var(--cd-teal);
  --teal-ink: #a1eddb;
  --ok: #a4efc8;
  --ok-bg: #153c2d;
  --bad: #ffb7ac;
  --bad-bg: #452a30;
  color-scheme: dark;
  color: var(--body-text);
  background: radial-gradient(ellipse at 88% 8%, #19344538, transparent 48%), var(--cd-bg);
}

body.command-deck :is(h1, h2, h3, h4, legend, label, details summary) { color: var(--cd-text); }
body.command-deck a { color: var(--cd-sky); }
body.command-deck :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--cd-orange) !important;
  outline-offset: 3px;
}
body.command-deck ::selection { background: #386c80; color: #fff; }
body.command-deck :is(hr, fieldset) { border-color: var(--cd-line); }
body.command-deck :is(code, .setup-url, .folder-example) { color: var(--cd-text); background: #1a3045; }
body.command-deck .skip-link { color: #172334; background: var(--cd-orange); border-color: #ffc99f; }
body.command-deck .ambient-canvas { opacity: .055; }
body.command-deck .ambient-canvas.water { opacity: 1; }
/* Tier 1: safety. Specificity 0, background-color only. Page sections are children of main, which stays transparent. */
:where(html.has-water) :where(body.command-deck .workspace-body > main) > :where(*),
:where(html.has-water) :where(body.command-deck .workspace-body) :where(.rq-layout) > :where(*),
:where(html.has-water) :where(body.command-deck .workspace-footer) { background-color: rgba(11, 20, 33, .66); }
/* Pass-through: brightness list. Must follow Tier 1. */
:where(html.has-water) :where(body.command-deck .workspace-body) :where(.rq-layout) { background-color: transparent; }
/* Loose lines of text straight under main (hints, "On call now") get the panel's rounded edge and a little inner space. */
:where(html.has-water) :where(body.command-deck .workspace-body > main) > :where(p) { border-radius: 10px; padding-inline: .6em; }
/* Tier 2: feather, cosmetic only. */
:where(html.has-water) :where(body.command-deck .workspace-body > main) > :where(header, .page-heading, [class*="-head"]),
:where(html.has-water) :where(body.command-deck) :where(.workspace-footer, .ro-findbar, .rq-vacancies, .rq-filters) { box-shadow: 0 0 24px 14px rgba(11, 20, 33, .66); border-radius: 12px; }
/* Dark halo behind the orange focus outline so it reads over bright water. */
/* !important because ~20 later button and link rules set box-shadow; the two components with their own focus shadow keep it. */
:where(html.has-water) body.command-deck :focus-visible:not(.quick-links > a, .ro-shift-card) { box-shadow: 0 0 0 6px #0b1421 !important; }
@media (forced-colors: active) { .ambient-canvas { display: none; } }

/* The existing desktop sidebar and mobile navigation keep their positioning and visibility rules. */
body.command-deck .sidebar {
  color: var(--cd-text);
  background: linear-gradient(175deg, #111f30, #0d1725 75%);
  border-right-color: var(--cd-line);
  box-shadow: 5px 0 24px #0002;
}
body.command-deck .workspace-brand { background: transparent; border-color: transparent; box-shadow: none; }
body.command-deck .workspace-brand img { background: #fff; }
body.command-deck .workspace-brand > span,
body.command-deck .nav-section { color: var(--cd-muted); }
body.command-deck .sidebar nav a {
  color: #c5d4e3;
  background: transparent;
  border-color: transparent;
  border-left-color: transparent;
  border-radius: 10px;
  box-shadow: none;
  transform: none;
  font-size: 14px;
}
body.command-deck .sidebar nav a > .icon { color: #add7ec; background: #1e3349; box-shadow: none; }
body.command-deck .sidebar nav a:hover { color: #fff; background: #1e3349; border-color: #46647d; transform: none; }
body.command-deck .sidebar nav a[aria-current=page] {
  color: #ffd5b3;
  background: linear-gradient(110deg, #59402e, #29313b);
  border-color: #946b4a;
  border-left-color: var(--cd-orange);
  box-shadow: inset 3px 0 var(--cd-orange);
}
body.command-deck .sidebar nav a[aria-current=page] > .icon { background: #ff9b571c; color: #ffd0aa; }
body.command-deck .nav-count { color: #182839; background: #ffc080; }
body.command-deck .sidebar-bottom,
body.command-deck .sidebar-profile { border-color: var(--cd-line); }
body.command-deck :is(.care-note, .sidebar-profile) { color: var(--cd-muted); background: #15273a; border-color: var(--cd-line); box-shadow: none; }
body.command-deck .sidebar-profile strong { color: var(--cd-text); }
body.command-deck .sidebar-profile small { color: var(--cd-muted); }
body.command-deck .sidebar-profile .avatar { color: #b9f5e3; background: #23474c; border-color: #608d8d; }
body.command-deck .sign-out { color: #d0dfeb; background: #172a3e; border-color: var(--cd-line); box-shadow: none; }
body.command-deck .sign-out:hover { color: #fff; background: #253e55; }
body.command-deck .workspace-top { background: #101c2b; border-color: var(--cd-line); }
body.command-deck .workspace-top::before { height: 2px; background: linear-gradient(90deg, #ffad70, #65cabb 60%, #365c76); }
body.command-deck .breadcrumb { color: var(--cd-muted); }
body.command-deck .breadcrumb strong { color: var(--cd-text); }
body.command-deck :is(.scope-label, .internal-label, .today) { color: #c1d7e7; background: #1a2e43; border-color: var(--cd-line); }
body.command-deck .menu-toggle { color: var(--cd-text); background: transparent; border-color: transparent; box-shadow: none; }
body.command-deck .menu-toggle:hover { background: #263c52; }
body.command-deck .eyebrow { color: var(--cd-orange); }
body.command-deck :is(.page-heading .eyebrow, .section-heading .eyebrow) { color: #9fe6d5; }
body.command-deck :is(.page-heading p, .hint, .empty, .report-counter, .directory-foot) { color: var(--cd-muted); }

/* Reuse the existing tilt and manual-spin wrappers around a static SVG sculpture. */
body.command-deck.workspace .welcome-banner {
  min-height: 330px;
  background: var(--cd-surface, radial-gradient(ellipse at 84% 45%, #376c6155, transparent 55%), linear-gradient(120deg, #20344a, #122133 76%));
  border: 1px solid #49677e;
  border-radius: 18px;
  box-shadow: 0 15px 34px #0003, inset 0 1px #c5e2f018;
}
body.command-deck .welcome-banner::before { background: radial-gradient(ellipse at 78% 5%, #8ddbc514, transparent 64%); }
body.command-deck.workspace .welcome-banner > div:first-child { max-width: 56%; }
body.command-deck.workspace .welcome-banner h2 { color: #f2f6fb; font-size: clamp(31px, 3.05vw, 44px); line-height: 1.14; font-weight: 650; }
body.command-deck.workspace .welcome-banner p { color: #c7d8e5; font-size: 15px; }
body.command-deck.workspace .welcome-banner .eyebrow { color: #ffc18e; }
body.command-deck.workspace .welcome-banner .button { color: #172839; background: var(--cd-orange); border-color: #ffc493; box-shadow: 0 3px 0 #835331; font-size: 14px; }
body.command-deck.workspace .welcome-banner .button:hover { background: #ffba85; }
body.command-deck.workspace .welcome-banner .banner-caption { color: #b3cedb; }
body.command-deck.workspace .welcome-banner .moments-art { width: 48%; height: 100%; max-width: 540px; right: 12px; bottom: 0; opacity: 1; }
body.command-deck.workspace .welcome-banner .moments-art .moments-core {
  width: 100%; height: 100%; position: relative; display: block;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  animation: none; transform: none;
}
body.command-deck .command-deck-sculpture { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 15px 15px #0004); }
body.command-deck .moments-core,
body.command-deck .moment-dot { animation: none; }
body.command-deck .moment-dot { opacity: .32; }
body.command-deck .moment-dot.c { background: radial-gradient(circle at 28% 22%, #e7f9ff, #7bc8e1 40%, #285a79 85%); }
body.command-deck .moments-spin { color: #d5e8f2; background: #173349dd; border-color: #6b91a8; box-shadow: none; font-size: 13px; }
body.command-deck .moments-spin:hover { color: #fff; background: #274b61; transform: none; }
body.command-deck .motion-control { color: #c7dfeb; background: #1a3347; border-color: #48677e; box-shadow: none; }
body.command-deck .motion-control:hover { background: #2c4b61; }
body.command-deck .quick-links > a {
  color: var(--cd-text);
  background: linear-gradient(145deg, #243c55, #16283c 82%);
  border-color: #496a85;
  border-top-color: #81c5df;
  box-shadow: 0 5px 0 #08131f, 0 6px 0 #36516b, inset 0 1px #e1f0fa15;
}
body.command-deck .quick-links > a:nth-child(2) { border-top-color: #74d8bd; }
body.command-deck .quick-links > a:nth-child(3) { border-top-color: #ffb675; }
body.command-deck .quick-links > a:nth-child(4) { border-top-color: #a9cce4; }
body.command-deck .quick-links > a:hover,
body.command-deck .quick-links > a:focus-visible { border-color: #97c8df; box-shadow: 0 6px 0 #0b1828, 0 16px 26px -12px #0008; }
body.command-deck .quick-links strong { color: var(--cd-text); font-size: 15px; }
body.command-deck .quick-links small { color: #c1d2e2; font-size: 14px; }
body.command-deck .quick-links > a > .icon { color: #b5d8eb; }
body.command-deck .quick-icon { color: #a1e9db; background: #1b4b4b; border: 1px solid #598e8d; }
body.command-deck .quick-icon.amber { color: #ffd1a7; background: #4f3c2b; border-color: #a27951; }
body.command-deck .quick-icon.blue { color: #b0e2fa; background: #224766; border-color: #658eae; }

/* Shared work surfaces; no display, overflow, permissions or embedded-document changes. */
body.command-deck :is(.card, .scroll, .directory, .member, .organise, .empty, .notes li, .department-empty,
  .report-toolbar, .management-stats > div, .access-fields > fieldset, .upload-option, .sample-file,
  .proposal-principles > div, .participant-actions details, .participant-assignment-list, .team-profile-preview,
  .ask-starters, .ask-request, .ask-stats > div, .memory-source, .memory-analysis-filters, .memory-metric,
  .memory-state-section, .memory-analysis-scroll, .dash-panel, .dash-metric, .dash-issue,
  .celebrate-card, .celebrate-aside, .award-round, .nominate-box, .celebrate-empty,
  .festive-suggestion-box, .suggestion-inbox, .notice-submissions, .notice-review, .notice-upload,
  .upload-folder-tree, .subfolder-access details, .audit-detail-content) {
  color: var(--body-text);
  background: var(--cd-surface, var(--cd-panel));
  border-color: var(--cd-line);
  box-shadow: inset 0 1px #bed8eb09;
}
body.command-deck :is(.member-text h4, .member strong, .person-create summary strong, .ask-request-question,
  .memory-id, .flip-number, .dash-metric strong, .dash-metric span, .profile-preview-copy h4) { color: var(--cd-text); }
body.command-deck :is(.member .role, .profile-preview-copy .role, .expand-label, .file-open-link, .account-apps summary,
  .permission-summary summary, .audit-detail summary, .subfolder-access summary) { color: #9ce9d9; }
/* The selected role on User access gets a dark tile; print keeps the light tile from workspace.css. */
@media screen {
  body.command-deck .role-options .check:has(input:checked) { color: var(--cd-text); background: var(--accent-soft); border-color: var(--cd-teal); }
}
body.command-deck :is(.member p, .profile-preview-copy p, .team-profile-preview, .directory-foot, .member-count,
  .ask-card-heading p, .ask-input-help, .ask-send-row p, .ask-prompt span, .ask-process span, .ask-request-meta,
  .ask-request-id, .ask-starters p, .ask-stats span, .step-status,
  .sample-file small, .dashboard p, .dash-metric small, .dash-bar, .dash-section-head label,
  .celebrate-aside p, .celebrate-aside li, .notice-submissions p, .notice-review p, .notice-upload p,
  .notice-compose-intro, .upload-folder-tree p, .subfolder-access > p, .review-facts dt, .review-stats span,
  .review-summary dt, .review-legend) { color: var(--cd-muted); }
body.command-deck .ask-toolbar [role=status],
body.command-deck #dash-notices small { color: var(--cd-muted); }
body.command-deck .member-count { background: #213b52; }
body.command-deck .member:hover { border-color: #77b4c4; }
body.command-deck :is(.profile-preview-copy, .profile-preview-portrait .no-photo) { color: var(--cd-text); background: #183247; }
body.command-deck .team-group h3 { color: #d8e8f3; border-color: var(--cd-line); }
body.command-deck .notes li.resolved { border-left-color: #76d7a3; }
body.command-deck :is(.notes li.feedback, .notes li.change) { border-left-color: var(--cd-orange); }
body.command-deck .department-links a { color: #bfdfed; background: #1c344b; border-color: #45657f; }
body.command-deck .department-links a:hover { background: #2a4b62; }

/* Inputs and buttons retain their native controls and existing sizes. */
body.command-deck :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]), select, textarea) {
  color: var(--cd-text); background-color: #101e2e; border-color: var(--cd-field-line, #58758e);
}
body.command-deck :is(input, textarea)::placeholder { color: #a9bfd2; opacity: 1; }
body.command-deck :is(input[type=checkbox], input[type=radio], input[type=range]) { accent-color: #73ddc5; }
body.command-deck input[type=file]::file-selector-button { color: #dfedf5; background: #26445d; border: 1px solid #66869d; border-radius: 7px; }
body.command-deck :is(.search-field, .browser-search) { color: var(--cd-sky); background: #13273b; border-color: var(--cd-search-line, #526f88); }
body.command-deck :is(.search-field input, .browser-search input) { background: transparent; }
body.command-deck :is(button, .button) { color: #162638; background-color: var(--cd-orange); border-color: #ffbd8a; box-shadow: none; }
body.command-deck :is(button, .button):hover { color: #102238; background-color: #ffb982; box-shadow: none; }
body.command-deck :is(button.secondary, .button.secondary, .page-jumps a, .memory-status-seg button,
  .publish-steps button, .ask-prompt, .library-folder-access, .library-actions .button.small,
  .library-drag, .flip-toggle, .item-actions > summary) { color: #cbe2f0; background: #213b53; border-color: #55778f; box-shadow: none; }
body.command-deck :is(button.secondary, .button.secondary, .page-jumps a, .ask-prompt, .library-folder-access,
  .library-actions .button.small, .library-drag, .flip-toggle, .item-actions > summary):hover { color: #fff; background: #2c4c66; }
body.command-deck :is(button.danger, .library-delete button.danger, .delete-confirm button.danger) { color: #fff0ed; background: #8c3d36; border-color: #c27369; }
body.command-deck :is(button.danger, .library-delete button.danger, .delete-confirm button.danger):hover { color: #fff; background: #a34c43; }
body.command-deck :is(.password-toggle, .menu-toggle, .sign-out, .motion-control, .moments-spin) { color: #d3e4f0; background-color: #1c3349; border-color: #54728a; }
body.command-deck :is(.password-toggle, .menu-toggle, .sign-out, .motion-control, .moments-spin):hover { color: #fff; background-color: #2b4a63; }
body.command-deck :is(button.tile, button.expand, .reviews-table th button.sort, .column-sort, .folder-toggle,
  .folder-open, .flip-link, [data-browser-path] button) { color: var(--cd-text); background: transparent; box-shadow: none; }
body.command-deck :is(button.tile, button.expand, .column-sort, .folder-toggle, .folder-open, .flip-link, [data-browser-path] button):hover { color: var(--cd-sky); background-color: #203b51; }
body.command-deck :is(button.tile.review-flag, .delete-confirm, .library-delete p, .ask-reject summary) { color: #ffb8aa; }
body.command-deck :is(.tabs, .memory-status-seg) { color: var(--cd-text); background: #102133; border-color: var(--cd-line); }
body.command-deck :is(.tabs a, .comm-tabs a, .celebrate-tabs a, .publishing-tabs a) { color: #c4dbeb; background: #1b3046; border-color: #46647d; box-shadow: none; }
body.command-deck :is(.tabs a.on, .tabs a.active, .tabs a[aria-current], .tabs a[aria-selected=true],
  .comm-tabs a[aria-current], .celebrate-tabs a[aria-current], .publishing-tabs a[aria-current],
  .publish-steps button[aria-current=step], .memory-status-seg button[aria-pressed=true], .page-jumps a:first-child) {
  color: #e1fff4; background: #245e5b; border-color: #78c5b8; box-shadow: none;
}
body.command-deck :is(.memory-metric[aria-pressed=true], .memory-state-bar[aria-pressed=true]) { color: #e4fff5; background: #204c4d; border-color: #9ce8d3; }
body.command-deck :is(.library-delete form, .library-delete > summary, .ask-reject form) { color: #ffd1c5; background: #3a2933; border-color: #986b73; }

/* Tables, selection and disclosure menus stay readable without changing scrolling or hiding rows. */
body.command-deck :is(.reviews-table, .report-browser, .browser-table, .memory-analysis-scroll) { color: var(--body-text); background: var(--cd-surface, var(--cd-panel)); border-color: var(--cd-line); }
body.command-deck :is(th, .browser-table th, .reviews-table thead th, table.sheet tr:first-child td) { color: #c1d9e9; background: #1c344b; border-color: var(--cd-line); }
body.command-deck :is(td, .browser-table td, .reviews-table td) { color: var(--body-text); border-color: #31495e; font-size: 14px; }
body.command-deck :is(.reports tr.folder-head td, .browser-table .folder-head td, tbody.folder-group .folder-header td) { color: var(--cd-text); background: #172e43; border-color: var(--cd-line); }
body.command-deck :is(.reports tbody tr[data-report]:hover, .browser-table tr[data-file-row]:hover > td, .permission-table tbody tr:hover) { background: #20394e; }
body.command-deck :is(.review-detail td, .review-stats div, .review-live, .audit-detail-content) { color: var(--cd-text); background: var(--cd-surface, #192e43); border-color: var(--cd-line); }
body.command-deck .review-due > tr:first-child td,
body.command-deck .oncall-current td { color: #ffe0b9; background: #3b3228; }
body.command-deck .review-chart { background: #f5f9fc; border-radius: 8px; }
body.command-deck .review-score.good { color: #e9fff1; background: #286d4f; }
body.command-deck .review-score.mid { color: #fff5d9; background: #805d21; }
body.command-deck .review-score.low { color: #fff0eb; background: #99443c; }
body.command-deck .review-new { color: #e6fff5; background: #23666b; }
body.command-deck .library-drop-active,
body.command-deck .library-drop-active > tr > td { color: #e0fff2; background: #214f4d !important; box-shadow: inset 0 0 0 2px #8dd8c4; }
body.command-deck :is(.library-drop-root, .selection-summary) { color: #c1f2e5; background: #173d3b; border-color: #598d85; }
body.command-deck .report-workspace { --ink: var(--cd-text); --muted: var(--cd-muted); --line: var(--cd-line); --blue: var(--cd-sky); --teal: var(--cd-teal); }
body.command-deck .report-workspace .browser-toolbar > .browser-search { color: var(--cd-sky); background: #13273b; border-color: var(--cd-search-line, #526f88); }
body.command-deck .report-workspace .browser-table .report-name > a { color: #dfedf7; }
body.command-deck :is(.browser-toolbar, .organise-panel, .publish-card fieldset, .publish-final, .reading-help p) { color: var(--body-text); background: var(--cd-surface, #182e43); border-color: var(--cd-line); }
body.command-deck :is(.report-name > a, .report-name > strong, .folder-open strong) { color: #dfedf7; }
body.command-deck :is(.browser-toolbar > label, .file-meta a, .permission-summary, .organise-panel > summary,
  .file-permission, .file-meta, .filename, .report-date, [data-browser-count], [data-selected-count],
  [data-browser-path] > span, .folder-open small, .flip-face p, .flip-empty, .flip-list li > span:last-child) { color: var(--cd-muted); }
body.command-deck :is(.file-type, .state-tag) { color: #b8e2fb; background: #213f5c; border-color: #4c718d; }
body.command-deck .file-type[data-ext=pdf] { color: #c9e6ff; background: #2b3d59; border-color: #5e7699; }
body.command-deck :is(.file-type[data-ext=xlsx], .file-type[data-ext=csv]) { color: #a9ebce; background: #1e453c; border-color: #578b76; }
body.command-deck .folder-open > .icon { color: #a4e8d9; background: #224846; }
body.command-deck .report-workspace tbody:nth-of-type(3n+2) .folder-open > .icon,
body.command-deck .report-workspace tbody:nth-of-type(3n) .folder-open > .icon { color: #b1ddf4; background: #26455f; }
body.command-deck :is(.action-content a, .file-open-link, .flip-link) { color: var(--cd-sky); }
body.command-deck .item-actions[open] > summary,
body.command-deck [data-browser-path] [aria-current] { color: #d8f4ff; background: #294960; }
body.command-deck :is(.flip-face, .state-map) { color: var(--cd-text); background: linear-gradient(150deg, #213950, #13283b); border-color: #4e728c; box-shadow: 0 4px 0 #091722; }
body.command-deck .flip-back { background: linear-gradient(150deg, #214747, #142b39); }
body.command-deck .state[aria-pressed=true] .state-top path,
body.command-deck .state:focus-visible .state-top path { stroke: #e7fff4; }

/* Badge defaults come first; compound state selectors stay separate to preserve their meaning. */
body.command-deck .ask-status { color: #d0dfeb; background: #2b3e53; }
body.command-deck :is(.dash-state, .dash-badge) { color: #b9f2d3; background: #1e4437; }
body.command-deck :is(.error, .vis-unpublished, .ask-status-failed, .ask-status-rejected),
body.command-deck p.error { color: #ffc6b9; background: #452a30; border-color: #9d6c70; }
body.command-deck :is(.ok, .vis-live, .comm-confirmed, .comm-ack-label, .memory-review-ok, .celebrate-voted) { color: #aaf0ca; }
body.command-deck :is(.ok, .vis-live, .ask-status-approved, .celebrate-notice),
body.command-deck p.ok,
body.command-deck .award-steps li.complete { color: #b9f2d3; background: #1e4437; }
body.command-deck :is(.vis-scheduled, .request-flag, .proposal-note),
body.command-deck :is(.dash-state[data-state=attention], .dash-badge[data-state=attention]) { color: #ffdfab; background: #493b27; border-color: #9d8156; }
body.command-deck :is(.dash-state[data-state=unknown], .dash-badge[data-state=unknown]) { color: #d0dfeb; background: #2b3e53; }
body.command-deck :is(.ask-status-working, .ask-status-ready, .notice-status, .celebrate-preview),
body.command-deck :is(.dash-state[data-state=pending], .dash-badge[data-state=pending]) { color: #c5e8ff; background: #24445f; }
body.command-deck :is(.comm-tags span, .comm-members, .celebrate-avatar, .celebrate-badge, .celebrate-badge.plum, .ask-step, .ask-spark),
body.command-deck .ask-process li::before { color: #bceee2; background: #244b4c; border-color: #557d82; }
body.command-deck :is(.ask-request-note, .audit-detail summary, .notice-board-page .comm-card[data-pinned="1"]) { color: var(--body-text); background: #1a3547; border-color: #52758c; }
body.command-deck .memory-state-bar { color: var(--cd-text); background: #1b3044; }
body.command-deck .memory-state-bar::before { background: #335b6b; }
body.command-deck .memory-state-bar:hover,
body.command-deck .memory-metric:hover { color: #fff; background: #294a5d; }
body.command-deck .dashboard { --dash-teal: #8ce2d1; --dash-navy: #152f45; }
body.command-deck :is(.dash-summary, .comm-guide, .notice-board-page .comm-guide) { color: #d2e7ef; background: var(--cd-surface, linear-gradient(125deg, #1d344e, #1c454b)); border-color: #46677b; }
body.command-deck :is(.dash-links a, .notice-board-page .comm-guide h2, .notice-board-page .comm-guide h3, .notice-board-page .comm-stat strong),
body.command-deck #dash-notices .dash-issue span strong { color: #d4eff7; border-color: var(--cd-line); }
body.command-deck .dash-issue strong { color: #ffe0a9; background: #4c3c24; }
body.command-deck .dash-eyebrow { color: #9ee7d8 !important; }
body.command-deck .dash-bar i { background: #72cabb; }
body.command-deck .comm-guide .comm-small,
body.command-deck.notice-board-page .comm-guide .comm-small,
body.command-deck.notice-board-page .comm-unread-count { color: #c0d9e1; }
body.command-deck :is(.notice-hero, .celebrate-hero, .celebrate-hero.birthdays, .celebrate-hero.events) { background: var(--cd-surface, radial-gradient(ellipse at 95% 5%, #4c93834d, transparent 60%), linear-gradient(120deg, #213c55, #15313e)); border: 1px solid #476b7e; }
body.command-deck .celebrate-card:nth-child(n) { background: var(--cd-surface, linear-gradient(145deg, #1e3549, #132437)); border-color: var(--cd-line); border-top-color: #75c6b9; }
body.command-deck :is(.celebrate-card:nth-child(n) .celebrate-avatar, .celebrate-card:nth-child(n) .celebrate-badge) { color: #bdeedb; background: #254c4d; }
body.command-deck :is(.celebrate-aside h2, .celebrate-aside .celebrate-details summary, .event-date, .award-result strong) { color: #a7e8dc !important; }
body.command-deck .birthday-date,
body.command-deck .birthday-card:nth-child(n) .birthday-date { color: #ffe1bc; background: linear-gradient(140deg, #68523a, #3d3c36); }
body.command-deck .birthday-today { background: #243d48; border-color: #d5ad76; }
body.command-deck .award-steps li { color: #ccdeeb; background: #223a51; }
body.command-deck .award-steps li.complete:nth-child(2) { color: #c0f3dc; background: #244e44; }
body.command-deck :is(.festive-banner, .festive-banner-content, .festive-banner .festive-banner-content, .festive-banner-footer, .festive-banner .festive-banner-footer) { color: var(--cd-text); background: #172c3d; border-color: var(--cd-line); }
body.command-deck :is(.festive-banner h2, .festive-banner .festive-party, .festive-banner .festive-party em, .festive-banner .festive-host, .festive-brand > span, .festive-people dd, .festive-facts dd) { color: #e2f1ec; }
body.command-deck :is(.festive-banner-content > p, .festive-eyebrow, .festive-people dt, .festive-banner .festive-people dt, .festive-banner-footer span, .festive-facts dt, .festive-banner .festive-facts > div:nth-child(n) dt) { color: #bcd4d9; }
body.command-deck .festive-banner .festive-people > div:nth-child(n) { background: #213c49; border-color: #587d84; border-left-color: #d9ae77; }
body.command-deck :is(.festive-facts, .festive-facts > div, .festive-banner .festive-facts > div:nth-child(n)) { border-color: #4b6876; }
body.command-deck :is(.festive-suggest-link, .festive-banner .festive-suggest-link) { color: #142839; background: #a9e3d2; border-color: #c4f2df; }
body.command-deck :is(.festive-suggestion-box h2, .festive-suggestion-box .eyebrow) { color: #d6eee9; }
body.command-deck .festive-suggestion-box p { color: var(--cd-muted); }
body.command-deck .festive-suggestion-box > .celebrate-form label { color: var(--cd-text); font-size: 14px; }
body.command-deck .festive-suggestion-box button { color: #192838; background: var(--cd-orange); }

/* Weather, native dialogs, sign-in and footer use the same palette. */
body.command-deck :is(dialog, .comm-compose, .weather-panel) { color: var(--cd-text); background: #162b3e; border-color: #66849a; box-shadow: 0 22px 64px #0007; }
body.command-deck dialog::backdrop { background: #04101dcc; }
body.command-deck .local-weather summary { color: #dbf1ed; background: #203d4a; border-color: #618890; }
body.command-deck :is(.weather-panel h2, .weather-panel label, .weather-status) { color: #dbedf6; }
body.command-deck :is(.weather-eyebrow, .weather-privacy, .weather-panel small, .weather-chevron) { color: var(--cd-muted); }
body.command-deck .weather-panel > button { color: #162638; background: var(--cd-orange); }
body.command-deck.auth-page .workspace-top { background: #102033; }
body.command-deck .auth-brand img { background: #fff; padding: 5px; border-radius: 8px; height: 57px; }
body.command-deck .auth-brand span { color: #c0d4e2; border-color: #557187; }
body.command-deck :is(.signin-layout, .signin-form) { color: var(--body-text); background: var(--cd-surface, #15283b); border-color: #4b6b84; }
body.command-deck .signin-layout { box-shadow: 0 24px 60px #0004; }
body.command-deck .signin-story { background: radial-gradient(ellipse at 100% 20%, #5ba89438, transparent 60%), linear-gradient(145deg, #203b54, #14313e); }
body.command-deck .signin-story::before { background: radial-gradient(ellipse at 90% 10%, #ffc1811c, transparent 62%); }
body.command-deck .signin-story h1 { color: #f1f7fc; }
body.command-deck .signin-story h1 em { color: #ffc38f; }
body.command-deck :is(.signin-form h2, .signin-form label) { color: var(--cd-text); }
body.command-deck :is(.signin-intro, .signin-help, .auth-assurance) { color: var(--cd-muted); border-color: var(--cd-line); }
body.command-deck .signin-trust { margin-top: 14px; font-size: 12px; line-height: 1.7; color: var(--cd-muted); }
body.command-deck .signin-trust p { margin: 0 0 4px; }
body.command-deck .signin-trust a { color: var(--cd-text); }
body.command-deck .signin-submit { color: #162638; background: var(--cd-orange); }
body.command-deck .signin-submit:hover { background: #ffb982; }
body.command-deck .workspace-footer .clock { color: #c5d9e7; background: #15293d; border-color: #3f607a; }
body.command-deck .workspace-footer .clock b { color: #b5cfe0; }
body.command-deck .workspace-footer .clock time { color: #eef6fc; }
body.command-deck .workspace-footer .clock.home { background: #1b3c3e; border-color: #598d85; }
body.command-deck .workspace-footer .clock.home b,
body.command-deck .workspace-footer .clock.home time { color: #b7efda; }
body.command-deck :is(.workspace-footer .clocks, .country-acknowledgement) { border-color: var(--cd-line); }
body.command-deck .country-acknowledgement { color: #c0d4e2; background: var(--cd-surface, #112335); }
body.command-deck .country-acknowledgement h2 { color: #aedfd9; }
body.command-deck .country-acknowledgement p { color: #c0d4e2; }
body.command-deck .workspace-footer .legal { color: #b3c9d9; }
body.command-deck .workspace-footer .legal strong { color: #e1edf6; }
body.command-deck .admin-copy-status:not(:empty) { color: #c7f5e2; background: #20463f; border-color: #7ab5a6; }

/* Functional copy stays legible; compact secondary labels retain their existing layout. */
body.command-deck :is(.quiet-link, .member .role, .member p, .signin-intro, .signin-help, .signin-form label,
  .browser-toolbar > label, .action-content p, .action-content li, .ask-compose label, .ask-prompt strong,
  .ask-prompt span, .ask-process strong, .ask-process span, .comm-card-bottom, .comm-reply-form span,
  .notice-compose-intro, .review-facts dt, .celebrate-aside p, .celebrate-aside li) { font-size: 14px; }
body.command-deck :is(.report-workspace .browser-toolbar select, .report-workspace .browser-search input,
  .report-workspace .folder-open, .report-workspace .item-actions > summary, .report-workspace .action-content .small,
  .report-workspace .publish-steps button, .ask-compose select, .ask-filter-label select) { font-size: 14px; }

@media (max-width: 650px) {
  body.command-deck.workspace .welcome-banner { flex-direction: column; align-items: flex-start; padding: 28px 26px 62px; min-height: 0; }
  body.command-deck.workspace .welcome-banner > div:first-child { max-width: 100%; }
  body.command-deck.workspace .welcome-banner h2 { font-size: 34px; }
  body.command-deck.workspace .welcome-banner .moments-art { position: relative; align-self: center; right: auto; bottom: auto; width: 100%; max-width: 430px; height: 235px; margin-top: 10px; }
  body.command-deck .quick-links > a { padding: 19px 17px; }
}

html[data-motion=paused] body.command-deck .command-deck-sculpture { transform: none; }
@media (prefers-reduced-motion: reduce) {
  body.command-deck .command-deck-sculpture,
  body.command-deck .quick-links > a { transition: none; }
}

/* Keep the existing print permissions and hidden-row rules; only reset this theme's ink and surfaces. */
@media print {
  body.command-deck {
    --cd-text: #172b3f; --cd-muted: #40596c; --body-text: #24394a;
    --cd-panel: #fff; --cd-line: #bac6cf; --surface: #fff; --solid: #fff;
    --navy: #172b3f; --ink: #172b3f; --muted: #40596c; --mid-gray: #40596c;
    --ok: #175936; --ok-bg: #edf6f0; --bad: #8a3026; --bad-bg: #fff0ed;
    color-scheme: light; background: #fff !important; color: #172b3f;
  }
  body.command-deck :is(.card, .scroll, .directory, .member, .organise, .report-browser, .browser-toolbar,
    .browser-table, .reviews-table, .review-detail td, .review-stats div, .review-live, .publish-card fieldset,
    .memory-source, .memory-metric, .memory-state-section, .memory-analysis-scroll, .dash-panel, .dash-metric,
    .dash-summary, .comm-card, .comm-thread, .comm-reply, .ask-request, .celebrate-card, .celebrate-aside,
    .award-round, .festive-banner, .festive-banner-content, .festive-banner .festive-banner-content,
    .festive-banner-footer, .festive-banner .festive-banner-footer, .notice-submissions, .notice-review,
    .country-acknowledgement, .audit-detail-content, th, td) { background: #fff !important; color: #172b3f !important; border-color: #bac6cf; box-shadow: none; }
  body.command-deck :is(h1, h2, h3, h4, p, label, legend, strong, small, summary, dt, dd, a, .hint,
    .festive-party, .festive-party em, .file-meta, .filename, .report-date, .memory-id, .comm-tags span,
    .vis, .ask-status, .dash-state, .dash-badge, .celebrate-badge, .review-score) { color: #172b3f !important; }
  body.command-deck :is(.vis, .ask-status, .dash-state, .dash-badge, .celebrate-badge, .review-score,
    .comm-tags span, .file-type, .state-tag, .selection-summary, .request-flag, .review-due > tr:first-child td,
    .oncall-current td, .error, .ok) { background: #f1f4f6 !important; color: #172b3f !important; }
  body.command-deck :is(input:not([type=hidden]), select, textarea, .search-field, .browser-search) { background: #fff !important; color: #172b3f !important; border-color: #bac6cf; }
  body.command-deck .command-deck-sculpture { display: none !important; }
  .ambient-canvas { display: none !important; }
  /* The water scrim is screen-only; same zero-specificity selectors, later in source order. */
  :where(html.has-water) :where(body.command-deck .workspace-body > main) > :where(*),
  :where(html.has-water) :where(body.command-deck .workspace-body) :where(.rq-layout) > :where(*),
  :where(html.has-water) :where(body.command-deck .workspace-footer) { background-color: transparent; }
  :where(html.has-water) :where(body.command-deck .workspace-body > main) > :where(header, .page-heading, [class*="-head"]),
  :where(html.has-water) :where(body.command-deck) :where(.workspace-footer, .ro-findbar, .rq-vacancies, .rq-filters) { box-shadow: none; }
}

/* Glass panels over the water (owner, 28/11/2026). Screen only, never under forced colours or in print.
   Each converted surface reads var(--cd-surface, <its own value>), so without the water the fallback is exactly
   today's value. Zero specificity: nothing here outranks an existing rule. Text contrast is checked against the
   brightest water through one .66 layer (worst pair: 11px #ff9b57, about 5.3:1). */
@media screen and (forced-colors: none) {
  :where(html.has-water) {
    --cd-surface: rgba(11, 20, 33, .66);
    --cd-surface-inset: rgba(11, 20, 33, .30);
    --cd-surface-strong: rgba(11, 20, 33, .80);
    --cd-field-line: #728ea7;
    --cd-search-line: #6f8ea8;
  }
  /* A surface inside another glass surface takes the inset layer (effective alpha about .76). */
  :where(html.has-water) :where(.card, .scroll, .directory, .member, .organise, .empty, .notes li, .department-empty,
    .report-toolbar, .management-stats > div, .access-fields > fieldset, .upload-option, .sample-file,
    .proposal-principles > div, .participant-actions details, .participant-assignment-list, .ask-starters, .ask-request,
    .ask-stats > div, .memory-source, .memory-analysis-filters, .memory-metric, .memory-state-section,
    .memory-analysis-scroll, .dash-panel, .dash-metric, .dash-issue, .celebrate-card, .celebrate-aside, .award-round,
    .nominate-box, .celebrate-empty, .festive-suggestion-box, .suggestion-inbox, .notice-submissions, .notice-review,
    .notice-upload, .upload-folder-tree, .subfolder-access details, .audit-detail-content, .welcome-banner,
    .reviews-table, .report-browser, .browser-table, .review-detail td, .review-stats div, .review-live, .browser-toolbar,
    .organise-panel, .publish-card fieldset, .publish-final, .reading-help p, .dash-summary, .comm-guide, .notice-hero,
    .celebrate-hero, .signin-layout, .signin-form, .country-acknowledgement, .brainstorm-hero, .brainstorm-prompts > div,
    .brainstorm-compose, .brainstorm-idea, .brainstorm-empty, .brainstorm-game, .comm-card, .comm-thread, .comm-empty,
    .comm-reply, .comm-reply-form, .hs-panel, .hs-status, .hs-upload, .hs-section-nav, .hs-kpi, .hs-web-kpis article,
    .hs-catalog-item, .hs-thread, .hs-coverage, .rq-card)
    :where(.card, .scroll, .directory, .member, .organise, .empty, .notes li, .department-empty,
    .report-toolbar, .management-stats > div, .access-fields > fieldset, .upload-option, .sample-file,
    .proposal-principles > div, .participant-actions details, .participant-assignment-list, .ask-starters, .ask-request,
    .ask-stats > div, .memory-source, .memory-analysis-filters, .memory-metric, .memory-state-section,
    .memory-analysis-scroll, .dash-panel, .dash-metric, .dash-issue, .celebrate-card, .celebrate-aside, .award-round,
    .nominate-box, .celebrate-empty, .festive-suggestion-box, .suggestion-inbox, .notice-submissions, .notice-review,
    .notice-upload, .upload-folder-tree, .subfolder-access details, .audit-detail-content, .welcome-banner,
    .reviews-table, .report-browser, .browser-table, .review-detail td, .review-stats div, .review-live, .browser-toolbar,
    .organise-panel, .publish-card fieldset, .publish-final, .reading-help p, .dash-summary, .comm-guide, .notice-hero,
    .celebrate-hero, .signin-layout, .signin-form, .country-acknowledgement, .brainstorm-hero, .brainstorm-prompts > div,
    .brainstorm-compose, .brainstorm-idea, .brainstorm-empty, .brainstorm-game, .comm-card, .comm-thread, .comm-empty,
    .comm-reply, .comm-reply-form, .hs-panel, .hs-status, .hs-upload, .hs-section-nav, .hs-kpi, .hs-web-kpis article,
    .hs-catalog-item, .hs-thread, .hs-coverage, .rq-card) { --cd-surface: var(--cd-surface-inset); }
  /* Bars, overlays, sticky parts and photo banners stay opaque, and so does every surface inside them. Must follow the inset rule. */
  :where(html.has-water) :where(.sidebar, .workspace-top, dialog, [role=dialog], [role=menu], [role=listbox], [role=tooltip],
    [popover], .comm-compose, .weather-panel, .local-weather, .team-profile-preview, .invite-dialog, .hs-dialog,
    .review-save-bar, .rq-pop, .admin-copy-status, .theme-preview-bar, .theme-preview-notice, .festive-banner,
    #ezdash-root, thead, th),
  :where(html.has-water) :where(.sidebar, .workspace-top, dialog, [role=dialog], [role=menu], [role=listbox], [role=tooltip],
    [popover], .comm-compose, .weather-panel, .local-weather, .team-profile-preview, .invite-dialog, .hs-dialog,
    .review-save-bar, .rq-pop, .admin-copy-status, .theme-preview-bar, .theme-preview-notice, .festive-banner,
    #ezdash-root, thead, th) :where(*) { --cd-surface: initial; --cd-field-line: initial; --cd-search-line: initial; }
}
