/* Secondary workspaces for the 2026-10-07 CRATA redesign.
   Loaded after legacy module styles; all selectors stay inside real module roots. */

body[class] :is(.library-page, .project-workspace, .staff-page, .comms-page, .finance-page, .recordings-page),
body[class] #main:has(.knowledge-layout),
body[class] #main:has(.learning-summary),
body[class] #main:has(.connection-list) {
  --nm-navy: #0c1420;
  --nm-panel: #172334;
  --nm-lime: #d8f36a;
  --nm-lime-soft: #eff8ce;
  --nm-canvas: #f4f6f3;
  --nm-card: #fff;
  --nm-ink: #172126;
  --nm-muted: #637174;
  --nm-line: #dce4df;
  --nm-shadow: 0 18px 42px rgba(12, 20, 32, .06);
  color: var(--nm-ink);
}

body[class] :is(.library-page, .project-workspace, .staff-page, .comms-page, .finance-page, .recordings-page) :is(button, a, summary, input, select, textarea):focus-visible,
body[class] #main:has(.knowledge-layout) :is(button, a, summary, input, textarea):focus-visible,
body[class] #main:has(.learning-summary) :is(button, a):focus-visible,
body[class] #main:has(.connection-list) :is(button, a):focus-visible {
  outline: 3px solid #9dbd36;
  outline-offset: 3px;
}

/* Each module opens with one dark stage. The lime rule is the common signature. */
body[class] .library-page .library-heading,
body[class] .project-workspace .project-heading,
body[class] .staff-page .staff-heading,
body[class] .comms-page .comms-heading,
body[class] .finance-page .finance-heading,
body[class] .recordings-page .rec-page-heading,
body[class] .recordings-page .rec-detail-heading,
body[class] #main:has(.knowledge-layout) > .page-heading,
body[class] #main:has(.learning-summary) > .page-heading,
body[class] #main:has(.connection-list) > .page-heading {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 128px;
  padding: 26px clamp(22px, 2.4vw, 36px);
  margin: 0 0 22px;
  border: 1px solid #243347;
  border-radius: 22px;
  background: radial-gradient(circle at 85% -90%, rgba(216, 243, 106, .18), transparent 43%), var(--nm-navy);
  box-shadow: 0 20px 42px rgba(12, 20, 32, .14);
  color: #f5f8f2;
}

body[class] .library-page .library-heading::before,
body[class] .project-workspace .project-heading::before,
body[class] .staff-page .staff-heading::before,
body[class] .comms-page .comms-heading::before,
body[class] .finance-page .finance-heading::before,
body[class] .recordings-page .rec-page-heading::before,
body[class] .recordings-page .rec-detail-heading::before,
body[class] #main:has(.knowledge-layout) > .page-heading::before,
body[class] #main:has(.learning-summary) > .page-heading::before,
body[class] #main:has(.connection-list) > .page-heading::before {
  content: '';
  position: absolute;
  z-index: -1;
  right: -10px;
  top: -88px;
  width: 285px;
  height: 285px;
  border: 1px solid rgba(216, 243, 106, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 58px rgba(216, 243, 106, .035), 0 0 0 116px rgba(216, 243, 106, .018);
  pointer-events: none;
}

body[class] :is(.library-heading, .project-heading, .staff-heading, .comms-heading, .finance-heading, .rec-page-heading, .rec-detail-heading) h1,
body[class] #main:has(.knowledge-layout) > .page-heading h1,
body[class] #main:has(.learning-summary) > .page-heading h1,
body[class] #main:has(.connection-list) > .page-heading h1 {
  color: #f6f9f2;
  font-size: clamp(25px, 2.2vw, 34px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -.055em;
}

body[class] :is(.library-heading, .project-heading, .staff-heading, .comms-heading, .finance-heading, .rec-page-heading, .rec-detail-heading) p,
body[class] #main:has(.knowledge-layout) > .page-heading p:not(.eyebrow),
body[class] #main:has(.learning-summary) > .page-heading p:not(.eyebrow),
body[class] #main:has(.connection-list) > .page-heading p:not(.eyebrow) {
  color: #aebdc2;
  font-size: 14px;
  line-height: 1.65;
}

body[class] #main:has(.knowledge-layout) > .page-heading .eyebrow,
body[class] #main:has(.learning-summary) > .page-heading .eyebrow,
body[class] #main:has(.connection-list) > .page-heading .eyebrow,
body[class] .project-workspace .project-breadcrumb {
  color: var(--nm-lime);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .17em;
  text-transform: uppercase;
}

body[class] :is(.library-page, .project-workspace, .staff-page, .comms-page, .finance-page, .recordings-page) :is(.primary, .staff-primary, .finance-primary, .project-chat-send) {
  border-color: var(--nm-lime);
  background: var(--nm-lime);
  color: var(--nm-navy);
  font-weight: 750;
  box-shadow: none;
}

body[class] :is(.library-page, .project-workspace, .staff-page, .comms-page, .finance-page, .recordings-page) :is(.primary, .staff-primary, .finance-primary, .project-chat-send):hover:not(:disabled) {
  border-color: #c6e859;
  background: #c6e859;
  color: var(--nm-navy);
  transform: translateY(-1px);
}

body[class] :is(.library-page, .project-workspace, .staff-page, .comms-page, .finance-page, .recordings-page) :is(.secondary, .library-type-tab, .staff-button:not(.staff-primary), .finance-button:not(.finance-primary), .comms-button, .project-button, .project-refresh-button) {
  border-color: var(--nm-line);
  background: #fff;
  color: var(--nm-ink);
  box-shadow: none;
}

body[class] :is(.library-page, .project-workspace, .staff-page, .comms-page, .finance-page, .recordings-page) :is(input:not([type=checkbox]), select, textarea) {
  border-color: #cfdad3;
  background: #fff;
  color: var(--nm-ink);
  caret-color: #405f12;
}

body[class] :is(.library-page, .project-workspace, .staff-page, .comms-page, .finance-page, .recordings-page) :is(input:not([type=checkbox]), select, textarea)::placeholder {
  color: #91a09d;
}

/* Document library: dark collection rail, dense file index, quiet reader. */
body[class] .library-page {
  border: 0;
  border-radius: 22px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body[class] .library-page .library-heading {
  flex-shrink: 0;
  border-bottom: 1px solid #243347;
}

body[class] .library-page .library-layout {
  min-height: 600px;
  grid-template-columns: minmax(205px, .65fr) minmax(310px, 1.05fr) minmax(320px, 1.35fr);
  gap: 10px;
  background: transparent;
}

body[class] .library-page .library-sidebar,
body[class] .library-page .library-main,
body[class] .library-page .library-preview {
  min-width: 0;
  border: 1px solid var(--nm-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--nm-shadow);
}

body[class] .library-page .library-sidebar {
  background: var(--nm-panel);
  border-color: #26384a;
  color: #e9f0ed;
}

body[class] .library-page .library-sidebar :is(.library-category-heading, .library-category-title, .library-collection-button, .library-folder-button, .library-list-row) {
  color: #dce8e4;
}

body[class] .library-page .library-sidebar :is(.library-category-heading, .library-category-title) {
  color: #a9bcc0;
}

body[class] .library-page .library-sidebar :is(.library-collection-button, .library-folder-button):hover {
  background: #25384a;
  color: #fff;
}

body[class] .library-page .library-sidebar :is(.library-collection-button, .library-folder-button).is-active,
body[class] .library-page .library-sidebar .library-collection-button.is-ancestor {
  background: #344631;
  color: var(--nm-lime);
  box-shadow: inset 3px 0 0 var(--nm-lime);
}

body[class] .library-page .library-main {
  background: var(--nm-card);
}

body[class] .library-page .library-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--nm-line);
}

body[class] .library-page .library-toolbar h2,
body[class] .library-page .library-item-title {
  color: var(--nm-ink);
  font-weight: 700;
}

body[class] .library-page .library-document-row {
  border-bottom: 1px solid #edf1ec;
}

body[class] .library-page .library-document-row:hover {
  background: #f5f8ef;
}

body[class] .library-page .library-document-row:has(.library-list-row.is-selected),
body[class] .library-page .library-list-row.is-selected {
  background: var(--nm-lime-soft);
  color: var(--nm-ink);
  box-shadow: inset 3px 0 0 #a7c948;
}

body[class] .library-page .library-item-badge {
  border-color: #c9e279;
  background: var(--nm-lime-soft);
  color: #354c16;
}

body[class] .library-page .library-preview {
  background: #eef3ee;
}

body[class] .library-page .library-preview-heading {
  background: #fff;
  border-bottom: 1px solid var(--nm-line);
  color: var(--nm-ink);
}

body[class] .library-page .library-preview-body pre {
  background: #fff;
  color: var(--nm-ink);
}

body[class] .library-page .library-preview-feedback {
  background: rgba(244, 246, 243, .96);
  color: var(--nm-muted);
}

body[class] .library-page:has(.library-project-group > .library-empty) {
  background: var(--nm-canvas);
}

body[class] .library-page:has(.library-project-group > .library-empty) .library-layout {
  flex: 0 0 auto;
  align-self: center;
  grid-template-columns: minmax(210px, .55fr) minmax(0, 1.45fr);
  width: min(100% - 28px, 1060px);
  min-height: 340px;
  margin: 0 auto 24px;
}

body[class] .library-page:has(.library-project-group > .library-empty) .library-preview {
  display: none;
}

body[class] .library-page:has(.library-project-group > .library-empty) .library-sidebar,
body[class] .library-page:has(.library-project-group > .library-empty) .library-main {
  min-height: 340px;
}

body[class] .library-page:has(.library-project-group > .library-empty) .library-sidebar {
  background: #eaf0eb;
  border-color: var(--nm-line);
  color: var(--nm-ink);
}

body[class] .library-page:has(.library-project-group > .library-empty) .library-sidebar h2,
body[class] .library-page:has(.library-project-group > .library-empty) .library-sidebar .library-empty {
  color: var(--nm-muted);
}

body[class] .library-page:has(.library-project-group > .library-empty) .library-main .library-empty {
  padding: 35px 22px;
}

/* Project workspace: a dark project index alongside white progress surfaces. */
body[class] .project-workspace {
  --project-ink: var(--nm-ink);
  --project-muted: var(--nm-muted);
  --project-line: var(--nm-line);
  --project-accent: #40601c;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 20px;
  background: transparent;
}

body[class] .project-workspace .project-navigation {
  margin: 0;
  padding: 22px 12px 36px;
  border: 1px solid #26384a;
  border-radius: 18px;
  background: var(--nm-panel);
  box-shadow: var(--nm-shadow);
}

body[class] .project-workspace .project-navigation-title,
body[class] .project-workspace .project-group-toggle {
  color: #a9bcc0;
}

body[class] .project-workspace .project-navigation-item {
  color: #d5e2e0;
}

body[class] .project-workspace .project-navigation-item small {
  color: #99aaaf;
}

body[class] .project-workspace .project-navigation-item:hover {
  background: #25384a;
  color: #fff;
}

body[class] .project-workspace .project-navigation-item.is-selected {
  background: #344631;
  color: var(--nm-lime);
  box-shadow: inset 3px 0 0 var(--nm-lime);
}

body[class] .project-workspace .project-content {
  max-width: none;
  padding: 0 0 44px;
}

body[class] .project-workspace .project-heading {
  min-height: 140px;
  margin-bottom: 18px;
}

body[class] .project-workspace .project-sharing-badge {
  border-color: #668352;
  background: #253b35;
  color: #d9edb1;
}

body[class] .project-workspace .project-heading :is(.project-text-button, .project-refresh-button) {
  border: 1px solid #5c7154;
  border-radius: 9px;
  padding: 8px 10px;
  background: #233332;
  color: #e4f3ba;
}

body[class] .project-workspace .project-heading :is(.project-text-button, .project-refresh-button):hover {
  background: #334840;
  color: #fff;
}

body[class] .project-workspace .project-controls {
  border-bottom: 0;
  margin: 6px 0 20px;
}

body[class] .project-workspace .project-tabs {
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #e9efea;
}

body[class] .project-workspace .project-tab {
  min-height: 40px;
  padding: 9px 16px;
  border: 0;
  border-radius: 9px;
  color: #607071;
  font-size: 13px !important;
}

body[class] .project-workspace .project-tab[aria-selected=true] {
  background: var(--nm-navy);
  color: var(--nm-lime);
  box-shadow: 0 5px 14px rgba(12, 20, 32, .14);
}

body[class] .project-workspace :is(.project-session, .project-sharing-panel, .project-conversations, .project-finals, .project-empty) {
  border: 1px solid var(--nm-line);
  border-radius: 18px;
  background: #fff;
  color: var(--nm-ink);
  box-shadow: var(--nm-shadow);
}

body[class] .project-workspace .project-session-header,
body[class] .project-workspace .project-conversation-heading {
  background: #f5f8f3;
  border-bottom-color: var(--nm-line);
}

body[class] .project-workspace :is(.project-session-date strong, .project-session-title h2, .project-conversation-heading h2) {
  color: var(--nm-ink);
}

body[class] .project-workspace :is(.project-copy, .project-full-text, .project-history li > p) {
  color: #425252;
}

body[class] .project-workspace .project-full-text {
  background: #f4f7f3;
}

body[class] .project-workspace :is(.project-session-work, .project-work-record + .project-work-record, .project-recording + .project-recording) {
  border-top-color: var(--nm-line);
}

body[class] .project-workspace .project-chat-composer {
  border-top: 1px solid var(--nm-line);
  background: #f7faf5;
}

body[class] .project-workspace .project-chat-composer textarea {
  border-color: #bfcec2;
  background: #fff;
  color: var(--nm-ink);
}

body[class] .project-workspace:has(.project-panel > .project-empty):not(:has(.project-tabs)) {
  background: var(--nm-canvas);
}

body[class] .project-workspace:has(.project-panel > .project-empty):not(:has(.project-tabs)) .project-navigation {
  border-color: var(--nm-line);
  background: #eaf0eb;
  box-shadow: none;
}

body[class] .project-workspace:has(.project-panel > .project-empty):not(:has(.project-tabs)) .project-navigation-title,
body[class] .project-workspace:has(.project-panel > .project-empty):not(:has(.project-tabs)) .project-empty-small {
  color: #536660;
}

body[class] .project-workspace:has(.project-panel > .project-empty):not(:has(.project-tabs)) .project-heading {
  min-height: 112px;
  border-color: var(--nm-line);
  background: #eaf0eb;
  color: var(--nm-ink);
  box-shadow: none;
}

body[class] .project-workspace:has(.project-panel > .project-empty):not(:has(.project-tabs)) .project-heading::before {
  display: none;
}

body[class] .project-workspace:has(.project-panel > .project-empty):not(:has(.project-tabs)) .project-heading h1 {
  color: var(--nm-ink);
}

body[class] .project-workspace:has(.project-panel > .project-empty):not(:has(.project-tabs)) .project-breadcrumb {
  color: #526c38;
}

body[class] .project-workspace:has(.project-panel > .project-empty):not(:has(.project-tabs)) .project-panel > .project-empty {
  display: flex;
  min-height: min(54vh, 490px);
  max-width: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px 25px;
  border: 1px solid var(--nm-line);
  border-radius: 20px;
  background: #fff;
  text-align: center;
  box-shadow: var(--nm-shadow);
}

body[class] .project-workspace:has(.project-panel > .project-empty):not(:has(.project-tabs)) .project-panel > .project-empty h2 {
  color: var(--nm-ink);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 750;
}

body[class] .project-workspace:has(.project-panel > .project-empty):not(:has(.project-tabs)) .project-panel > .project-empty p {
  color: var(--nm-muted);
}

/* Staff: assignments read as a split operation desk. */
body[class] .staff-page,
body[class] .comms-page,
body[class] .finance-page,
body[class] .recordings-page {
  max-width: 1540px;
  margin-inline: auto;
}

body[class] .staff-page {
  --staff-ink: var(--nm-ink);
  --staff-muted: var(--nm-muted);
  --staff-line: var(--nm-line);
  --staff-accent: #48691f;
}

body[class] .staff-page .staff-heading {
  margin-bottom: 20px;
}

body[class] .staff-page .staff-profiles {
  gap: 10px;
  border: 0;
  padding-bottom: 12px;
  margin-bottom: 8px;
}

body[class] .staff-page .staff-profile,
body[class] .staff-page .staff-list-panel,
body[class] .staff-page .staff-detail {
  border: 1px solid var(--nm-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--nm-shadow);
}

body[class] .staff-page .staff-profile.is-selected {
  border-color: #aacb58;
  background: var(--nm-lime-soft);
  box-shadow: inset 0 -3px 0 #a9c843;
}

body[class] .staff-page .staff-avatar {
  background: var(--nm-panel);
  color: var(--nm-lime);
}

body[class] .staff-page .staff-filters {
  background: #e8eee9;
}

body[class] .staff-page .staff-filter.is-active {
  background: var(--nm-panel);
  color: var(--nm-lime);
}

body[class] .staff-page .staff-workspace {
  grid-template-columns: minmax(280px, .76fr) minmax(0, 1.24fr);
  gap: 14px;
}

body[class] .staff-page .staff-list-heading {
  background: var(--nm-panel);
  border-bottom-color: #314153;
}

body[class] .staff-page .staff-list-heading h2 {
  color: #f6f8f4;
}

body[class] .staff-page .staff-list-heading > span {
  color: var(--nm-lime);
}

body[class] .staff-page .staff-assignment {
  border-bottom-color: var(--nm-line);
  color: var(--nm-ink);
}

body[class] .staff-page .staff-assignment:hover {
  background: #f6f9f1;
}

body[class] .staff-page .staff-assignment.is-selected {
  background: var(--nm-lime-soft);
  box-shadow: inset 4px 0 0 #a9c843;
}

body[class] .staff-page .staff-detail-heading h2,
body[class] .staff-page .staff-instruction > p {
  color: var(--nm-ink);
}

body[class] .staff-page .staff-status-review_requested {
  background: #fff2cf;
  color: #765718;
}

body[class] .staff-page .staff-status-completed {
  background: #e9f5cf;
  color: #3d601a;
}

body[class] .staff-page .staff-report {
  border-color: var(--nm-line);
  background: #f7f9f4;
}

/* Mail and calendar: separate information panes, shared dark command header. */
body[class] .comms-page .comms-heading {
  margin-bottom: 19px;
}

body[class] .comms-page :is(.comms-accounts-bar, .comms-mail-workspace, .comms-calendar-workspace) {
  border: 1px solid var(--nm-line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--nm-shadow);
}

body[class] .comms-page .comms-accounts-bar {
  padding: 10px 15px;
  margin-bottom: 12px;
}

body[class] .comms-page .comms-filters {
  padding: 4px;
  border-radius: 11px;
  background: #e8eee9;
}

body[class] .comms-page .comms-filter.is-active,
body[class] .comms-page .comms-calendar-switch .comms-filter[aria-pressed=true] {
  border-color: var(--nm-navy);
  background: var(--nm-navy);
  color: var(--nm-lime);
}

body[class] .comms-page .comms-mail-list {
  background: #fff;
  border-right-color: var(--nm-line);
}

body[class] .comms-page .comms-list-caption {
  background: var(--nm-panel);
  color: #f5f7f3;
}

body[class] .comms-page .comms-list-caption span {
  color: var(--nm-lime);
}

body[class] .comms-page .comms-mail-row {
  border-bottom-color: #e8eee8;
  color: var(--nm-ink);
}

body[class] .comms-page .comms-mail-row:hover {
  background: #f5f8ee;
}

body[class] .comms-page .comms-mail-row.is-selected {
  background: var(--nm-lime-soft);
  box-shadow: inset 3px 0 0 #aac84c;
}

body[class] .comms-page .comms-mail-detail,
body[class] .comms-page .comms-calendar-board,
body[class] .comms-page .comms-agenda {
  background: #fff;
  color: var(--nm-ink);
}

body[class] .comms-page .comms-calendar-toolbar {
  border-bottom: 1px solid var(--nm-line);
}

body[class] .comms-page .comms-calendar-date h2 {
  color: #f6f9f2;
  font-weight: 750;
}

body[class] .comms-page .comms-calendar-nav :is(.comms-icon-button, .comms-text-button) {
  border: 1px solid #52606a;
  background: #253444;
  color: #f6f9f2;
}

body[class] .comms-page .comms-calendar-nav :is(.comms-icon-button, .comms-text-button):hover {
  border-color: #a9c658;
  background: #354734;
  color: var(--nm-lime);
}

body[class] .comms-page .comms-calendar-workspace {
  overflow: hidden;
}

/* Finance: real totals get visual priority, transactions stay a readable table. */
body[class] .finance-page {
  --finance-ink: var(--nm-ink);
  --finance-muted: var(--nm-muted);
  --finance-line: var(--nm-line);
  --finance-accent: #48691f;
}

body[class] .finance-page .finance-heading {
  min-height: 148px;
  margin-bottom: 20px;
}

body[class] .finance-page .finance-heading .finance-text-button,
body[class] .finance-page .finance-heading .finance-button:not(.finance-primary) {
  border-color: #64765d;
  background: #243530;
  color: #e5f0c8;
}

body[class] .finance-page .finance-heading .finance-start-control > span {
  color: #b5c7c4;
}

body[class] .finance-page .finance-view-tabs,
body[class] .finance-page .finance-company-tabs {
  border-color: var(--nm-line);
  background: #e8eee9;
  border-radius: 12px;
}

body[class] .finance-page .finance-view-tab.is-active,
body[class] .finance-page .finance-company[aria-pressed=true] {
  border-color: var(--nm-navy);
  background: var(--nm-navy);
  color: var(--nm-lime);
  box-shadow: 0 5px 14px rgba(12, 20, 32, .13);
}

body[class] .finance-page :is(.finance-account, .finance-transactions, .finance-plan-card) {
  border: 1px solid var(--nm-line);
  border-radius: 17px;
  background: #fff;
  color: var(--nm-ink);
  box-shadow: var(--nm-shadow);
}

body[class] .finance-page .finance-account.is-selected {
  border-color: #b1cf64;
  background: #f6fbe9;
  box-shadow: inset 0 3px 0 #a9c843;
}

body[class] .finance-page .finance-account :is(strong, h3),
body[class] .finance-page .finance-plan-main > strong,
body[class] .finance-page .finance-plan-amount > strong {
  color: var(--nm-ink);
}

body[class] .finance-page .finance-summary,
body[class] .finance-page .finance-plan-summary {
  gap: 10px;
  margin: 20px 0;
}

body[class] .finance-page .finance-summary > div,
body[class] .finance-page .finance-plan-summary > div {
  min-width: 0;
  border: 1px solid #293b4d;
  border-radius: 16px;
  background: var(--nm-panel);
  color: #f5f7f3;
  box-shadow: var(--nm-shadow);
}

body[class] .finance-page .finance-summary > div:first-child {
  border-color: #d7ec8c;
  background: var(--nm-lime);
  color: var(--nm-navy);
}

body[class] .finance-page .finance-summary > div :is(span, strong),
body[class] .finance-page .finance-plan-summary > div :is(span, strong) {
  color: inherit;
}

body[class] .finance-page .finance-summary strong,
body[class] .finance-page .finance-plan-summary strong {
  font-variant-numeric: tabular-nums;
}

body[class] .finance-page .finance-transactions > header {
  border-bottom: 1px solid var(--nm-line);
  background: #f7f9f5;
}

body[class] .finance-page .finance-transactions h2,
body[class] .finance-page .finance-plan-list-heading h2 {
  color: var(--nm-ink);
}

body[class] .finance-page .finance-plan-list-heading h2 {
  color: #f6f9f2;
}

body[class] .finance-page .finance-plan-list-heading h2 small {
  color: var(--nm-lime);
}

body[class] .finance-page .finance-plan-list-heading .finance-text-button {
  padding: 7px 12px;
  border: 1px solid #62755d;
  border-radius: 9px;
  background: #243530;
  color: #e5f0c8;
}

body[class] .finance-page .finance-plan-list-heading .finance-text-button:hover {
  border-color: #b4d060;
  background: #354934;
  color: #f6ffdc;
}

body[class] .finance-page .finance-plan-empty {
  border: 1px solid var(--nm-line);
  background: #fff;
  color: var(--nm-ink);
  box-shadow: var(--nm-shadow);
}

body[class] .finance-page .finance-plan-empty .finance-eyebrow {
  color: #5b762c;
}

body[class] .finance-page .finance-plan-empty h3 {
  color: var(--nm-ink);
}

body[class] .finance-page .finance-plan-empty p {
  color: #516166;
}

body[class] .finance-page .finance-table th {
  background: var(--nm-panel);
  color: #dce6dc;
  border-bottom-color: #36485b;
}

body[class] .finance-page .finance-table tr:hover td {
  background: #f5f8ee;
}

body[class] .finance-page .finance-plan-card.is-open {
  border-color: #accb5e;
  box-shadow: 0 14px 28px rgba(12, 20, 32, .08);
}

body[class] .finance-page .finance-plan-remainder {
  background: var(--nm-lime-soft);
  color: #52652c;
}

body[class] .finance-page .finance-plan-remainder > strong {
  color: #273d1f;
}

body[class] .finance-page .finance-workspace {
  display: grid;
  grid-template-columns: minmax(210px, .72fr) minmax(440px, 2fr) minmax(250px, .82fr);
  align-items: start;
  gap: 14px;
}

body[class] .finance-page .finance-workspace > :is(aside, section) {
  min-width: 0;
}

body[class] .finance-page .finance-workspace-accounts,
body[class] .finance-page .finance-workspace-banking {
  padding: 17px;
  border: 1px solid var(--nm-line);
  border-radius: 18px;
  background: #eaf0eb;
}

body[class] .finance-page .finance-workspace-banking {
  background: #edf1eb;
}

body[class] .finance-page .finance-workspace-label {
  margin-bottom: 18px;
}

body[class] .finance-page .finance-workspace-label > span {
  display: block;
  margin-bottom: 9px;
  color: #5c764b;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .13em;
}

body[class] .finance-page .finance-workspace-label h2 {
  margin: 0;
  color: var(--nm-ink);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.035em;
}

body[class] .finance-page .finance-workspace-label p {
  margin: 5px 0 0;
  color: var(--nm-muted);
  font-size: 12px;
  line-height: 1.6;
}

body[class] .finance-page .finance-workspace-activity .finance-workspace-label > span {
  color: var(--nm-lime);
}

body[class] .finance-page .finance-workspace-activity .finance-workspace-label h2 {
  color: #f6f9f2;
}

body[class] .finance-page .finance-workspace-activity .finance-workspace-label p {
  color: #b9c9c8;
}

body[class] .finance-page .finance-workspace-accounts .finance-company-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  width: 100%;
  margin: 0 0 14px;
  padding: 4px;
}

body[class] .finance-page .finance-workspace-accounts .finance-company {
  flex: 1 0 auto;
  padding: 7px 9px;
  font-size: 12px;
}

body[class] .finance-page .finance-workspace-accounts .finance-accounts {
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
}

body[class] .finance-page .finance-workspace-accounts .finance-account {
  box-shadow: none;
}

body[class] .finance-page .finance-workspace-accounts .finance-account-select-button {
  padding: 12px 13px 9px;
}

body[class] .finance-page .finance-workspace-accounts .finance-account-select-button > strong {
  font-size: 17px;
}

body[class] .finance-page .finance-workspace-accounts .finance-account-connect {
  padding: 0 13px 12px;
}

body[class] .finance-page .finance-workspace-activity .finance-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 0;
  margin: 0 0 14px;
  border: 0;
}

body[class] .finance-page .finance-workspace-activity .finance-summary > div {
  padding: 16px 13px;
}

body[class] .finance-page .finance-workspace-activity .finance-summary strong {
  font-size: clamp(19px, 1.85vw, 28px);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body[class] .finance-page .finance-workspace-banking .finance-direct-sync {
  margin: 0 0 12px;
  padding: 14px;
  background: #fff;
  box-shadow: none;
}

body[class] .finance-page .finance-workspace-banking .finance-direct-sync-heading {
  grid-template-columns: 18px minmax(0, 1fr);
}

body[class] .finance-page .finance-workspace-banking .finance-direct-sync-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

body[class] .finance-page .finance-workspace-banking .finance-local-login {
  display: block;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--nm-line);
  border-radius: 13px;
  background: #fff;
}

body[class] .finance-page .finance-workspace-banking .finance-local-login-actions {
  justify-content: flex-start;
  max-width: none;
  margin-top: 8px;
}

body[class] .finance-page .finance-workspace-banking .finance-provider-status {
  margin: 0;
}

@media (max-width: 1200px) {
  body[class] .finance-page .finance-workspace {
    grid-template-columns: minmax(210px, .7fr) minmax(0, 2fr);
  }

  body[class] .finance-page .finance-workspace-banking {
    grid-column: 1 / -1;
  }
}

@media (max-width: 759px) {
  body[class] .finance-page .finance-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  body[class] .finance-page .finance-workspace-banking {
    grid-column: auto;
  }

  body[class] .finance-page .finance-workspace-activity .finance-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Recording decisions: review controls lead, text remains calm. */
body[class] .recordings-page .rec-page-heading,
body[class] .recordings-page .rec-detail-heading {
  margin-bottom: 20px;
}

body[class] .recordings-page .rec-page-heading > button,
body[class] .recordings-page .rec-detail-heading .rec-more > summary {
  border-color: #58704d;
  background: #243630;
  color: #e3efbd;
}

body[class] .recordings-page .rec-controls {
  margin-bottom: 16px;
}

body[class] .recordings-page .rec-filters,
body[class] .recordings-page .rec-pane-tabs {
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: #e9eee9;
}

body[class] .recordings-page .rec-filters button[aria-pressed=true],
body[class] .recordings-page .rec-pane-tabs button[aria-selected=true] {
  border: 0;
  border-radius: 9px;
  background: var(--nm-panel);
  color: var(--nm-lime);
  box-shadow: 0 6px 14px rgba(12, 20, 32, .12);
}

body[class] .recordings-page .rec-list,
body[class] .recordings-page .recording-reader,
body[class] .recordings-page .recording-candidate-panel {
  border: 1px solid var(--nm-line);
  border-radius: 18px;
  background: #fff;
  color: var(--nm-ink);
  box-shadow: var(--nm-shadow);
  overflow: hidden;
}

body[class] .recordings-page .rec-row {
  border-bottom-color: #e8eee7;
  color: var(--nm-ink);
}

body[class] .recordings-page .rec-row:hover {
  background: #f5f9ec;
}

body[class] .recordings-page .rec-row-icon {
  background: var(--nm-panel);
  color: var(--nm-lime);
}

body[class] .recordings-page .rec-row-main strong,
body[class] .recordings-page .rec-detail-heading h1,
body[class] .recordings-page .rec-candidate-title strong {
  color: var(--nm-ink);
}

body[class] .recordings-page .rec-detail-heading h1 {
  color: #f6f9f2;
}

body[class] .recordings-page .rec-row-state.needs-review {
  color: #4b6727;
}

body[class] .recordings-page :is(.summary-groups button[aria-pressed=true], .rec-candidate[open] > summary) {
  background: var(--nm-lime-soft);
  color: var(--nm-ink);
}

body[class] .recordings-page .summary-source-mark,
body[class] .recordings-page .rec-kind {
  border-color: #bfd785;
  background: var(--nm-lime-soft);
  color: #3f581f;
}

body[class] .recordings-page .rec-candidate {
  border-color: var(--nm-line);
  background: #fff;
}

/* Knowledge, learning and status are part of the same product, not legacy islands. */
body[class] #main:has(.knowledge-layout) .knowledge-intro {
  gap: 10px;
}

body[class] #main:has(.knowledge-layout) .knowledge-intro > div {
  border: 1px solid #293b4d;
  border-top: 3px solid var(--nm-lime);
  border-radius: 14px;
  background: var(--nm-panel);
  color: #f5f8f3;
}

body[class] #main:has(.knowledge-layout) .knowledge-intro :is(h3, .intro-number) {
  color: var(--nm-lime);
}

body[class] #main:has(.knowledge-layout) .knowledge-intro p {
  color: #b5c5c7;
}

body[class] #main:has(.knowledge-layout) .knowledge-card,
body[class] #main:has(.knowledge-layout) .knowledge-detail,
body[class] #main:has(.learning-summary) .learning-card,
body[class] #main:has(.learning-summary) .revision-row,
body[class] #main:has(.connection-list) .connection-list article {
  border: 1px solid var(--nm-line);
  border-radius: 16px;
  background: #fff;
  color: var(--nm-ink);
  box-shadow: var(--nm-shadow);
}

body[class] #main:has(.knowledge-layout) .knowledge-card:hover,
body[class] #main:has(.learning-summary) .revision-row:hover {
  border-color: #adca69;
  background: #f8fbed;
}

body[class] #main:has(.knowledge-layout) .knowledge-card.active {
  border-color: #aac864;
  background: var(--nm-lime-soft);
  box-shadow: inset 4px 0 0 #a7c54a;
}

body[class] #main:has(.knowledge-layout) .knowledge-card h3,
body[class] #main:has(.learning-summary) .learning-card h3,
body[class] #main:has(.connection-list) .connection-list h2 {
  color: var(--nm-ink);
  font-weight: 700;
}

body[class] #main:has(.knowledge-layout) .knowledge-card :is(p, footer),
body[class] #main:has(.knowledge-layout) .knowledge-card > div,
body[class] #main:has(.learning-summary) .learning-card :is(p, footer),
body[class] #main:has(.learning-summary) .learning-card > div,
body[class] #main:has(.connection-list) .connection-list :is(p, small) {
  color: var(--nm-muted);
}

body[class] #main:has(.knowledge-layout) .knowledge-detail .panel-heading {
  border-bottom-color: #344659;
  background: var(--nm-panel);
  color: #f4f8f1;
}

body[class] #main:has(.knowledge-layout) .knowledge-detail .panel-heading h2 {
  color: #f4f8f1;
}

body[class] #main:has(.knowledge-layout) .knowledge-context {
  border-left: 3px solid #aac950;
  background: #f2f8dd;
  color: #435733;
}

body[class] #main:has(.knowledge-layout) .knowledge-editor {
  border: 1px solid #cbd9cd;
  background: #fff;
  color: var(--nm-ink);
}

body[class] #main:has(.learning-summary) .learning-summary {
  border: 1px solid #293b4d;
  border-radius: 18px;
  background: var(--nm-panel);
  color: #f5f8f2;
  box-shadow: var(--nm-shadow);
}

body[class] #main:has(.learning-summary) .learning-summary > div {
  border-right-color: #435769;
}

body[class] #main:has(.learning-summary) .learning-summary b {
  color: var(--nm-lime);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

body[class] #main:has(.learning-summary) .learning-summary :is(span, p, small) {
  color: #c5d3cd;
}

body[class] #main:has(.connection-list) .connection-list article {
  border-top: 3px solid #c1db70;
}

body[class] #main:has(.connection-list) .connection-list article:nth-child(4n + 1) {
  border-top-color: #253a4d;
}

/* Module-owned editors and connection dialogs use the same visual vocabulary. */
body[class] :is(.library-dialog, .staff-dialog, .comms-connection-dialog, .finance-dialog, .finance-plan-editor) {
  --nm-navy: #0c1420;
  --nm-panel: #172334;
  --nm-lime: #d8f36a;
  --nm-lime-soft: #eff8ce;
  --nm-ink: #172126;
  --nm-muted: #637174;
  --nm-line: #dce4df;
  background: #fff;
  color: var(--nm-ink);
}

body[class] dialog:has(> :is(.library-dialog, .staff-dialog, .comms-connection-dialog, .finance-dialog, .finance-plan-editor)) {
  border: 1px solid #cbd8cf;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(5, 13, 22, .3);
}

body[class] :is(.staff-dialog, .comms-connection-dialog, .finance-dialog, .finance-plan-editor) > header {
  border-bottom: 1px solid var(--nm-line);
  padding-bottom: 15px;
}

body[class] :is(.library-dialog, .staff-dialog, .comms-connection-dialog, .finance-dialog, .finance-plan-editor) h2 {
  color: var(--nm-ink);
  font-weight: 750;
  letter-spacing: -.045em;
}

body[class] :is(.library-dialog, .staff-dialog, .comms-connection-dialog, .finance-dialog, .finance-plan-editor) :is(input:not([type=checkbox]), select, textarea) {
  border-color: #cbd8ce;
  background: #fff;
  color: var(--nm-ink);
}

body[class] :is(.library-dialog, .staff-dialog, .comms-connection-dialog, .finance-dialog, .finance-plan-editor) :is(input, select, textarea, button, a):focus-visible {
  outline: 3px solid #9dbd36;
  outline-offset: 3px;
}

body[class] :is(.library-dialog, .staff-dialog, .comms-connection-dialog, .finance-dialog, .finance-plan-editor) :is(.primary, .staff-primary, .finance-primary, .comms-setup-primary) {
  border-color: var(--nm-lime);
  background: var(--nm-lime);
  color: var(--nm-navy);
  font-weight: 750;
}

body[class] .library-dialog .library-add-tabs,
body[class] .comms-connection-dialog .comms-setup-accounts,
body[class] .finance-dialog .finance-schedule-card,
body[class] .staff-dialog .staff-recipient,
body[class] .finance-plan-editor .finance-plan-editor-totals {
  border-color: #d5e4c9;
  background: #f1f8df;
  color: #3c5525;
}

body[class] .library-dialog .library-add-tabs button[aria-pressed=true] {
  border-radius: 8px;
  background: var(--nm-panel);
  color: var(--nm-lime);
}

body[class] .finance-dialog .finance-import-counts strong,
body[class] .finance-plan-editor .finance-plan-editor-totals > strong {
  color: #334e19;
  font-variant-numeric: tabular-nums;
}

body[class] .finance-dialog .finance-table th {
  background: var(--nm-panel);
  color: #eef3e8;
}

/* Keep side-by-side readers usable on tablets and long Korean labels on phones. */
@media (max-width: 1180px) {
  body[class] .library-page .library-layout {
    grid-template-columns: minmax(160px, .6fr) minmax(260px, 1fr) minmax(275px, 1.1fr);
  }

  body[class] .project-workspace {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 12px;
  }
}

@media (max-width: 900px) {
  body[class] .library-page .library-layout {
    grid-template-columns: minmax(160px, .58fr) minmax(0, 1fr);
  }

  body[class] .library-page .library-preview {
    grid-column: 1 / -1;
    min-height: 360px;
  }

  body[class] .staff-page .staff-workspace {
    grid-template-columns: minmax(260px, .85fr) minmax(0, 1fr);
  }
}

@media (max-width: 759px) {
  body[class] .library-page:has(.library-project-group > .library-empty) .library-layout {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 24px);
    min-height: 0;
  }

  body[class] .library-page:has(.library-project-group > .library-empty) .library-sidebar {
    grid-column: auto;
    min-height: 110px;
    max-height: none;
  }

  body[class] .library-page:has(.library-project-group > .library-empty) .library-main {
    min-height: 300px;
  }

  body[class] .library-page .library-heading,
  body[class] .project-workspace .project-heading,
  body[class] .staff-page .staff-heading,
  body[class] .comms-page .comms-heading,
  body[class] .finance-page .finance-heading,
  body[class] .recordings-page .rec-page-heading,
  body[class] .recordings-page .rec-detail-heading,
  body[class] #main:has(.knowledge-layout) > .page-heading,
  body[class] #main:has(.learning-summary) > .page-heading,
  body[class] #main:has(.connection-list) > .page-heading {
    min-height: 112px;
    padding: 20px 18px;
    border-radius: 17px;
  }

  body[class] .library-page .library-layout,
  body[class] .project-workspace,
  body[class] .staff-page .staff-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  body[class] .library-page .library-sidebar {
    max-height: 260px;
    overflow: auto;
  }

  body[class] .library-page .library-preview {
    grid-column: auto;
  }

  body[class] .project-workspace .project-navigation {
    max-height: 230px;
    overflow: auto;
  }

  body[class] .project-workspace .project-controls,
  body[class] .finance-page .finance-heading,
  body[class] .recordings-page .rec-page-heading {
    flex-wrap: wrap;
  }

  body[class] .project-workspace .project-tabs,
  body[class] .finance-page .finance-view-tabs,
  body[class] .recordings-page .rec-filters {
    max-width: 100%;
    overflow-x: auto;
  }

  body[class] #main:has(.knowledge-layout) .knowledge-intro {
    grid-template-columns: minmax(0, 1fr);
  }

  body[class] #main:has(.knowledge-layout) .knowledge-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[class] :is(.library-page, .project-workspace, .staff-page, .comms-page, .finance-page, .recordings-page) :is(button, a) {
    transition: none;
  }
}
