:root {
  --container: 1200px;
  --container-narrow: 820px;
  --space-xs: .5rem;
  --space-sm: .75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --transition-fast: 160ms cubic-bezier(.4, 0, .2, 1);
  --transition-normal: 240ms cubic-bezier(.4, 0, .2, 1);
  --transition-slow: 400ms cubic-bezier(.4, 0, .2, 1);
}

:root,
[data-theme="clean"] {
  --bg-secondary: #f5f7f9;
  --surface-hover: #eceff3;
  --border-hover: #0f6b5c;
  --accent-secondary: #0f6b5c;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px -12px rgba(16,24,40,.18);
  --shadow-lg: 0 12px 32px -14px rgba(16,24,40,.28);
  --glow: none;
  --input-bg: #ffffff;
  --input-border: #d7dde5;
  --focus-ring: color-mix(in srgb, #0f6b5c 28%, transparent);
  --header-bg: color-mix(in srgb, #ffffff 86%, transparent);
  --header-border: #d7dde5;
  --hero-bg: #f5f7f9;
  --hero-glow-1: transparent;
  --hero-glow-2: transparent;
  --decor-pattern: none;
  --decor-size: 0;
  --decor-opacity: 0;
  --heading-spacing: -.01em;
  --heading-weight: 600;
  --eyebrow-transform: none;
  --card-bg: #f5f7f9;
  --card-radius: 10px;
  --card-lift: -4px;
  --mock-bg: #eceff3;
  --mock-bar: #d7dde5;
  --bg: #ffffff;
  --surface: #f5f7f9;
  --surface-2: #eceff3;
  --text: #1c2230;
  --muted: #55607a;
  --primary: #0f6b5c;
  --primary-hover: #0b5145;
  --primary-active: #083c33;
  --on-primary: #ffffff;
  --secondary: #eceff3;
  --on-secondary: #1c2230;
  --border: #d7dde5;
  --focus: #0f6b5c;
  --font-heading: 'Noto Serif Thai', serif;
  --font-body: 'IBM Plex Sans Thai', sans-serif;
  --radius: 10px;
  --btn-radius: 999px;
  --btn-border-width: 1px;
  --btn-shadow: none;
  --btn-shadow-active: none;
  --btn-translate-active: 0;
  --btn-primary-bg: #0f6b5c;
  --hero-text: #1c2230;
  --hero-muted: #55607a;
  --hero-border: #d7dde5;
  --hero-surface: #eceff3;
}

[data-theme="nature"] {
  --bg-secondary: #e7ede3;
  --surface-hover: #dbe4d5;
  --border-hover: #3d6b35;
  --accent-secondary: #3d6b35;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px -12px rgba(16,24,40,.18);
  --shadow-lg: 0 12px 32px -14px rgba(16,24,40,.28);
  --glow: none;
  --input-bg: #ffffff;
  --input-border: #c2cfba;
  --focus-ring: color-mix(in srgb, #3d6b35 28%, transparent);
  --header-bg: color-mix(in srgb, #f2f5f0 86%, transparent);
  --header-border: #c2cfba;
  --hero-bg: #e7ede3;
  --hero-glow-1: transparent;
  --hero-glow-2: transparent;
  --decor-pattern: none;
  --decor-size: 0;
  --decor-opacity: 0;
  --heading-spacing: -.01em;
  --heading-weight: 600;
  --eyebrow-transform: none;
  --card-bg: #e7ede3;
  --card-radius: 14px;
  --card-lift: -4px;
  --mock-bg: #dbe4d5;
  --mock-bar: #c2cfba;
  --bg: #f2f5f0;
  --surface: #e7ede3;
  --surface-2: #dbe4d5;
  --text: #1f2a22;
  --muted: #4c5a4f;
  --primary: #3d6b35;
  --primary-hover: #325829;
  --primary-active: #274520;
  --on-primary: #ffffff;
  --secondary: #dbe4d5;
  --on-secondary: #1f2a22;
  --border: #c2cfba;
  --focus: #3d6b35;
  --font-heading: 'Mitr', sans-serif;
  --font-body: 'Sarabun', sans-serif;
  --radius: 14px;
  --btn-radius: 14px;
  --btn-border-width: 1px;
  --btn-shadow: inset 0 -4px 0 rgba(0,0,0,.28);
  --btn-shadow-active: inset 0 -1px 0 rgba(0,0,0,.28);
  --btn-translate-active: 3px;
  --btn-primary-bg: #3d6b35;
  --hero-text: #1f2a22;
  --hero-muted: #4c5a4f;
  --hero-border: #c2cfba;
  --hero-surface: #dbe4d5;
}

[data-theme="midnight"] {
  --bg-secondary: #1a2439;
  --surface-hover: #223049;
  --border-hover: #e3b35b;
  --accent-secondary: #e3b35b;
  --shadow: 0 2px 6px rgba(0,0,0,.4), 0 16px 40px -18px rgba(0,0,0,.7);
  --shadow-lg: 0 24px 60px -22px rgba(0,0,0,.8);
  --glow: none;
  --input-bg: #1a2439;
  --input-border: #2e3d59;
  --focus-ring: color-mix(in srgb, #e3b35b 28%, transparent);
  --header-bg: rgba(18,26,43,.86);
  --header-border: #2e3d59;
  --hero-bg: #1a2439;
  --hero-glow-1: transparent;
  --hero-glow-2: transparent;
  --decor-pattern: none;
  --decor-size: 0;
  --decor-opacity: 0;
  --heading-spacing: -.01em;
  --heading-weight: 600;
  --eyebrow-transform: none;
  --card-bg: #1a2439;
  --card-radius: 8px;
  --card-lift: -4px;
  --mock-bg: #223049;
  --mock-bar: #2e3d59;
  --bg: #121a2b;
  --surface: #1a2439;
  --surface-2: #223049;
  --text: #e8ecf4;
  --muted: #a9b5cc;
  --primary: #e3b35b;
  --primary-hover: #f0c477;
  --primary-active: #c99741;
  --on-primary: #1a1406;
  --secondary: #223049;
  --on-secondary: #e8ecf4;
  --border: #2e3d59;
  --focus: #e3b35b;
  --font-heading: 'Prompt', sans-serif;
  --font-body: 'Anuphan', sans-serif;
  --radius: 8px;
  --btn-radius: 8px;
  --btn-border-width: 1px;
  --btn-shadow: none;
  --btn-shadow-active: none;
  --btn-translate-active: 0;
  --btn-primary-bg: #e3b35b;
  --hero-text: #e8ecf4;
  --hero-muted: #a9b5cc;
  --hero-border: #2e3d59;
  --hero-surface: #223049;
}

[data-theme="pop"] {
  --bg-secondary: #ffffff;
  --surface-hover: #e9e3ff;
  --border-hover: #5b3df5;
  --accent-secondary: #5b3df5;
  --shadow: 4px 4px 0 #1a1633;
  --shadow-lg: 7px 7px 0 #1a1633;
  --glow: none;
  --input-bg: #ffffff;
  --input-border: #1a1633;
  --focus-ring: color-mix(in srgb, #5b3df5 28%, transparent);
  --header-bg: color-mix(in srgb, #f4f1ff 86%, transparent);
  --header-border: #1a1633;
  --hero-bg: #ffffff;
  --hero-glow-1: transparent;
  --hero-glow-2: transparent;
  --decor-pattern: none;
  --decor-size: 0;
  --decor-opacity: 0;
  --heading-spacing: -.01em;
  --heading-weight: 600;
  --eyebrow-transform: none;
  --card-bg: #ffffff;
  --card-radius: 12px;
  --card-lift: -3px;
  --mock-bg: #e9e3ff;
  --mock-bar: #1a1633;
  --bg: #f4f1ff;
  --surface: #ffffff;
  --surface-2: #e9e3ff;
  --text: #1a1633;
  --muted: #4a4470;
  --primary: #5b3df5;
  --primary-hover: #4a2fd6;
  --primary-active: #3b24ad;
  --on-primary: #ffffff;
  --secondary: #ffd23f;
  --on-secondary: #1a1633;
  --border: #1a1633;
  --focus: #5b3df5;
  --font-heading: 'Kanit', sans-serif;
  --font-body: 'K2D', sans-serif;
  --radius: 12px;
  --btn-radius: 12px;
  --btn-border-width: 2px;
  --btn-shadow: 4px 4px 0 #1a1633;
  --btn-shadow-active: 0 0 0 #1a1633;
  --btn-translate-active: 4px;
  --btn-primary-bg: #5b3df5;
  --hero-text: #1a1633;
  --hero-muted: #4a4470;
  --hero-border: #1a1633;
  --hero-surface: #e9e3ff;
}

[data-theme="formal"] {
  --bg-secondary: #f1f1ed;
  --surface-hover: #e6e6e0;
  --border-hover: #7a1f2b;
  --accent-secondary: #7a1f2b;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px -12px rgba(16,24,40,.18);
  --shadow-lg: 0 12px 32px -14px rgba(16,24,40,.28);
  --glow: none;
  --input-bg: #ffffff;
  --input-border: #cfcfc7;
  --focus-ring: color-mix(in srgb, #7a1f2b 28%, transparent);
  --header-bg: color-mix(in srgb, #fafaf8 86%, transparent);
  --header-border: #cfcfc7;
  --hero-bg: #f1f1ed;
  --hero-glow-1: transparent;
  --hero-glow-2: transparent;
  --decor-pattern: none;
  --decor-size: 0;
  --decor-opacity: 0;
  --heading-spacing: 0;
  --heading-weight: 600;
  --eyebrow-transform: uppercase;
  --card-bg: #f1f1ed;
  --card-radius: 2px;
  --card-lift: -4px;
  --mock-bg: #e6e6e0;
  --mock-bar: #cfcfc7;
  --bg: #fafaf8;
  --surface: #f1f1ed;
  --surface-2: #e6e6e0;
  --text: #1f1f1f;
  --muted: #585856;
  --primary: #7a1f2b;
  --primary-hover: #611821;
  --primary-active: #4a1219;
  --on-primary: #ffffff;
  --secondary: #e6e6e0;
  --on-secondary: #1f1f1f;
  --border: #cfcfc7;
  --focus: #7a1f2b;
  --font-heading: 'Trirong', serif;
  --font-body: 'Sarabun', sans-serif;
  --radius: 2px;
  --btn-radius: 2px;
  --btn-border-width: 1px;
  --btn-shadow: none;
  --btn-shadow-active: none;
  --btn-translate-active: 0;
  --btn-primary-bg: #7a1f2b;
  --hero-text: #1f1f1f;
  --hero-muted: #585856;
  --hero-border: #cfcfc7;
  --hero-surface: #e6e6e0;
}

[data-theme="royal-gold"] {
  --bg: #070707;
  --bg-secondary: #0d0d0d;
  --surface: rgba(255,255,255,.045);
  --surface-2: rgba(255,255,255,.075);
  --surface-hover: rgba(255,255,255,.085);
  --card-bg: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  --text: #f7f5f0;
  --muted: #b0a99c;
  --primary: #e3b64a;
  --primary-hover: #f0cb74;
  --primary-active: #c89a34;
  --on-primary: #1a1206;
  --accent-secondary: #fff1b8;
  --secondary: rgba(226,184,75,.10);
  --on-secondary: #f5d77a;
  --border: rgba(226,184,75,.22);
  --border-hover: rgba(226,184,75,.55);
  --focus: #e3b64a;
  --focus-ring: rgba(226,184,75,.35);
  --shadow: 0 2px 8px rgba(0,0,0,.6), 0 18px 45px -20px rgba(0,0,0,.9);
  --shadow-lg: 0 28px 70px -24px rgba(0,0,0,.95);
  --glow: 0 10px 30px rgba(218,170,50,.18);
  --input-bg: rgba(255,255,255,.04);
  --input-border: rgba(226,184,75,.28);
  --header-bg: rgba(7,7,7,.72);
  --header-border: rgba(226,184,75,.16);
  --hero-bg: #070707;
  --hero-glow-1: radial-gradient(circle at 72% 28%, rgba(218,170,50,.16), transparent 46%);
  --hero-glow-2: radial-gradient(circle at 12% 78%, rgba(245,215,122,.07), transparent 42%);
  --decor-pattern: radial-gradient(rgba(226,184,75,.16) 1px, transparent 1px);
  --decor-size: 26px 26px;
  --decor-opacity: .5;
  --font-heading: 'Taviraj', serif;
  --font-body: 'Sarabun', sans-serif;
  --heading-spacing: .005em;
  --heading-weight: 600;
  --eyebrow-transform: uppercase;
  --radius: 14px;
  --card-radius: 16px;
  --btn-radius: 12px;
  --btn-border-width: 1px;
  --btn-shadow: 0 10px 30px rgba(218,170,50,.15);
  --btn-shadow-active: 0 4px 14px rgba(218,170,50,.18);
  --btn-translate-active: 0;
  --btn-primary-bg: linear-gradient(135deg, #f0cb74, #d9a928 55%, #b8871c);
  --card-lift: -4px;
  --mock-bg: rgba(255,255,255,.05);
  --mock-bar: rgba(226,184,75,.3);
  --hero-text: #f7f5f0;
  --hero-muted: #b0a99c;
  --hero-border: rgba(226,184,75,.22);
  --hero-surface: rgba(255,255,255,.075);
}

[data-theme="neon-cyber"] {
  --bg: #050714;
  --bg-secondary: #090d1d;
  --surface: rgba(15,20,40,.55);
  --surface-2: rgba(22,28,56,.72);
  --surface-hover: rgba(28,34,68,.8);
  --card-bg: linear-gradient(150deg, rgba(20,26,54,.72), rgba(10,14,32,.55));
  --text: #e9edfb;
  --muted: #9fa9cc;
  --primary: #c084fc;
  --primary-hover: #d8b4fe;
  --primary-active: #a855f7;
  --on-primary: #0b0620;
  --accent-secondary: #38bdf8;
  --secondary: rgba(124,58,237,.16);
  --on-secondary: #d8b4fe;
  --border: rgba(124,100,255,.22);
  --border-hover: rgba(168,85,247,.6);
  --focus: #38bdf8;
  --focus-ring: rgba(56,189,248,.35);
  --shadow: 0 2px 10px rgba(0,0,0,.5), 0 20px 50px -22px rgba(8,12,40,.9);
  --shadow-lg: 0 30px 70px -26px rgba(10,6,40,.95);
  --glow: 0 10px 34px rgba(124,58,237,.3);
  --input-bg: rgba(15,20,40,.7);
  --input-border: rgba(124,100,255,.3);
  --header-bg: rgba(5,7,20,.7);
  --header-border: rgba(124,100,255,.18);
  --hero-bg: #050714;
  --hero-glow-1: radial-gradient(circle at 16% 26%, rgba(124,58,237,.30), transparent 45%);
  --hero-glow-2: radial-gradient(circle at 84% 34%, rgba(6,182,212,.22), transparent 44%);
  --decor-pattern: linear-gradient(rgba(124,100,255,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(124,100,255,.16) 1px, transparent 1px);
  --decor-size: 40px 40px;
  --decor-opacity: .55;
  --font-heading: 'Chakra Petch', sans-serif;
  --font-body: 'Bai Jamjuree', sans-serif;
  --heading-spacing: .01em;
  --heading-weight: 600;
  --eyebrow-transform: uppercase;
  --radius: 14px;
  --card-radius: 16px;
  --btn-radius: 12px;
  --btn-border-width: 1px;
  --btn-shadow: 0 10px 30px rgba(124,58,237,.28);
  --btn-shadow-active: 0 4px 16px rgba(124,58,237,.3);
  --btn-translate-active: 0;
  --btn-primary-bg: linear-gradient(135deg, #7c3aed, #6d28d9 45%, #0e7490);
  --card-lift: -4px;
  --mock-bg: rgba(18,24,50,.85);
  --mock-bar: rgba(124,100,255,.4);
  --hero-text: #e9edfb;
  --hero-muted: #9fa9cc;
  --hero-border: rgba(124,100,255,.22);
  --hero-surface: rgba(22,28,56,.72);
}

[data-theme="emerald-premium"] {
  --bg: #03100c;
  --bg-secondary: #061713;
  --surface: rgba(16,185,129,.06);
  --surface-2: rgba(16,185,129,.10);
  --surface-hover: rgba(16,185,129,.14);
  --card-bg: linear-gradient(155deg, rgba(9,32,26,.9), rgba(3,16,12,.75));
  --text: #eaf5f0;
  --muted: #9cb5aa;
  --primary: #34d399;
  --primary-hover: #6ee7b7;
  --primary-active: #10b981;
  --on-primary: #022c22;
  --accent-secondary: #d6b85a;
  --secondary: rgba(214,184,90,.12);
  --on-secondary: #e5cd86;
  --border: rgba(52,211,153,.18);
  --border-hover: rgba(52,211,153,.5);
  --focus: #34d399;
  --focus-ring: rgba(52,211,153,.32);
  --shadow: 0 2px 8px rgba(0,0,0,.45), 0 18px 44px -20px rgba(0,20,14,.9);
  --shadow-lg: 0 26px 64px -24px rgba(0,24,16,.95);
  --glow: 0 10px 30px rgba(16,185,129,.22);
  --input-bg: rgba(9,32,26,.7);
  --input-border: rgba(52,211,153,.26);
  --header-bg: rgba(3,16,12,.74);
  --header-border: rgba(52,211,153,.14);
  --hero-bg: #03100c;
  --hero-glow-1: radial-gradient(circle at 26% 24%, rgba(16,185,129,.22), transparent 46%);
  --hero-glow-2: radial-gradient(circle at 80% 70%, rgba(214,184,90,.12), transparent 42%);
  --decor-pattern: repeating-linear-gradient(45deg, rgba(52,211,153,.10) 0 1px, transparent 1px 22px);
  --decor-size: auto;
  --decor-opacity: .6;
  --font-heading: 'Pridi', serif;
  --font-body: 'Niramit', sans-serif;
  --heading-spacing: 0;
  --heading-weight: 600;
  --eyebrow-transform: none;
  --radius: 12px;
  --card-radius: 14px;
  --btn-radius: 10px;
  --btn-border-width: 1px;
  --btn-shadow: 0 10px 28px rgba(16,185,129,.2);
  --btn-shadow-active: 0 4px 14px rgba(16,185,129,.24);
  --btn-translate-active: 0;
  --btn-primary-bg: linear-gradient(135deg, #34d399, #10b981 55%, #047857);
  --card-lift: -4px;
  --mock-bg: rgba(9,32,26,.9);
  --mock-bar: rgba(52,211,153,.35);
  --hero-text: #eaf5f0;
  --hero-muted: #9cb5aa;
  --hero-border: rgba(52,211,153,.18);
  --hero-surface: rgba(16,185,129,.10);
}

[data-theme="red-dragon"] {
  --bg: #0d0505;
  --bg-secondary: #160707;
  --surface: rgba(255,255,255,.045);
  --surface-2: rgba(220,38,38,.12);
  --surface-hover: rgba(220,38,38,.18);
  --card-bg: linear-gradient(150deg, rgba(33,10,8,.95), rgba(13,5,5,.8));
  --text: #faf0ee;
  --muted: #bfa6a2;
  --primary: #f87171;
  --primary-hover: #fca5a5;
  --primary-active: #ef4444;
  --on-primary: #2b0605;
  --accent-secondary: #f59e0b;
  --secondary: rgba(245,158,11,.14);
  --on-secondary: #fbbf24;
  --border: rgba(239,68,68,.24);
  --border-hover: rgba(248,113,113,.62);
  --focus: #f59e0b;
  --focus-ring: rgba(245,158,11,.38);
  --shadow: 0 2px 10px rgba(0,0,0,.55), 0 20px 48px -20px rgba(40,4,4,.9);
  --shadow-lg: 0 28px 66px -24px rgba(50,6,6,.95);
  --glow: 0 10px 32px rgba(220,38,38,.28);
  --input-bg: rgba(33,10,8,.7);
  --input-border: rgba(239,68,68,.3);
  --header-bg: rgba(13,5,5,.74);
  --header-border: rgba(239,68,68,.18);
  --hero-bg: #0d0505;
  --hero-glow-1: radial-gradient(circle at 24% 30%, rgba(220,38,38,.28), transparent 46%);
  --hero-glow-2: radial-gradient(circle at 78% 26%, rgba(245,158,11,.18), transparent 44%);
  --decor-pattern: repeating-radial-gradient(circle at 50% 50%, rgba(245,158,11,.10) 0 1px, transparent 1px 30px);
  --decor-size: auto;
  --decor-opacity: .55;
  --font-heading: 'Fahkwang', sans-serif;
  --font-body: 'Krub', sans-serif;
  --heading-spacing: .005em;
  --heading-weight: 600;
  --eyebrow-transform: uppercase;
  --radius: 12px;
  --card-radius: 14px;
  --btn-radius: 10px;
  --btn-border-width: 1px;
  --btn-shadow: 0 10px 30px rgba(220,38,38,.26);
  --btn-shadow-active: 0 4px 14px rgba(220,38,38,.3);
  --btn-translate-active: 0;
  --btn-primary-bg: linear-gradient(135deg, #ef4444, #dc2626 50%, #c2410c);
  --card-lift: -4px;
  --mock-bg: rgba(33,10,8,.92);
  --mock-bar: rgba(239,68,68,.4);
  --hero-text: #faf0ee;
  --hero-muted: #bfa6a2;
  --hero-border: rgba(239,68,68,.24);
  --hero-surface: rgba(220,38,38,.12);
}

[data-theme="ice-crystal"] {
  --bg: #f5faff;
  --bg-secondary: #eaf5ff;
  --surface: #ffffff;
  --surface-2: #e4f0fb;
  --surface-hover: #f0f7ff;
  --card-bg: linear-gradient(165deg, #ffffff, #f3f9ff);
  --text: #0b2942;
  --muted: #456f8d;
  --primary: #0369a1;
  --primary-hover: #075985;
  --primary-active: #0c4a6e;
  --on-primary: #ffffff;
  --accent-secondary: #0e7490;
  --secondary: #dbeefc;
  --on-secondary: #0b2942;
  --border: rgba(14,165,233,.22);
  --border-hover: rgba(2,132,199,.55);
  --focus: #0284c7;
  --focus-ring: rgba(2,132,199,.3);
  --shadow: 0 1px 2px rgba(12,74,110,.06), 0 14px 34px -16px rgba(12,74,110,.28);
  --shadow-lg: 0 26px 60px -22px rgba(12,74,110,.35);
  --glow: 0 10px 30px rgba(2,132,199,.18);
  --input-bg: #ffffff;
  --input-border: rgba(14,165,233,.3);
  --header-bg: rgba(245,250,255,.82);
  --header-border: rgba(14,165,233,.2);
  --hero-bg: #04101f;
  --hero-glow-1: radial-gradient(circle at 78% 24%, rgba(56,189,248,.28), transparent 48%);
  --hero-glow-2: radial-gradient(circle at 16% 72%, rgba(6,182,212,.18), transparent 44%);
  --decor-pattern: radial-gradient(rgba(125,211,252,.28) 1px, transparent 1px);
  --decor-size: 30px 30px;
  --decor-opacity: .5;
  --font-heading: 'Noto Sans Thai', sans-serif;
  --font-body: 'KoHo', sans-serif;
  --heading-spacing: -.015em;
  --heading-weight: 700;
  --eyebrow-transform: uppercase;
  --radius: 14px;
  --card-radius: 18px;
  --btn-radius: 12px;
  --btn-border-width: 1px;
  --btn-shadow: 0 8px 22px rgba(2,132,199,.18);
  --btn-shadow-active: 0 3px 10px rgba(2,132,199,.2);
  --btn-translate-active: 0;
  --btn-primary-bg: linear-gradient(135deg, #0284c7, #0369a1 55%, #0e7490);
  --card-lift: -4px;
  --mock-bg: #eef6fd;
  --mock-bar: rgba(14,165,233,.3);
  --hero-text: #f2f9ff;
  --hero-muted: #a8c6dd;
  --hero-border: rgba(125,211,252,.25);
  --hero-surface: rgba(255,255,255,.07);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  word-break: break-word;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-spacing);
  line-height: 1.25;
  margin: 0 0 .6em;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); line-height: 1.12; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.15rem); margin-top: 0; }
h3 { font-size: clamp(1.12rem, 1.05rem + .5vw, 1.35rem); margin-top: 1.6em; }

p { margin: 0 0 1.15em; }
ul, ol { margin: 0 0 1.15em; padding-inline-start: 1.4em; }
li { margin-bottom: .5em; }
li::marker { color: var(--primary); }
strong { font-weight: 600; color: var(--text); }

a { color: var(--primary); text-underline-offset: 3px; transition: color var(--transition-fast); }
a:hover { color: var(--primary-hover); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; display: block; }

.wrap { width: min(100% - 2.5rem, var(--container-narrow)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--primary); color: var(--on-primary);
  padding: .9rem 1.3rem; border-radius: 0 0 var(--radius-md) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* =========================================================
   ปุ่ม
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 22px;
  font-family: var(--font-heading); font-size: 1rem; font-weight: 600;
  line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer; position: relative;
  border: var(--btn-border-width) solid transparent;
  border-radius: var(--btn-radius);
  background: var(--btn-primary-bg); color: var(--on-primary);
  box-shadow: var(--btn-shadow);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal),
              background-color var(--transition-normal), border-color var(--transition-normal),
              color var(--transition-normal);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--glow), var(--btn-shadow); color: var(--on-primary); }
.btn:active {
  transform: translateY(var(--btn-translate-active)) scale(.985);
  box-shadow: var(--btn-shadow-active);
  background: var(--primary-active);
}
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .5; cursor: not-allowed; pointer-events: none;
  box-shadow: none; transform: none; filter: grayscale(.3);
}

.btn-secondary {
  background: var(--secondary); color: var(--on-secondary);
  border-color: var(--border);
  box-shadow: none;
}
.btn-secondary:hover {
  background: var(--surface-hover); color: var(--on-secondary);
  border-color: var(--border-hover);
  box-shadow: none;
}
.btn-secondary:active { background: var(--surface-2); color: var(--on-secondary); }

.btn-outline {
  background: transparent; color: var(--primary);
  border-color: var(--border-hover); box-shadow: none;
}
.btn-outline:hover { background: var(--secondary); color: var(--primary-hover); box-shadow: none; }
.btn-outline:active { background: var(--surface-2); color: var(--primary); }

.btn-ghost {
  background: transparent; color: var(--text);
  border-color: transparent; box-shadow: none;
}
.btn-ghost:hover { background: var(--surface); color: var(--primary); box-shadow: none; }
.btn-ghost:active { background: var(--surface-2); color: var(--primary); }

.btn-sm { min-height: 48px; padding: 0 16px; font-size: .92rem; }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 1.06rem; }
.btn-icon { padding: 0; width: 48px; min-height: 48px; }
.btn-icon svg { width: 22px; height: 22px; }

.cta-group { display: flex; flex-wrap: wrap; gap: .85rem; margin: 2.2rem 0; }
.cta-group.center { justify-content: center; }

/* =========================================================
   หัวเว็บ
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: background-color var(--transition-normal), border-color var(--transition-normal),
              box-shadow var(--transition-normal);
}
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.site-header.is-scrolled {
  border-bottom-color: var(--header-border);
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .7rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-heading); font-weight: 600; font-size: 1.14rem;
  color: var(--text); text-decoration: none;
  min-height: 48px; min-width: 0; flex-shrink: 1;
}
.brand:hover { color: var(--text); }
.brand-logo { height: 36px; width: auto; flex-shrink: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.header-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.header-cta { display: flex; gap: .5rem; }
.btn-compact { min-height: 48px; padding: 0 16px; font-size: .94rem; }

.nav-toggle { display: none; }

.header-nav-row { border-top: 1px solid var(--header-border); }
.site-nav ul {
  display: flex; gap: 0 1.5rem; list-style: none; margin: 0; padding: 0;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 48px;
  color: var(--muted); text-decoration: none; font-weight: 500;
  white-space: nowrap; font-size: .96rem; position: relative;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--primary); transform: scaleX(0); transform-origin: left;
  transition: transform var(--transition-normal);
}
.site-nav a:hover { color: var(--primary); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--primary); }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: clamp(2.5rem, 1.5rem + 4vw, 5.5rem) 0 clamp(3rem, 2rem + 4vw, 6rem);
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
  border-bottom: 1px solid var(--hero-border);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: var(--hero-glow-1), var(--hero-glow-2);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: var(--decor-pattern);
  background-size: var(--decor-size);
  opacity: var(--decor-opacity);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 72%);
  pointer-events: none;
}
.hero h1, .hero h2, .hero h3 { color: var(--hero-text); }
.hero a { color: var(--primary); }

.hero-inner {
  display: grid; gap: clamp(1.8rem, 1rem + 3vw, 3rem);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
}
.hero-text > :last-child { margin-bottom: 0; }
.hero-text .intro {
  font-size: clamp(1.02rem, .98rem + .3vw, 1.18rem);
  color: var(--hero-muted);
  max-width: 62ch; margin-bottom: 1.6rem;
}
.hero-text .intro p:last-child { margin-bottom: 0; }
.hero-cta { margin: 0 0 1.4rem; }
.hero .byline {
  border-block: 0; padding: 0; margin: 0;
  color: var(--hero-muted);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-heading); font-size: .82rem; font-weight: 600;
  letter-spacing: .08em; text-transform: var(--eyebrow-transform);
  color: var(--primary);
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 999px; padding: .4rem .9rem;
  margin-bottom: 1.1rem;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
}

/* ---- ภาพประกอบ hero: กรอบเบราว์เซอร์จำลอง สร้างด้วย CSS ล้วน ---- */
.hero-media { position: relative; }
.mockup {
  position: relative; z-index: 2;
  background: var(--mock-bg);
  border: 1px solid var(--hero-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.mockup-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--hero-border);
  background: var(--hero-surface);
}
.mockup-dots { display: flex; gap: .35rem; }
.mockup-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--mock-bar); }
.mockup-url {
  flex: 1; min-width: 0; font-size: .74rem; color: var(--hero-muted);
  background: var(--hero-bg); border: 1px solid var(--hero-border);
  border-radius: 999px; padding: .22rem .7rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-body);
}
.mockup-body { padding: 1rem; display: grid; gap: .7rem; }
.mockup-line { height: 9px; border-radius: 999px; background: var(--mock-bar); opacity: .55; }
.mockup-line.w-70 { width: 70%; }
.mockup-line.w-45 { width: 45%; }
.mockup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .2rem; }
.mockup-card {
  background: var(--hero-surface);
  border: 1px solid var(--hero-border);
  border-radius: var(--radius-md);
  padding: .8rem; display: grid; gap: .5rem;
}
.mockup-card .bar { height: 7px; border-radius: 999px; background: var(--mock-bar); opacity: .5; }
.mockup-card .bar.short { width: 55%; }
.mockup-chart { display: flex; align-items: flex-end; gap: .3rem; height: 42px; }
.mockup-chart i {
  flex: 1; border-radius: 3px 3px 0 0;
  background: linear-gradient(to top, var(--primary), transparent);
  opacity: .85;
}
.mockup-chart i:nth-child(1) { height: 40%; }
.mockup-chart i:nth-child(2) { height: 70%; }
.mockup-chart i:nth-child(3) { height: 55%; }
.mockup-chart i:nth-child(4) { height: 90%; }
.mockup-chart.alt i:nth-child(1) { height: 60%; }
.mockup-chart.alt i:nth-child(2) { height: 35%; }
.mockup-chart.alt i:nth-child(3) { height: 80%; }
.mockup-chart.alt i:nth-child(4) { height: 50%; }

/* การ์ดลอยรอบกรอบเบราว์เซอร์ */
.float-card {
  position: absolute; z-index: 3;
  display: flex; align-items: center; gap: .55rem;
  background: var(--hero-surface);
  border: 1px solid var(--hero-border);
  border-radius: var(--radius-md);
  padding: .6rem .85rem;
  box-shadow: var(--shadow);
  font-size: .82rem; font-weight: 600; color: var(--hero-text);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}
.float-card svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
.float-a { top: 8%; right: -8%; }
.float-b { bottom: 10%; left: -9%; }
.js .float-a { animation: floaty 7s ease-in-out infinite; }
.js .float-b { animation: floaty 9s ease-in-out infinite reverse; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-orb {
  position: absolute; z-index: -1; border-radius: 50%;
  filter: blur(46px); opacity: .5; pointer-events: none;
  background: var(--primary);
}
.hero-orb.a { width: 260px; height: 260px; top: -60px; right: -40px; }
.hero-orb.b { width: 200px; height: 200px; bottom: -70px; left: -50px; background: var(--accent-secondary); }

/* =========================================================
   หัวข้อ section
   ========================================================= */
main { padding-bottom: clamp(3rem, 2rem + 3vw, 5rem); }

.section-head { margin-bottom: 1.6rem; }
.section-head .eyebrow { margin-bottom: .8rem; }

.breadcrumb { padding: 1.1rem 0 .2rem; font-size: .9rem; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-inline-end: .45rem; opacity: .5; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

.intro { font-size: 1.08rem; color: var(--muted); margin-bottom: 1.5rem; }
.byline {
  display: flex; flex-wrap: wrap; gap: .4rem 1.2rem;
  font-size: .9rem; color: var(--muted);
  padding: .85rem 0; border-block: 1px solid var(--border);
  margin-bottom: 1.8rem;
}

.cover { margin: 0 0 2.2rem; }
.cover img { width: 100%; border-radius: var(--card-radius); box-shadow: var(--shadow); }
figure { margin: 0 0 1.6rem; }
figcaption { font-size: .88rem; color: var(--muted); margin-top: .55rem; }

/* =========================================================
   การ์ด
   ========================================================= */
.card {
  position: relative; overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition-normal), border-color var(--transition-normal),
              box-shadow var(--transition-normal);
}
.card:hover {
  transform: translateY(var(--card-lift));
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--glow);
}

/* =========================================================
   สารบัญ
   ========================================================= */
.toc {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 2.4rem;
  box-shadow: var(--shadow);
}
.toc h2 { margin: 0 0 .7rem; font-size: 1.05rem; }
.toc ol { margin: 0; padding-inline-start: 1.25rem; }
.toc li { margin-bottom: .25rem; }
.toc a { display: inline-block; padding: .3rem 0; min-height: 32px; color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--primary); text-decoration: underline; }

/* =========================================================
   เนื้อหา section
   ========================================================= */
.section { margin-bottom: clamp(2.4rem, 2rem + 1.5vw, 3.4rem); scroll-margin-top: 110px; }
.section h2 { position: relative; padding-top: .3rem; }
.section img { border-radius: var(--card-radius); margin-bottom: 1rem; box-shadow: var(--shadow); }

/* =========================================================
   FAQ
   ========================================================= */
.faq { margin: clamp(2.5rem, 2rem + 2vw, 3.6rem) 0; }
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  margin-bottom: .8rem; overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.faq-item:hover { border-color: var(--border-hover); }
.faq-item[open] { border-color: var(--border-hover); box-shadow: var(--shadow); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1.05rem 1.3rem;
  font-family: var(--font-heading); font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 48px; color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; flex-shrink: 0;
  width: 13px; height: 13px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--transition-normal);
}
.faq-item[open] summary::after { transform: rotate(-135deg) translate(-3px, -3px); }
.faq-answer { padding: 0 1.3rem 1.15rem; color: var(--muted); }
.faq-answer > :last-child { margin-bottom: 0; }

/* =========================================================
   บทความที่เกี่ยวข้อง
   ========================================================= */
.related { margin: clamp(2.6rem, 2rem + 2vw, 3.8rem) 0 0; }
.related-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  list-style: none; margin: 0; padding: 0;
}
.related-card {
  display: block; padding: 1.2rem 1.3rem; text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  color: var(--text); min-height: 48px;
  box-shadow: var(--shadow);
  transition: transform var(--transition-normal), border-color var(--transition-normal),
              box-shadow var(--transition-normal);
}
.related-card:hover {
  transform: translateY(var(--card-lift));
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--glow);
  color: var(--text);
}
.related-card strong {
  display: block; font-family: var(--font-heading); margin-bottom: .4rem; font-size: 1.02rem;
}
.related-card span { font-size: .9rem; color: var(--muted); }

/* =========================================================
   ท้ายเว็บ
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: clamp(2rem, 1.5rem + 2vw, 3rem) 0;
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  color: var(--muted); font-size: .94rem;
  position: relative; overflow: hidden;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.2rem 2rem; justify-content: space-between; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0 1.4rem; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); min-height: 48px; display: inline-flex; align-items: center; text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }

/* =========================================================
   404
   ========================================================= */
.notfound { text-align: center; padding: clamp(3rem, 2rem + 4vw, 5rem) 0; }
.notfound .code {
  font-size: clamp(3.5rem, 2rem + 8vw, 6rem);
  font-family: var(--font-heading); font-weight: 700;
  color: var(--primary); margin: 0 0 .2em; line-height: 1;
}

/* =========================================================
   เอฟเฟกต์ตอนเลื่อนจอ
   ทำงานเฉพาะเมื่อมี JavaScript (class .js)
   ปิด JS แล้วเนื้อหาแสดงครบตามปกติ ไม่มีอะไรถูกซ่อน
   ========================================================= */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: 2; max-width: 520px; }
  .hero-text { order: 1; }
  .float-a { right: -2%; }
  .float-b { left: -2%; }
}

@media (max-width: 760px) {
  /* เมนูกลายเป็นแผงที่กดเปิด */
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; padding: 0;
    background: transparent; color: var(--text);
    border: 1px solid var(--border); border-radius: var(--btn-radius);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
  }
  .nav-toggle:hover { background: var(--surface); border-color: var(--border-hover); }
  .nav-toggle svg { width: 22px; height: 22px; }
  .nav-toggle .icon-close { display: none; }
  .nav-toggle[aria-expanded="true"] .icon-open { display: none; }
  .nav-toggle[aria-expanded="true"] .icon-close { display: block; }

  .header-nav-row {
    display: none;
    border-top: 1px solid var(--header-border);
    background: var(--bg);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  .header-nav-row.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; overflow: visible; }
  .site-nav li { border-bottom: 1px solid var(--border); }
  .site-nav li:last-child { border-bottom: 0; }
  .site-nav a { width: 100%; min-height: 56px; font-size: 1rem; }
  .site-nav a::after { display: none; }
  .site-nav a[aria-current="page"] { background: var(--surface); }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap, .wrap-wide { width: min(100% - 2rem, var(--container-narrow)); }
  .brand { font-size: 1rem; gap: .45rem; }
  .brand-logo { height: 30px; }
  .header-cta { gap: .4rem; }
  .btn-compact { padding: 0 13px; font-size: .88rem; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn, .cta-group .btn { width: 100%; }
  .float-card { font-size: .74rem; padding: .5rem .7rem; }
  .float-a { top: 4%; right: 0; }
  .float-b { bottom: 4%; left: 0; }
  .mockup-grid { grid-template-columns: 1fr; }
  .toc, .faq-item summary { padding-inline: 1.05rem; }
  .related-card { padding: 1rem 1.05rem; }
}

@media (max-width: 400px) {
  .brand span { display: none; }
  .btn-compact { padding: 0 11px; font-size: .84rem; }
  .float-card { display: none; }
}

/* =========================================================
   ลดการเคลื่อนไหวตามการตั้งค่าของผู้ใช้
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .card:hover, .related-card:hover { transform: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* =========================================================
   พิมพ์
   ========================================================= */
@media print {
  .site-header, .header-cta, .nav-toggle, .hero-media, .theme-switcher { display: none !important; }
  .hero { background: none; color: #000; padding: 0; }
  body { background: #fff; color: #000; }
}


/* DEV THEME SWITCHER START — ลบบล็อกนี้ได้เมื่อขึ้น production */
.theme-switcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 120;
  font-family: var(--font-body);
}
.theme-switcher summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 48px; padding: 0 16px;
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border-hover); border-radius: 999px;
  box-shadow: var(--shadow-lg); font-weight: 600; font-size: .9rem;
}
.theme-switcher summary::-webkit-details-marker { display: none; }
.theme-switcher summary .swatch {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--primary); border: 1px solid var(--border);
}
.theme-switcher-panel {
  position: absolute; right: 0; bottom: calc(100% + 10px);
  width: 240px; max-height: 62vh; overflow-y: auto;
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: .5rem;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.theme-switcher-panel .group-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
  padding: .5rem .6rem .3rem;
}
.theme-switcher-panel button {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  min-height: 44px; padding: .4rem .6rem; margin-bottom: 2px;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text); font: inherit; font-size: .88rem; text-align: start;
}
.theme-switcher-panel button:hover { background: var(--surface-2); }
.theme-switcher-panel button[aria-pressed="true"] {
  border-color: var(--border-hover); background: var(--surface);
  font-weight: 700;
}
.theme-switcher-panel button i {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(128,128,128,.4);
}
@media (max-width: 640px) {
  .theme-switcher { right: 12px; bottom: 12px; }
  .theme-switcher-panel { width: min(74vw, 240px); }
}
/* DEV THEME SWITCHER END */

.sw-clean { background: #0f6b5c; }
.sw-nature { background: #3d6b35; }
.sw-midnight { background: #e3b35b; }
.sw-pop { background: #5b3df5; }
.sw-formal { background: #7a1f2b; }
.sw-royal-gold { background: #e3b64a; }
.sw-neon-cyber { background: #c084fc; }
.sw-emerald-premium { background: #34d399; }
.sw-red-dragon { background: #f87171; }
.sw-ice-crystal { background: #0369a1; }