/* Copyright 2026 CLEALINK TECHNOLOGY CO.,LTD. All rights reserved. */

/* Design tokens. Every colour, size and duration used by the components is defined here.
   Brand colours (--key-*, --primary, ...) are the values for the default key colour; the theme module replaces
   them at runtime. State colours are fixed and never derived from the key colour. */

:root {
  color-scheme: light;

  /* Typography: system fonts only. */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-10: 10px; --fs-11: 11px; --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-15: 15px; --fs-18: 18px; --fs-20: 20px;

  /* Spacing and shape. */
  --sp-1: 2px; --sp-2: 4px; --sp-3: 6px; --sp-4: 8px; --sp-5: 10px; --sp-6: 12px; --sp-7: 16px; --sp-8: 20px; --sp-9: 24px; --sp-10: 32px;
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 12px; --r-2xl: 14px; --r-3xl: 16px;

  /* Motion. */
  --t-fast: 90ms; --t-med: 160ms; --t-slow: 240ms;
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* Brand (default key colour #2C67B2). */
  --key-50: #F0F6FF; --key-100: #DEECFF; --key-200: #BFDBFF; --key-300: #8EBDFD; --key-400: #649DE9;
  --key-500: #4681CE; --key-600: #2C67B2; --key-700: #195094; --key-800: #0C3C75; --key-900: #062A56;
  --primary: #2C67B2; --primary-hover: #1C58A2; --on-primary: #FFFFFF;
  --primary-soft: #F0F6FF; --on-primary-soft: #0C3C75; --link: #2C67B2; --focus: #4681CE; --name: #195094;

  /* Surfaces and text (light). */
  --bg: #F5F7FA; --surface: #FFFFFF; --surface-2: #F5F7FA; --raised: #FFFFFF; --tile: #1B2027;
  --border: #D9DFE7; --border-strong: #C9D1DC; --line: #E6EAF0;
  --text: #17202B; --text-2: #3A4656; --muted: #5B6777; --faint: #7B8797;
  --overlay: rgba(23, 32, 43, .78); --scrim: rgba(15, 18, 22, .45);
  --shadow-1: 0 6px 18px rgba(23, 32, 43, .12); --shadow-2: 0 12px 32px rgba(23, 32, 43, .18);
  --tip-bg: #17202B; --tip-text: #F5F7FA; --tip-muted: #AEB8C6;

  /* State colours (light). */
  --on-bg: #E8EFF8; --on-border: #2C67B2; --on-text: #1F4E8C;
  --red: #E5484D; --red-bg: #FDECEC; --red-text: #8E1B1F; --red-soft: #C9353A;
  --green: #1F9D62; --green-bg: #DDF3E7; --green-text: #17663F;
  --amber: #B7791F; --amber-bg: #FCEFCB; --amber-text: #7A5200;
  --ban-bg: #F5F7FA; --ban-border: #9AA5B4; --ban-text: #5B6777;
  --danger: #E5484D; --on-danger: #FFFFFF; --danger-hover: #D13A40;
  --meter-off: #E6EAF0; --meter-on: #1F9D62;

  /* Lists, tables and timelines of the signed-in pages (light). Slot colours carry white text. */
  --fill: #F0F3F7; --th-bg: #FAFBFC; --row-sel: #F3F8FE; --tag-bg: #E6EAF0; --tag-text: #3A4656;
  --slot-other: #4E6F9C; --slot-past: #667284; --slot-now: #197660; --slot-text: #FFFFFF; --slot-full: #E5A0A2;
  --stripe: #E1E6EE; --danger-line: #E5A0A2; --bar: #2C67B2; --bar-quiet: #C9D1DC;
}

/* Dark values. Applied when the page asks for dark, or follows an OS that does. */
:root[data-theme="dark"], :root[data-theme="hc"] {
  color-scheme: dark;
  --primary: #2C67B2; --primary-hover: #1C58A2; --on-primary: #FFFFFF;
  --primary-soft: #153055; --on-primary-soft: #DEECFF; --link: #8EBDFD; --focus: #649DE9; --name: #8EBDFD;
  --bg: #0F1216; --surface: #12161B; --surface-2: #171B21; --raised: #1F242C; --tile: #1B2027;
  --border: #2A313B; --border-strong: #3A4656; --line: #2A313B;
  --text: #E8ECF1; --text-2: #CBD3DD; --muted: #9AA5B4; --faint: #8D98A8;
  --overlay: rgba(10, 12, 15, .78); --scrim: rgba(5, 7, 9, .6);
  --shadow-1: 0 8px 24px rgba(0, 0, 0, .4); --shadow-2: 0 12px 32px rgba(0, 0, 0, .5);
  --tip-bg: #E8ECF1; --tip-text: #17202B; --tip-muted: #5B6777;
  --on-bg: #16324F; --on-border: #4C8DE0; --on-text: #CFE2FA;
  --red: #E5484D; --red-bg: #4A1D21; --red-text: #FFD5D6; --red-soft: #FF8A8D;
  --green: #3DD68C; --green-bg: #123D2B; --green-text: #B6F2D4;
  --amber: #F5B83D; --amber-bg: #3A2E0F; --amber-text: #FFE2A1;
  --ban-bg: #171B21; --ban-border: #5A6677; --ban-text: #8D98A8;
  --meter-off: #2A313B; --meter-on: #3DD68C;
  --fill: #1F242C; --th-bg: #161A20; --row-sel: #16263A; --tag-bg: #2A313B; --tag-text: #CBD3DD;
  --slot-full: #8A2F35; --stripe: #2A313B; --danger-line: #8A2F35; --bar-quiet: #3A4656;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --primary-soft: #153055; --on-primary-soft: #DEECFF; --link: #8EBDFD; --focus: #649DE9; --name: #8EBDFD;
    --bg: #0F1216; --surface: #12161B; --surface-2: #171B21; --raised: #1F242C;
    --border: #2A313B; --border-strong: #3A4656; --line: #2A313B;
    --text: #E8ECF1; --text-2: #CBD3DD; --muted: #9AA5B4; --faint: #8D98A8;
    --fill: #1F242C; --th-bg: #161A20; --row-sel: #16263A; --tag-bg: #2A313B; --tag-text: #CBD3DD;
    --slot-full: #8A2F35; --stripe: #2A313B; --danger-line: #8A2F35; --bar-quiet: #3A4656;
  }
}

/* High contrast: darker surfaces, brighter text and stronger borders on top of the dark values. */
:root[data-theme="hc"] {
  --bg: #000000; --surface: #050608; --surface-2: #0A0C0F; --raised: #14181E; --tile: #0A0C0F;
  --border: #7B8797; --border-strong: #AEB8C6; --line: #5A6677;
  --text: #FFFFFF; --text-2: #F0F3F7; --muted: #D2D9E2; --faint: #C1C9D4;
  --ban-border: #AEB8C6; --ban-text: #D2D9E2; --ban-bg: #050608;
  --on-text: #E6F0FF; --red-text: #FFE9EA; --green-text: #D9FBEA; --amber-text: #FFF0CC;
  --fill: #14181E; --th-bg: #0A0C0F; --row-sel: #10233B; --tag-bg: #1F242C; --tag-text: #F0F3F7;
  --stripe: #2F3945; --danger-line: #E5484D; --bar-quiet: #7B8797;
}
