/* Fonts (bundled locally, subset by unicode-range) */
@font-face { font-family: 'Prompt'; font-weight: 500; font-display: swap; src: url(../fonts/prompt-thai-500-normal.woff2) format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Prompt'; font-weight: 500; font-display: swap; src: url(../fonts/prompt-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Prompt'; font-weight: 500; font-display: swap; src: url(../fonts/prompt-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Prompt'; font-weight: 600; font-display: swap; src: url(../fonts/prompt-thai-600-normal.woff2) format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Prompt'; font-weight: 600; font-display: swap; src: url(../fonts/prompt-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Prompt'; font-weight: 600; font-display: swap; src: url(../fonts/prompt-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sarabun'; font-weight: 400; font-display: swap; src: url(../fonts/sarabun-thai-400-normal.woff2) format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Sarabun'; font-weight: 400; font-display: swap; src: url(../fonts/sarabun-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Sarabun'; font-weight: 400; font-display: swap; src: url(../fonts/sarabun-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sarabun'; font-weight: 600; font-display: swap; src: url(../fonts/sarabun-thai-600-normal.woff2) format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Sarabun'; font-weight: 600; font-display: swap; src: url(../fonts/sarabun-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Sarabun'; font-weight: 600; font-display: swap; src: url(../fonts/sarabun-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Playfair Display'; font-weight: 600; font-display: swap; src: url(../fonts/playfair-display-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Playfair Display'; font-weight: 600; font-display: swap; src: url(../fonts/playfair-display-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 600; font-display: swap; src: url(../fonts/playfair-display-latin-600-italic.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC; }

:root {
  /* brand */
  --snow: #F4F8FB; --ice: #DCEBF5; --glacier: #3F7CAC; --navy: #14283F; --pine: #2A6F6B; --alpen: #E9967A; --gold: #D9A93A;
  /* semantic (light) */
  --bg: #EEF4F9;
  --bg-a: #DCEBF5; --bg-b: #F7E6DE;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #FFFFFF;
  --surface-2: #E8F1F8;
  --text: #14283F;
  --muted: #44586D;
  --line: rgba(20, 40, 63, 0.11);
  --accent: #2C628E;       /* glacier, darkened for text contrast (6.4:1 on white) */
  --accent-on: #FFFFFF;
  --accent-soft: rgba(63, 124, 172, 0.13);
  --glacier-soft: #C9DDEC;
  --pine-ink: #225B58;
  --alpen-ink: #A9472B;
  --warn-bg: #FFF1E3; --warn-line: #F1C9A2; --warn-ink: #7A3B12;
  --danger: #B3261E;
  --tab-bg: rgba(255, 255, 255, 0.86);
  --shadow: 0 1px 2px rgba(20, 40, 63, 0.06), 0 6px 18px -6px rgba(20, 40, 63, 0.14), 0 22px 40px -24px rgba(20, 40, 63, 0.22);
  --shadow-lg: 0 2px 4px rgba(20, 40, 63, 0.06), 0 18px 48px -12px rgba(20, 40, 63, 0.28);
  --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
  --blur: saturate(160%) blur(18px);

  /* type scale (rem, root = 16/17/19 by setting) */
  --f-ui: 'Prompt', 'Sarabun', system-ui, sans-serif;
  --f-body: 'Sarabun', 'Prompt', system-ui, sans-serif;
  --f-serif: 'Playfair Display', Georgia, serif;
  --fs-xs: 0.8125rem; --fs-sm: 0.875rem; --fs-base: 1rem; --fs-md: 1.125rem; --fs-lg: 1.375rem; --fs-xl: 1.75rem; --fs-2xl: 2.25rem; --fs-3xl: 2.75rem;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;

  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0A1828;
  --bg-a: #12304D; --bg-b: #1B2440;
  --surface: rgba(22, 42, 66, 0.78);
  --surface-solid: #132A42;
  --surface-2: #1B3552;
  --text: #EEF4F9;
  --muted: #AFC2D3;
  --line: rgba(220, 235, 245, 0.11);
  --accent: #8FC1E8;
  --accent-on: #0A1828;
  --accent-soft: rgba(143, 193, 232, 0.14);
  --glacier-soft: #27486A;
  --ice: #21405F;
  --snow: #E4EDF5;
  --pine-ink: #7CCBC3;
  --alpen-ink: #F2B49D;
  --warn-bg: rgba(233, 150, 122, 0.13); --warn-line: rgba(233, 150, 122, 0.4); --warn-ink: #F6C7B2;
  --danger: #FF8A80;
  --tab-bg: rgba(14, 30, 48, 0.88);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px -10px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 18px 50px -12px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

:root[data-size='S'] { font-size: 16px; }
:root, :root[data-size='M'] { font-size: 17px; }
:root[data-size='L'] { font-size: 19px; }
