/* Airline Inbox design tokens (Calm ledger): the only place colours, type scale, spacing, radius, motion,
   z-index and shadows are defined. Every other stylesheet reads these with var(). Do not write raw hex
   colours anywhere else. Light is the default on :root; dark is an explicit :root[data-theme="dark"] block
   (theme.js sets data-theme on <html>, so there is no prefers-color-scheme block here); compact density is
   :root[data-density="compact"]. Loaded first, before base.css. */

/* Breakpoint scale. Media queries cannot read custom properties, so these literal values are the only ones allowed:
   xs 420   landing only: max-width 419.98px
   sm 640   min-width 640px / max-width 639.98px
   md 960   min-width 960px / max-width 959.98px
   lg 1100  min-width 1100px
   xl 1440  max-width 1439.98px */

:root {
  color-scheme: light;
  /* type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: var(--font-sans);
  --mono: var(--font-mono);
  --text-2xs: 0.6875rem;  /* 11 */
  --text-xs: 0.75rem;     /* 12 */
  --text-sm: 0.8125rem;   /* 13 */
  --text-base: 0.875rem;  /* 14 */
  --text-md: 0.9375rem;   /* 15 */
  --text-lg: 1rem;        /* 16 */
  --text-xl: 1.125rem;    /* 18 */
  --text-2xl: 1.375rem;   /* 22 */
  --text-3xl: 1.75rem;    /* 28 */
  --text-4xl: 2.25rem;    /* 36 */
  --text-5xl: clamp(2.25rem, 1.5rem + 2.8vw, 3.5rem);
  --lh-tight: 1.2; --lh-snug: 1.35; --lh-base: 1.45; --lh-relaxed: 1.6;
  --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700;
  --tracking-tight: -0.015em; --tracking-tighter: -0.025em; --tracking-caps: 0.06em;

  /* space (4px grid) */
  --space-0-5: 2px; --space-1: 4px; --space-1-5: 6px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;

  /* radius */
  --radius-xs: 4px; --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px; --radius-xl: 14px; --radius-full: 999px;
  --radius: var(--radius-md);

  /* layout */
  --sidebar-w: 248px; --topbar-h: 56px; --content-max: 1360px; --gutter: 32px;

  /* controls */
  --control-h: 34px; --control-h-sm: 28px; --control-h-lg: 40px;

  /* density: comfortable (default) */
  --row-py: 10px; --row-px: 12px; --table-font: var(--text-base); --list-py: 10px;

  /* motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-1: 100ms; --dur-2: 160ms; --dur-3: 240ms;

  /* z-index scale */
  --z-sticky: 2; --z-topbar: 20; --z-scrim: 30; --z-drawer: 40; --z-popover: 50; --z-toast: 60; --z-skip: 100;

  /* surfaces */
  --bg: #F6F7F9; --surface: #FFFFFF; --surface-2: #F9FAFB; --surface-3: #F1F3F6; --surface-raised: #FFFFFF;
  --row-hover: #F7F8FA; --row-flag: #FFFBF1; --scrim: rgba(15, 18, 24, 0.40);
  /* text */
  --ink: #14181F; --ink-2: #3F4754; --muted: #5B6472; --placeholder: #5F6C77; --ink-inverse: #FFFFFF;
  /* lines */
  --hairline: #ECEEF2; --border: #E2E5EA; --border-strong: #CDD2DA;
  --field-line: #C9CFD7; --field-line-hover: #AEB6C1; --field-line-strong: #858E9A;
  /* accent */
  --accent: #1F63C6; --accent-hover: #1A57B0; --accent-active: #1A51A3; --on-accent: #FFFFFF;
  --accent-icon: #1F63C6; /* icons drawn in the accent colour (outline + its tint keep 3:1 on every surface) */
  --accent-soft: #EAF2FD; --accent-soft-ink: #1A51A3; --accent-ring: rgba(31, 99, 198, 0.22);
  --link: #1A57B0; --focus: #2F74D8;
  /* status: solid / ink (text, icons) / soft (background) / line (border) */
  --good: #12A150; --good-ink: #0B7A3E; --good-soft: #EBF8F0; --good-line: #B3E3C6;
  --warning: #C88400; --warning-ink: #8F4B05; --warning-soft: #FEF6E4; --warning-line: #F6D58C;
  --critical: #D7372B; --critical-ink: #B42318; --critical-soft: #FDF0EF; --critical-line: #F5C2BD;
  --info: #2F74D8; --info-ink: #1A57B0; --info-soft: #EDF4FE; --info-line: #BAD3F7;
  --neutral: #7A8391; --neutral-ink: #424A57; --neutral-soft: #F1F3F6; --neutral-line: #DCE0E6;
  --violet: #7A55E0; --violet-ink: #5B36C4; --violet-soft: #F3F0FE; --violet-line: #D5CBFA;
  --danger: #C9302C; --danger-hover: #B42318; --on-danger: #FFFFFF;
  /* sidebar */
  --side-bg: #F0F2F5; --side-ink: #3F4754; --side-muted: #6E7785; --side-ink-muted: #5B6472; --side-hover: rgba(20, 24, 31, 0.05);
  --side-active: #FFFFFF; --side-active-ink: #14181F; --side-line: #E2E5EA;
  /* charts + mail types (dots, bars; all ≥ 3:1 on surface) */
  --seq: #2F74D8; --seq-track: #ECEFF3;
  --t-invoice: #2F74D8; --t-credit_note: #E2622B; --t-e_ticket: #0E8FA8; --t-schedule_change: #BD8100;
  --t-cancellation: #D6457A; --t-refund: #2E9440; --t-check_in: #7A55E0; --t-other: #7F8794;
  /* illustrations (empty states, sign-in, landing hero): colours for the ill-* classes */
  --ill-bg: #EAF1FB;
  --ill-paper: #FFFFFF;
  --ill-paper-2: #F3F6FA;
  --ill-detail: #3F4754;
  --ill-muted: #D3DBE6;
  --ill-accent: #1F63C6;
  --ill-accent-soft: #DCE8FA;
  --ill-teal: #0F9AA8;
  --ill-teal-soft: #D3F0F2;
  --ill-good: #1E9E62;
  --ill-good-soft: #D9F2E5;
  --ill-warn: #E09B1A;
  --ill-warn-soft: #FBEBCB;
  --ill-shadow: rgba(16, 24, 40, 0.12);
  --ill-on-accent: #FFFFFF;
  --ill-stroke: #5B6472;
  --ill-stroke-soft: #B9C3D0;
  --ill-g-accent-a: #4A8DEB;
  --ill-g-accent-b: #1A52AE;
  --ill-g-paper-a: #FFFFFF;
  --ill-g-paper-b: #E9EEF6;
  --ill-g-bg-a: #DCE8FA;
  --ill-g-bg-b: #F5F8FD;
  --ill-g-teal-a: #35C2CE;
  --ill-g-teal-b: #0E8794;
  --ill-g-good: #2DB673;
  --ill-g-warn: #F2B33D;
  --ill-g-glow: #5E9BF0;
  --ill-g-shadow: #101828;
  /* icon tint: opacity of the soft fill (.duo) behind the outline; tuned per theme so the outline keeps 3:1 */
  --icon-tint: 0.24;
  /* elevation levels: 0 = hairline border only (tables, sections); 1 = --shadow-sm (cards);
     2 = --shadow-md (popovers, menus, dropdowns); 3 = --shadow-lg (drawer, dialogs) */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 2px 6px -1px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 2px 4px -1px rgba(16, 24, 40, 0.06), 0 12px 24px -6px rgba(16, 24, 40, 0.12);
  --shadow-lg: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 24px 48px -12px rgba(16, 24, 40, 0.22);
  --shadow: var(--shadow-sm);
  --card-highlight: 0 0 #0000;
  --title-rule: linear-gradient(90deg, rgba(31, 99, 198, 0.45), var(--hairline) 32%, transparent);
  /* scroll cue colour for .table-wrap and .tabs edges */
  --scroll-shadow: rgba(16, 24, 40, 0.18);
  /* select chevron (data: URIs are allowed by img-src) */
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6472' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9L12 15L18 9'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D0F13; --surface: #14171C; --surface-2: #181B21; --surface-3: #1E2229; --surface-raised: #1A1E24;
  --row-hover: #191D23; --row-flag: #1C1A12; --scrim: rgba(0, 0, 0, 0.60);
  --ink: #E8EBF0; --ink-2: #BAC2CD; --muted: #9099A7; --placeholder: #868F9C; --ink-inverse: #0D0F13;
  --hairline: #1D2128; --border: #262B33; --border-strong: #353C46;
  --field-line: #2E343D; --field-line-hover: #414854; --field-line-strong: #5F6875;
  --accent: #2F6FD0; --accent-hover: #3573D6; --accent-active: #2A66C4; --on-accent: #FFFFFF;
  --accent-icon: #5E9BF0;
  --accent-soft: #14243A; --accent-soft-ink: #9CC3FA; --accent-ring: rgba(94, 155, 240, 0.35);
  --link: #7DB2F7; --focus: #5E9BF0;
  --good: #2FB866; --good-ink: #5FD38E; --good-soft: #0F2519; --good-line: #1E4A31;
  --warning: #E3A21A; --warning-ink: #F0BE5A; --warning-soft: #2A1F0B; --warning-line: #57401A;
  --critical: #E5534B; --critical-ink: #FF948A; --critical-soft: #2E1413; --critical-line: #5C2723;
  --info: #5E9BF0; --info-ink: #8DBBF8; --info-soft: #122238; --info-line: #24446E;
  --neutral: #7C8592; --neutral-ink: #C0C7D1; --neutral-soft: #1E2229; --neutral-line: #333A44;
  --violet: #9A7CF0; --violet-ink: #BBA7FA; --violet-soft: #1F1937; --violet-line: #3D3270;
  --danger: #C9372F; --danger-hover: #B73129; --on-danger: #FFFFFF;
  --side-bg: #0A0C0F; --side-ink: #BAC2CD; --side-muted: #7C8592; --side-ink-muted: #7C8592; --side-hover: rgba(255, 255, 255, 0.05);
  --side-active: #1A1E24; --side-active-ink: #E8EBF0; --side-line: #1D2128;
  --seq: #5E9BF0; --seq-track: #1E2229;
  --t-invoice: #5E9BF0; --t-credit_note: #EE7A45; --t-e_ticket: #31B6CF; --t-schedule_change: #E0A82E;
  --t-cancellation: #EA6A98; --t-refund: #4CB860; --t-check_in: #9A7CF0; --t-other: #7C8592;
  /* illustrations */
  --ill-bg: #16233A;
  --ill-paper: #1E2530;
  --ill-paper-2: #262E3B;
  --ill-detail: #C3CAD5;
  --ill-muted: #3A4454;
  --ill-accent: #4C8DEB;
  --ill-accent-soft: #1A2D4B;
  --ill-teal: #2CC0CD;
  --ill-teal-soft: #123A41;
  --ill-good: #36B87A;
  --ill-good-soft: #133526;
  --ill-warn: #E8AE45;
  --ill-warn-soft: #3A2C12;
  --ill-shadow: rgba(0, 0, 0, 0.5);
  --ill-on-accent: #FFFFFF;
  --ill-stroke: #8E98A8;
  --ill-stroke-soft: #3E4858;
  --ill-g-accent-a: #66A3F5;
  --ill-g-accent-b: #2257B4;
  --ill-g-paper-a: #2A3240;
  --ill-g-paper-b: #1A2029;
  --ill-g-bg-a: #1B2B45;
  --ill-g-bg-b: #10151D;
  --ill-g-teal-a: #3FCFDA;
  --ill-g-teal-b: #158E9A;
  --ill-g-good: #3CC584;
  --ill-g-warn: #F0BC5A;
  --ill-g-glow: #5E9BF0;
  --ill-g-shadow: #000000;
  --icon-tint: 0.26;
  --shadow-xs: none;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 6px -1px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 2px 4px -1px rgba(0, 0, 0, 0.5), 0 12px 28px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 4px 10px -2px rgba(0, 0, 0, 0.5), 0 28px 56px -12px rgba(0, 0, 0, 0.7);
  --card-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --title-rule: linear-gradient(90deg, rgba(94, 155, 240, 0.5), var(--hairline) 32%, transparent);
  --scroll-shadow: rgba(0, 0, 0, 0.6);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239099A7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9L12 15L18 9'/%3E%3C/svg%3E");
}

:root[data-density="compact"] { --row-py: 6px; --row-px: 10px; --table-font: var(--text-sm); --list-py: 7px; }

@media (max-width: 959.98px) { :root { --gutter: 20px; } }
@media (max-width: 639.98px) { :root { --gutter: 16px; --topbar-h: 52px; } }
