@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Colors per design spec */
  --color-primary: #8D0F17;
  --color-primary-hover: #B21824;
  --color-secondary: #D8A93C;
  --color-accent: #FFD86B;
  --color-bg: #F7F8FA;
  --color-surface: #FFFFFF;
  --color-border: #ECECEC;
  --color-text: #202124;
  --color-text-muted: #666666;
  --color-success: #29B36A;
  --color-warning: #FFB020;
  --color-danger: #E5484D;
  --color-info: #3B82F6;

  /* Legacy aliases used across pages — kept for compatibility */
  --color-primary-dark: #6B0A11;
  --color-primary-light: #FBEAEC;
  --color-gold: var(--color-secondary);
  --color-gold-dark: #A88318;
  --color-gold-light: #FFF6DA;
  --color-danger-bg: #FDECEC;
  --color-warning-bg: #FFF6E5;
  --color-success-bg: #E7F7EF;

  /* Radius & spacing (8px system) */
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 12px 32px rgba(141, 15, 23, 0.15);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.16);

  --font-display: "Prompt", "Inter", "Noto Sans Thai", sans-serif;
  --font-body: "Prompt", "Inter", "Noto Sans Thai", sans-serif;

  --duration: 300ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--color-primary-hover); text-decoration: none; }

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

button { font-family: inherit; }

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

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Fade-up animation utility */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 500ms var(--ease) both; }

/* ==================== HEADER (solid bar) ==================== */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--color-primary);
  height: 60px;
  display: flex; align-items: center;
  transition: box-shadow 300ms var(--ease);
}
.site-header.scrolled {
  position: fixed;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.site-header .brand,
.site-header .brand:hover { color: #fff; text-shadow: none; }
.site-header .main-nav a { color: rgba(255, 255, 255, 0.8); }
.site-header .main-nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.site-header .main-nav a.active { background: rgba(255, 255, 255, 0.18); color: #fff; font-weight: 600; }
.site-header .icon-btn {
  background: rgba(255, 255, 255, 0.1); color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.site-header .icon-btn:hover { background: rgba(255, 255, 255, 0.22); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.site-header .icon-btn .dot { border-color: var(--color-primary); }
body.no-hero .site-header {
  position: sticky; top: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; width: 100%;
}
.header-left { display: flex; align-items: center; gap: 24px; min-width: 0; overflow: hidden; }
.header-left .main-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.header-left .main-nav::-webkit-scrollbar { display: none; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  color: var(--color-text); white-space: nowrap; flex-shrink: 0;
}
.brand > span:last-child { white-space: nowrap; }
.brand:hover { color: var(--color-primary); }
.brand-badge {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.main-nav { display: flex; gap: 2px; flex-wrap: nowrap; }
.main-nav a {
  color: var(--color-text-muted); font-weight: 500; font-size: 14px;
  padding: 8px 12px; border-radius: 10px; white-space: nowrap;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.main-nav a:hover { color: var(--color-primary); background: var(--color-primary-light); }
.main-nav a.active { color: var(--color-primary); background: var(--color-primary-light); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--color-bg); color: var(--color-text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: all var(--duration) var(--ease);
  border: 1px solid var(--color-border);
  position: relative;
}
.icon-btn:hover { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary-light); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-danger); border: 2px solid #fff; }

.login-btn {
  background: var(--color-accent);
  color: var(--color-primary-dark); font-family: var(--font-display); font-weight: 600;
  font-size: 13px; padding: 8px 18px; border-radius: var(--radius-pill);
  border: none;
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease);
  white-space: nowrap;
}
.login-btn:hover { background: #ffe699; transform: translateY(-1px); color: var(--color-primary-dark); }

/* ==================== HERO ==================== */
.hero-banner {
  position: relative;
  background: linear-gradient(135deg, #6B0A11 0%, #8D0F17 40%, #4a0708 100%);
  min-height: 520px;
  padding: 100px 0 72px;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: center;
}
/* Slideshow layer */
.hero-slides {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden;
}
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  will-change: transform, opacity;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 900ms cubic-bezier(0.22, 0.61, 0.36, 1), opacity 900ms ease;
}
.hero-slide.prev { transform: translateX(-100%); opacity: 0; }
.hero-slide.active { transform: translateX(0); opacity: 1; }
.hero-slide.next { transform: translateX(100%); opacity: 0; }
/* Overlay tint on top of images */
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(circle at 15% 20%, rgba(216, 169, 60, 0.15) 0, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(178, 24, 36, 0.3) 0, transparent 45%),
    linear-gradient(135deg, rgba(107,10,17,0.75) 0%, rgba(141,15,23,0.5) 40%, rgba(74,7,8,0.8) 100%);
  pointer-events: none;
}
.hero-banner > .container { position: relative; z-index: 2; }
/* Slide indicator dots */
.hero-dots {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 3;
}
.hero-dots button {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.35); border: none;
  cursor: pointer; padding: 0;
  transition: all 300ms var(--ease);
}
.hero-dots button.active { background: var(--color-accent); width: 24px; border-radius: 4px; }
/* Centered hero content */
.hero-content {
  max-width: 680px; margin: 0 auto; text-align: center;
  position: relative; z-index: 2;
}
.hero-content .overline {
  color: var(--color-accent); font-family: var(--font-display); font-weight: 600;
  font-size: 12px; letter-spacing: 3px; margin: 0 0 18px; text-transform: uppercase;
  opacity: 0.9;
}
.hero-content h1 {
  font-family: var(--font-display); font-weight: 800; font-size: 54px; line-height: 1.1;
  color: #fff; margin: 0 0 18px; text-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
}
.hero-content h1 .accent { color: var(--color-accent); }
.hero-content > p {
  color: rgba(255, 255, 255, 0.8); font-size: 16px; margin: 0 0 28px; line-height: 1.6;
}
.hero-banner > .container { position: relative; z-index: 2; width: 100%; }

.search-box {
  display: flex; gap: 0; margin: 0 0 20px;
  background: #fff;
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 22px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}
.search-box input {
  flex: 1; border: none; outline: none;
  font-family: inherit; font-size: 15px;
  background: transparent; color: var(--color-text);
  min-width: 0;
}
.search-box input::placeholder { color: #9CA3AF; }
.search-box button {
  padding: 12px 26px; border: none; border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background var(--duration) var(--ease), transform var(--duration) var(--ease);
  white-space: nowrap;
}
.search-box button:hover { background: var(--color-primary-hover); transform: translateY(-1px); }

.quick-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.quick-tags a {
  background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12px; font-weight: 500;
  padding: 6px 14px; border-radius: var(--radius-pill);
  transition: all var(--duration) var(--ease);
}
.quick-tags a:hover { background: rgba(255,216,107,0.18); border-color: var(--color-accent); color: var(--color-accent); }

/* System status bar — shown only when there are issues */
.sys-status-bar {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 10px 0;
  font-size: 13px;
}
.sys-status-bar.ssb-ok { background: #f0fdf4; border-bottom-color: #bbf7d0; }
.sys-status-inner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ssb-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-warning);
}
.ssb-dot.ok { background: var(--color-success); }
.ssb-label { font-weight: 600; color: #92400e; }
.ssb-label.ok { color: #166534; }
.ssb-systems {
  color: #78350f; font-size: 12px;
  padding: 2px 10px; background: rgba(0,0,0,0.06);
  border-radius: var(--radius-pill);
}
.ssb-link {
  font-size: 12px; font-weight: 600; color: var(--color-primary);
  margin-left: 4px;
}
.ssb-link:hover { text-decoration: underline; }
.ssb-close {
  margin-left: auto; background: none; border: none;
  color: #9CA3AF; cursor: pointer; padding: 2px;
  display: flex; align-items: center;
  border-radius: 4px; transition: color 150ms;
}
.ssb-close:hover { color: var(--color-text); }

/* Shared dot style (kept for any remaining uses) */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.ok { background: var(--color-success); }
.status-dot.warn { background: var(--color-warning); }
.status-dot.err { background: var(--color-danger); }

@media (max-width: 960px) {
  .hero-banner { min-height: auto; padding: 80px 0 56px; }
  .hero-content h1 { font-size: 40px; }
}

/* Stats metric strip */
.stats-strip-wrap {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.stats-strip {
  display: flex; align-items: stretch;
}
.stat-metric {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  padding: 20px 16px;
  border-right: 1px solid var(--color-border);
  transition: background var(--duration) var(--ease);
}
.stat-metric:last-child { border-right: none; }
.stat-metric:hover { background: var(--color-bg); }
.stat-metric .sm-num {
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  color: var(--color-primary); line-height: 1;
}
.stat-metric .sm-label {
  font-size: 11px; font-weight: 500; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ==================== SECTIONS ==================== */
main { padding: 48px 0; }
.section { margin: 0 0 48px; }
.section:last-child { margin-bottom: 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  margin: 0; color: var(--color-text); line-height: 1.2;
  display: flex; align-items: center; gap: 10px;
}
.section-head h2::before {
  content: ''; display: inline-block;
  width: 3px; height: 20px;
  background: var(--color-primary); border-radius: 2px; flex-shrink: 0;
}
.section-head a {
  font-size: 13px; font-weight: 600; color: var(--color-primary);
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
}
.section-head a:hover { gap: 8px; }

/* ==================== GRID & CARDS ==================== */
.grid { display: grid; gap: 24px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
a.card, button.card { display: block; color: inherit; cursor: pointer; text-align: left; width: 100%; }
button.card { border-width: 1px; font: inherit; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--color-primary-light); }
a.card:hover { text-decoration: none; color: inherit; }
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin: 0 0 8px; line-height: 1.3; color: var(--color-text); }
.card p { font-size: 14px; color: var(--color-text-muted); margin: 0; line-height: 1.6; }

/* Announcement card */
.announcement-card {
  position: relative; padding: 20px 22px;
  border-left: 3px solid var(--color-border);
}
.announcement-card.ann-danger { border-left-color: var(--color-danger); }
.announcement-card.ann-warning { border-left-color: var(--color-warning); }
.announcement-card.ann-info { border-left-color: var(--color-info); }
.announcement-card.ann-ok { border-left-color: var(--color-success); }
.announcement-card .ann-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.announcement-card .ann-badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-pill);
}
.announcement-card .ann-badge.danger { background: var(--color-danger-bg); color: var(--color-danger); }
.announcement-card .ann-badge.warning { background: var(--color-warning-bg); color: var(--color-warning); }
.announcement-card .ann-badge.info { background: var(--color-success-bg); color: var(--color-success); }
.announcement-card .ann-date { font-size: 12px; color: var(--color-text-muted); }
.announcement-card h3 { font-size: 15px; margin: 0 0 8px; line-height: 1.4; }
.announcement-card p { font-size: 13px; margin: 0 0 14px; color: var(--color-text-muted); }
.announcement-card .ann-footer {
  display: flex; align-items: center; justify-content: flex-end;
  font-size: 12px; font-weight: 600; color: var(--color-primary);
}
.announcement-card:hover .ann-footer { gap: 6px; }

/* Category tile */
.category-tile { display: flex; align-items: center; gap: 16px; padding: 20px; }
.category-tile .icon-circle {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-primary-light), #ffe5e8);
  transition: transform var(--duration) var(--ease);
}
.category-tile:hover .icon-circle { transform: scale(1.08); }
.category-tile .tile-body { flex: 1; min-width: 0; }
.category-tile h3 { margin: 0 0 4px; font-size: 16px; }
.category-tile p { margin: 0; font-size: 13px; }
.category-tile .tile-arrow { color: var(--color-text-muted); font-size: 18px; transition: transform var(--duration) var(--ease); }
.category-tile:hover .tile-arrow { color: var(--color-primary); transform: translateX(4px); }

/* Channel card (download / social) */
.channel-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; position: relative; overflow: hidden; }
.channel-card .channel-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  transition: transform var(--duration) var(--ease);
  overflow: hidden;
}
.channel-card .channel-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.channel-card:hover .channel-icon { transform: scale(1.08); }
.channel-card .channel-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.channel-card .channel-sub { font-size: 12px; color: var(--color-text-muted); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.channel-card h3 { margin: 0; font-size: 17px; }

/* Trending list */
.trending-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.trending-list li { border-bottom: 1px solid var(--color-border); }
.trending-list li:last-child { border-bottom: none; }
.trending-list a {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; color: var(--color-text); font-size: 15px; font-weight: 500;
  transition: background var(--duration) var(--ease), padding var(--duration) var(--ease);
}
.trending-list a:hover { background: var(--color-primary-light); color: var(--color-primary); padding-left: 24px; }
.trending-list .rank { color: var(--color-primary); font-weight: 700; }
.trending-list .rank-arrow { margin-left: auto; color: var(--color-text-muted); transition: color var(--duration) var(--ease); }
.trending-list a:hover .rank-arrow { color: var(--color-primary); }

/* Recent item */
.recent-item { display: flex; gap: 16px; padding: 16px; align-items: flex-start; }
.recent-item .thumb {
  width: 88px; height: 88px; border-radius: 16px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-primary-light), #ffe5e8);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; overflow: hidden;
}
.recent-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-item .recent-body { min-width: 0; flex: 1; }
.recent-item .tag { margin-bottom: 8px; }
.recent-item h3 { font-size: 15px; margin: 4px 0 8px; line-height: 1.35; }
.recent-item .recent-meta { font-size: 12px; color: var(--color-text-muted); display: flex; gap: 12px; align-items: center; }

.tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--color-primary-light); color: var(--color-primary);
}

.badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); }
.badge.investigating { background: var(--color-warning-bg); color: var(--color-warning); }
.badge.workaround { background: var(--color-primary-light); color: var(--color-primary); }
.badge.resolved { background: var(--color-success-bg); color: var(--color-success); }

/* ==================== FAQ page ==================== */
.faq-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-chip {
  padding: 10px 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-border); background: var(--color-surface);
  font-family: var(--font-display); font-size: 14px; font-weight: 500;
  color: var(--color-text-muted); cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.filter-chip:hover { color: var(--color-primary); border-color: var(--color-primary-light); }
.filter-chip.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: #fff; border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(141, 15, 23, 0.25);
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 12px; overflow: hidden;
  transition: box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.faq-item[open] { border-color: var(--color-primary-light); box-shadow: var(--shadow); }
.faq-item summary {
  padding: 20px 24px; cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary > span:first-child { flex: 1; }
.faq-item summary strong, .faq-item summary > span:first-child > :first-child { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--color-text); display: block; }
.faq-item summary .meta { display: flex; gap: 6px; flex-shrink: 0; }
.faq-item .faq-summary-line { color: var(--color-text-muted); font-size: 14px; font-weight: 400; margin-top: 4px; }
.faq-item .faq-body { padding: 4px 24px 24px; font-size: 14px; color: var(--color-text); }
.faq-item .escalation-note {
  margin-top: 16px; padding: 14px 16px;
  background: var(--color-warning-bg); border-radius: var(--radius-sm);
  font-size: 13px; color: #92400e;
}
.copy-btn {
  border: 1px solid var(--color-border); background: var(--color-surface);
  padding: 8px 16px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500; cursor: pointer; margin-top: 12px;
  transition: all var(--duration) var(--ease);
}
.copy-btn:hover { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary-light); }
.view-count { font-weight: 600; color: var(--color-primary); }

.empty-state { text-align: center; color: var(--color-text-muted); padding: 60px 0; }

/* Content pages */
.page-head { padding: 48px 0 8px; }
.page-head h1 { font-family: var(--font-display); font-weight: 700; font-size: 40px; margin: 0 0 12px; color: var(--color-text); line-height: 1.2; }
.page-head p { color: var(--color-text-muted); margin: 0; font-size: 16px; }

.content-block {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 32px; margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.content-block h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--color-text); margin: 0 0 16px; }
.content-block h3 { font-size: 16px; margin: 24px 0 10px; }
.content-block ul { margin: 8px 0; padding-left: 22px; font-size: 15px; }
.content-block ul li { margin-bottom: 6px; }
.content-block table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.content-block th, .content-block td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
.content-block th { color: var(--color-text-muted); font-weight: 600; font-size: 13px; }

.toc { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 32px; }
.toc a {
  font-size: 14px; padding: 8px 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text);
  font-weight: 500;
}
.toc a:hover { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary-light); text-decoration: none; }

.glossary-grid { display: grid; grid-template-columns: 180px 1fr; gap: 0 24px; font-size: 15px; }
.glossary-grid dt { font-family: var(--font-display); font-weight: 600; padding: 14px 0; border-top: 1px solid var(--color-border); }
.glossary-grid dd { margin: 0; padding: 14px 0; border-top: 1px solid var(--color-border); color: var(--color-text-muted); }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--color-border); font-size: 15px; }
.checklist li:last-child { border-bottom: none; }
.checklist input { margin-top: 4px; }

.note-sample {
  display: inline-block; font-size: 13px; color: var(--color-text-muted);
  background: var(--color-warning-bg); border: 1px dashed #fde68a;
  padding: 8px 14px; border-radius: var(--radius-sm); margin-bottom: 24px;
}

/* Alert banner */
.alert-banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px; border-radius: var(--radius); margin: 0 0 24px; font-size: 14px;
}
.alert-banner.warning { background: var(--color-warning-bg); border: 1px solid #fde68a; color: #92400e; }
.alert-banner.danger { background: var(--color-danger-bg); border: 1px solid #fecaca; color: #991b1b; }
.alert-banner strong { display: block; margin-bottom: 4px; }

/* ==================== AI Chat Widget ==================== */
.chat-widget {
  position: fixed; bottom: 24px; right: 24px;
  width: 360px; max-width: calc(100vw - 32px);
  background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 80;
  border: 1px solid var(--color-border);
  animation: fadeUp 300ms var(--ease);
}
.chat-widget-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: #fff; padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
}
.chat-widget-header .chat-emoji {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.chat-widget-header .chat-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.chat-widget-header .chat-subtitle { font-size: 11px; opacity: 0.85; margin-top: 2px; }
.chat-widget-header .beta-tag { background: var(--color-accent); color: var(--color-primary-dark); font-size: 10px; padding: 2px 8px; border-radius: var(--radius-pill); font-weight: 700; margin-left: 6px; }
.chat-widget-header .chat-close {
  margin-left: auto; background: rgba(255, 255, 255, 0.15); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.chat-widget-header .chat-close:hover { background: rgba(255, 255, 255, 0.25); }
.chat-widget-body { padding: 20px; font-size: 14px; }
.chat-bubble { background: var(--color-bg); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; color: var(--color-text); line-height: 1.5; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chat-suggestions button {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  padding: 7px 14px; font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.chat-suggestions button:hover { background: var(--color-primary-light); border-color: var(--color-primary-light); color: var(--color-primary); }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--color-border);
  border-radius: var(--radius-pill); font-size: 14px; outline: none;
  font-family: inherit;
}
.chat-input-row input:focus { border-color: var(--color-primary); }
.chat-input-row button {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: #fff; border: none; border-radius: 50%;
  width: 40px; height: 40px; cursor: pointer; flex-shrink: 0;
  font-size: 14px;
}
.chat-widget-fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: #fff; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(141, 15, 23, 0.4);
  border: 3px solid #fff; cursor: pointer; z-index: 80;
  transition: transform var(--duration) var(--ease);
}
.chat-widget-fab:hover { transform: scale(1.08); }


/* ==================== CHANNEL BANNERS ==================== */
.channel-banners-section { padding: 0 0 48px; }
.channel-banners-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.channel-banner {
  position: relative; border-radius: var(--radius);
  background: linear-gradient(135deg, #2d0208 0%, #5a0a12 40%, #8D0F17 100%);
  padding: 32px 28px; color: #fff; overflow: hidden;
}
.channel-banner::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at 80% -20%, rgba(255,200,60,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.channel-banner-top {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px;
}
.channel-banner-circle {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.channel-banner-titles h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  margin: 0 0 5px; color: #fff; line-height: 1.2;
}
.channel-banner-titles p {
  font-size: 13px; margin: 0; line-height: 1.5;
  color: rgba(255,255,255,0.65);
}
.social-btns-row {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px;
}
.social-circle-btn {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; text-decoration: none;
  transition: transform 200ms var(--ease), filter 200ms var(--ease), box-shadow 200ms var(--ease);
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.social-circle-btn:hover {
  transform: translateY(-3px) scale(1.06);
  filter: brightness(1.15);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
.social-circle-btn img { width: 26px; height: 26px; object-fit: contain; }
.download-btns-col { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.download-badge-btn {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px; padding: 9px 16px; color: #fff; text-decoration: none;
  transition: background 200ms, border-color 200ms, transform 150ms;
}
.download-badge-btn:hover {
  background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.35);
  color: #fff; transform: translateX(3px);
}
.download-badge-btn .badge-icon { font-size: 26px; flex-shrink: 0; line-height: 1; }
.download-badge-btn .badge-icon img { width: 26px; height: 26px; object-fit: contain; }
.download-badge-btn .badge-text small {
  display: block; font-size: 10px; opacity: 0.7; font-weight: 400; line-height: 1.2;
}
.download-badge-btn .badge-text strong { font-size: 15px; font-weight: 700; line-height: 1; }
@media (max-width: 760px) {
  .channel-banners-grid { grid-template-columns: 1fr; }
}

/* ==================== FOOTER ==================== */
.footer-channels-wrap {
  display: flex; gap: 32px; flex-wrap: wrap;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}
.footer-channel-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer-channel-label {
  font-size: 12px; font-weight: 600; color: var(--color-accent);
  white-space: nowrap; letter-spacing: 0.3px;
}
.footer-channel-list { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-channel-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px; padding: 5px 12px;
  color: rgba(255, 255, 255, 0.8); font-size: 13px; font-weight: 500;
  transition: background 200ms, color 200ms, border-color 200ms;
  text-decoration: none; white-space: nowrap;
}
.footer-channel-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.site-footer-rich {
  background: linear-gradient(135deg, #1a0405, #0d0203);
  color: rgba(255, 255, 255, 0.75);
  margin-top: 80px; padding: 64px 0 0;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 48px; padding-bottom: 40px; }
.footer-col h4 { color: var(--color-accent); font-family: var(--font-display); font-weight: 600; font-size: 15px; margin: 0 0 20px; }
.footer-col p { font-size: 14px; line-height: 1.7; margin: 0 0 16px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: rgba(255, 255, 255, 0.7); font-size: 14px; transition: color var(--duration) var(--ease); }
.footer-col a:hover { color: var(--color-accent); }
.footer-social { display: flex; gap: 10px; margin-top: 12px; }
.footer-social a {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
  transition: all var(--duration) var(--ease);
}
.footer-social a:hover { background: var(--color-primary); }
.newsletter-form { display: flex; gap: 8px; margin-top: 12px; }
.newsletter-form input {
  flex: 1; padding: 12px 16px; border-radius: var(--radius-pill);
  border: none; font-size: 13px; font-family: inherit; min-width: 0;
}
.newsletter-form button {
  background: var(--color-accent); color: var(--color-primary-dark);
  border: none; border-radius: var(--radius-pill);
  padding: 12px 20px; font-weight: 700; cursor: pointer; font-size: 13px;
  font-family: var(--font-display);
  transition: transform var(--duration) var(--ease);
}
.newsletter-form button:hover { transform: translateY(-1px); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 24px 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: rgba(255, 255, 255, 0.5);
  flex-wrap: wrap; gap: 12px;
}
.footer-bottom a { color: rgba(255, 255, 255, 0.5); margin-left: 16px; }
.footer-bottom a:hover { color: var(--color-accent); }

/* ==================== Responsive ==================== */
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .hero-main h1 { font-size: 36px; }
  .section-head h2 { font-size: 26px; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  main { padding: 32px 0; }
  .section { margin-bottom: 32px; }
}
@media (max-width: 640px) {
  .site-header { height: auto; padding: 12px 0; }
  .header-left { flex-wrap: wrap; width: 100%; gap: 12px; }
  .main-nav {
    width: 100%; flex-wrap: nowrap; overflow-x: auto;
    padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  }
  .main-nav a { white-space: nowrap; }
  .hero-banner { padding: 40px 0; }
  .hero-main h1 { font-size: 30px; }
  .section-head h2 { font-size: 22px; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .chat-widget { width: calc(100vw - 24px); right: 12px; bottom: 12px; }
  .chat-widget-fab { right: 16px; bottom: 16px; width: 54px; height: 54px; }
  .page-head h1 { font-size: 28px; }
}
