/*
 * MARPT canonical design-token authority for React/Vite surfaces AND every
 * retained legacy public/*.html surface. Plain CSS custom properties keep
 * this layer portable to a future Next.js shell.
 * Served to legacy documents via GET /marpt-tokens.css (server_v2.py serves
 * this exact source file; there is no separate public/marpt-tokens.css copy).
 * public/marpt-theme.css was retired in STYLE-6; this file is now the only global semantic palette authority in the repository.
 */

:root,
html[data-marpt-theme="dark"] {
  color-scheme: dark;

  --marpt-bg: #0e1116;
  --marpt-surface: #161b22;
  --marpt-surface-subtle: #1c232d;
  --marpt-surface-elevated: #151b26;
  --marpt-bg-muted: rgba(110, 118, 129, 0.16);

  --marpt-border: #30363d;
  --marpt-border-subtle: #252d38;
  --marpt-border-strong: #8b949e;

  --marpt-text-primary: #e6edf7;
  --marpt-text-secondary: #a8b1bd;
  --marpt-text-muted: #8b949e;
  --marpt-text-inverse: #0e1116;

  /* Filled actions must retain >=4.5:1 contrast with white labels. */
  --marpt-accent: #1f6feb;
  --marpt-accent-hover: #1f4f9e;
  --marpt-accent-emphasis: #58a6ff;
  --marpt-accent-muted: rgba(47, 129, 247, 0.14);
  --marpt-accent-rgb: 31, 111, 235;

  --marpt-success: #34d399;
  --marpt-success-muted: rgba(52, 211, 153, 0.16);
  --marpt-warning: #f59e0b;
  --marpt-warning-muted: rgba(245, 158, 11, 0.18);
  --marpt-danger: #f85149;
  --marpt-danger-muted: rgba(248, 81, 73, 0.16);
  --marpt-info: #2f81f7;
  --marpt-info-muted: rgba(47, 129, 247, 0.16);

  --marpt-shadow-soft: 0 0 22px rgba(31, 111, 235, 0.10);
  --marpt-shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.45);
  --marpt-focus-ring: 0 0 0 3px rgba(88, 166, 255, 0.38);

  /* Compatibility aliases consumed by existing product styles. */
  --marpt-bg-deep: var(--marpt-bg);
  --marpt-bg-elevated: var(--marpt-surface);
  --marpt-bg-panel: var(--marpt-surface-subtle);
  --marpt-surface-card: var(--marpt-surface);
  --marpt-surface-modal: var(--marpt-surface-elevated);
  --marpt-surface-input: var(--marpt-bg);
  --marpt-surface-tooltip: var(--marpt-surface-elevated);

  /* Shared workflow-shell frame semantics remain light by design. */
  --marpt-workflow-shell-frame-bg: #f7f9fc;
  --marpt-workflow-shell-frame-surface: #ffffff;
  --marpt-workflow-shell-frame-surface-strong: #f9fbff;
  --marpt-workflow-shell-frame-border: rgba(24, 39, 64, 0.14);
  --marpt-workflow-shell-frame-border-soft: rgba(24, 39, 64, 0.09);
  --marpt-workflow-shell-frame-text: #172033;
  --marpt-workflow-shell-frame-muted: #667085;
  --marpt-workflow-shell-frame-accent: #2e62b2;
}

html[data-marpt-theme="light"] {
  color-scheme: light;

  --marpt-bg: #f7f9fc;
  --marpt-surface: #ffffff;
  --marpt-surface-subtle: #f3f6fb;
  --marpt-surface-elevated: #ffffff;
  --marpt-bg-muted: rgba(46, 98, 178, 0.08);

  --marpt-border: #d8dee8;
  --marpt-border-subtle: #e6ebf2;
  --marpt-border-strong: #8fa1bc;

  --marpt-text-primary: #172033;
  --marpt-text-secondary: #526078;
  --marpt-text-muted: #667085;
  --marpt-text-inverse: #ffffff;

  --marpt-accent: #1f6feb;
  --marpt-accent-hover: #1d4ed8;
  --marpt-accent-emphasis: #1f4f9e;
  --marpt-accent-muted: #dbeafe;
  --marpt-accent-rgb: 31, 111, 235;

  --marpt-success: #047857;
  --marpt-success-muted: rgba(4, 120, 87, 0.12);
  --marpt-warning: #9a5f00;
  --marpt-warning-muted: rgba(154, 95, 0, 0.14);
  --marpt-danger: #b91c1c;
  --marpt-danger-muted: rgba(185, 28, 28, 0.12);
  --marpt-info: #1f6feb;
  --marpt-info-muted: rgba(31, 111, 235, 0.12);

  --marpt-shadow-soft: 0 0 22px rgba(31, 111, 235, 0.10);
  --marpt-shadow-medium: 0 10px 30px rgba(24, 39, 64, 0.14);
  --marpt-focus-ring: 0 0 0 3px rgba(31, 111, 235, 0.30);

  /* Compatibility aliases consumed by existing product styles. */
  --marpt-bg-deep: var(--marpt-bg);
  --marpt-bg-elevated: var(--marpt-surface);
  --marpt-bg-panel: var(--marpt-surface-subtle);
  --marpt-surface-card: var(--marpt-surface);
  --marpt-surface-modal: var(--marpt-surface-elevated);
  --marpt-surface-input: var(--marpt-surface);
  --marpt-surface-tooltip: var(--marpt-text-primary);

  /* Shared workflow-shell frame semantics remain light by design. */
  --marpt-workflow-shell-frame-bg: #f7f9fc;
  --marpt-workflow-shell-frame-surface: #ffffff;
  --marpt-workflow-shell-frame-surface-strong: #f9fbff;
  --marpt-workflow-shell-frame-border: rgba(24, 39, 64, 0.14);
  --marpt-workflow-shell-frame-border-soft: rgba(24, 39, 64, 0.09);
  --marpt-workflow-shell-frame-text: #172033;
  --marpt-workflow-shell-frame-muted: #667085;
  --marpt-workflow-shell-frame-accent: #2e62b2;
}
