/* Signal OSX design system: the values every external product reads.
   Source of truth: tokens.json in this folder. If the two disagree, tokens.json wins.
   Approved direction: system/decisions/decision-2026-11-14-signal-osx-direction-approval.md
   Light is the default. A design tool sets data-theme="dark" on its root element. */

@font-face { font-family: "Inter Tight"; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url("../assets/fonts/InterTight[wght].ttf") format("truetype"); }
@font-face { font-family: "Noto Sans Thai"; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url("../assets/fonts/NotoSansThai[wdth,wght].ttf") format("truetype"); }

:root {
  /* Colour, light */
  --sx-bg: #FCF9F8;            /* the page, a warm off-white */
  --sx-surface: #FFFFFF;       /* header, left menu, cards, menus */
  --sx-text: #12143A;          /* Indigo 900: headings, labels, body */
  --sx-text-2: #414361;        /* secondary text */
  --sx-muted: #5B5D77;         /* captions, column headings, icons at rest */
  --sx-line: #E8E8EE;          /* hairline between regions */
  --sx-line-row: #F0F0F4;      /* hairline between table rows */
  --sx-line-box: #DCDCE6;      /* outline of a box that has a shadow */
  --sx-line-control: #C9CAD3;  /* outline of a button or filter that carries its own label */
  --sx-line-field: #898A9D;    /* outline of a field you type into */
  --sx-selected: #EEF1FE;      /* current menu item, open switcher */
  --sx-accent: #5A81FA;        /* Soft Violet 500: marks and icons only, never small text on light */
  --sx-primary-bg: #12143A;
  --sx-primary-text: #FFFFFF;
  --sx-attention-text: #8A3B12;
  --sx-attention-mark: #B4541F;
  --sx-danger: #A8261B;         /* problems and destructive actions */
  --sx-danger-on: #FFFFFF;
  --sx-scrim: rgba(18, 20, 58, 0.36);   /* the dimmed page behind a pop-up window */
  --sx-focus: #12143A;
  --sx-fade: rgba(90, 129, 250, 0.20);

  /* Type */
  --sx-font: "Inter Tight", "Noto Sans Thai", "Helvetica Neue", Arial, sans-serif;
  --sx-size-label: 13px;       /* small labels and captions */
  --sx-size-ui: 14px;          /* everything you click in the frame, buttons, fields */
  --sx-size-data: 15px;        /* table cells and card text */
  --sx-size-body: 16px;        /* reading text */
  --sx-size-title: 18px;       /* card and section titles */
  --sx-size-page: 30px;        /* page title */
  --sx-size-display: 40px;     /* a home page greeting */
  --sx-weight-light: 300;      /* display only */
  --sx-weight-regular: 400;
  --sx-weight-medium: 500;     /* emphasis and the current item */
  --sx-leading: 1.45;
  --sx-leading-tight: 1.2;
  --sx-tracking: 0.01em;
  --sx-tracking-caps: 0.06em;

  /* Space: one scale, in steps of four */
  --sx-space-1: 4px; --sx-space-2: 8px; --sx-space-3: 12px; --sx-space-4: 16px;
  --sx-space-5: 20px; --sx-space-6: 24px; --sx-space-8: 32px; --sx-space-10: 40px;

  /* Corners */
  --sx-radius-control: 8px; --sx-radius-box: 10px; --sx-radius-card: 12px; --sx-radius-pill: 999px;

  /* Shadows: only on boxes that sit above the page */
  --sx-shadow-box: 0 1px 2px rgba(18, 20, 58, 0.07), 0 3px 8px rgba(18, 20, 58, 0.05);
  --sx-shadow-card: 0 0 0 1px var(--sx-line-box), 0 1px 2px rgba(18, 20, 58, 0.07), 0 4px 12px rgba(18, 20, 58, 0.05);
  --sx-shadow-menu: 0 0 0 1px var(--sx-line-box), 0 16px 40px rgba(18, 20, 58, 0.16);

  /* Sizes */
  --sx-header-height: 56px;
  --sx-sidebar-width: 248px;
  --sx-control-height: 36px;   /* a minimum: a control grows with its text */
  --sx-chip-height: 32px;
  --sx-logo-size: 20px;        /* header lockup lettering; the tile is 1.25 times this */

  /* Motion */
  --sx-motion-fast: 120ms; --sx-motion-base: 200ms; --sx-ease: cubic-bezier(0.2, 0, 0, 1);

  /* Light values of the three surfaces a dark tool recolours. They sit here, before the dark block,
     so the dark values win when data-theme="dark" is on the root element itself. */
  --sx-panel: #FFFFFF; --sx-raised: #FFFFFF; --sx-well: #FCF9F8;
}

[data-theme="dark"] {
  --sx-bg: #0E1030;
  --sx-surface: #12143A;       /* header and tool rail */
  --sx-panel: #161942;         /* side panels */
  --sx-raised: #1D2050;        /* menus and cards */
  --sx-well: #0A0B22;          /* the area behind the work */
  --sx-text: #FFFFFF;
  --sx-text-2: #C9CBE0;
  --sx-muted: #9699BF;
  --sx-line: #2A2D5C;
  --sx-line-row: #2A2D5C;
  --sx-line-box: #3B3E6E;
  --sx-line-control: #5A5E8C;
  --sx-line-field: #7B7FA8;
  --sx-selected: #252960;
  --sx-primary-bg: #FFFFFF;
  --sx-primary-text: #12143A;
  --sx-attention-text: #F0A77E;
  --sx-attention-mark: #F0A77E;
  --sx-danger: #FF9C94;
  --sx-danger-on: #12143A;
  --sx-scrim: rgba(5, 6, 20, 0.6);
  --sx-focus: #5A81FA;
  --sx-fade: rgba(90, 129, 250, 0);
  --sx-shadow-box: 0 1px 2px rgba(0, 0, 0, 0.35);
  --sx-shadow-card: 0 0 0 1px var(--sx-line-box), 0 1px 2px rgba(0, 0, 0, 0.35);
  --sx-shadow-menu: 0 0 0 1px var(--sx-line-box), 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* Thai: taller lines, no letter spacing, and nothing smaller than 14px. */
:lang(th) { --sx-leading: 1.6; --sx-leading-tight: 1.45; --sx-tracking: 0; --sx-tracking-caps: 0; --sx-size-label: 14px; }

@media (prefers-reduced-motion: reduce) { :root { --sx-motion-fast: 0ms; --sx-motion-base: 0ms; } }
