/* DS-STYLES-1: source declarations in original cascade order.
   The zero-specificity guard follows the existing RootLayout stylesheet marker.
   global-error has no marker and retains its precision-only token environment. */
/* Source order retained: mactopus-visual-v1.css */
/* Exact approved Visual Design Spec v1.0 §25. Do not tune these per component. */
:root {
  --m-font-family-ui:
    "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --m-font-synthesis: none;
  --m-font-numeric: tabular-nums lining-nums;
  --m-font-numeric-prose: proportional-nums;
  --m-font-tracking: normal;
  --m-font-weight-regular: 400;
  --m-font-weight-medium: 500;
  --m-font-weight-semibold: 600;
  --m-font-size-meta: 0.75rem;
  --m-font-size-body: 0.875rem;
  --m-font-size-section: 1.25rem;
  --m-font-size-page: 1.75rem;
  --m-line-height-meta: 1.125rem;
  --m-line-height-dense: 1.25rem;
  --m-line-height-body: 1.3125rem;
  --m-line-height-panel: 1.5rem;
  --m-line-height-section: 1.75rem;
  --m-line-height-page: 2.1875rem;
  --m-space-1: 0.25rem;
  --m-space-2: 0.5rem;
  --m-space-3: 0.75rem;
  --m-space-4: 1rem;
  --m-space-5: 1.5rem;
  --m-space-6: 2rem;
  --m-space-7: 3rem;
  --m-radius-control: 0.5rem;
  --m-radius-surface: 0.75rem;
  --m-radius-elevated: 1rem;
  --m-radius-pill: 9999px;
  --m-border-width: 1px;
  --m-focus-width: 3px;
  --m-focus-offset: 2px;
  --m-control-height-compact: 2.5rem;
  --m-control-height-touch: 2.75rem;
  --m-control-height-mobile: 3rem;
  --m-row-height-dense: 2.75rem;
  --m-duration-micro: 150ms;
  --m-duration-reduced: 0ms;
  --m-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --m-glass-blur: 12px;
  --m-layer-surface: 1;
  --m-canvas: #eef0f3;
  --m-surface: #f6f7f9;
  --m-surface-subtle: #e8ebef;
  --m-surface-elevated: #fcfdfe;
  --m-text-primary: #24272c;
  --m-text-secondary: #535d69;
  --m-text-disabled: #5f6975;
  --m-text-inverse: #f4f6f8;
  --m-border-subtle: #d8dde4;
  --m-border-default: #bbc3ce;
  --m-border-strong: #697483;
  --m-interactive-primary: #252a31;
  --m-interactive-primary-hover: #383e47;
  --m-interactive-primary-pressed: #15191f;
  --m-on-primary: var(--m-text-inverse);
  --m-interactive-secondary: #e8ebef;
  --m-interactive-secondary-hover: #dde2e8;
  --m-interactive-secondary-pressed: #cfd6df;
  --m-on-secondary: var(--m-text-primary);
  --m-interactive-disabled: #e8ebef;
  --m-on-disabled: var(--m-text-disabled);
  --m-link: #244e85;
  --m-focus-ring: #254f86;
  --m-selected: #dfe9f5;
  --m-on-selected: #24466e;
  --m-selected-border: #55779f;
  --m-success-foreground: #285d40;
  --m-success-background: #e5f0e9;
  --m-success-border: #558268;
  --m-attention-foreground: #715017;
  --m-attention-background: #f3ecdd;
  --m-attention-border: #977237;
  --m-danger-foreground: #873c43;
  --m-danger-background: #f5e8e9;
  --m-danger-border: #ab6970;
  --m-information-foreground: #31577f;
  --m-information-background: #e7eef7;
  --m-information-border: #6281a6;
  --m-pending-foreground: var(--m-text-secondary);
  --m-pending-background: var(--m-surface-subtle);
  --m-pending-border: var(--m-border-default);
  --m-glass-fill: rgba(252, 253, 254, 0.94);
  --m-glass-border: rgba(67, 80, 100, 0.22);
  --m-glass-highlight: rgba(255, 255, 255, 0.7);
  --m-glass-reflection: rgba(57, 86, 122, 0.03);
  --m-glass-solid: var(--m-surface-elevated);
  --m-scrim: rgba(15, 18, 24, 0.32);
  --m-shadow-elevated: 0 8px 24px rgba(24, 27, 32, 0.12);
  --m-shadow-overlay: 0 16px 48px rgba(24, 27, 32, 0.18);
  --m-canvas-ambient:
    radial-gradient(
      ellipse 100% 64% at 6% 0%,
      rgba(102, 128, 164, 0.12) 0%,
      rgba(102, 128, 164, 0) 72%
    ),
    radial-gradient(
      ellipse 100% 70% at 100% 55%,
      rgba(255, 255, 255, 0.64) 0%,
      rgba(255, 255, 255, 0) 80%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 20%,
      rgba(255, 255, 255, 0.08) 100%
    );
}
[data-theme="light"] {
  --m-canvas: #eef0f3;
  --m-surface: #f6f7f9;
  --m-surface-subtle: #e8ebef;
  --m-surface-elevated: #fcfdfe;
  --m-text-primary: #24272c;
  --m-text-secondary: #535d69;
  --m-text-disabled: #5f6975;
  --m-text-inverse: #f4f6f8;
  --m-border-subtle: #d8dde4;
  --m-border-default: #bbc3ce;
  --m-border-strong: #697483;
  --m-interactive-primary: #252a31;
  --m-interactive-primary-hover: #383e47;
  --m-interactive-primary-pressed: #15191f;
  --m-on-primary: var(--m-text-inverse);
  --m-interactive-secondary: #e8ebef;
  --m-interactive-secondary-hover: #dde2e8;
  --m-interactive-secondary-pressed: #cfd6df;
  --m-on-secondary: var(--m-text-primary);
  --m-interactive-disabled: #e8ebef;
  --m-on-disabled: var(--m-text-disabled);
  --m-link: #244e85;
  --m-focus-ring: #254f86;
  --m-selected: #dfe9f5;
  --m-on-selected: #24466e;
  --m-selected-border: #55779f;
  --m-success-foreground: #285d40;
  --m-success-background: #e5f0e9;
  --m-success-border: #558268;
  --m-attention-foreground: #715017;
  --m-attention-background: #f3ecdd;
  --m-attention-border: #977237;
  --m-danger-foreground: #873c43;
  --m-danger-background: #f5e8e9;
  --m-danger-border: #ab6970;
  --m-information-foreground: #31577f;
  --m-information-background: #e7eef7;
  --m-information-border: #6281a6;
  --m-pending-foreground: var(--m-text-secondary);
  --m-pending-background: var(--m-surface-subtle);
  --m-pending-border: var(--m-border-default);
  --m-glass-fill: rgba(252, 253, 254, 0.94);
  --m-glass-border: rgba(67, 80, 100, 0.22);
  --m-glass-highlight: rgba(255, 255, 255, 0.7);
  --m-glass-reflection: rgba(57, 86, 122, 0.03);
  --m-glass-solid: var(--m-surface-elevated);
  --m-scrim: rgba(15, 18, 24, 0.32);
  --m-shadow-elevated: 0 8px 24px rgba(24, 27, 32, 0.12);
  --m-shadow-overlay: 0 16px 48px rgba(24, 27, 32, 0.18);
  --m-canvas-ambient:
    radial-gradient(
      ellipse 100% 64% at 6% 0%,
      rgba(102, 128, 164, 0.12) 0%,
      rgba(102, 128, 164, 0) 72%
    ),
    radial-gradient(
      ellipse 100% 70% at 100% 55%,
      rgba(255, 255, 255, 0.64) 0%,
      rgba(255, 255, 255, 0) 80%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 20%,
      rgba(255, 255, 255, 0.08) 100%
    );
}
[data-theme="dark"] {
  --m-canvas: #101113;
  --m-surface: #1b1d20;
  --m-surface-subtle: #16181b;
  --m-surface-elevated: #24272c;
  --m-text-primary: #eceef1;
  --m-text-secondary: #b2b7c0;
  --m-text-disabled: #9ba2ad;
  --m-text-inverse: #20242a;
  --m-border-subtle: #30353d;
  --m-border-default: #434a55;
  --m-border-strong: #828a96;
  --m-interactive-primary: #e1e5eb;
  --m-interactive-primary-hover: #f0f2f5;
  --m-interactive-primary-pressed: #c5ccd6;
  --m-on-primary: var(--m-text-inverse);
  --m-interactive-secondary: #22252a;
  --m-interactive-secondary-hover: #2a2e34;
  --m-interactive-secondary-pressed: #313740;
  --m-on-secondary: var(--m-text-primary);
  --m-interactive-disabled: #24272c;
  --m-on-disabled: var(--m-text-disabled);
  --m-link: #9dbce7;
  --m-focus-ring: #8ab3e8;
  --m-selected: #1d2e43;
  --m-on-selected: #cbdff7;
  --m-selected-border: #779bc8;
  --m-success-foreground: #a5d7b8;
  --m-success-background: #1d3026;
  --m-success-border: #609c7a;
  --m-attention-foreground: #e8cd99;
  --m-attention-background: #342b1d;
  --m-attention-border: #ac8950;
  --m-danger-foreground: #e9afb1;
  --m-danger-background: #352225;
  --m-danger-border: #af7378;
  --m-information-foreground: #b5cbe8;
  --m-information-background: #223044;
  --m-information-border: #7597c3;
  --m-pending-foreground: var(--m-text-secondary);
  --m-pending-background: var(--m-surface-elevated);
  --m-pending-border: var(--m-border-default);
  --m-glass-fill: rgba(36, 39, 44, 0.94);
  --m-glass-border: rgba(200, 209, 222, 0.22);
  --m-glass-highlight: rgba(255, 255, 255, 0.08);
  --m-glass-reflection: rgba(48, 83, 128, 0.04);
  --m-glass-solid: var(--m-surface-elevated);
  --m-scrim: rgba(0, 0, 0, 0.6);
  --m-shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.28);
  --m-shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.36);
  --m-canvas-ambient:
    radial-gradient(
      ellipse 100% 64% at 6% 0%,
      rgba(52, 77, 112, 0.26) 0%,
      rgba(52, 77, 112, 0) 72%
    ),
    radial-gradient(
      ellipse 100% 70% at 100% 55%,
      rgba(128, 140, 156, 0.07) 0%,
      rgba(128, 140, 156, 0) 80%
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.16) 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --m-canvas: #101113;
    --m-surface: #1b1d20;
    --m-surface-subtle: #16181b;
    --m-surface-elevated: #24272c;
    --m-text-primary: #eceef1;
    --m-text-secondary: #b2b7c0;
    --m-text-disabled: #9ba2ad;
    --m-text-inverse: #20242a;
    --m-border-subtle: #30353d;
    --m-border-default: #434a55;
    --m-border-strong: #828a96;
    --m-interactive-primary: #e1e5eb;
    --m-interactive-primary-hover: #f0f2f5;
    --m-interactive-primary-pressed: #c5ccd6;
    --m-on-primary: var(--m-text-inverse);
    --m-interactive-secondary: #22252a;
    --m-interactive-secondary-hover: #2a2e34;
    --m-interactive-secondary-pressed: #313740;
    --m-on-secondary: var(--m-text-primary);
    --m-interactive-disabled: #24272c;
    --m-on-disabled: var(--m-text-disabled);
    --m-link: #9dbce7;
    --m-focus-ring: #8ab3e8;
    --m-selected: #1d2e43;
    --m-on-selected: #cbdff7;
    --m-selected-border: #779bc8;
    --m-success-foreground: #a5d7b8;
    --m-success-background: #1d3026;
    --m-success-border: #609c7a;
    --m-attention-foreground: #e8cd99;
    --m-attention-background: #342b1d;
    --m-attention-border: #ac8950;
    --m-danger-foreground: #e9afb1;
    --m-danger-background: #352225;
    --m-danger-border: #af7378;
    --m-information-foreground: #b5cbe8;
    --m-information-background: #223044;
    --m-information-border: #7597c3;
    --m-pending-foreground: var(--m-text-secondary);
    --m-pending-background: var(--m-surface-elevated);
    --m-pending-border: var(--m-border-default);
    --m-glass-fill: rgba(36, 39, 44, 0.94);
    --m-glass-border: rgba(200, 209, 222, 0.22);
    --m-glass-highlight: rgba(255, 255, 255, 0.08);
    --m-glass-reflection: rgba(48, 83, 128, 0.04);
    --m-glass-solid: var(--m-surface-elevated);
    --m-scrim: rgba(0, 0, 0, 0.6);
    --m-shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.28);
    --m-shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.36);
    --m-canvas-ambient:
      radial-gradient(
        ellipse 100% 64% at 6% 0%,
        rgba(52, 77, 112, 0.26) 0%,
        rgba(52, 77, 112, 0) 72%
      ),
      radial-gradient(
        ellipse 100% 70% at 100% 55%,
        rgba(128, 140, 156, 0.07) 0%,
        rgba(128, 140, 156, 0) 80%
      ),
      linear-gradient(180deg, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.16) 100%);
  }
}


/* Source order retained: mactopus-living-spatial.css */
/* Living Spatial v1.0-rc1 semantic adapter; pilot-adjustable values.
   Existing primitives consume the legacy aliases below; layout migration is scoped. */
:root {
  --m-font-size-meta: 0.8125rem;
  --m-font-size-body: 1rem;
  --m-font-size-section: 1.5625rem;
  --m-font-size-page: 2.125rem;
  --m-line-height-body: 1.5rem;
  --m-line-height-page: 2.5rem;
  --m-line-height-section: 1.9375rem;
  --m-radius-elevated: 1.25rem;
  --m-control-height-compact: 2.75rem;
  --m-focus-width: 2px;
  --m-focus-offset: 3px;
  --m-glass-blur: 9px;
}
:root,
[data-theme="light"] {
  --m-environment: #e6ecef;
  --m-workspace: rgba(244, 248, 250, 0.74);
  --m-workspace-opaque: #f0f4f6;
  --m-data: #f7f9fa;
  --m-data-header: #e5ecf0;
  --m-context: #e1eaef;
  --m-foreground: #f8fafb;
  --m-control: #eff4f7;
  --m-text-primary: #233139;
  --m-text-secondary: #435965;
  --m-text-muted: #435965;
  --m-border-subtle: #aebfc9;
  --m-border-strong: #586d78;
  --m-selected-border: #496c7e;
  --m-focus-ring: #345f76;
  --m-selected: #cfdfeb;
  --m-interactive-primary: #294b5c;
  --m-on-primary: #ffffff;
  --m-hover: #e2ecf2;
  --m-success-foreground: #376747;
  --m-attention-foreground: #82500c;
  --m-danger-foreground: #933737;
  --m-glass-fill: rgba(248, 251, 253, 0.74);
  --m-glass-highlight: rgba(255, 255, 255, 0.78);
  --m-glass-reflection: rgba(255, 255, 255, 0.22);
  --m-canvas-ambient:
    radial-gradient(ellipse at 82% 16%, #b9cbd6 0%, transparent 60%),
    radial-gradient(ellipse at 12% 85%, #f0f4f6 0%, transparent 65%);
  --m-scrim: rgba(26, 44, 55, 0.32);
}
[data-theme="dark"] {
  --m-environment: #05090b;
  --m-workspace: rgba(16, 24, 29, 0.72);
  --m-workspace-opaque: #11181d;
  --m-data: #11191e;
  --m-data-header: #202a31;
  --m-context: #263139;
  --m-foreground: #182229;
  --m-control: #0d151a;
  --m-text-primary: #f1f3f4;
  --m-text-secondary: #bdc8cf;
  --m-text-muted: #a9bac5;
  --m-border-subtle: #34444e;
  --m-border-strong: #a9bac5;
  --m-selected-border: #b6c8d3;
  --m-focus-ring: #cfdfeb;
  --m-selected: #283841;
  --m-interactive-primary: #e8eef1;
  --m-on-primary: #13242c;
  --m-hover: #1b2931;
  --m-success-foreground: #a7d2b6;
  --m-attention-foreground: #f2c47f;
  --m-danger-foreground: #f1a9a9;
  --m-glass-fill: rgba(31, 44, 54, 0.62);
  --m-glass-highlight: rgba(240, 248, 255, 0.4);
  --m-glass-reflection: rgba(199, 223, 239, 0.13);
  --m-canvas-ambient:
    radial-gradient(
      circle 30px at 28% 26%,
      rgba(122, 155, 181, 0.28),
      transparent 90%
    ),
    radial-gradient(
      circle 25px at 49% 24%,
      rgba(123, 158, 184, 0.24),
      transparent 90%
    ),
    radial-gradient(
      circle 32px at 65% 20%,
      rgba(111, 147, 173, 0.23),
      transparent 90%
    ),
    radial-gradient(
      circle 30px at 52% 48%,
      rgba(118, 157, 189, 0.26),
      transparent 90%
    ),
    radial-gradient(
      circle 40px at 89% 51%,
      rgba(124, 157, 184, 0.28),
      transparent 90%
    ),
    radial-gradient(
      circle 34px at 33% 92%,
      rgba(119, 151, 178, 0.28),
      transparent 90%
    ),
    radial-gradient(
      circle 38px at 79% 91%,
      rgba(126, 160, 189, 0.29),
      transparent 90%
    ),
    radial-gradient(
      ellipse at 78% 76%,
      rgba(29, 44, 53, 0.24),
      transparent 64%
    ),
    radial-gradient(ellipse at 22% 18%, rgba(21, 34, 43, 0.28), transparent 65%);
  --m-scrim: rgba(3, 9, 13, 0.68);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --m-environment: #05090b;
    --m-workspace: rgba(16, 24, 29, 0.72);
    --m-workspace-opaque: #11181d;
    --m-data: #11191e;
    --m-data-header: #202a31;
    --m-context: #263139;
    --m-foreground: #182229;
    --m-control: #0d151a;
    --m-text-primary: #f1f3f4;
    --m-text-secondary: #bdc8cf;
    --m-text-muted: #a9bac5;
    --m-border-subtle: #34444e;
    --m-border-strong: #a9bac5;
    --m-selected-border: #b6c8d3;
    --m-focus-ring: #cfdfeb;
    --m-selected: #283841;
    --m-interactive-primary: #e8eef1;
    --m-on-primary: #13242c;
    --m-hover: #1b2931;
    --m-success-foreground: #a7d2b6;
    --m-attention-foreground: #f2c47f;
    --m-danger-foreground: #f1a9a9;
    --m-glass-fill: rgba(31, 44, 54, 0.62);
    --m-glass-highlight: rgba(240, 248, 255, 0.4);
    --m-glass-reflection: rgba(199, 223, 239, 0.13);
    --m-canvas-ambient:
      radial-gradient(
        circle 30px at 28% 26%,
        rgba(122, 155, 181, 0.28),
        transparent 90%
      ),
      radial-gradient(
        circle 25px at 49% 24%,
        rgba(123, 158, 184, 0.24),
        transparent 90%
      ),
      radial-gradient(
        circle 32px at 65% 20%,
        rgba(111, 147, 173, 0.23),
        transparent 90%
      ),
      radial-gradient(
        circle 30px at 52% 48%,
        rgba(118, 157, 189, 0.26),
        transparent 90%
      ),
      radial-gradient(
        circle 40px at 89% 51%,
        rgba(124, 157, 184, 0.28),
        transparent 90%
      ),
      radial-gradient(
        circle 34px at 33% 92%,
        rgba(119, 151, 178, 0.28),
        transparent 90%
      ),
      radial-gradient(
        circle 38px at 79% 91%,
        rgba(126, 160, 189, 0.29),
        transparent 90%
      ),
      radial-gradient(
        ellipse at 78% 76%,
        rgba(29, 44, 53, 0.24),
        transparent 64%
      ),
      radial-gradient(
        ellipse at 22% 18%,
        rgba(21, 34, 43, 0.28),
        transparent 65%
      );
    --m-scrim: rgba(3, 9, 13, 0.68);
  }
}
:root,
[data-theme] {
  --m-canvas: var(--m-environment);
  --m-surface: var(--m-data);
  --m-surface-subtle: var(--m-control);
  --m-surface-elevated: var(--m-foreground);
  --m-border-default: var(--m-border-subtle);
  --m-input-border: var(--m-border-strong);
  --m-glass-solid: var(--m-workspace-opaque);
  --m-glass-border: var(--m-glass-edge);
  --m-text-disabled: var(--m-text-muted);
  --m-text-inverse: var(--m-on-primary);
  --m-on-disabled: var(--m-text-muted);
  --m-interactive-disabled: var(--m-data-header);
  --m-interactive-secondary: var(--m-workspace-opaque);
  --m-interactive-secondary-hover: var(--m-hover);
  --m-interactive-secondary-pressed: var(--m-selected);
  --m-interactive-primary-hover: var(--m-interactive-primary);
  --m-interactive-primary-pressed: var(--m-interactive-primary);
  --m-on-secondary: var(--m-text-primary);
  --m-on-selected: var(--m-text-primary);
  --m-link: var(--m-text-primary);
  --m-success-background: var(--m-data);
  --m-success-border: var(--m-success-foreground);
  --m-attention-background: var(--m-data);
  --m-attention-border: var(--m-attention-foreground);
  --m-danger-background: var(--m-data);
  --m-danger-border: var(--m-danger-foreground);
  --m-information-foreground: var(--m-text-secondary);
  --m-information-background: var(--m-data);
  --m-information-border: var(--m-border-strong);
  --m-pending-background: var(--m-data);
  --m-pending-foreground: var(--m-text-secondary);
  --m-pending-border: var(--m-border-subtle);
}

@media (max-width: 600px) {
  :root {
    --m-font-size-page: 1.75rem;
    --m-line-height-page: 2.125rem;
  }
}
:root {
  --m-shadow-overlay: 0 8px 28px rgba(8, 25, 37, 0.08);
}

/* VIS-HOME-01 shared ERP materials; login owns its separate palette. */
:root {
  --m-glass-blur: 12px;
}
[data-theme="dark"] {
  --m-shadow-overlay: 0 8px 28px rgba(0, 0, 0, 0.22);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --m-shadow-overlay: 0 8px 28px rgba(0, 0, 0, 0.22);
  }
}

:root,
[data-theme="light"] {
  --m-glass-edge: rgba(114, 143, 162, 0.5);
  --m-glass-sheen:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 20%),
    linear-gradient(135deg, var(--m-glass-reflection), transparent 60%);
  --m-glass-shadow:
    inset 0 1px 0 var(--m-glass-highlight), 0 0 18px rgba(135, 169, 191, 0.1),
    var(--m-shadow-overlay);
  --m-danger-indicator: #d62e38;
  --m-attention-indicator: #ae6a08;
}
[data-theme="dark"] {
  --m-glass-edge: rgba(168, 195, 214, 0.48);
  --m-glass-sheen:
    linear-gradient(
      180deg,
      rgba(211, 232, 245, 0.1),
      transparent 18%,
      transparent 76%,
      rgba(145, 180, 208, 0.06)
    ),
    radial-gradient(
      ellipse at 100% 100%,
      rgba(141, 180, 207, 0.2),
      transparent 55%
    ),
    linear-gradient(135deg, var(--m-glass-reflection), transparent 55%);
  --m-glass-shadow:
    inset 0 1px 0 var(--m-glass-highlight),
    inset 0 -1px 0 rgba(158, 190, 214, 0.12), 0 0 22px rgba(138, 185, 216, 0.1),
    0 12px 28px rgba(0, 0, 0, 0.24);
  --m-danger-indicator: #ff434b;
  --m-attention-indicator: #ffca4b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --m-glass-edge: rgba(168, 195, 214, 0.48);
    --m-glass-sheen:
      linear-gradient(
        180deg,
        rgba(211, 232, 245, 0.1),
        transparent 18%,
        transparent 76%,
        rgba(145, 180, 208, 0.06)
      ),
      radial-gradient(
        ellipse at 100% 100%,
        rgba(141, 180, 207, 0.2),
        transparent 55%
      ),
      linear-gradient(135deg, var(--m-glass-reflection), transparent 55%);
    --m-glass-shadow:
      inset 0 1px 0 var(--m-glass-highlight),
      inset 0 -1px 0 rgba(158, 190, 214, 0.12),
      0 0 22px rgba(138, 185, 216, 0.1), 0 12px 28px rgba(0, 0, 0, 0.24);
    --m-danger-indicator: #ff434b;
    --m-attention-indicator: #ffca4b;
  }
}


/* DS-1 / PO 2026-10-17. Shared semantic roles; legacy tokens are adapters. */
:root,
[data-theme="light"],
[data-theme="dark"] {
  --m-font-family-ui: "Inter", system-ui, sans-serif;
  --m-font-family-mono: "JetBrains Mono", ui-monospace, monospace;
  --m-font-tracking: -0.006em;
  --m-font-weight-regular: 400;
  --m-font-weight-medium: 500;
  --m-font-weight-semibold: 600;
  --m-font-size-brand: 15px;
  --m-font-size-key: 11px;
  --m-radius-brand: 7px;
  --m-font-size-meta: 12.5px;
  --m-font-size-body: 14px;
  --m-font-size-large: 16px;
  --m-font-size-subhead: 18px;
  --m-font-size-section: 22px;
  --m-font-size-page: 32px;
  --m-font-size-dashboard: 40px;
  --m-line-height-body: 1.5;
  --m-line-height-meta: 1.5;
  --m-line-height-panel: 1.4;
  --m-line-height-section: 1.3;
  --m-line-height-page: 1.2;
  --m-radius-control: 10px;
  --m-radius-card: 12px;
  --m-radius-surface: 16px;
  --m-radius-elevated: 16px;
  --m-radius-header: 18px;
  --m-radius-badge: 6px;
  --m-radius-pill: 999px;
  --m-control-height-compact: 40px;
  --m-control-height-touch: 44px;
  --m-control-height-mobile: 44px;
  --m-space-1: 4px;
  --m-space-2: 8px;
  --m-space-3: 12px;
  --m-space-4: 16px;
  --m-space-5: 20px;
  --m-space-6: 24px;
  --m-space-8: 32px;
  --m-accent: #5ad1e6;
  --m-accent-ink: #04161a;
  --m-primary-gradient: linear-gradient(180deg, #9becfa, #4fc6de 55%, #2fa9c4);
  --m-primary-edge: rgba(255, 255, 255, 0.65);
  --m-primary-shadow: rgba(90, 209, 230, 0.6);
  --m-silver: linear-gradient(140deg, #e9eef2, #8f9aa6);
  --m-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --m-ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --m-glass-blur: 26px;
  --m-wallpaper: url("/assets/backgrounds/bg-octopus.webp");
  --m-wallpaper-opacity: 0.3;
  --m-logo-error: #ec7474;
  --m-focus-ring: var(--m-accent);
  --m-focus-width: 2px;
  --m-focus-offset: 3px;
}
:root,
[data-theme="light"] {
  --m-environment: #eef0f3;
  --m-workspace: rgba(255, 255, 255, 0.75);
  --m-workspace-opaque: #f9fafb;
  --m-data: #f9fafb;
  --m-data-header: #f1f3f5;
  --m-context: #e4e8ed;
  --m-foreground: #fff;
  --m-control: rgba(255, 255, 255, 0.36);
  --m-text-primary: #171b20;
  --m-text-secondary: #37414c;
  --m-text-muted: #58616d;
  --m-text-faint: #606874;
  --m-border-subtle: rgba(20, 30, 40, 0.14);
  --m-border-strong: #757e89;
  --m-selected-border: #087083;
  --m-selected: #dce9ec;
  --m-hover: #e9edf1;
  --m-success-foreground: #226b46;
  --m-attention-foreground: #825512;
  --m-danger-foreground: #a3363b;
  --m-info-foreground: #3f6377;
  --m-success-background: rgba(34, 107, 70, 0.1);
  --m-success-border: rgba(34, 107, 70, 0.28);
  --m-attention-background: rgba(130, 85, 18, 0.1);
  --m-attention-border: rgba(130, 85, 18, 0.28);
  --m-danger-background: rgba(163, 54, 59, 0.1);
  --m-danger-border: rgba(163, 54, 59, 0.28);
  --m-info-background: rgba(63, 99, 119, 0.1);
  --m-info-border: rgba(63, 99, 119, 0.28);
  --m-glass-drop: rgba(31, 43, 55, 0.22);
  --m-button-fill: rgba(255, 255, 255, 0.5);
  --m-field-fill: rgba(255, 255, 255, 0.36);
  --m-glass-fill: rgba(255, 255, 255, 0.75);
  --m-glass-highlight: rgba(255, 255, 255, 0.9);
  --m-glass-edge: rgba(20, 30, 40, 0.12);
  --m-glass-sheen: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.2) 40%
  );
  --m-glass-shadow:
    inset 0 1px 0 var(--m-glass-highlight), inset 0 0 0 1px var(--m-glass-edge),
    0 20px 50px -22px var(--m-glass-drop);
  --m-control-sheen: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.3)
  );
  --m-canvas-ambient:
    radial-gradient(ellipse at 75% 10%, #fff, transparent 65%),
    linear-gradient(140deg, #eef0f3, #e3e7ec);
  --m-scrim: rgba(10, 15, 20, 0.4);
  --m-focus-ring: #087083;
}
[data-theme="dark"] {
  --m-focus-ring: var(--m-accent);
  --m-environment: #050608;
  --m-workspace: rgba(10, 12, 15, 0.55);
  --m-workspace-opaque: #0e1114;
  --m-data: #0e1114;
  --m-data-header: #16191e;
  --m-context: #1c2026;
  --m-foreground: #161a1f;
  --m-control: rgba(18, 21, 26, 0.5);
  --m-text-primary: #fff;
  --m-text-secondary: #d4d9e0;
  --m-text-muted: #8b919a;
  --m-text-faint: #898f98;
  --m-border-subtle: rgba(255, 255, 255, 0.08);
  --m-border-strong: #747b85;
  --m-selected-border: var(--m-accent);
  --m-selected: #263239;
  --m-hover: #20252c;
  --m-success-foreground: #58c792;
  --m-attention-foreground: #e2b45b;
  --m-danger-foreground: #f58b8b;
  --m-info-foreground: #8fb3c8;
  --m-success-background: rgba(88, 199, 146, 0.12);
  --m-success-border: rgba(88, 199, 146, 0.3);
  --m-attention-background: rgba(226, 180, 91, 0.12);
  --m-attention-border: rgba(226, 180, 91, 0.32);
  --m-danger-background: rgba(245, 139, 139, 0.12);
  --m-danger-border: rgba(245, 139, 139, 0.34);
  --m-info-background: rgba(143, 179, 200, 0.12);
  --m-info-border: rgba(143, 179, 200, 0.3);
  --m-glass-drop: rgba(0, 0, 0, 0.8);
  --m-button-fill: rgba(18, 21, 26, 0.5);
  --m-field-fill: rgba(8, 11, 15, 0.32);
  --m-glass-fill: rgba(10, 12, 15, 0.55);
  --m-glass-highlight: rgba(255, 255, 255, 0.14);
  --m-glass-edge: rgba(255, 255, 255, 0.07);
  --m-glass-sheen: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.015) 40%
  );
  --m-glass-shadow:
    inset 0 1px 0 var(--m-glass-highlight), inset 0 0 0 1px var(--m-glass-edge),
    0 20px 50px -22px var(--m-glass-drop);
  --m-control-sheen: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.03)
  );
  --m-canvas-ambient: none;
  --m-scrim: rgba(0, 0, 0, 0.65);
}
:root,
[data-theme="light"],
[data-theme="dark"] {
  --m-canvas: var(--m-environment);
  --m-surface: var(--m-data);
  --m-surface-subtle: var(--m-control);
  --m-surface-elevated: var(--m-foreground);
  --m-border-default: var(--m-border-subtle);
  --m-input-border: var(--m-border-strong);
  --m-glass-solid: var(--m-workspace-opaque);
  --m-glass-border: var(--m-glass-edge);
  --m-text-disabled: var(--m-text-muted);
  --m-text-inverse: var(--m-accent-ink);
  --m-on-disabled: var(--m-text-muted);
  --m-interactive-disabled: var(--m-data-header);
  --m-interactive-primary: var(--m-accent);
  --m-interactive-primary-hover: var(--m-accent);
  --m-interactive-primary-pressed: var(--m-accent);
  --m-on-primary: var(--m-accent-ink);
  --m-interactive-secondary: var(--m-control);
  --m-interactive-secondary-hover: var(--m-hover);
  --m-interactive-secondary-pressed: var(--m-selected);
  --m-on-secondary: var(--m-text-primary);
  --m-on-selected: var(--m-text-primary);
  --m-link: var(--m-text-secondary);
  --m-information-foreground: var(--m-info-foreground);
  --m-information-background: var(--m-info-background);
  --m-information-border: var(--m-info-border);
  --m-pending-background: var(--m-data);
  --m-pending-foreground: var(--m-text-muted);
  --m-pending-border: var(--m-border-subtle);
  --m-shadow-overlay: none;
  --m-shadow-elevated: none;
  --m-danger-indicator: var(--m-danger-foreground);
  --m-attention-indicator: var(--m-attention-foreground);
}
html {
  font-feature-settings: "cv01", "ss03";
  -webkit-font-smoothing: antialiased;
}
h1,
h2 {
  letter-spacing: -0.022em;
  font-weight: 500;
}
.m-numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
kbd,
code,
.m-identifier {
  font-family: var(--m-font-family-mono);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

::selection {
  background: var(--m-selected);
  color: var(--m-text-primary);
}
input,
textarea {
  caret-color: var(--m-focus-ring);
}
* {
  scrollbar-color: var(--m-border-strong) var(--m-control);
}

/* Material is owned here, including legacy boundaries that opt into this primitive.
   Paint overrides are deliberate: page modules retain geometry, never a second recipe. */
:root [data-m-glass] {
  background: var(--m-glass-sheen), var(--m-glass-fill) !important;
  border: 0 !important;
  box-shadow: var(--m-glass-shadow) !important;
  border-radius: var(--m-radius-surface);
  backdrop-filter: blur(var(--m-glass-blur)) saturate(160%) !important;
  -webkit-backdrop-filter: blur(var(--m-glass-blur)) saturate(160%) !important;
}
/* A form, table or card inside a material boundary shares its plane, not another blur. */
:root [data-m-glass] [data-m-glass]:not([data-m-glass="overlay"]) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root [data-m-glass] :where(table, thead, tbody, tr, th, td) {
  background: transparent !important;
}
.m-identifier {
  font-feature-settings: "zero";
}
:root [data-m-button] {
  position: relative;
  overflow: hidden;
  border: 0 !important;
  border-radius: var(--m-radius-control);
  background: var(--m-control-sheen), var(--m-button-fill) !important;
  color: var(--m-text-primary) !important;
  box-shadow:
    inset 0 1px 0 var(--m-glass-highlight),
    inset 0 0 0 1px var(--m-glass-edge) !important;
  text-decoration: none;
  transition: transform 0.35s var(--m-ease-spring);
}
:root [data-m-button="primary"] {
  background: var(--m-primary-gradient) !important;
  color: var(--m-accent-ink) !important;
  box-shadow:
    inset 0 1px 0 var(--m-primary-edge),
    0 10px 28px -10px var(--m-primary-shadow) !important;
}
:root [data-m-button]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 30%,
    var(--m-glass-highlight) 50%,
    transparent 70%
  ) !important;
  transform: translateX(-120%);
  transition: transform 0.8s var(--m-ease-standard);
}
@media (hover: hover) {
  :root [data-m-button]:hover:not(:disabled):not([aria-disabled="true"]) {
    transform: translateY(-2px);
  }
  :root
    [data-m-button]:hover:not(:disabled):not([aria-disabled="true"])::after {
    transform: translateX(120%);
  }
}
:root [data-m-button]:active:not(:disabled):not([aria-disabled="true"]) {
  transform: scale(0.97);
}
:root [data-m-button="tertiary"] {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--m-text-secondary) !important;
}
:root [data-m-button="destructive"] {
  color: var(--m-danger-foreground);
}
:root [data-m-button]:is(:disabled, [aria-disabled="true"]) {
  background: var(--m-interactive-disabled) !important;
  color: var(--m-on-disabled) !important;
  box-shadow: none !important;
  transform: none;
}
:root [data-m-button]:is(:disabled, [aria-disabled="true"])::after {
  content: none;
}
:root [data-m-field] {
  background: var(--m-control-sheen), var(--m-field-fill);
  box-shadow: inset 0 1px 0 var(--m-glass-highlight);
  color: var(--m-text-primary);
}
:root [data-m-glass] :is(table, [data-m-flat]) {
  background: transparent !important;
  box-shadow: none;
}
@supports not (backdrop-filter: blur(1px)) {
  :root [data-m-glass] {
    background: var(--m-glass-solid) !important;
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root [data-m-glass] {
    background: var(--m-glass-solid) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  :root [data-m-glass] [data-m-glass]:not([data-m-glass="overlay"]) {
    background: transparent !important;
  }
}
:root[data-material="opaque"] [data-m-glass] {
  background: var(--m-glass-solid) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-material="opaque"]
  [data-m-glass]
  [data-m-glass]:not([data-m-glass="overlay"]) {
  background: transparent !important;
}

:root .m-numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
:root [data-m-glass] :is(tr[aria-selected="true"], tr[data-selected="true"]) {
  background: var(--m-selected) !important;
}

:root select[data-m-field] {
  background-color: var(--m-field-fill);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--m-text-muted) 50%),
    linear-gradient(135deg, var(--m-text-muted) 50%, transparent 50%),
    var(--m-control-sheen);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%,
    0 0;
  background-size:
    5px 5px,
    5px 5px,
    100% 100%;
  background-repeat: no-repeat;
}
:root [data-m-field]:disabled {
  background: var(--m-interactive-disabled);
  color: var(--m-on-disabled);
  box-shadow: none;
}
:root [data-m-field][aria-invalid="true"] {
  border-color: var(--m-danger-foreground);
}

:root [data-m-button][aria-pressed="true"],
:root [data-m-button][aria-current="page"] {
  background: var(--m-control-sheen), var(--m-selected) !important;
  box-shadow:
    inset 0 1px 0 var(--m-glass-highlight),
    inset 0 0 0 1px var(--m-selected-border) !important;
}

/* A row within a glass plane, without another blurred plane. */
[data-m-row] {
  background: var(--m-control-sheen) !important;
  border: 1px solid var(--m-border-subtle);
  border-radius: var(--m-radius-control);
  padding: var(--m-space-4);
  box-shadow: inset 0 1px 0 var(--m-border-subtle);
}

[hidden] {
  display: none !important;
}

.m-status-panel {
  padding: var(--m-space-6);
  border-radius: var(--m-radius-surface);
}
@media print {
  :root,
  [data-theme] {
    --m-print-paper: #fff;
    --m-print-ink: #111;
    --m-text-primary: var(--m-print-ink);
    --m-text-secondary: var(--m-print-ink);
    --m-text-muted: var(--m-print-ink);
  }
  [data-m-glass],
  [data-m-row] {
    background: var(--m-print-paper) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    color: var(--m-print-ink);
  }
}

/* Navigation and work links share row affordances and keyboard focus. */
:root a {
  text-decoration: none !important;
}

/* Links that perform a command use the same complete hit area as Button. */
:root a[data-m-button] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--m-space-2);
  min-height: var(--m-control-height-compact);
  padding: 0 var(--m-space-4);
}

/* Higher source resolution on wide and retina displays; same material layer. */
@media (min-width: 1920px), (min-resolution: 1.5dppx) {
  :root {
    --m-wallpaper: url("/assets/backgrounds/bg-octopus-4k.webp");
  }
}

/* DS-GLASS-1: exact repeated values; local palettes stay at use sites. */
:root,
[data-theme="light"],
[data-theme="dark"] {
  --m-shadow-selection-rail: inset 3px 0 var(--m-selected-border);
  --m-shadow-control-outline: inset 0 0 0 1px var(--m-border-subtle);
  --m-shadow-selection-outline: inset 0 0 0 1px var(--m-selected-border);
  --m-shadow-trade-panel: inset 0 1px 0 rgba(240, 248, 255, 0.13),
    0 22px 48px -18px rgba(0, 0, 0, 0.7);
  --m-blur-trade-panel: blur(24px) saturate(125%);
  --m-gradient-carousel-mask: linear-gradient(
    90deg,
    transparent 0,
    #000 46px,
    #000 calc(100% - 46px),
    transparent
  );
  --m-shadow-current-outline: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent);
  --m-blur-glass-control: blur(var(--m-glass-blur)) saturate(160%);
  --m-shadow-control-glass: inset 0 1px 0 var(--m-glass-highlight),
    inset 0 0 0 1px var(--m-glass-edge);
  --m-shadow-surface-highlight: inset 0 1px var(--m-glass-highlight);
  --m-shadow-selection-rail-thin: inset 2px 0 var(--m-selected-border);
}
