/* S1 design tokens (spec section 2). Values come from docs/design/1.0-mockups/page-1-project-overview.html.
 * Every name is prefixed --s1- so nothing here can collide with the legacy stylesheets. */
:root {
  --s1-ink: #111318;
  --s1-ink-hover: #262a33;
  --s1-on-ink: #ffffff;
  --s1-ink-2: #3a3f4b;
  --s1-mute: #5b616e;
  /* Surfaces (direction B, one surface): ink sidebar, a white page, a tint for full-width insets. One set; dark values below. */
  --s1-line: #d5d8de;
  --s1-line-soft: #e8eaee;
  --s1-canvas: #ffffff;   /* the page surface: white edge to edge. The tint for insets (composer, strip, side column) is --s1-panel-head. */
  --s1-panel: #ffffff;
  --s1-panel-head: #f5f6f8;   /* the tint: table heads, footers, hover */
  --s1-panel-band: var(--s1-panel); /* a panel's title row: the panel's own surface over a soft rule, never a tinted band */
  --s1-column: #f4f5f8;
  --s1-rail: #15171c;
  --s1-rail-raised: #1f2229;
  --s1-rail-active: #2b2f38;
  --s1-rail-line: #2e323b;
  --s1-rail-text: #c9cdd5;
  --s1-rail-mute: #8e94a0;
  --s1-rail-accent: #d9577c;
  --s1-shadow-panel: 0 1px 2px rgba(17, 19, 24, .05);
  --s1-row: 45px;
  --s1-nav-row: 33px;
  --s1-scale: .92;   /* the 10% density pass: hard-coded type and spacing in the sheets are written calc(Npx * var(--s1-scale, 1)); a phone (below) is 1 */
  --s1-tb-h: 48px;
  --s1-control-h: 29px;      /* a button, a field: 32px before the 10% density pass; a phone keeps 44px (s1-mobile.css) */
  --s1-control-h-sm: 24px;   /* the sticky top bar: a sticky table head sits below it */
  --s1-panel-gap: 14px;  --s1-maroon: #8a1538;
  /* Motion: one set. Exits are one step faster than the matching entrance. Transform and opacity only. Spec: s1-motion.css. */
  --s1-dur-1: 120ms;   /* press, hover colour, icon hover */
  --s1-dur-2: 180ms;   /* menus, tabs, chips, icon one-shots, row exit */
  --s1-dur-3: 240ms;   /* page enter, side panel, dialog, sheet */
  --s1-dur-4: 320ms;   /* list reflow, bar fill, success check */
  --s1-dur-5: 560ms;   /* a one-shot icon moment: the bell's swing, the send flying off */
  --s1-ease: cubic-bezier(.2, 0, 0, 1);         /* everything entering or moving */
  --s1-ease-exit: cubic-bezier(.4, 0, 1, 1);    /* everything leaving */
  --s1-ease-emph: cubic-bezier(.05, .7, .1, 1); /* side panel, sheet */
  --s1-stagger: 40ms;
  /* Page layout on a monitor. A page may grow to --s1-page-max; from about 1440px a page that has context to show puts it in a side column
   * (.k-wide in s1-kit.css) instead of stacking everything in one column. Running text never runs wider than --s1-measure. */
  --s1-page-max: 1760px;
  --s1-side-col: 350px;
  --s1-measure: 78ch;
  --s1-gutter: 24px; /* the one page gutter: the top bar, the tab strip and every page's content share this left edge (16px on a phone, in s1-mobile.css) */

  /* Brand accent: identity and orientation, never status. One hue per workspace (set in instances/<id>/instance.json, changeable in
   * Look and feel). s1-brand.js overwrites --s1-accent / --s1-on-accent at load, after checking WCAG AA (white text on it >= 4.5:1). The soft, line
   * and text tokens derive from it, so one value restyles the app bar, the active nav item, section heads, avatars and empty states.
   * Rule: ink = actions (buttons), accent = where you are and who we are, semantic = status (late, soon, wait, ok). */
  --s1-accent: #8a1538;
  --s1-on-accent: #ffffff;
  --s1-accent-text: var(--s1-accent);
  --s1-accent-soft: color-mix(in srgb, var(--s1-accent) 9%, #ffffff);
  --s1-accent-soft-2: color-mix(in srgb, var(--s1-accent) 16%, #ffffff);
  --s1-accent-line: color-mix(in srgb, var(--s1-accent) 32%, #ffffff);
  /* Hover shade and the optional second color (Manage > Look and feel). s1-brand.js sets --s1-accent-hover, and --s1-accent-2 / --s1-on-accent-2 only when the
   * workspace has a second color; without one these all follow the accent, so nothing changes. */
  --s1-accent-hover: color-mix(in srgb, var(--s1-accent) 86%, #000000);
  --s1-accent-2: var(--s1-accent);
  --s1-on-accent-2: var(--s1-on-accent);
  --s1-accent-2-text: var(--s1-accent-2);
  --s1-accent-2-soft: color-mix(in srgb, var(--s1-accent-2) 9%, #ffffff);
  --s1-accent-2-soft-2: color-mix(in srgb, var(--s1-accent-2) 16%, #ffffff);
  --s1-accent-2-line: color-mix(in srgb, var(--s1-accent-2) 32%, #ffffff);
  /* The accent swatches offered in Manage > Look and feel (the same list as RWTBrand.presets). Each passes AA with white text. */
  --s1-swatch-maroon: #8a1538;
  --s1-swatch-plum: #6b2d7a;
  --s1-swatch-indigo: #3b3f9e;
  --s1-swatch-slate: #34566f;
  --s1-swatch-teal: #0f6767;
  --s1-swatch-forest: #1f6b45;
  --s1-swatch-copper: #8a4a14;
  --s1-swatch-ink: #111318;

  /* Color carries meaning only. */
  --s1-late: #c2261d;
  --s1-soon: #8f5500;
  --s1-wait: #3557d6;
  --s1-ok: #1f7a4d;

  /* Role palette (avatar tint, RWT.roleTone): hues no status, brand or viewer colour uses; the one place the role colours are defined. A role is a person, never a state. */
  --s1-role-pi: #84477a; --s1-role-lead: #950b68; --s1-role-coordinator: #596325;
  --s1-role-trainee: #007270; --s1-role-staff: #292f31;

  --s1-line-strong: #b9bec9;  /* hover border, the stronger hairline */
  --s1-fill-strong: #8f95a3;  /* a quiet mark: a dashed edge, a done bar, an arrow */
  --s1-fill-soft: #eceef3;    /* a drop target, a highlighted label */
  --s1-hover: #fafbfc;        /* a table or timeline row under the pointer */
  --s1-dot: #c5c9d2;          /* a separator dot, a struck-through line */
  --s1-track: #dcdfe5;
  --s1-avatar: #e1e4e9;
  --s1-checkbox: #7d8491;
  --s1-control-line: #7d8491;  /* the edge of a field, a dropdown, a checkbox: at least 3:1 on every surface of the theme (WCAG 1.4.11); every theme sets its own. test/ui-control-contrast.test.mjs checks each one */

  --s1-radius-panel: 10px;
  --s1-radius-control: 8px;
  --s1-radius-empty: 10px;
  --s1-radius-pill: 999px;

  --s1-font-ui: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --s1-font-display: "Inter Tight", Inter, system-ui, sans-serif;
  /* The type scale: the only font sizes in the portal, and none below 12px (owner decision 2026-11-24). On a monitor the eight steps are six sizes
   * (12 13 14 16 20 24) and one display size (28) for a page's big figure; a phone (s1-mobile.css) reads one size larger from step 2 up. Size never
   * shrinks with --s1-scale: density comes from spacing. Weight and colour tell a label from body text when both are 12px. */
  --s1-fs-1: 12px;   /* labels, counts, meta */
  --s1-fs-2: 12px;   /* body */
  --s1-fs-3: 13px;   /* a row's title, emphasis */
  --s1-fs-4: 14px;   /* a lead line, a field's text */
  --s1-fs-5: 16px;   /* a section head */
  --s1-fs-6: 20px;   /* a page title */
  --s1-fs-7: 24px;   /* a big number */
  --s1-fs-8: 28px;   /* display: one per page at most */
  --s1-text-base: var(--s1-fs-2);
  --s1-text-small: var(--s1-fs-1);
  --s1-text-micro: var(--s1-fs-1);
  --s1-title: var(--s1-fs-6);
  --s1-panel-title: 700 var(--s1-fs-2)/1.2 var(--s1-font-display);

  --s1-space-1: 4px;
  --s1-space-2: 7px;
  --s1-space-3: 11px;
  --s1-space-4: 14px;
  --s1-space-5: 18px;
  --s1-space-6: 22px;

  /* Card inner padding for loose text and empty states (the card-inset utility in s1-kit.css and s1-components.css).
   * Phone overrides live in s1-mobile.css. */
  --s1-inset-x: 14px;
  --s1-inset-y: 11px;
  --s1-panel-pad-x: 16px;
}



/* Dark values: the same names, opt-in with data-theme="dark" (a page that still carries a raw light color is fixed where it is found, never given a second set). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --s1-ink: #eef0f3; --s1-ink-hover: #ffffff; --s1-on-ink: #111318; --s1-ink-2: #c0c5ce; --s1-mute: #959ba7;
  --s1-line: #30343c; --s1-line-soft: #262930; --s1-canvas: #191c21; --s1-panel: #191c21; --s1-panel-head: #1f2228; --s1-column: #1f2228;
  --s1-rail: #0b0c0f; --s1-rail-raised: #14161a; --s1-rail-active: #23262d; --s1-rail-line: #262930; --s1-rail-accent: #e0668a;
  --s1-shadow-panel: 0 1px 2px rgba(0, 0, 0, .4);
  --s1-late: #ff8f85; --s1-soon: #f0b45a; --s1-wait: #93a9ff; --s1-ok: #6fcf9b;
  --s1-role-pi: #ffbcff; --s1-role-lead: #e45a9f; --s1-role-coordinator: #969652;
  --s1-role-trainee: #009fa9; --s1-role-staff: #c2d9d9;
  --s1-track: #30343c; --s1-avatar: #262930; --s1-checkbox: #717989; --s1-control-line: #717989;
  --s1-line-strong: #4a4f5a; --s1-fill-strong: #6b717e; --s1-fill-soft: #272b32; --s1-hover: #1c1f25; --s1-dot: #3d414b;
}
