/* =====================================================================
   BigTechCenter.com — Public site stylesheet
   Sections:
     1. Design tokens (light / dark)
     2. Base & typography
     3. Layout helpers
     4. Header, navigation, mobile drawer
     5. Buttons, chips, badges, forms
     6. Ticker, hero, article cards
     7. Sidebar / trending, SaaS cards, stats, newsletter
     8. Article page
     9. Product / pricing / plans
    10. Modal, search overlay, toast
    11. Contact, about, misc
    12. Footer
    13. States (loading / empty / error), utilities
    14. Responsive
   ===================================================================== */

/* 1. Design tokens -------------------------------------------------- */
:root {
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-soft: rgba(79, 70, 229, .10);
  --accent: #06b6d4;
  --accent-soft: rgba(6, 182, 212, .12);
  --grad: linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #06b6d4 100%);
  --grad-soft: linear-gradient(135deg, rgba(79,70,229,.10), rgba(6,182,212,.10));

  --bg: #f7f8fc;
  --bg-elev: #ffffff;
  --bg-sunk: #eef0f7;
  --surface-glass: rgba(255, 255, 255, .72);
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5b6477;
  --border: #e3e6f0;
  --border-strong: #cbd1e1;
  --success: #059669;
  --warning: #b45309;
  --danger: #dc2626;
  --on-primary: #ffffff;
  --link: #4338ca;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 24px -8px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 60px -18px rgba(30, 27, 75, .30);
  --focus: 0 0 0 3px rgba(99, 102, 241, .55);

  --font: "Inter", "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1200px;
  --header-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020;
    --bg-elev: #121833;
    --bg-sunk: #0e1429;
    --surface-glass: rgba(18, 24, 51, .72);
    --text: #e8ebf7;
    --text-2: #c3c9dd;
    --muted: #97a0bb;
    --border: #232b4a;
    --border-strong: #34406a;
    --primary-soft: rgba(129, 140, 248, .16);
    --accent-soft: rgba(34, 211, 238, .14);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --link: #a5b4fc;
    --shadow: 0 8px 28px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020;
  --bg-elev: #121833;
  --bg-sunk: #0e1429;
  --surface-glass: rgba(18, 24, 51, .72);
  --text: #e8ebf7;
  --text-2: #c3c9dd;
  --muted: #97a0bb;
  --border: #232b4a;
  --border-strong: #34406a;
  --primary-soft: rgba(129, 140, 248, .16);
  --accent-soft: rgba(34, 211, 238, .14);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --link: #a5b4fc;
  --shadow: 0 8px 28px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

/* 2. Base & typography --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[lang="th"] body { line-height: 1.75; }
img, svg { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; letter-spacing: -.01em; color: var(--text); }
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] h3 { letter-spacing: 0; line-height: 1.4; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); font-weight: 750; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: rgba(99, 102, 241, .25); }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--primary); color: #fff !important; padding: 10px 16px; border-radius: 10px;
}
.skip-link:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 3. Layout helpers ------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }
/* keep the container gutters when combined (the shorthands above would zero them) */
.container.section, .container.section-sm, .container.hero { padding-left: 20px; padding-right: 20px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary);
}
html[data-theme="dark"] .eyebrow { color: #a5b4fc; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .eyebrow { color: #a5b4fc; } }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.page-hero {
  position: relative; padding: 56px 0 40px; overflow: hidden;
  background: radial-gradient(900px 300px at 10% -10%, rgba(79,70,229,.18), transparent 70%),
              radial-gradient(700px 260px at 95% 0%, rgba(6,182,212,.16), transparent 70%);
}
.page-hero h1 { margin-bottom: .3em; }
.page-hero .lead { font-size: 1.1rem; color: var(--text-2); max-width: 720px; }
.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* 4. Header / nav --------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface-glass);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text) !important; font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad); color: #fff; font-size: .78rem; font-weight: 900; letter-spacing: .02em;
  box-shadow: 0 6px 18px -6px rgba(79, 70, 229, .65);
}
.brand-name b { color: var(--primary); }
html[data-theme="dark"] .brand-name b { color: #818cf8; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .brand-name b { color: #818cf8; } }
.main-nav { display: flex; gap: 4px; margin-left: 8px; }
.main-nav a {
  padding: 8px 12px; border-radius: 10px; color: var(--text-2) !important; font-weight: 550; font-size: .95rem;
}
.main-nav a:hover { background: var(--primary-soft); text-decoration: none; color: var(--text) !important; }
.main-nav a[aria-current="page"] { color: var(--primary) !important; background: var(--primary-soft); }
html[data-theme="dark"] .main-nav a[aria-current="page"] { color: #a5b4fc !important; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .main-nav a[aria-current="page"] { color: #a5b4fc !important; } }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px;
  border-radius: 11px; border: 1px solid transparent; background: transparent; cursor: pointer;
  color: var(--text-2); font-weight: 700; font-size: .85rem;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.lang-btn { border-color: var(--border); letter-spacing: .04em; }
.menu-btn { display: none; }
.theme-btn .i-sun { display: none; }
html[data-theme="dark"] .theme-btn .i-sun { display: block; }
html[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  html:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}

/* Drawer */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(8, 10, 25, .5); z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 340px); z-index: 90;
  background: var(--bg-elev); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  transform: translateX(105%); transition: transform .25s ease; padding: 18px; display: flex; flex-direction: column; gap: 6px;
  visibility: hidden;
}
body.drawer-open .drawer { transform: none; visibility: visible; }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.drawer a.drawer-link {
  display: block; padding: 12px 14px; border-radius: 12px; color: var(--text) !important; font-weight: 600;
}
.drawer a.drawer-link:hover, .drawer a.drawer-link[aria-current="page"] { background: var(--primary-soft); text-decoration: none; }
.drawer .btn { margin-top: 12px; }
.drawer-tools { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }

/* 5. Buttons, chips, badges, forms ---------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 650; font-size: .95rem; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, box-shadow .15s ease, background .15s;
  text-decoration: none !important; line-height: 1.3;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff !important; box-shadow: 0 8px 22px -10px rgba(79, 70, 229, .8); }
.btn-primary:hover { box-shadow: 0 12px 28px -10px rgba(79, 70, 229, .95); }
.btn-outline { background: var(--bg-elev); border-color: var(--border-strong); color: var(--text) !important; }
.btn-outline:hover { border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-2) !important; }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn-lg { padding: 13px 24px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn.liked { background: rgba(236, 72, 153, .12); border-color: rgba(236, 72, 153, .5); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-2) !important;
  font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--primary); text-decoration: none; }
.chip[aria-pressed="true"], .chip.active { background: var(--primary); border-color: var(--primary); color: #fff !important; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; background: var(--primary-soft); color: var(--primary);
}
html[data-theme="dark"] .badge { color: #c7d2fe; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .badge { color: #c7d2fe; } }
.badge-accent { background: var(--accent-soft); color: #0e7490; }
html[data-theme="dark"] .badge-accent { color: #67e8f9; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .badge-accent { color: #67e8f9; } }
.badge-warn { background: rgba(245, 158, 11, .16); color: var(--warning); }
.tag { display: inline-block; padding: 4px 10px; border-radius: 8px; background: var(--bg-sunk); color: var(--text-2) !important; font-size: .82rem; }
.tag:hover { text-decoration: none; background: var(--primary-soft); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; color: var(--text-2); }
.field .req { color: var(--danger); }
.input, .field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--bg-elev); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 130px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .82rem; min-height: 0; }
.form-alert { padding: 12px 16px; border-radius: 12px; font-weight: 600; margin-bottom: 16px; }
.form-alert.ok { background: rgba(5, 150, 105, .12); color: var(--success); }
.form-alert.err { background: rgba(220, 38, 38, .10); color: var(--danger); }

/* Segmented toggle (monthly / yearly) */
.seg {
  display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg-sunk); border: 1px solid var(--border);
}
.seg button {
  border: 0; background: transparent; padding: 8px 18px; border-radius: 999px; font-weight: 650; cursor: pointer; color: var(--text-2);
}
.seg button[aria-pressed="true"] { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }
.seg .save-pill { margin-left: 6px; font-size: .72rem; color: var(--success); font-weight: 800; }

/* 6. Ticker, hero, article cards ------------------------------------ */
.ticker {
  background: #0f1330; color: #e0e7ff; font-size: .88rem; border-bottom: 1px solid rgba(255,255,255,.06);
}
.ticker-inner { display: flex; align-items: center; gap: 14px; height: 40px; overflow: hidden; }
.ticker-label {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: linear-gradient(90deg, #ef4444, #f97316); color: #fff; font-weight: 800; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
}
.ticker-label .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.ticker-track { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-items { display: inline-flex; gap: 40px; white-space: nowrap; animation: ticker 45s linear infinite; padding-left: 10px; }
.ticker:hover .ticker-items, .ticker:focus-within .ticker-items { animation-play-state: paused; }
.ticker-items a { color: #e0e7ff !important; }
.ticker-items a::before { content: "•"; color: #22d3ee; margin-right: 10px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.hero { padding: 28px 0 8px; }
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; }
.hero-side { display: grid; gap: 22px; grid-template-rows: 1fr 1fr; }

.cover {
  position: relative; overflow: hidden; background: var(--grad); border-radius: var(--radius);
  aspect-ratio: 16 / 9; display: block;
}
.cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,.18), transparent 50%),
              linear-gradient(180deg, transparent 40%, rgba(5, 8, 25, .35));
}
.cover-emoji {
  position: absolute; right: 16px; bottom: 10px; z-index: 1; font-size: 3rem; line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}
.cover-cat {
  position: absolute; left: 14px; top: 14px; z-index: 1; padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .88); color: #1e1b4b; font-size: .75rem; font-weight: 800;
}

.feature-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 440px;
  border-radius: var(--radius-lg); overflow: hidden; color: #fff !important; box-shadow: var(--shadow);
  isolation: isolate;
}
.feature-card:hover { text-decoration: none; }
.feature-card .cover { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; z-index: -1; }
.feature-card .cover::after { background: linear-gradient(180deg, rgba(5,8,25,.05) 20%, rgba(5, 8, 25, .82)); }
.feature-card .cover-emoji { top: 22px; right: 26px; bottom: auto; font-size: 5rem; }
.feature-body { padding: 28px; position: relative; }
.feature-body h2, .feature-body h3 { color: #fff; margin: 10px 0 8px; }
.feature-body h2 { font-size: clamp(1.4rem, 3vw, 2.1rem); }
.feature-body p { color: rgba(255,255,255,.86); margin: 0 0 10px; max-width: 620px; }
.feature-body .meta { color: rgba(255,255,255,.78); }
.feature-card.small { min-height: 0; height: 100%; }
.feature-card.small .feature-body { padding: 20px; }
.feature-card.small .cover-emoji { font-size: 3rem; top: 16px; right: 18px; }
.feature-card.small h3 { font-size: 1.1rem; }
.feature-card:hover .cover { transform: scale(1.03); }
.feature-card .cover { transition: transform .5s ease; }

.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }

.article-card {
  display: flex; flex-direction: column; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  color: inherit !important;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.article-card .cover { border-radius: 0; }
.article-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.article-card h3 { margin: 0; font-size: 1.05rem; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-card p { margin: 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card .meta { margin-top: auto; padding-top: 6px; }

.article-row {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding: 16px; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--border); color: inherit !important; transition: box-shadow .18s, border-color .18s;
}
.article-row:hover { box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.article-row .cover { border-radius: 12px; }
.article-row h3 { margin: 6px 0; font-size: 1.15rem; }
.article-row p { color: var(--muted); margin: 0 0 8px; }
.list-stack { display: grid; gap: 16px; }

/* 7. Sidebar / trending --------------------------------------------- */
.side-box { padding: 20px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); }
.side-box + .side-box { margin-top: 22px; }
.side-box h3 { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; }
.trending-list { list-style: none; margin: 0; padding: 0; counter-reset: tr; }
.trending-list li { counter-increment: tr; display: grid; grid-template-columns: 38px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.trending-list li:first-child { border-top: 0; padding-top: 4px; }
.trending-list li::before {
  content: counter(tr, decimal-leading-zero); font-weight: 900; font-size: 1.35rem; line-height: 1.2;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.trending-list a { color: var(--text) !important; font-weight: 650; font-size: .95rem; line-height: 1.45; }
.trending-list .meta { margin-top: 4px; font-size: .78rem; }

/* SaaS product cards */
.saas-band { background: linear-gradient(180deg, transparent, var(--bg-sunk) 18%, var(--bg-sunk) 82%, transparent); }
.product-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1px solid var(--border); color: inherit !important; overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.product-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--pc, var(--grad));
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; border-color: var(--border-strong); }
.product-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 1.7rem;
  background: var(--primary-soft);
}
.product-card h3 { margin: 0; font-size: 1.12rem; }
.product-card p { margin: 0; color: var(--muted); font-size: .93rem; }
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .85rem; color: var(--muted); padding-top: 8px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.stars { color: #f59e0b; letter-spacing: 1px; font-size: .9rem; }
.stars .off { color: var(--border-strong); }

/* Stats band */
.stats-band {
  border-radius: var(--radius-lg); padding: 36px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(600px 200px at 0% 0%, rgba(255,255,255,.18), transparent 60%), var(--grad);
  box-shadow: var(--shadow-lg);
}
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; text-align: center; }
.stat-num { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 900; line-height: 1.1; letter-spacing: -.02em; }
.stat-label { opacity: .9; font-size: .92rem; }

/* Newsletter */
.newsletter {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; padding: 36px;
  border-radius: var(--radius-lg); background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow);
  background-image: var(--grad-soft);
}
.newsletter h2 { margin-bottom: 6px; }
.newsletter p { color: var(--text-2); margin: 0; }
.nl-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
.nl-form .nl-msg { grid-column: 1 / -1; font-size: .9rem; min-height: 1.4em; margin: 0; }
.nl-msg.ok { color: var(--success); font-weight: 600; }
.nl-msg.err { color: var(--danger); font-weight: 600; }

/* 8. Article page --------------------------------------------------- */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--grad); z-index: 60; transition: width .08s linear; }
.article-head { max-width: 820px; margin: 0 auto; padding: 36px 0 18px; }
.article-head h1 { font-size: clamp(1.7rem, 4.2vw, 2.7rem); margin: 12px 0 14px; }
.article-head .excerpt { font-size: 1.15rem; color: var(--text-2); }
.breadcrumb { font-size: .85rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted) !important; }
.article-cover { max-width: 1000px; margin: 8px auto 30px; aspect-ratio: 21 / 9; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.article-cover .cover-emoji { font-size: clamp(3rem, 9vw, 6rem); right: 30px; bottom: 20px; }
.article-layout { display: grid; grid-template-columns: 64px minmax(0, 740px); gap: 32px; justify-content: center; }
.share-rail { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; display: flex; flex-direction: column; gap: 10px; }
.share-btn {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text-2) !important; cursor: pointer; font-weight: 800; font-size: .9rem;
}
.share-btn:hover { border-color: var(--primary); color: var(--primary) !important; text-decoration: none; }
.share-btn svg { width: 18px; height: 18px; }
.prose { font-size: 1.08rem; color: var(--text-2); overflow-wrap: anywhere; }
html[lang="th"] .prose { font-size: 1.1rem; line-height: 1.95; }
.prose h2 { font-size: 1.5rem; margin: 1.6em 0 .6em; color: var(--text); }
.prose h3 { font-size: 1.2rem; margin: 1.4em 0 .5em; color: var(--text); }
.prose p { margin: 0 0 1.2em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin: .35em 0; }
.prose a { color: var(--primary) !important; text-decoration: underline; text-underline-offset: 3px; }
html[data-theme="dark"] .prose a { color: #a5b4fc !important; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .prose a { color: #a5b4fc !important; } }
.prose blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 12px 12px 0; color: var(--text); font-style: italic; }
.prose code { font-family: var(--font-mono); font-size: .9em; background: var(--bg-sunk); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: #0f1330; color: #e0e7ff; padding: 16px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: transparent; padding: 0; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }
.article-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.author-box { display: grid; grid-template-columns: 72px 1fr; gap: 18px; padding: 22px; margin: 28px 0; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); }
.avatar { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: var(--grad-soft); border: 1px solid var(--border); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-box h3 { margin: 0; }
.author-box .role { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.author-box p { margin: 0; color: var(--text-2); font-size: .95rem; }
.share-inline { display: none; gap: 8px; }

/* 9. Product / pricing ---------------------------------------------- */
.product-hero { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.product-hero .product-icon { width: 88px; height: 88px; font-size: 3rem; border-radius: 24px; box-shadow: var(--shadow); background: var(--bg-elev); }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list li::before {
  content: "✓"; flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: #0891b2; font-weight: 900; font-size: .8rem; margin-top: 3px;
}
.features-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.features-grid .feat { padding: 16px 18px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.features-grid .feat .ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); font-weight: 900; color: var(--primary); }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; align-items: stretch; }
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 26px 22px; border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1px solid var(--border);
}
.plan-card.popular { border: 2px solid var(--primary); box-shadow: var(--shadow-lg); }
.plan-card .popular-tag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%); padding: 4px 14px; border-radius: 999px;
  background: var(--grad); color: #fff; font-size: .75rem; font-weight: 800; white-space: nowrap;
}
.plan-name { font-size: 1.1rem; font-weight: 800; margin: 0; }
.plan-price { font-size: 2.1rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.plan-price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.plan-sub { color: var(--muted); font-size: .85rem; min-height: 1.3em; }
.plan-save { color: var(--success); font-weight: 700; }
.plan-card .feature-list { font-size: .92rem; gap: 8px; flex: 1; }
/* VAT note + self-serve sign-up (plans.js: "รวม VAT แล้ว" / "+VAT 7%", "เปิดรับสมัครเร็ว ๆ นี้", subscribe modal) */
.plan-vat { font-size: .8rem; font-weight: 650; color: var(--muted); margin-top: -10px; }
.plan-soon { cursor: default; opacity: .75; }
.seg[hidden] { display: none; }
.plan-soon-link { display: block; text-align: center; font-size: .86rem; font-weight: 650; margin-top: -6px; }
.sub-note { font-size: .84rem; color: var(--muted); margin: 14px 0 0; line-height: 1.55; }
.field-hint { display: block; font-size: .8rem; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.consent-field .check a { text-decoration: underline; }
.pricing-product { margin-bottom: 48px; }
.pricing-product-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.pricing-product-head .product-icon { width: 46px; height: 46px; font-size: 1.5rem; }
.pricing-product-head h2 { margin: 0; font-size: 1.35rem; }
.pricing-product-head p { margin: 0; color: var(--muted); }
.pricing-product-head .btn { margin-left: auto; }
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq-item { border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); overflow: hidden; }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left;
  padding: 18px 20px; background: transparent; border: 0; cursor: pointer; font-weight: 700; font-size: 1rem; color: var(--text);
}
.faq-q::after { content: "+"; font-size: 1.4rem; font-weight: 400; color: var(--primary); transition: transform .2s; flex: none; }
.faq-q[aria-expanded="true"]::after { transform: rotate(45deg); }
.faq-a { padding: 0 20px 18px; color: var(--text-2); }
.faq-a[hidden] { display: none; }

/* 10. Modal, search overlay, toast ---------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 10, 25, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--bg-elev);
  border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 26px;
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 1.3rem; }
.success-box { text-align: center; padding: 10px 0; }
.success-box .big { font-size: 3rem; }
.success-box .code { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 800; padding: 10px 16px; background: var(--bg-sunk); border-radius: 12px; display: inline-block; margin: 8px 0; }

.search-overlay {
  position: fixed; inset: 0; z-index: 110; padding: 10vh 16px 16px; background: rgba(8, 10, 25, .6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.search-overlay[hidden] { display: none; }
.search-panel { max-width: 680px; margin: 0 auto; background: var(--bg-elev); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: hidden; }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search-bar svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-bar input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 1.1rem; padding: 6px 0; }
.search-bar input:focus { outline: none; box-shadow: none; }
.search-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.search-group-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--muted); padding: 10px 12px 4px; }
.search-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; color: var(--text) !important; }
.search-item:hover, .search-item:focus { background: var(--primary-soft); text-decoration: none; }
.search-item .si-ic { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; background: var(--grad); }
.search-item .si-title { font-weight: 650; line-height: 1.35; }
.search-item .si-sub { color: var(--muted); font-size: .82rem; }
.search-hint { padding: 18px; color: var(--muted); text-align: center; font-size: .92rem; }
kbd { font-family: var(--font-mono); font-size: .75rem; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--bg-sunk); }

.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 12px 16px; border-radius: 12px; background: #111633; color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem; animation: toast-in .2s ease; }
.toast.err { background: #7f1d1d; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* 11. Contact / about ----------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.contact-card { padding: 28px; }
.office-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.office-list li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.office-list .ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--primary-soft); font-size: 1.1rem; }
.office-list strong { display: block; }
.office-list span { color: var(--muted); font-size: .92rem; }
.value-card { padding: 24px; }
.value-card .ic { font-size: 1.8rem; margin-bottom: 8px; }
.value-card p { color: var(--muted); margin: 0; }
.team-card { padding: 24px; text-align: center; }
.team-card .avatar { margin: 0 auto 12px; }
.team-card p { color: var(--muted); margin: 0; font-size: .9rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; max-width: 760px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--grad); border-radius: 2px; }
.timeline li { position: relative; padding: 0 0 26px 14px; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-elev); border: 3px solid var(--primary); }
.timeline .year { font-weight: 900; color: var(--primary); }
html[data-theme="dark"] .timeline .year { color: #a5b4fc; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .timeline .year { color: #a5b4fc; } }
.timeline p { margin: 2px 0 0; color: var(--text-2); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.split .card { padding: 28px; }
.split .ic { font-size: 2rem; }
.cta-band { text-align: center; padding: 48px 24px; border-radius: var(--radius-lg); background: var(--grad); color: #fff; box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; }
.cta-band p { opacity: .92; }
.cta-band .btn-outline { background: rgba(255,255,255,.95); color: #312e81 !important; border-color: transparent; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.pagination button { min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); cursor: pointer; font-weight: 650; padding: 0 12px; }
.pagination button[aria-current="page"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }
.filters-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters-bar .search-input { flex: 1 1 260px; position: relative; }
.filters-bar .search-input input { padding-left: 40px; }
.filters-bar .search-input svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.active-filter { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 999px; background: var(--accent-soft); font-size: .88rem; font-weight: 600; }
.active-filter button { border: 0; background: transparent; cursor: pointer; font-size: 1rem; color: var(--text-2); border-radius: 50%; width: 24px; height: 24px; }
.result-count { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }

/* 12. Footer -------------------------------------------------------- */
.site-footer { margin-top: 64px; background: #0b0f24; color: #b7bfd9; padding: 56px 0 24px; }
.site-footer a { color: #d6dcf0 !important; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { color: #fff; font-size: .95rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .92rem; }
.site-footer .brand { color: #fff !important; }
.site-footer .brand-name b { color: #818cf8; }
.footer-about { font-size: .92rem; margin-top: 12px; max-width: 360px; }
.socials { display: flex; gap: 8px; margin-top: 16px; }
.socials a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.06); font-weight: 800; font-size: .8rem; }
.socials a:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.footer-fbpages { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; font-size: .82rem; }
.footer-fbpages a { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px 3px 3px; border-radius: 999px; background: rgba(255,255,255,.06); overflow-wrap: anywhere; }
.footer-fbpages a:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.footer-fbpages b { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px; background: #1877f2; color: #fff; font: 800 .72rem/1 Arial, sans-serif; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .85rem; }

/* 13. States & utilities -------------------------------------------- */
.state { padding: 36px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); grid-column: 1 / -1; }
.state .ic { font-size: 2rem; margin-bottom: 6px; }
.state.error { color: var(--danger); border-color: rgba(220, 38, 38, .35); }
.state .btn { margin-top: 12px; }
.skeleton { position: relative; overflow: hidden; background: var(--bg-sunk); border-radius: var(--radius); min-height: 120px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shimmer 1.3s infinite;
}
html[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton.tall { min-height: 280px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .wrap { flex-wrap: wrap; }
.hidden, [hidden] { display: none !important; }

/* 14. Responsive ---------------------------------------------------- */
@media (max-width: 1080px) {
  .main-nav a { padding: 8px 9px; font-size: .9rem; }
  .header-cta { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
  .main-nav { display: none; }
  .menu-btn { display: inline-grid; }
  .hero-grid, .layout-main-side, .contact-grid, .newsletter { grid-template-columns: 1fr; }
  .hero-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .feature-card { min-height: 380px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .share-rail { display: none; }
  .share-inline { display: flex; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .container { padding: 0 16px; }
  .container.section, .container.section-sm, .container.hero { padding-left: 16px; padding-right: 16px; }
  .section { padding: 40px 0; }
  .header-actions .lang-btn, .header-actions .theme-btn { display: none; }
  .hero-side, .grid-2, .grid-3, .grid-4, .split, .features-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-card { min-height: 340px; }
  .feature-card.small { min-height: 220px; }
  .feature-body { padding: 20px; }
  .article-row { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .nl-form { grid-template-columns: minmax(0, 1fr); }
  .newsletter, .stats-band { padding: 24px 18px; }
  .footer-grid { grid-template-columns: 1fr; }
  .article-cover { aspect-ratio: 16 / 9; border-radius: var(--radius); }
  .product-hero { grid-template-columns: minmax(0, 1fr); }
  .pricing-product-head .btn { margin-left: 0; }
  .modal { padding: 20px; }
  .author-box { grid-template-columns: minmax(0, 1fr); }
  .brand-name { font-size: 1rem; }
}
@media (max-width: 380px) {
  .brand-name { display: none; }
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Article sources (real-news citations) ---- */
.article-sources {
  margin: 2rem 0 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border, rgba(127, 127, 127, .25));
  border-radius: 12px;
  font-size: .92rem;
}
.article-sources h2 { font-size: 1rem; margin: 0 0 .5rem; }
.article-sources ol { margin: 0; padding-left: 1.25rem; }
.article-sources li { margin: .25rem 0; overflow-wrap: anywhere; }
.article-ai-note {
  margin: 2rem 0 0;
  font-size: .85rem;
  color: var(--muted);
}
.article-ai-note + .article-sources { margin-top: .5rem; }

/* ---- Logo (Bracketed Grid, see tools/brand/build_logo.py) ---- */
.brand { gap: 12px; }
.brand-mark-svg { display: block; width: 38px; height: 38px; flex-shrink: 0; }
.brand-word-svg { display: block; height: 20px; width: 157.4px; }
.site-footer .brand-mark-svg { width: 34px; height: 34px; }
.site-footer .brand-word-svg { height: 18px; width: 141.7px; }
@media (max-width: 420px) {
  .brand-word-svg { display: none; }
}

/* ---- 15. Stories ("เรื่องราว": /stories, /story/<slug>, article box, home) ---- */
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 26px 22px; }
.story-card {
  position: relative; display: flex; flex-direction: column; margin: 0 10px 10px 0;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  color: inherit !important;
  /* stacked-pages look: one story = several articles */
  box-shadow: 5px 5px 0 -1px var(--bg-elev), 5px 5px 0 0 var(--border), 10px 10px 0 -1px var(--bg-elev), 10px 10px 0 0 var(--border);
  transition: transform .18s ease, border-color .18s;
}
.story-card:hover { transform: translate(-2px, -2px); border-color: var(--border-strong); text-decoration: none; }
.story-card .cover { border-radius: 0; aspect-ratio: 2 / 1; }
.story-card .cover-emoji { font-size: 2.4rem; }
.story-count {
  position: absolute; left: 12px; bottom: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; background: rgba(15, 19, 48, .74); color: #fff; font-size: .78rem; font-weight: 700;
}
.story-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.story-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 24px; }
.story-card h3 { margin: 0; font-size: 1.05rem; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.story-card p { margin: 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story-latest {
  font-size: .86rem; color: var(--text-2); padding: 8px 10px; border-radius: 10px; background: var(--bg-sunk);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5;
}
.story-latest .lbl { font-weight: 800; color: var(--primary); margin-right: 6px; text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; }
.story-card .meta { margin-top: auto; padding-top: 2px; }
.pill-live {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 800; background: rgba(220, 38, 38, .10); color: #b91c1c;
}
.pill-live .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
html[data-theme="dark"] .story-latest .lbl, html[data-theme="dark"] .st-n { color: #a5b4fc; }
html[data-theme="dark"] .pill-live { background: rgba(248, 113, 113, .16); color: #fca5a5; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .story-latest .lbl, html:not([data-theme="light"]) .st-n { color: #a5b4fc; }
  html:not([data-theme="light"]) .pill-live { background: rgba(248, 113, 113, .16); color: #fca5a5; }
}

/* Story page */
.story-hero {
  padding: 32px 0 26px;
  background: radial-gradient(900px 300px at 10% -10%, rgba(79,70,229,.16), transparent 70%),
              radial-gradient(700px 260px at 95% 0%, rgba(6,182,212,.14), transparent 70%);
}
.story-hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 10px 0 12px; max-width: 900px; }
.story-hero .lead { font-size: 1.1rem; color: var(--text-2); max-width: 820px; margin-bottom: 14px; }
.story-hero .meta { align-items: center; }
.story-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; padding-top: 26px; }
.story-layout > aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 18px; }
.story-timeline-title { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; margin: 0 0 18px; }
.story-timeline { list-style: none; margin: 0; padding: 0 0 0 32px; position: relative; }
.story-timeline::before {
  content: ""; position: absolute; left: 9px; top: 10px; bottom: 26px; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.st-item { position: relative; padding: 0 0 26px; }
.st-item::before {
  content: ""; position: absolute; left: -32px; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg); border: 4px solid var(--primary);
}
.st-item.is-latest::before { background: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
.st-item:last-child::after { content: ""; position: absolute; left: -26px; top: 24px; bottom: 0; width: 8px; background: var(--bg); }
.st-when { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: .88rem; color: var(--muted); }
.st-when time { font-weight: 800; color: var(--text); }
.st-n { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.st-latest { padding: 2px 9px; border-radius: 999px; background: var(--grad); color: #fff; font-size: .7rem; font-weight: 800; }
.st-card {
  display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 16px; padding: 14px; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--border); color: inherit !important; transition: box-shadow .18s, border-color .18s;
}
.st-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; }
.st-card .cover { border-radius: 10px; aspect-ratio: 16 / 10; }
.st-card .cover-emoji { font-size: 2rem; right: 10px; bottom: 6px; }
.st-card h3 { margin: 0 0 6px; font-size: 1.08rem; color: var(--text); }
.st-card p { margin: 0 0 8px; color: var(--muted); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.st-read { font-weight: 700; color: var(--link); font-size: .88rem; }
.story-note { font-size: .88rem; color: var(--muted); }
.story-note p { margin: 0; }
.story-more { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.story-more a { display: block; padding: 10px 12px; border-radius: 12px; background: var(--bg-sunk); color: var(--text) !important; font-weight: 650; line-height: 1.45; }
.story-more a:hover { background: var(--primary-soft); text-decoration: none; }
.story-more small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; }

/* Article page: "ส่วนหนึ่งของเรื่อง" box */
.story-box {
  margin: 30px 0 8px; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-elev); background-image: var(--grad-soft);
}
.story-box h2 { font-size: 1.15rem; margin: 0 0 14px; line-height: 1.45; }
.story-box h2 .lbl { color: var(--muted); font-weight: 700; margin-right: 6px; }
.story-box h2 a { color: var(--text) !important; }
.mini-timeline { list-style: none; margin: 0 0 14px; padding: 0 0 0 24px; position: relative; }
.mini-timeline li { position: relative; padding: 2px 0 12px; }
.mini-timeline li:not(:last-child)::after { content: ""; position: absolute; left: -18px; top: 20px; bottom: -6px; width: 2px; background: var(--border-strong); border-radius: 2px; }
.mini-timeline li::before {
  content: ""; position: absolute; left: -24px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-elev); border: 3px solid var(--border-strong);
}
.mini-timeline li.is-current::before { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.mini-timeline time { display: block; font-size: .78rem; color: var(--muted); font-weight: 700; }
.mini-timeline a, .mini-timeline .cur { font-weight: 650; line-height: 1.45; color: var(--text) !important; }
.mini-timeline .here {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft);
  color: var(--primary); font-size: .72rem; font-weight: 800; font-style: normal; vertical-align: 1px;
}
html[data-theme="dark"] .mini-timeline .here { color: #c7d2fe; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .mini-timeline .here { color: #c7d2fe; } }

@media (max-width: 920px) {
  .story-layout { grid-template-columns: minmax(0, 1fr); }
  .story-layout > aside { position: static; }
}
@media (max-width: 640px) {
  .story-grid { grid-template-columns: minmax(0, 1fr); }
  .story-timeline { padding-left: 26px; }
  .story-timeline::before { left: 7px; }
  .st-item::before { left: -26px; width: 18px; height: 18px; }
  .st-item:last-child::after { left: -22px; top: 22px; }
  .st-card { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .st-card .cover { display: none; }
  .story-box { padding: 16px; }
}

/* ---- 16. Article visuals: thumbnails, hero image, key figures, video ---- */
/* Brand champagne gold (logo kit #B08D57); --gold-ink keeps ≥ 3:1 for the large figures on light cards */
:root { --gold: #b08d57; --gold-ink: #9f7c46; --gold-soft: rgba(176, 141, 87, .12); --gold-line: rgba(176, 141, 87, .32); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --gold-ink: #dcc08e; --gold-soft: rgba(220, 192, 142, .09); --gold-line: rgba(220, 192, 142, .26); }
}
:root[data-theme="dark"] { --gold-ink: #dcc08e; --gold-soft: rgba(220, 192, 142, .09); --gold-line: rgba(220, 192, 142, .26); }

/* Card thumbnails (article cards, rows, featured, stories, story timeline) */
.cover > .cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.has-img .cover-emoji { display: none; }
.cover.is-ai::after { background: linear-gradient(180deg, transparent 55%, rgba(5, 8, 25, .30)); }
/* our covers are finished designs (brand lockup, category, headline, key figure): no overlay, no category chip */
/* the covers' ink so letterbox bars blend in (!important beats the inline category gradient, which comes back
   by itself when a broken image drops the class) */
.cover.is-cover { background: #0e1726 !important; }
.cover.is-cover > .cover-img { object-fit: contain; }     /* never crop a headline, whatever the card ratio */
.cover.is-cover::after { background: none; }
.cover.is-cover .cover-cat { display: none; }
.feature-card .cover.has-img::after { background: linear-gradient(180deg, rgba(5, 8, 25, .10) 15%, rgba(5, 8, 25, .86)); }
/* badges: bottom-left on gradient covers (the emoji sits bottom-right), bottom-right on images */
.thumb-badges { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: flex; gap: 6px; pointer-events: none; }
.cover.has-img .thumb-badges { left: auto; right: 10px; }
.feature-card .thumb-badges { left: auto; right: 20px; top: 18px; bottom: auto; }       /* title sits bottom-left */
.feature-card .cover:not(.has-img) .thumb-badges { left: 20px; right: auto; }            /* big emoji sits top-right */
.story-card .cover:not(.has-img) .thumb-badges { left: auto; right: 10px; top: 10px; bottom: auto; }
.thumb-badge {
  display: inline-flex; align-items: center; justify-content: center; height: 24px; min-width: 24px; padding: 0 9px;
  border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; line-height: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.thumb-ai { background: rgba(255, 255, 255, .94); color: #1e1b4b; }
.thumb-play { width: 30px; height: 30px; padding: 0; background: #e3002d; color: #fff; }
.thumb-play svg { width: 14px; height: 14px; margin-left: 2px; }
.search-item .si-ic { overflow: hidden; }
.search-item .si-ic img { width: 100%; height: 100%; object-fit: cover; }

/* Article hero image (AI illustration or our cover) */
.article-hero { max-width: 1000px; margin: 8px auto 30px; }
.article-hero-media {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow); background: var(--grad);
}
.article-hero-media img { width: 100%; height: auto; max-height: min(72vh, 620px); object-fit: cover; }
.article-hero.img-failed .article-hero-media { aspect-ratio: 21 / 9; }
.ai-chip {
  position: absolute; left: 14px; top: 14px; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .94);
  color: #1e1b4b; font-size: .74rem; font-weight: 800; letter-spacing: .06em; line-height: 1.2;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.article-hero figcaption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px;
  margin-top: 10px; padding: 0 4px; font-size: .88rem; color: var(--muted); line-height: 1.5;
}
.article-hero figcaption .cap { color: var(--text-2); }
.ai-label {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: .8rem;
  font-weight: 650; color: var(--text-2); background: var(--bg-sunk); border: 1px solid var(--border);
}

/* "ตัวเลขสำคัญ / Key figures" */
.key-facts {
  position: relative; overflow: hidden; margin: 0 0 30px; padding: 18px 20px 20px; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--border);
}
.key-facts::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--gold), #e3cfa6, var(--gold)); }
.key-facts h2 { margin: 0 0 14px; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
html[lang="th"] .key-facts h2 { font-size: .95rem; letter-spacing: .02em; }
.kf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.kf-grid.kf-n1 { grid-template-columns: minmax(0, 1fr); }
.kf {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding: 14px 16px;
  border-radius: 12px; background: var(--gold-soft); border: 1px solid var(--gold-line);
}
.kf dd {
  margin: 0; font-size: clamp(1.55rem, 3.2vw, 2.05rem); font-weight: 800; line-height: 1.12; letter-spacing: -.01em;
  color: var(--gold-ink); font-variant-numeric: tabular-nums; overflow-wrap: break-word;
}
.kf.kf-l dd { font-size: clamp(1.3rem, 2.5vw, 1.6rem); }
.kf.kf-xl dd { font-size: clamp(1.1rem, 2vw, 1.3rem); }
.kf dt { font-size: .88rem; line-height: 1.45; color: var(--text-2); }

/* Video: YouTube thumbnail + play button; the iframe is created on click */
.video-box { margin: 32px 0 8px; }
.video-box h2 { font-size: 1.15rem; margin: 0 0 12px; }
.yt { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: #000; box-shadow: var(--shadow); }
.yt-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play {
  position: absolute; inset: 0; width: 100%; height: 100%; display: grid; place-items: center; padding: 0; border: 0;
  cursor: pointer; color: #fff; background: linear-gradient(180deg, rgba(0, 0, 0, .04), rgba(0, 0, 0, .32));
}
.yt-btn {
  display: grid; place-items: center; width: 74px; height: 52px; border-radius: 15px; background: #e3002d;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .45); transition: background .15s, transform .15s;
}
.yt-btn svg { width: 30px; height: 30px; }
.yt-play:hover .yt-btn, .yt-play:focus-visible .yt-btn { background: #c20026; transform: scale(1.07); }
.yt-play:focus-visible { box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 6px var(--primary); border-radius: inherit; }
.yt-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 12px; }
.yt-info { min-width: 0; flex: 1 1 260px; }
.yt-title { font-weight: 700; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.yt-sub { font-size: .86rem; color: var(--muted); }
.yt-note { margin: 8px 0 0; font-size: .8rem; color: var(--muted); }

@media (max-width: 640px) {
  .article-hero-media { border-radius: var(--radius); }
  .article-hero-media img { max-height: 62vh; }
  .key-facts { padding: 16px; }
  .kf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kf-grid.kf-n1, .kf-grid.kf-n3 .kf:last-child { grid-column: 1 / -1; }
  .kf { padding: 12px 14px; }
  .yt-meta .yt-link { width: 100%; justify-content: center; }
}

/* ---- 17. News sections & categories (groups, admin display toggle — lnw.news SPEC §6b) ---- */
/* --cc = category colour from the categories collection (validated inline), --gc = section/group colour */
.badge-cat { background: color-mix(in srgb, var(--cc, var(--primary)) 13%, transparent); color: color-mix(in srgb, var(--cc, var(--primary)) 60%, #0f172a); }
html[data-theme="dark"] .badge-cat { background: color-mix(in srgb, var(--cc, #818cf8) 22%, transparent); color: color-mix(in srgb, var(--cc, #818cf8) 50%, #fff); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .badge-cat { background: color-mix(in srgb, var(--cc, #818cf8) 22%, transparent); color: color-mix(in srgb, var(--cc, #818cf8) 50%, #fff); }
}
.badge-on-image { background: rgba(255, 255, 255, .92); color: #1e1b4b; }
html[data-theme="dark"] .badge-on-image { color: #1e1b4b; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .badge-on-image { color: #1e1b4b; } }
.badge-on-image::before, .cover-cat::before {
  content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--cc, var(--primary));
}
.cover-cat { display: inline-flex; align-items: center; gap: 6px; }
.badge-link:hover { text-decoration: none; }
.article-cat { margin: 14px 0 -2px; }
.article-cat .badge { font-size: .8rem; padding: 4px 12px; }

/* chips: category (coloured when active), section/group, separators */
.chip-cat:hover { border-color: var(--cc, var(--primary)); }
.chip-group { font-weight: 750; }
.chip-group:hover { border-color: var(--gc, var(--primary)); }
.chip.chip-cat[aria-pressed="true"], .chip.chip-cat[aria-current="page"] {
  background: color-mix(in srgb, var(--cc, var(--primary)) 14%, var(--bg-elev)); border-color: var(--cc, var(--primary));
  color: color-mix(in srgb, var(--cc, var(--primary)) 60%, #0f172a) !important; box-shadow: inset 0 0 0 1px var(--cc, var(--primary));
}
.chip.chip-group[aria-pressed="true"] {
  background: color-mix(in srgb, var(--gc, var(--primary)) 14%, var(--bg-elev)); border-color: var(--gc, var(--primary));
  color: color-mix(in srgb, var(--gc, var(--primary)) 60%, #0f172a) !important; box-shadow: inset 0 0 0 1px var(--gc, var(--primary));
}
html[data-theme="dark"] .chip.chip-cat[aria-pressed="true"], html[data-theme="dark"] .chip.chip-cat[aria-current="page"] { color: color-mix(in srgb, var(--cc, #818cf8) 45%, #fff) !important; }
html[data-theme="dark"] .chip.chip-group[aria-pressed="true"] { color: color-mix(in srgb, var(--gc, #818cf8) 45%, #fff) !important; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .chip.chip-cat[aria-pressed="true"], html:not([data-theme="light"]) .chip.chip-cat[aria-current="page"] { color: color-mix(in srgb, var(--cc, #818cf8) 45%, #fff) !important; }
  html:not([data-theme="light"]) .chip.chip-group[aria-pressed="true"] { color: color-mix(in srgb, var(--gc, #818cf8) 45%, #fff) !important; }
}
.chip-sep { flex: none; width: 1px; align-self: stretch; margin: 5px 2px; background: var(--border-strong); }
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .badge-cat { background: var(--primary-soft); color: var(--primary); }
  .chip.chip-cat[aria-pressed="true"], .chip.chip-group[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff !important; }
}

/* header: "ข่าว ▾" + mega-menu (desktop); mobile uses the drawer sections */
.nav-drop { position: relative; display: inline-flex; align-items: center; }
.main-nav .nav-drop > a { padding-right: 5px; }
.nav-drop-btn {
  display: inline-grid; place-items: center; width: 26px; height: 34px; margin-left: -3px; padding: 0; border: 0;
  border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer;
}
.nav-drop-btn svg { width: 15px; height: 15px; transition: transform .18s ease; }
.nav-drop-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-drop-btn:hover, .nav-drop-btn[aria-expanded="true"] { background: var(--primary-soft); color: var(--text); }
.mega {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 49; background: var(--bg-elev);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.mega-inner { padding-top: 22px; padding-bottom: 16px; }
.mega-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 28px; }
.mega-col.wide { grid-column: span 2; }
.mega-col.wide ul { grid-template-columns: 1fr 1fr; column-gap: 12px; }
.mega-col { border-top: 3px solid var(--gc, var(--primary)); padding-top: 10px; }
.mega-group { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 800; color: var(--text) !important; }
.mega-group:hover, .mega-group[aria-current="page"] { text-decoration: none; color: var(--gc, var(--primary)) !important; }
.mega-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mega-col li a {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 9px; font-size: .93rem;
  color: var(--text-2) !important; border-left: 3px solid transparent;
}
.mega-col li a:hover, .mega-col li a[aria-current="page"] {
  text-decoration: none; color: var(--text) !important; border-left-color: var(--cc, var(--primary));
  background: color-mix(in srgb, var(--cc, var(--primary)) 10%, transparent);
}
.mega-col .mi { flex: none; width: 1.3em; text-align: center; }
.mega-desc { margin: 2px 0 0; font-size: .86rem; line-height: 1.5; color: var(--muted); }
.mega-foot { display: flex; gap: 20px; justify-content: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .9rem; font-weight: 650; }
@media (max-width: 920px) { .mega { display: none !important; } }

.drawer { overflow-y: auto; }
.drawer-sec { margin: 0 0 6px 14px; padding: 4px 0 6px 12px; border-left: 2px solid var(--border); }
.drawer-sec-title { margin: 2px 0 4px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.drawer-group summary {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  font-weight: 650; color: var(--text); list-style: none;
}
.drawer-group summary::-webkit-details-marker { display: none; }
.drawer-group summary::after {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 4px 3px 6px; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s;
}
.drawer-group[open] summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
.drawer-group summary:hover { background: var(--primary-soft); }
.dg-count { margin-left: auto; padding: 0 8px; border-radius: 999px; background: var(--bg-sunk); color: var(--muted); font-size: .74rem; font-weight: 700; }
.drawer-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 4px 10px 10px; }
.drawer-cats .chip { padding: 6px 11px; font-size: .84rem; }
.drawer-cats .chip[aria-current="page"] { border-color: var(--cc, var(--primary)); }
.drawer-tools { align-items: center; }
.drawer-tools .btn { margin-top: 0; }

/* home: per-section blocks (tech first) */
.home-sections { margin-top: 12px; }
.home-sec { padding-top: 26px; padding-bottom: 6px; }
.sec-head {
  position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 2px solid var(--border);
}
.sec-head::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 96px; height: 3px; border-radius: 3px; background: var(--gc, var(--primary)); }
.sec-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.55rem); }
.sec-ic {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; font-size: 1.1rem;
  background: color-mix(in srgb, var(--gc, var(--primary)) 14%, transparent);
}
.sec-cats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; }
.sec-cats a { color: var(--text-2) !important; font-weight: 600; }
.sec-cats a:hover { color: var(--text) !important; text-decoration-color: var(--cc, var(--primary)); text-decoration-thickness: 2px; }
.sec-all { margin-left: auto; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.sec-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.sec-row .article-card .cover-emoji { font-size: 2.4rem; }

/* /news: sections row + categories of the active section */
.news-filter { display: grid; gap: 10px; margin-bottom: 16px; }
.group-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.cat-row { padding: 10px 12px; border-radius: var(--radius); background: var(--bg-sunk); border: 1px solid var(--border); }
.page-hero[style*="--gc"] .eyebrow { color: color-mix(in srgb, var(--gc) 62%, #0f172a); }
html[data-theme="dark"] .page-hero[style*="--gc"] .eyebrow { color: color-mix(in srgb, var(--gc) 45%, #fff); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .page-hero[style*="--gc"] .eyebrow { color: color-mix(in srgb, var(--gc) 45%, #fff); } }

@media (max-width: 1080px) {
  .sec-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .home-sec { padding-top: 20px; }
  .sec-cats { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .sec-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  /* compact rows after the first card: thumbnail left, title right */
  .sec-row .article-card:not(:first-child) { flex-direction: row; }
  .sec-row .article-card:not(:first-child) .cover { flex: none; width: 112px; aspect-ratio: auto; min-height: 88px; }
  .sec-row .article-card:not(:first-child) .cover-emoji { font-size: 1.6rem; right: 8px; bottom: 6px; }
  .sec-row .article-card:not(:first-child) .cover-cat,
  .sec-row .article-card:not(:first-child) .thumb-badges,
  .sec-row .article-card:not(:first-child) p { display: none; }
  .sec-row .article-card:not(:first-child) .article-card-body { padding: 10px 12px; gap: 4px; }
  .sec-row .article-card:not(:first-child) h3 { font-size: .96rem; -webkit-line-clamp: 2; }
  .sec-row .article-card:not(:first-child) .meta { padding-top: 2px; font-size: .78rem; }
  .sec-row .article-card:not(:first-child) .meta span:nth-child(n+3) { display: none; }   /* date + read time only */
  .cat-row { flex-wrap: nowrap; overflow-x: auto; }
}

/* ---- 16. SaaS marketplace (/appcenter, /appcenter/<slug>, /shops, /shops/<slug>) ---- */
/* header "Sell on BigTechCenter" */
.main-nav a.nav-sell { margin-left: 6px; border: 1px dashed var(--border-strong); color: var(--primary) !important; font-weight: 650; white-space: nowrap; }
.main-nav a.nav-sell:hover { border-color: var(--primary); }
html[data-theme="dark"] .main-nav a.nav-sell { color: #a5b4fc !important; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .main-nav a.nav-sell { color: #a5b4fc !important; } }
.drawer a.drawer-sub { padding: 8px 14px 8px 30px; font-weight: 550; color: var(--text-2) !important; }
.drawer a.drawer-sell { margin-top: 6px; border: 1px dashed var(--border-strong); color: var(--primary) !important; }
.main-nav a { white-space: nowrap; }
.nav-sell .ns-short { display: none; }
@media (max-width: 1240px) { .main-nav a.nav-sell { margin-left: 2px; } }
@media (max-width: 1180px) {
  .nav-sell .ns-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-sell .ns-short { display: inline; }
}

/* shop badges */
.badge-official, .badge-verified { gap: 3px; white-space: nowrap; }
.badge-official { background: var(--grad); color: #fff !important; }
.badge-verified { background: rgba(5, 150, 105, .12); color: #047857; }
html[data-theme="dark"] .badge-verified { color: #6ee7b7; background: rgba(52, 211, 153, .14); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .badge-verified { color: #6ee7b7; background: rgba(52, 211, 153, .14); } }
.badge-official svg, .badge-verified svg { width: 11px; height: 11px; }

/* product card additions */
.pc-badges { justify-content: flex-end; }
.pc-shop { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; font-size: .84rem; color: var(--muted); }
.pc-price { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .92rem; }
.pc-price b { color: var(--text); font-weight: 750; }
.pc-price small { color: var(--muted); font-size: .8rem; margin-left: 2px; }
.product-card .pc-price + .product-foot { margin-top: 0; }
.product-card .pc-price { margin-top: auto; }

/* shop logo + cards */
.shop-logo {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; overflow: hidden;
  background: var(--grad); color: #fff; font-weight: 900; font-size: 1.35rem; border: 1px solid var(--border);
}
.shop-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.shop-logo.is-official { background: var(--bg-elev); color: var(--text); }
.shop-logo .shop-mark { width: 72%; height: 72%; }
.shop-card {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1px solid var(--border); color: inherit !important; min-width: 0;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.shop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.shop-card-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.shop-card h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shop-card h3 > span:first-child { overflow-wrap: anywhere; }
.shop-card p { margin: 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); }
.shop-card-meta > span:first-child { margin-right: 4px; }
.shop-card.compact { padding: 14px; }
.shop-card.compact .shop-logo { width: 44px; height: 44px; font-size: 1.1rem; border-radius: 12px; }

/* horizontal strips (featured products, shops) — scroll inside the container, never the page */
.mp-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 18px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 4px 2px 12px; scrollbar-width: thin;
}
.mp-strip > * { scroll-snap-align: start; }
.mp-strip-shops { grid-auto-columns: minmax(250px, 1fr); }
@media (min-width: 1081px) { .mp-strip { grid-auto-columns: calc((100% - 54px) / 4); } }

/* search + filters */
.mp-search { position: relative; display: flex; gap: 10px; max-width: 680px; margin-top: 18px; }
.mp-search input {
  flex: 1; min-width: 0; padding: 13px 16px 13px 44px; border-radius: 14px; border: 1px solid var(--border-strong);
  background: var(--bg-elev); color: var(--text); font-size: 1rem; box-shadow: var(--shadow-sm);
}
.mp-search input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.mp-search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.mp-search-ic svg { width: 20px; height: 20px; }
.mp-filters {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px 16px; align-items: end;
  margin: 14px 0 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border);
}
.mp-filter { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mp-filter > label:not(.check) { font-size: .8rem; font-weight: 650; color: var(--muted); }
.mp-filter select, .mp-filter input[type="search"] {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text);
}
.mp-filter select:focus, .mp-filter input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.mp-checks { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; padding-bottom: 6px; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: .9rem; font-weight: 550; color: var(--text-2); line-height: 1.45; }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); cursor: pointer; }
.mp-resultbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; margin-bottom: 12px; flex-wrap: wrap; }
.chip-n { font-size: .75rem; font-weight: 700; opacity: .7; }
.state h3 { color: var(--text); }

/* "Sell on BigTechCenter" band */
.sell-band {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: center; padding: 30px 32px;
  border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-elev); background-image: var(--grad-soft);
}
.sell-band h2 { margin: 6px 0 6px; font-size: clamp(1.2rem, 2.4vw, 1.55rem); }
.sell-band p { margin: 0; color: var(--text-2); max-width: 720px; }
.sell-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }

/* product page */
.product-shopline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 10px; color: var(--muted); font-size: .95rem; }
.product-shopline a { font-weight: 650; }
.mp-product-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.mp-aside { display: grid; gap: 18px; position: sticky; top: calc(var(--header-h) + 16px); }
.mp-box { padding: 20px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); }
.mp-box h2, .mp-box h3 { font-size: 1rem; margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.shop-box-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.shop-box-head b { display: block; font-size: 1.08rem; color: var(--text); overflow-wrap: anywhere; }
.shop-box p { color: var(--text-2); font-size: .92rem; margin: 0 0 12px; }
.mp-actions { display: grid; gap: 8px; }
.facts { margin: 0; display: grid; gap: 10px; font-size: .92rem; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.mp-details { margin-top: 28px; }
.mp-details .prose { font-size: 1rem; }
html[lang="th"] .mp-details .prose { font-size: 1.02rem; line-height: 1.85; }
.screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 12px; }
.screens a { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-sunk); }
.screens img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.inquiry-card { max-width: 820px; margin: 0 auto; padding: 28px; }
.inquiry-card .head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.inquiry-card .head h2 { margin: 0; }
.inquiry-card .head p { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }
.consent-field { padding: 14px 16px; border-radius: 12px; background: var(--bg-sunk); border: 1px solid var(--border); }
.consent-field .check { color: var(--text); font-weight: 650; }
.consent-text { margin: 0 0 0 26px; font-size: .84rem; color: var(--muted); line-height: 1.55; }
.consent-ver { display: inline-block; margin-left: 4px; font-size: .78rem; opacity: .85; }
.consent-field.has-error { border-color: var(--danger); }
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.modal form, .inquiry-card form { position: relative; }
.plan-card .plan-price.plan-contact { font-size: 1.45rem; }

/* shop page */
.shop-hero { position: relative; padding: 0 0 26px; }
.shop-cover {
  height: clamp(130px, 22vw, 240px); border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--grad);
  background-size: cover; background-position: center;
}
.shop-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: start; padding-top: 14px; }
.shop-head .shop-logo { width: 104px; height: 104px; margin-top: -62px; border-radius: 26px; font-size: 2.6rem; border: 4px solid var(--bg); box-shadow: var(--shadow); }
.shop-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
.shop-head h1 .badge { font-size: .8rem; padding: 4px 12px; }
.shop-head .lead { margin: 4px 0 0; color: var(--text-2); font-size: 1.05rem; }
.shop-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.shop-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 16px; color: var(--muted); font-size: .9rem; }
.shop-meta span { display: inline-flex; align-items: center; gap: 6px; }
.shop-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .92rem; overflow-wrap: anywhere; }

@media (max-width: 1080px) {
  .mp-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mp-checks { grid-column: 1 / -1; }
}
@media (max-width: 920px) {
  .mp-product-layout, .shop-layout { grid-template-columns: minmax(0, 1fr); }
  .mp-aside { position: static; }
  .shop-head { grid-template-columns: auto minmax(0, 1fr); }
  .shop-head-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .mp-search { flex-wrap: nowrap; }
  .mp-search .btn { padding: 10px 14px; }
  .mp-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px; }
  .mp-filter:nth-child(3) { grid-column: 1 / -1; }
  .sell-band { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; }
  .sell-actions { flex-direction: row; flex-wrap: wrap; }
  .mp-strip { grid-auto-columns: minmax(240px, 82%); }
  .shop-head { gap: 4px 14px; }
  .shop-head .shop-logo { width: 76px; height: 76px; margin-top: -48px; border-radius: 20px; font-size: 2rem; }
  .inquiry-card { padding: 20px 16px; }
  .consent-text { margin-left: 0; margin-top: 6px; }
}
@media (max-width: 400px) {
  .mp-filters { grid-template-columns: minmax(0, 1fr); }
}
#inquiry, #plans { scroll-margin-top: calc(var(--header-h) + 12px); }

/* Analytics consent banner + privacy section (site.js §9b, analytics.js) -------------------------- */
.an-consent { position: fixed; left: 16px; bottom: 16px; z-index: 150; width: min(420px, calc(100vw - 32px)); padding: 14px 16px; border-radius: var(--radius); background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: .9rem; line-height: 1.55; animation: toast-in .2s ease; }
.an-consent p { margin: 0 0 10px; color: var(--text-2); }
.an-consent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.an-consent-actions a { margin-left: auto; font-size: .85rem; color: var(--link); }
@media (max-width: 560px) { .an-consent { left: 8px; right: 8px; bottom: 8px; width: auto; } }
@media print { .an-consent { display: none; } }
.privacy-card { padding: 28px; scroll-margin-top: calc(var(--header-h) + 16px); }
.privacy-card h2 { font-size: clamp(1.15rem, 2.2vw, 1.45rem); margin: 6px 0 12px; }
.privacy-card > p { color: var(--text-2); margin: 0 0 10px; max-width: 75ch; }
.privacy-controls { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.privacy-controls p { margin: 0 0 10px; }

/* ---- 17. Member account (Sign in with Google: header, drawer, subscribe modal, /account) ---- */
.acct-slot { display: inline-flex; align-items: center; }
.acct-slot:empty { display: none; }
.acct-btn { display: inline-flex; align-items: center; gap: 6px; border-color: var(--border); white-space: nowrap; color: var(--text-2) !important; }
.acct-btn:hover { text-decoration: none; }
.acct-btn svg { width: 18px; height: 18px; }
/* icon only: the 1200 px header has no room for a text label without squeezing the wordmark */
.acct-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.acct-drop { position: relative; }
.acct-avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--bg-elev);
  background: var(--grad); color: #fff; font-weight: 800; font-size: .95rem; cursor: pointer; box-shadow: 0 0 0 1px var(--border-strong);
}
.acct-avatar:hover, .acct-avatar[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--primary); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 70; width: min(280px, calc(100vw - 24px));
  padding: 6px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.acct-menu a, .acct-menu button {
  display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; text-align: left;
  font: inherit; font-size: .92rem; font-weight: 600; color: var(--text) !important; cursor: pointer;
}
.acct-menu a:hover, .acct-menu button:hover { background: var(--primary-soft); text-decoration: none; }
.acct-who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); min-width: 0; }
.acct-avatar-lg {
  flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 1.05rem;
}
.acct-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.acct-id b, .acct-id small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-id small { color: var(--muted); font-size: .8rem; }
.drawer-acct { margin: 0 0 10px; padding: 0 0 12px; border-bottom: 1px solid var(--border); }
.drawer-acct .acct-who { border-bottom: 0; padding: 4px 4px 8px; margin: 0; }
.drawer-acct-links { display: flex; gap: 8px; flex-wrap: wrap; }
.drawer-acct-links .btn { margin-top: 0; }
.drawer .drawer-acct .g-btn { margin-top: 0; }

/* Google button (branding: white / #131314 in dark, Google "G" mark, never recoloured) */
.g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px;
  background: #fff; border: 1px solid #747775; color: #1f1f1f !important; font-weight: 600;
}
.g-btn:hover { background: #f7f8f8; text-decoration: none; box-shadow: 0 1px 3px rgba(60, 64, 67, .3); }
.g-btn .g-logo { width: 20px; height: 20px; flex: none; }
html[data-theme="dark"] .g-btn { background: #131314; border-color: #8e918f; color: #e3e3e3 !important; }
html[data-theme="dark"] .g-btn:hover { background: #1f1f20; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .g-btn { background: #131314; border-color: #8e918f; color: #e3e3e3 !important; }
  html:not([data-theme="light"]) .g-btn:hover { background: #1f1f20; }
}
.sub-google { margin-bottom: 4px; }
.sub-google .field-hint { text-align: center; margin-top: 6px; }
.or-sep { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--muted); font-size: .82rem; font-weight: 600; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sub-member { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 14px; border-radius: 12px; background: var(--primary-soft); font-size: .88rem; font-weight: 600; min-width: 0; }
.sub-member span:last-child { overflow-wrap: anywhere; }
.sub-member .acct-avatar-lg { width: 32px; height: 32px; font-size: .9rem; }
input[readonly].is-locked { background: var(--bg-sunk); color: var(--text-2); cursor: not-allowed; }

/* /account */
.acct-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 880px; }
.acct-page > *, .ms-card > *, .acct-head > * { min-width: 0; }
.acct-card { padding: 24px; }
.acct-card h2 { font-size: 1.2rem; margin: 0 0 10px; }
.acct-card > p { color: var(--text-2); max-width: 70ch; }
.acct-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.acct-head .acct-avatar-lg { width: 52px; height: 52px; font-size: 1.35rem; }
.acct-head h1 { margin: 0; font-size: clamp(1.3rem, 3vw, 1.75rem); overflow-wrap: anywhere; }
.acct-head .acct-id small { font-size: .88rem; }
.acct-head .acct-id { flex: 1 1 200px; }
.acct-signin { max-width: 560px; }
.acct-signin .g-btn { width: 100%; max-width: 360px; }
.acct-notes { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--text-2); font-size: .92rem; }
.acct-notes li { display: flex; gap: 8px; }
.ms-card { padding: 22px; display: grid; gap: 14px; }
.ms-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ms-top h3 { margin: 0; font-size: 1.08rem; }
.ms-top .text-muted { font-size: .88rem; }
.ms-chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.ms-chip.ok { background: rgba(5, 150, 105, .12); color: var(--success); }
.ms-chip.warn { background: rgba(180, 83, 9, .12); color: var(--warning); }
.ms-chip.off { background: var(--bg-sunk); color: var(--muted); }
.ms-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; margin: 0; }
.ms-facts dt { font-size: .78rem; color: var(--muted); font-weight: 600; }
.ms-facts dd { margin: 2px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.ms-alert { padding: 12px 14px; border-radius: 12px; background: var(--bg-sunk); border: 1px solid var(--border); font-size: .9rem; }
.ms-alert b { display: block; margin-bottom: 2px; }
.ms-alert.warn { background: rgba(245, 158, 11, .10); border-color: rgba(245, 158, 11, .35); }
.ms-alert.err { background: rgba(220, 38, 38, .08); border-color: rgba(220, 38, 38, .3); }
.ms-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ms-receipts { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ms-receipts th, .ms-receipts td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--border); vertical-align: top; }
.ms-receipts th { color: var(--muted); font-weight: 600; font-size: .78rem; border-top: 0; }
.ms-receipts .num { text-align: right; white-space: nowrap; }
.ms-receipts-wrap { overflow-x: auto; }
.acct-danger { border-color: rgba(220, 38, 38, .35); }
.btn-danger { background: transparent; border-color: rgba(220, 38, 38, .55); color: var(--danger) !important; }
.btn-danger:hover { background: rgba(220, 38, 38, .08); }
@media (max-width: 640px) {
  .acct-card, .ms-card { padding: 18px; }
  .ms-actions .btn { width: 100%; }
  .acct-avatar { width: 34px; height: 34px; }
}

/* ---- home: member box (log in with Google / subscribe) — sidebar ≥ 921 px, strip under the hero ≤ 920 px ---- */
.member-box { background-image: var(--grad-soft); }
.member-box .btn-block + .btn-block { margin-top: 8px; }
.member-box .g-btn { display: flex; justify-content: center; width: 100%; }
.member-hi { font-weight: 700; margin-bottom: 10px; overflow-wrap: anywhere; }
.member-from { margin: 8px 0 0; font-size: .82rem; color: var(--muted); text-align: center; }
.member-or { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: .8rem; color: var(--muted); }
.member-or::before, .member-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.member-strip { display: none; margin-top: 18px; }
@media (max-width: 920px) {
  .member-strip { display: block; }
  .member-side { display: none; }
}

/* ---- Life Hack / DIY: safety box, license box, member badge (article.js) ---- */
.safety-box {
  margin: 0 0 1.5rem; padding: 14px 18px; border-radius: 12px;
  background: rgba(245, 158, 11, .12); border: 1px solid rgba(217, 119, 6, .45); border-left-width: 5px;
}
.safety-box h2 { margin: 0 0 4px; font-size: 1.02rem; color: var(--warning); display: flex; align-items: center; gap: 6px; }
.safety-box p { margin: 0; color: var(--text); line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.license-box {
  margin: .75rem 0 1rem; padding: 1rem 1.25rem; border-radius: 12px; font-size: .92rem;
  background: var(--bg-sunk); border: 1px dashed var(--border-strong);
}
.license-box h2 { font-size: 1rem; margin: 0 0 .4rem; display: flex; align-items: center; gap: 6px; }
.license-box p { margin: 0; color: var(--text-2); line-height: 1.65; overflow-wrap: anywhere; }
.license-box p + p { margin-top: .4rem; }
.license-box a { font-weight: 600; }
.member-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: rgba(13, 148, 136, .12); color: #0f766e; white-space: nowrap;
}
:root[data-theme="dark"] .member-badge { color: #5eead4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .member-badge { color: #5eead4; } }
.member-box .avatar { font-size: 1.8rem; }
.member-box .btn { margin-top: 10px; }

/* ---- /account tabs + "เขียนบทความ / Write" (account.js, account-write.js) ---- */
.acct-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.acct-tab {
  appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; padding: 10px 14px;
  border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; border-radius: 8px 8px 0 0;
}
.acct-tab:hover { color: var(--text); background: var(--bg-sunk); }
.acct-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.acct-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ms-chip.err { background: rgba(220, 38, 38, .12); color: var(--danger); }
.wr-head-top { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.wr-head-top h2 { margin: 0 0 6px; }
.wr-head p { color: var(--text-2); margin: 0 0 8px; max-width: 64ch; }
.wr-limits { font-size: .88rem; margin: 4px 0 10px !important; }
.wr-rules { font-size: .88rem; line-height: 1.6; padding: 10px 14px; border-radius: 10px; background: var(--bg-sunk); color: var(--text-2); margin: 0 0 12px; }
.wr-rules b { color: var(--warning); }
.wr-list { display: grid; gap: 14px; }
.wr-card { padding: 18px 20px; display: grid; gap: 8px; }
.wr-card h3 { margin: 0; font-size: 1.08rem; overflow-wrap: anywhere; }
.wr-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.wr-cat { font-size: .85rem; font-weight: 700; color: var(--text-2); }
.wr-ex { margin: 0; color: var(--text-2); font-size: .93rem; }
.wr-dates { font-size: .82rem; }
.wr-del { color: var(--danger) !important; }
.wr-empty { text-align: center; color: var(--muted); }
.wr-empty span { font-size: 2rem; }
.wr-editor { display: grid; gap: 12px; }
.wr-back { justify-self: start; }
.wr-form { display: grid; gap: 14px; }
.wr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wr-field { display: grid; gap: 5px; min-width: 0; }
.wr-field textarea { min-height: 72px; }
.wr-field .form-label { font-weight: 600; font-size: .9rem; color: var(--text-2); }
.wr-hint { color: var(--muted); font-size: .82rem; }
.wr-err { color: var(--danger); font-size: .85rem; font-weight: 600; }
.wr-field.has-err .form-control, .wr-field.has-err .form-select, .wr-field.has-err .wr-body { border-color: var(--danger); }
.wr-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--border); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--bg-sunk); }
.wr-tool {
  min-width: 36px; height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: var(--bg-elev);
  color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
}
.wr-tool:hover { border-color: var(--border-strong); }
.wr-tool:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.wr-tool[data-cmd="italic"] { font-style: italic; }
.wr-body {
  min-height: 260px; max-height: 70vh; overflow: auto; padding: 12px 16px; border: 1px solid var(--border); border-radius: 0 0 10px 10px;
  background: var(--bg-elev); color: var(--text); line-height: 1.7;
}
.wr-body:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.wr-body > :first-child { margin-top: 0; }
.wr-count { font-size: .82rem; color: var(--muted); }
.wr-count.low { color: var(--warning); font-weight: 600; }
.wr-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.wr-consent { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-sunk); line-height: 1.55; font-size: .93rem; cursor: pointer; }
.wr-consent input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.wr-consent small { display: block; color: var(--muted); margin-top: 4px; font-size: .82rem; }
.wr-consent.has-err { border-color: var(--danger); }
.wr-actions { flex-wrap: wrap; }
@media (max-width: 640px) {
  .wr-grid { grid-template-columns: minmax(0, 1fr); }
  .wr-card { padding: 16px; }
  .wr-head-top .btn { width: 100%; }
}

/* ---- 18. AI star rating (ai_ratings.py): card chip "★ 4.2 · AI" (classes air-*; .ai-chip belongs to AI illustrations), product-page assessment box, /about#ai-rating ----
   An AI assessment of the listing data — never styled like (or called) a user review. */
.air-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px 1px 7px; border-radius: 999px; font-size: .82rem; line-height: 1.7; white-space: nowrap; background: rgba(245, 158, 11, .12); color: #92400e; border: 1px solid rgba(245, 158, 11, .38); }
.air-chip .air-star { color: #d97706; }
.air-chip b { font-weight: 750; color: inherit; font-variant-numeric: tabular-nums; }
.air-chip .air-tag { font-weight: 650; letter-spacing: .02em; opacity: .85; }
a.air-chip { text-decoration: none !important; cursor: pointer; }
a.air-chip:hover { background: rgba(245, 158, 11, .2); }
.air-chip-lg { font-size: .92rem; padding: 2px 12px 2px 9px; }
html[data-theme="dark"] .air-chip { color: #fcd34d; background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .34); }
html[data-theme="dark"] .air-chip .air-star { color: #fbbf24; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .air-chip { color: #fcd34d; background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .34); }
  html:not([data-theme="light"]) .air-chip .air-star { color: #fbbf24; }
}
.air-box { padding: 22px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-sm); scroll-margin-top: calc(var(--header-h) + 16px); }
.air-box:focus { outline: none; }
.air-head { display: flex; gap: 16px; align-items: center; }
.air-head-main { min-width: 0; }
.air-score { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 86px; height: 86px; flex: none; border-radius: 18px; background: var(--grad-soft); border: 1px solid var(--border); }
.air-num { font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.air-of { font-size: .74rem; color: var(--muted); margin-top: 4px; }
.air-head h2 { margin: 0 0 4px; font-size: 1.22rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.air-pill { font-size: .7rem; font-weight: 750; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--link); }
.air-stars { --pct: 0%; display: inline-block; font-size: 1.15rem; letter-spacing: 2px; line-height: 1.25; color: transparent; background: linear-gradient(90deg, #f59e0b var(--pct), var(--border-strong) var(--pct)); -webkit-background-clip: text; background-clip: text; }
.air-meta { font-size: .85rem; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.air-disclosure { margin: 16px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--bg-sunk); border: 1px dashed var(--border-strong); font-size: .88rem; color: var(--text-2); line-height: 1.65; }
.air-disclosure a { font-weight: 650; white-space: nowrap; }
.air-changed { margin: 10px 0 0; font-size: .86rem; color: var(--warning); }
.air-summary { margin-top: 16px; }
.air-summary h3, .air-crit-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.air-crit-h { margin-top: 18px; }
.air-summary p { margin: 0; color: var(--text); line-height: 1.7; }
.air-crit { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.air-crit-row { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; color: var(--text); }
.air-crit-row b { font-variant-numeric: tabular-nums; }
.air-bar { height: 8px; margin-top: 5px; border-radius: 999px; overflow: hidden; background: var(--bg-sunk); border: 1px solid var(--border); }
.air-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.air-note { margin: 5px 0 0; font-size: .84rem; color: var(--muted); line-height: 1.55; }
@media (max-width: 720px) { .air-crit { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .air-box { padding: 16px; }
  .air-head { gap: 12px; }
  .air-score { width: 70px; height: 70px; border-radius: 14px; }
  .air-num { font-size: 1.7rem; }
}
.airate-list { list-style: none; margin: 4px 0 16px; padding: 0; display: grid; gap: 8px; max-width: 75ch; }
.airate-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 6px; color: var(--text-2); }
.airate-list li::before { content: "★"; color: #f59e0b; }
.airate-list b { color: var(--text); }
