/* Connect theme — the one design system every page on this origin reads.

   One palette for the whole origin (2026-10-17): the /apps palette — neutral
   paper and charcoal in Day, neutral graphite in Dark, a charcoal (Day) or
   near-white (Dark) primary action with its own ink, copper only as the accent
   (current page, focus, emphasis). Each surface keeps its own token names and
   points them here, so a colour changes in one place:

     landing + site pages  landing/colour-unification.css
     the application       src/styles/61-colour-unification.css
     the product apps      apps/shared/tokens.css (scale and --pa-* only)
     documentation         docs/docs.css
     the assistant         landing/agent.css
     privacy, terms, trust privacy/privacy.css, terms/terms.css

   The theme itself is chosen by src/site/connect-theme.js (data-theme on <html>).
   Values, plus one thing every page shares: the backdrop at the end of this
   file (the /apps hub's layered gradient), drawn behind every page on the origin. */

:root {
  /* Surfaces */
  --cx-canvas: #F6F6F4;
  --cx-shell: #F1F1EE;
  --cx-surface: #FFFFFF;
  --cx-surface-2: #F1F1EE;
  --cx-hover: #EEEEEA;
  --cx-selected: #E8E7E2;
  --cx-input: #FFFFFF;
  --cx-rail: #FBFBFA;
  --cx-overlay: rgba(20, 21, 23, .42);

  /* Text: every tone clears 4.5:1 on every surface it sits on, down to
     --cx-selected (tools/test_ui_color_contrast_v1.py measures it). */
  --cx-text: #17181A;
  --cx-text-2: #44464A;
  --cx-text-3: #5D6065;
  --cx-text-disabled: #9A9C9F;

  /* Lines */
  --cx-border-soft: #ECECE8;
  --cx-border: #E1E1DC;
  --cx-border-strong: #CBCBC5;

  /* The primary action: charcoal ink in Day, near-white in Dark; its label is --cx-action-ink. */
  --cx-action: #1B1C1F;
  --cx-action-hover: #2E3034;
  --cx-action-ink: #FFFFFF;
  --cx-action-soft: #ECECE8;

  /* Emphasis: links, eyebrows, a figure that matters. Copper as text is the
     --cx-link shade; the fill tone is for marks, rules and focus. */
  --cx-accent: #B8692C;
  --cx-accent-soft: #F6EDE4;
  --cx-link: #8A5220;
  --cx-link-hover: #6B3E16;
  --cx-focus: #B8692C;
  --cx-accent-on-action: #E6AB78;   /* copper as text on an --cx-action fill */

  /* Meaning: fill, soft surface, and the shade text is read at. */
  --cx-success: #0F7B6C;
  --cx-success-soft: #E5F3EF;
  --cx-success-text: #0B6155;
  --cx-warning: #9A5A0E;
  --cx-warning-soft: #FBF0E0;
  --cx-warning-text: #82490A;
  --cx-danger: #B42318;
  --cx-danger-soft: #FCECEA;
  --cx-danger-text: #9E1E14;
  --cx-info: #4B5764;
  --cx-info-soft: #EEF0F2;
  --cx-info-text: #3D4752;

  /* Elevation */
  --cx-shadow-1: 0 1px 2px rgba(20, 21, 23, .05);
  --cx-shadow-2: 0 1px 2px rgba(20, 21, 23, .04), 0 8px 24px rgba(20, 21, 23, .07);
  --cx-shadow-3: 0 2px 8px rgba(20, 21, 23, .06), 0 24px 64px rgba(20, 21, 23, .16);
  /* Four restrained tones (the Owner's polish order, 2026-10-24): identity and emphasis only - a department's
     hue, a selected plan's wash, a pictogram - never body text and never a second action colour. Each -ink
     reads 4.5:1 on its -soft wash and on the surface. Elevation 1 and 2 for cards that lift on hover. */
  --cx-tone-blue: #2F6FDB; --cx-tone-blue-soft: #EAF1FD; --cx-tone-blue-ink: #1D4FA8;
  --cx-tone-teal: #0F8A7E; --cx-tone-teal-soft: #E4F4F1; --cx-tone-teal-ink: #0B6158;
  --cx-tone-amber: #B7791F; --cx-tone-amber-soft: #FBF1DF; --cx-tone-amber-ink: #8A5A12;
  --cx-tone-violet: #7357D6; --cx-tone-violet-soft: #EFEBFC; --cx-tone-violet-ink: #563BB5;
  --cx-elev-1: 0 1px 2px 0 rgba(17, 24, 39, .06);
  --cx-elev-2: 0 8px 22px -12px rgba(17, 24, 39, .22);
  --cx-chrome: #F6F6F4;   /* browser theme-color */

  /* Type */
  --cx-font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui,
             -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --cx-font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --cx-font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  --cx-text-page: 30px;
  --cx-text-section: 19px;
  --cx-text-body: 15px;
  --cx-text-meta: 13px;
  --cx-leading: 1.6;
  --cx-weight-strong: 650;

  /* Space, shape, motion */
  --cx-space-1: 4px;
  --cx-space-2: 8px;
  --cx-space-3: 12px;
  --cx-space-4: 16px;
  --cx-space-5: 24px;
  --cx-space-6: 32px;
  --cx-space-7: 40px;
  --cx-radius-sm: 8px;
  --cx-radius: 12px;
  --cx-radius-lg: 16px;
  --cx-radius-pill: 999px;
  --cx-control: 44px;
  --cx-ease: cubic-bezier(.2, .8, .2, 1);
  --cx-fast: 160ms;
}

:root[data-theme="dark"] {
  --cx-canvas: #0E0F10;
  --cx-shell: #121315;
  --cx-surface: #16171A;
  --cx-surface-2: #1D1F22;
  --cx-hover: #222429;
  --cx-selected: #2A2C31;
  --cx-input: #121315;
  --cx-rail: #121315;
  --cx-overlay: rgba(0, 0, 0, .6);

  --cx-text: #F3F3F1;
  --cx-text-2: #BCBEC2;
  --cx-text-3: #9DA0A6;
  --cx-text-disabled: #5E6166;

  --cx-border-soft: #212327;
  --cx-border: #2A2C31;
  --cx-border-strong: #3B3E44;

  --cx-action: #EDEDEA;
  --cx-action-hover: #FFFFFF;
  --cx-action-ink: #121315;
  --cx-action-soft: #26282D;

  --cx-accent: #D88A4B;
  --cx-accent-soft: rgba(216, 138, 75, .14);
  --cx-link: #E6AB78;
  --cx-link-hover: #F2C59D;
  --cx-focus: #D88A4B;
  --cx-accent-on-action: #8A5220;

  --cx-success: #34B99B;
  --cx-success-soft: rgba(52, 185, 155, .14);
  --cx-success-text: #63D2B9;
  --cx-warning: #E2A23C;
  --cx-warning-soft: rgba(226, 162, 60, .14);
  --cx-warning-text: #F0BE6C;
  --cx-danger: #EF6B5F;
  --cx-danger-soft: rgba(239, 107, 95, .14);
  --cx-danger-text: #F6948B;
  --cx-info: #9AA6B2;
  --cx-info-soft: rgba(154, 166, 178, .14);
  --cx-info-text: #BAC4CE;

  --cx-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --cx-shadow-2: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .38);
  --cx-shadow-3: 0 2px 8px rgba(0, 0, 0, .45), 0 24px 64px rgba(0, 0, 0, .6);
  --cx-tone-blue: #7FA8F5; --cx-tone-blue-soft: #1A2537; --cx-tone-blue-ink: #A9C4F8;
  --cx-tone-teal: #4CC2B4; --cx-tone-teal-soft: #142C29; --cx-tone-teal-ink: #8ADBD0;
  --cx-tone-amber: #E3A954; --cx-tone-amber-soft: #2E2416; --cx-tone-amber-ink: #F0C786;
  --cx-tone-violet: #A895F2; --cx-tone-violet-soft: #241F38; --cx-tone-violet-ink: #C7BAF7;
  --cx-elev-1: 0 1px 2px 0 rgba(0, 0, 0, .4);
  --cx-elev-2: 0 10px 26px -12px rgba(0, 0, 0, .6);
  --cx-chrome: #0E0F10;
}

/* ---- a business's accent (the tenant UI layer, CONNECT_UI_LAYER_ACCENTS_V1, 2026-11-27) ---------------
   One accent at a time, in place of copper, for one business (webapp/apps/shared/ui-layer.js sets data-accent on
   <html>). Every tone is measured in backend/app/ui_layer.py (ACCENTS, palette_report) against the surfaces above,
   Day and Dark: the accent 3:1 as a mark and a focus ring, a link and its hover 4.5:1 down to --cx-selected, copper's
   place on the action fill 4.5:1. tools/test_tenant_ui_layer_v1.py holds these values equal to that table. The
   :not() and the pair of attributes keep each block above its theme's own, in either order. */
:root[data-accent="teal"]:not([data-theme="dark"]) { --cx-accent: #0E7490; --cx-accent-soft: #E3F1F5; --cx-link: #0B5E74; --cx-link-hover: #084A5C; --cx-focus: #0E7490; --cx-accent-on-action: #67C3DA; }
:root[data-theme="dark"][data-accent="teal"] { --cx-accent: #3AA6C2; --cx-accent-soft: rgba(58, 166, 194, .14); --cx-link: #7CCBDF; --cx-link-hover: #A6DDEB; --cx-focus: #3AA6C2; --cx-accent-on-action: #0B5E74; }
:root[data-accent="blue"]:not([data-theme="dark"]) { --cx-accent: #3461C9; --cx-accent-soft: #E8EEFA; --cx-link: #2A4FA6; --cx-link-hover: #1F3C80; --cx-focus: #3461C9; --cx-accent-on-action: #9DB7F2; }
:root[data-theme="dark"][data-accent="blue"] { --cx-accent: #6F95EE; --cx-accent-soft: rgba(111, 149, 238, .14); --cx-link: #A3BDF7; --cx-link-hover: #C4D5FA; --cx-focus: #6F95EE; --cx-accent-on-action: #2A4FA6; }
:root[data-accent="plum"]:not([data-theme="dark"]) { --cx-accent: #8E4BAE; --cx-accent-soft: #F3EAF7; --cx-link: #71398C; --cx-link-hover: #572B6C; --cx-focus: #8E4BAE; --cx-accent-on-action: #D3AAE6; }
:root[data-theme="dark"][data-accent="plum"] { --cx-accent: #B77DD3; --cx-accent-soft: rgba(183, 125, 211, .14); --cx-link: #D5B1E8; --cx-link-hover: #E6CDF2; --cx-focus: #B77DD3; --cx-accent-on-action: #71398C; }
:root[data-accent="green"]:not([data-theme="dark"]) { --cx-accent: #2F7D3A; --cx-accent-soft: #E7F2E9; --cx-link: #25642E; --cx-link-hover: #1B4B22; --cx-focus: #2F7D3A; --cx-accent-on-action: #8FD39A; }
:root[data-theme="dark"][data-accent="green"] { --cx-accent: #57B266; --cx-accent-soft: rgba(87, 178, 102, .14); --cx-link: #94D59E; --cx-link-hover: #BBE5C1; --cx-focus: #57B266; --cx-accent-on-action: #25642E; }

/* ---- the backdrop: the plain canvas, for the whole origin ----------------------------------
   One calm surface behind every page, in Day and Dark: the canvas colour itself, nothing drawn on it.
   The radial washes (blue, violet, green) and the grid that stood here from 2026-10-17 were decoration,
   which CRM-PLUS-GLOBAL-CONTRACT.md section 3 and request section 6 rule out (no decorative glows or
   washes; main's decision, 2026-10-23). Every page's body is transparent over the root, so this is the
   one place the page colour comes from; cards and panels keep their own surfaces. */
@media screen {
  html[data-theme] { background-color: var(--cx-canvas); }
  /*  Every surface's own body rule (the app's is html[data-theme] body, !important)
      is one step less specific than this, so the canvas shows on every page. */
  html[data-theme] > body,
  html[data-theme] > body.connect-site { background: transparent !important; }
  html[data-theme] > body::before { background: none !important; }
}

/* ---- the Live Office's people: the illustration palette (live-office-upgrade-20261126) ------------------------
   The Cloud Employees drawn on the Live Office floor (apps/shared/office/figures.js) are illustrations, so their
   skin, hair and clothes are physical colours, the same in Day and Dark; the stage, the cards and every word around
   them take the theme's own tokens. Read only through apps/shared/office/live-floor.css (`--lf-*`). */
:root {
  --cx-fig-skin-1: #F3D2B3; --cx-fig-skin-2: #E3B486; --cx-fig-skin-3: #C98C58; --cx-fig-skin-4: #A86C3F;
  --cx-fig-skin-5: #8A5530; --cx-fig-skin-6: #6A3F23;
  --cx-fig-hair-1: #1C1612; --cx-fig-hair-2: #3A2A1F; --cx-fig-hair-3: #5E3E2A; --cx-fig-hair-4: #8C6745;
  --cx-fig-hair-5: #B8B4AD; --cx-fig-hair-6: #2E2724;
  --cx-fig-navy: #26344F; --cx-fig-charcoal: #2F3238; --cx-fig-slate: #4B5669; --cx-fig-teal: #2E6E69;
  --cx-fig-green: #3F6B50; --cx-fig-plum: #5C3B67; --cx-fig-coral: #B4553E; --cx-fig-amber: #A8701E;
  --cx-fig-denim: #3E5B80; --cx-fig-leather: #6C4A31; --cx-fig-cream: #EDE3D1; --cx-fig-coat: #F6F6F3;
  --cx-fig-shirt: #E6ECF2; --cx-fig-satin: #4A4D55;
  --cx-fig-print: #FFFFFF; --cx-fig-print-dark: #1E2330;
  --cx-fig-shade: rgba(0, 0, 0, .18); --cx-fig-light: rgba(255, 255, 255, .22); --cx-fig-line: rgba(0, 0, 0, .28);
  --cx-fig-metal: #8B9199; --cx-fig-gear: #1F2226; --cx-fig-bezel: #202328;
  --cx-fig-desk: #CDBB9F; --cx-fig-desk-edge: #A7937A; --cx-fig-chair: #2C2F35;
  --cx-fig-paper: #FBFAF7; --cx-fig-prop-red: #B54A3C; --cx-fig-prop-blue: #3C6E9E;
}
