/**
 * 2026 Modern Mobile-First App Design System
 * Inspired by Tailwind CSS & Glassmorphic Neo-Fintech
 */

:root {
  --font-sans: 'Kanit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #eef2ff;
  --color-accent: #06b6d4;
  --color-gold: #f59e0b;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f97316;
  --color-slate-900: #0f172a;
  --color-slate-800: #1e293b;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748b;
  --color-slate-400: #94a3b8;
  --color-slate-100: #f1f5f9;
  --color-slate-50: #f8fafc;

  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.85);
  --border-glass: rgba(255, 255, 255, 0.5);

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 25px -5px rgba(79, 70, 229, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --brand-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
  --hero-radial: radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.12) 0%, rgba(248, 250, 252, 0) 70%);
}

/* ==========================================================================
   Dynamic Day-of-the-Week Auto Color System (Sunday 0 - Saturday 6)
   Matches auspicious daily colors with high WCAG 2.1 AA contrast
   ========================================================================== */

/* 0: Sunday (วันอาทิตย์ - แดงมงคล Ruby Red) */
[data-day="0"] {
  --color-primary: #dc2626;
  --color-primary-hover: #b91c1c;
  --color-primary-light: #fef2f2;
  --color-accent: #f97316;
  --shadow-glow: 0 0 25px -5px rgba(220, 38, 38, 0.35);
  --brand-gradient: linear-gradient(135deg, #dc2626 0%, #ea580c 50%, #e11d48 100%);
  --hero-radial: radial-gradient(circle at 50% 0%, rgba(220, 38, 38, 0.12) 0%, rgba(248, 250, 252, 0) 70%);
}

/* 1: Monday (วันจันทร์ - ทอง/เหลืองมงคล Royal Amber / Gold) */
[data-day="1"] {
  --color-primary: #d97706;
  --color-primary-hover: #b45309;
  --color-primary-light: #fffbeb;
  --color-accent: #f59e0b;
  --shadow-glow: 0 0 25px -5px rgba(217, 119, 6, 0.35);
  --brand-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #eab308 100%);
  --hero-radial: radial-gradient(circle at 50% 0%, rgba(217, 119, 6, 0.12) 0%, rgba(248, 250, 252, 0) 70%);
}

/* 2: Tuesday (วันอังคาร - ชมพูสดใส Rose / Pink) */
[data-day="2"] {
  --color-primary: #db2777;
  --color-primary-hover: #be185d;
  --color-primary-light: #fdf2f8;
  --color-accent: #f43f5e;
  --shadow-glow: 0 0 25px -5px rgba(219, 39, 119, 0.35);
  --brand-gradient: linear-gradient(135deg, #db2777 0%, #e11d48 50%, #f43f5e 100%);
  --hero-radial: radial-gradient(circle at 50% 0%, rgba(219, 39, 119, 0.12) 0%, rgba(248, 250, 252, 0) 70%);
}

/* 3: Wednesday (วันพุธ - เขียวเหนี่ยวทรัพย์ Emerald / Forest Green) */
[data-day="3"] {
  --color-primary: #059669;
  --color-primary-hover: #047857;
  --color-primary-light: #ecfdf5;
  --color-accent: #10b981;
  --shadow-glow: 0 0 25px -5px rgba(5, 150, 105, 0.35);
  --brand-gradient: linear-gradient(135deg, #059669 0%, #10b981 50%, #14b8a6 100%);
  --hero-radial: radial-gradient(circle at 50% 0%, rgba(5, 150, 105, 0.12) 0%, rgba(248, 250, 252, 0) 70%);
}

/* 4: Thursday (วันพฤหัสบดี - แสด/ส้มปัญญา Vibrant Orange / Tangerine) */
[data-day="4"] {
  --color-primary: #ea580c;
  --color-primary-hover: #c2410c;
  --color-primary-light: #fff7ed;
  --color-accent: #f97316;
  --shadow-glow: 0 0 25px -5px rgba(234, 88, 12, 0.35);
  --brand-gradient: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  --hero-radial: radial-gradient(circle at 50% 0%, rgba(234, 88, 12, 0.12) 0%, rgba(248, 250, 252, 0) 70%);
}

/* 5: Friday (วันศุกร์ - ฟ้าสุขุม ครามมหาลาภ Ocean Sky / Indigo Blue) */
[data-day="5"] {
  --color-primary: #0284c7;
  --color-primary-hover: #0369a1;
  --color-primary-light: #f0f9ff;
  --color-accent: #06b6d4;
  --shadow-glow: 0 0 25px -5px rgba(2, 132, 199, 0.35);
  --brand-gradient: linear-gradient(135deg, #0284c7 0%, #06b6d4 50%, #3b82f6 100%);
  --hero-radial: radial-gradient(circle at 50% 0%, rgba(2, 132, 199, 0.12) 0%, rgba(248, 250, 252, 0) 70%);
}

/* 6: Saturday (วันเสาร์ - ม่วงบารมี Royal Violet / Deep Purple) */
[data-day="6"] {
  --color-primary: #7c3aed;
  --color-primary-hover: #6d28d9;
  --color-primary-light: #f5f3ff;
  --color-accent: #9333ea;
  --shadow-glow: 0 0 25px -5px rgba(124, 58, 237, 0.35);
  --brand-gradient: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #c026d3 100%);
  --hero-radial: radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.12) 0%, rgba(248, 250, 252, 0) 70%);
}

/* Base Reset & Typography */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

*, *::before, *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--color-slate-800);
  line-height: 1.6;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  padding-bottom: 80px; /* Reserve space for mobile bottom dock */
  overflow-x: hidden;
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

/* Container */
.app-container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header & Glass Navbar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.2s ease;
}

.app-header::after {
  content: "";
  display: block;
  height: 2px;
  opacity: 0.7;
  background: repeating-linear-gradient(135deg, transparent 0 8px, var(--color-primary) 8px 10px, transparent 10px 18px);
}

.app-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-slate-900);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 1.75rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-slate-600);
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-primary);
}

/* Language Switcher Button */
.lang-switch {
  display: flex;
  align-items: center;
  background: var(--color-slate-100);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid #e2e8f0;
}

.lang-btn {
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  color: var(--color-slate-600);
  transition: all 0.2s ease;
  display: inline-block;
}

.lang-btn.active {
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

/* Hero Section */
.hero-wrapper {
  position: relative;
  overflow: hidden;
  background: var(--hero-radial);
  padding: 2.5rem 0 2rem;
}

@media (min-width: 768px) {
  .hero-wrapper {
    padding: 3.5rem 0 3rem;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-slate-900);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 2.75rem;
  }
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--color-slate-600);
  max-width: 620px;
  margin: 0 auto 2rem;
  font-weight: 400;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.125rem;
  }
}

/* Main Input Card - App Style */
.search-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  border: 1px solid rgba(226, 232, 240, 0.9);
  max-width: 620px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

@media (min-width: 768px) {
  .search-card {
    padding: 2rem;
  }
}

.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.phone-input {
  width: 100%;
  height: 58px;
  padding: 0 1rem 0 3.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-slate-900);
  background: var(--color-slate-50);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-lg);
  outline: none;
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
}

.phone-input:focus {
  border-color: var(--color-primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.input-icon-prefix {
  position: absolute;
  left: 1rem;
  color: var(--color-slate-400);
  pointer-events: none;
  font-size: 1.35rem;
}

.btn-submit-analyze {
  width: 100%;
  height: 52px;
  margin-top: 1rem;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-submit-analyze:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.btn-submit-analyze:active {
  transform: scale(0.98);
}

/* Sample Quick-pick Pills */
.sample-pills-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.25rem;
}

.sample-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-slate-500);
}

.sample-pill {
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--color-slate-100);
  color: var(--color-slate-700);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.sample-pill:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: rgba(79, 70, 229, 0.3);
}

/* Results Section - 2026 App Score Dashboard */
.result-card-main {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  margin-top: 2rem;
}

.result-hero-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
  color: #ffffff;
  padding: 2.5rem 1.5rem;
  text-align: center;
  position: relative;
}

.result-phone-display {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .result-phone-display {
    font-size: 2.5rem;
  }
}

.operator-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  margin-bottom: 1.5rem;
}

/* Big Grade Badge Circle */
.grade-circle-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.grade-badge-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  font-weight: 900;
  box-shadow: 0 0 30px rgba(0,0,0,0.3);
  margin-bottom: 0.75rem;
}

/* Grade Colors */
.grade-A-plus { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #ffffff; }
.grade-A { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #ffffff; }
.grade-B { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); color: #ffffff; }
.grade-C { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #ffffff; }
.grade-D { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); color: #ffffff; }
.grade-E { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: #ffffff; }

.grade-desc-pill {
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 500;
  max-width: 480px;
  margin: 0 auto;
}

/* Stat Grid (Score & Sum) */
.result-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.stat-box {
  background: #ffffff;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  text-align: center;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--color-slate-900);
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-slate-500);
  margin-top: 0.25rem;
}

/* Pairs Grid */
.pairs-grid-section {
  padding: 2rem 1.5rem;
}

.section-subheading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-slate-900);
  margin-bottom: 0.25rem;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--color-slate-500);
  margin-bottom: 1.5rem;
}

.pairs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .pairs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pair-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.pair-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.pair-badge-num {
  min-width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, monospace;
  background: var(--color-slate-100);
  color: var(--color-slate-800);
}

.pair-badge-num.pair-high {
  background: #dcfce7;
  color: #166534;
}

.pair-badge-num.pair-caution {
  background: #fee2e2;
  color: #991b1b;
}

.pair-info-wrap {
  flex: 1;
}

.pair-meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.pair-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-slate-900);
}

.pair-score-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.score-tag-good { background: #dcfce7; color: #15803d; }
.score-tag-caution { background: #fee2e2; color: #b91c1c; }
.score-tag-neutral { background: #e0f2fe; color: #0369a1; }

.pair-meaning {
  font-size: 0.88rem;
  color: var(--color-slate-600);
  line-height: 1.5;
}

/* Avoid Section */
.avoid-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.avoid-box.avoid-clean {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.avoid-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #9f1239;
  margin-bottom: 0.5rem;
}

.avoid-box.avoid-clean .avoid-header {
  color: #166534;
}

.avoid-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0.75rem 0;
}

.avoid-chip {
  background: #ffffff;
  color: #be123c;
  border: 1px solid #fda4af;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-md);
  font-family: monospace;
}

/* Action & Share Buttons */
.action-buttons-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.btn-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--color-slate-700);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-pill:hover {
  background: var(--color-slate-100);
  color: var(--color-slate-900);
}

.btn-action-pill.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.btn-action-pill.btn-primary:hover {
  background: var(--color-primary-hover);
}

/* E-E-A-T Knowledge Cards */
.eeat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .eeat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.eeat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.eeat-card-num {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-primary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.eeat-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-slate-900);
  margin-bottom: 0.5rem;
}

.eeat-card-desc {
  font-size: 0.88rem;
  color: var(--color-slate-600);
  line-height: 1.55;
}

/* FAQ Accordion - Modern Native */
.faq-wrap {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
}

.faq-heading {
  position: relative;
}

.faq-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
  color: #ffd166;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.faq-heading h2 {
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}

.faq-heading p {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.24);
}

.accordion-item-modern {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.accordion-trigger {
  width: 100%;
  padding: 1.15rem 1.25rem;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-slate-800);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.accordion-trigger:hover {
  color: var(--color-primary);
}

.accordion-icon {
  transition: transform 0.2s ease;
  font-size: 1.1rem;
  color: var(--color-slate-400);
}

.accordion-item-modern.open .accordion-icon {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.accordion-body-modern {
  display: none;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.92rem;
  color: var(--color-slate-600);
  line-height: 1.65;
  border-top: 1px solid #f1f5f9;
  padding-top: 1rem;
}

.accordion-item-modern.open .accordion-body-modern {
  display: block;
}

/* Mobile Bottom Dock (App Navigation) */
.mobile-bottom-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 64px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
}

@media (min-width: 1024px) {
  .mobile-bottom-dock {
    display: none;
  }
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--color-slate-500);
  font-size: 0.72rem;
  font-weight: 600;
  flex: 1;
  height: 100%;
  transition: color 0.15s ease;
}

.dock-item.active, .dock-item:hover {
  color: var(--color-primary);
}

.dock-icon {
  font-size: 1.25rem;
}

/* Site Footer */
.site-footer {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
  color: var(--color-slate-600);
  font-size: 0.9rem;
}

.footer-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-slate-900);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modern Embed Code Snippet */
.embed-code-box {
  background: #0f172a;
  color: #f8fafc;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  position: relative;
  margin-top: 1rem;
}

.btn-copy-embed {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-copy-embed:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   2026 Mobile Ergonomics & Strict Overflow Protection (320px - 480px)
   Prevents any horizontal pushing, clipped borders, or right-side scroll drift
   ========================================================================== */
@media (max-width: 640px) {
  .app-container {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
    overflow-x: hidden;
  }

  .search-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-lg);
  }

  .phone-input {
    font-size: 1.1rem;
    padding-left: 2.85rem;
    height: 52px;
  }

  .input-icon-prefix {
    left: 0.85rem;
    font-size: 1.15rem;
  }

  .result-hero-banner {
    padding: 2rem 1rem;
  }

  .result-phone-display {
    font-size: 1.55rem;
    letter-spacing: 0.04em;
    word-break: break-word;
  }

  .grade-badge-circle {
    width: 95px;
    height: 95px;
    font-size: 2.6rem;
  }

  .grade-desc-pill {
    font-size: 0.85rem;
    padding: 4px 12px;
    line-height: 1.4;
  }

  .result-stats-row {
    padding: 1rem;
    gap: 0.75rem;
  }

  .stat-box {
    padding: 0.85rem 0.5rem;
  }

  .stat-value {
    font-size: 1.45rem;
  }

  .pairs-grid-section {
    padding: 1.25rem 1rem;
  }

  .pair-card {
    padding: 1rem 0.85rem;
    gap: 0.75rem;
  }

  .pair-badge-num {
    min-width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .pair-title {
    font-size: 0.88rem;
  }

  .pair-meaning {
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .avoid-box {
    padding: 1.1rem 0.85rem;
  }

  .action-buttons-wrap {
    padding: 1.25rem 0.75rem;
    gap: 8px;
  }

  .btn-action-pill {
    padding: 8px 14px;
    font-size: 0.84rem;
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  /* Captcha responsive containment */
  .captcha-wrapper {
    max-width: 100%;
    transform: scale(0.92);
    transform-origin: center center;
  }
}

@media (max-width: 380px) {
  .app-container {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .hero-title {
    font-size: 1.55rem;
  }

  .result-phone-display {
    font-size: 1.35rem;
  }

  .captcha-wrapper {
    transform: scale(0.84);
  }
}

/* Thai auspicious theme: cinnabar red, antique gold and warm ivory. */
:root {
  --thai-red-950: #2a0909;
  --thai-red-900: #4a0d0d;
  --thai-red-800: #721616;
  --thai-red-700: #991b1b;
  --thai-gold: #d9aa45;
  --thai-gold-light: #f6df98;
  --thai-ivory: #fffaf0;
  --thai-ink: #3d1c16;
  --bg-app: #4a0d0d;
  --color-slate-900: var(--thai-ink);
  --color-slate-800: #5b2920;
  --color-slate-700: #744137;
  --color-slate-600: #8a5b4d;
  --color-slate-500: #9d7462;
  --color-slate-400: #b99378;
  --color-slate-100: #f7ead1;
  --color-slate-50: #fffaf0;
  --bg-card: var(--thai-ivory);
  --shadow-glow: 0 0 28px -8px rgba(217, 170, 69, 0.65);
  --brand-gradient: linear-gradient(135deg, var(--thai-red-800), var(--thai-red-950));
  --hero-radial: radial-gradient(circle at 50% 0%, rgba(217, 170, 69, 0.2), transparent 65%);
}

body {
  background-color: var(--thai-red-900);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(246, 223, 152, 0.1) 0 1px, transparent 1.5px),
    radial-gradient(circle at 85% 35%, rgba(246, 223, 152, 0.08) 0 1px, transparent 1.5px),
    linear-gradient(135deg, rgba(42, 9, 9, 0.18) 25%, transparent 25% 75%, rgba(42, 9, 9, 0.18) 75%);
  background-size: 28px 28px, 34px 34px, 48px 48px;
  color: var(--thai-ivory);
}

.app-header {
  background: rgba(42, 9, 9, 0.94);
  border-bottom: 1px solid rgba(246, 223, 152, 0.32);
  box-shadow: 0 4px 20px rgba(24, 3, 3, 0.24);
}

.app-brand, .nav-link { color: var(--thai-gold-light); }
.nav-link:hover, .nav-link.active { color: var(--thai-gold); }
.brand-icon { border: 1px solid var(--thai-gold); box-shadow: 0 4px 12px rgba(217, 170, 69, 0.25); }
.thai-nine-mark { color: var(--thai-gold-light); font-family: Georgia, 'Times New Roman', serif; font-size: 1.45em; font-weight: 700; line-height: 1; text-shadow: 0 1px 0 var(--thai-red-950), 0 0 8px rgba(246, 223, 152, 0.35); }
.lang-switch { background: rgba(255, 250, 240, 0.1); border-color: rgba(246, 223, 152, 0.3); }
.lang-btn { color: #eacb83; }
.lang-btn.active { background: var(--thai-gold); color: var(--thai-red-950); }

.hero-wrapper { background-color: transparent; background-image: var(--hero-radial); }
.hero-badge {
  background: rgba(246, 223, 152, 0.12);
  color: var(--thai-gold-light);
  border-color: rgba(246, 223, 152, 0.42);
}
.hero-title { color: var(--thai-gold-light); text-shadow: 0 2px 0 rgba(42, 9, 9, 0.55); }
.hero-subtitle { color: #f4dcb3; }
.seo-context { max-width: 620px; margin: -1.35rem auto 2rem; color: rgba(246, 223, 152, 0.82); font-size: 0.82rem; line-height: 1.5; }

.search-card, .result-card-main, .eeat-card, .accordion-item-modern {
  background: var(--thai-ivory);
  border-color: rgba(217, 170, 69, 0.55);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}
.search-card::before, .result-card-main::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--thai-gold), transparent);
}
.search-card, .result-card-main { position: relative; }
.search-card::after, .result-card-main::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(217, 170, 69, 0.2);
  border-radius: calc(var(--radius-lg) - 4px);
  pointer-events: none;
}
.phone-input { color: var(--thai-ink); background: #fffdf7; border-color: #dfbd70; }
.phone-input:focus { border-color: var(--color-primary); background: #fff; box-shadow: 0 0 0 4px rgba(217, 170, 69, 0.2); }
.input-icon-prefix { color: var(--color-primary); }

.btn-submit-analyze {
  min-height: 58px;
  background: linear-gradient(135deg, var(--thai-red-700), var(--thai-red-950));
  color: var(--thai-gold-light);
  border: 1px solid var(--thai-gold);
  border-radius: var(--radius-full);
  box-shadow: 0 5px 16px rgba(74, 13, 13, 0.35), inset 0 1px 0 rgba(246, 223, 152, 0.25);
  letter-spacing: 0.01em;
}
.btn-submit-analyze i {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--thai-gold-light);
  color: var(--thai-red-900);
  font-size: 1.2rem;
}
.btn-submit-analyze:hover { background: linear-gradient(135deg, var(--thai-red-800), #1d0505); box-shadow: 0 8px 22px rgba(217, 170, 69, 0.3); }
.sample-label, .sample-pill { color: var(--thai-gold-light); }
.sample-pill { background: rgba(246, 223, 152, 0.12); border-color: rgba(246, 223, 152, 0.35); }
.sample-pill:hover { background: var(--thai-gold); color: var(--thai-red-950); border-color: var(--thai-gold); }

.eeat-card-title, .section-subheading, .pair-title, .stat-value, .accordion-trigger { color: var(--thai-ink); }
.eeat-card-num, .accordion-trigger:hover, .accordion-item-modern.open .accordion-icon { color: var(--color-primary); }
.eeat-card-desc, .section-desc, .pair-meaning, .accordion-body-modern { color: var(--color-slate-600); }
.result-hero-banner { background: linear-gradient(135deg, var(--thai-red-950), var(--color-primary), var(--thai-red-800)); }
.result-stats-row, .action-buttons-wrap { background: #f8ecd8; border-color: #ead2a1; }
.stat-box, .pair-card { background: #fffdf7; border-color: #ead2a1; }
.btn-action-pill { background: #fffdf7; color: var(--thai-red-800); border-color: #d9aa45; }
.btn-action-pill.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff8e8; }

.mobile-bottom-dock { background: rgba(42, 9, 9, 0.96); border-top-color: rgba(246, 223, 152, 0.32); }
.dock-item { color: #eacb83; }
.dock-item.active, .dock-item:hover { color: var(--thai-gold-light); }
.site-footer { background: var(--thai-red-950); border-top-color: rgba(246, 223, 152, 0.32); color: #eacb83; }
.footer-brand, .site-footer h3, .site-footer .nav-link { color: var(--thai-gold-light) !important; }
.site-footer p, .site-footer div[style*="color: var(--color-slate-500)"] { color: #d9b88a !important; }

.results-scroll-notice {
  max-width: 620px;
  margin: 1.25rem auto -0.25rem;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  text-align: center;
  color: var(--thai-gold-light);
  background: rgba(42, 9, 9, 0.72);
  border: 1px solid rgba(246, 223, 152, 0.42);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
}
.results-scroll-notice i { color: var(--thai-gold); font-size: 1.1rem; }
.results-scroll-notice a { margin-left: 0.25rem; padding: 0.25rem 0.7rem; color: var(--thai-red-950); background: var(--thai-gold-light); border-radius: var(--radius-full); font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.results-scroll-notice a:hover { background: var(--thai-gold); }
.ai-advisor-card {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid rgba(217, 170, 69, 0.65);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #fffaf0, #f9edd7);
  box-shadow: var(--shadow-md);
}
.ai-advisor-card.ai-ready { border-color: #16a6a0; background: linear-gradient(145deg, #fffdf4, #e8fbf5); box-shadow: 0 0 0 3px rgba(22, 166, 160, 0.14), var(--shadow-md); }
.ai-advisor-heading { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.2rem; }
.ai-advisor-icon { position: relative; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; background: linear-gradient(145deg, var(--thai-red-800), var(--thai-red-950)); color: var(--thai-gold-light); border: 1px solid var(--thai-gold); box-shadow: 0 4px 12px rgba(123, 16, 22, 0.25); font-size: 1.35rem; }
.ai-advisor-icon small { position: absolute; right: -6px; bottom: -6px; min-width: 22px; padding: 2px 4px; border-radius: 999px; color: var(--thai-red-950); background: var(--thai-gold-light); border: 1px solid var(--thai-gold); font-size: 0.58rem; line-height: 1; font-weight: 900; letter-spacing: 0.02em; }
.ai-advisor-heading h2 { color: var(--thai-ink); font-size: 1.2rem; margin: 0; }
.ai-source-badge { display: inline-block; margin-top: 0.3rem; padding: 0.2rem 0.55rem; border-radius: 999px; color: #075985; background: #cffafe; border: 1px solid #67e8f9; font-size: 0.72rem; font-weight: 800; }
.ai-source-badge[hidden] { display: none; }
.ai-source-badge.ai-source-fallback { color: #9a3412; background: #ffedd5; border-color: #fdba74; }
.ai-advisor-heading p { color: var(--color-slate-600); font-size: 0.86rem; margin: 0.15rem 0 0; }
.ai-advisor-status { margin: 0 0 1rem; padding: 0.65rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.8rem; line-height: 1.45; }
.ai-advisor-status i { margin-right: 0.25rem; }
.ai-advisor-status-fallback { color: #7c2d12; background: #fff7ed; border: 1px solid #fed7aa; }
.ai-advisor-status-live { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.ai-advisor-status-loading { color: #075985; background: #effaff; border: 1px solid #7dd3fc; font-weight: 700; }
.ai-advisor-load-btn { width: 100%; min-height: 48px; border: 1px solid var(--thai-gold); border-radius: var(--radius-full); background: linear-gradient(135deg, var(--thai-red-800), var(--thai-red-950)); color: var(--thai-gold-light); font: inherit; font-weight: 700; cursor: pointer; }
.ai-advisor-load-btn:disabled { opacity: 0.75; cursor: wait; }
.ai-advisor-load-btn i { margin-right: 0.35rem; }
.ai-advisor-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 0.75rem 0 1rem; }
.ai-mode-btn { min-height: 38px; border: 1px solid #d9aa45; border-radius: var(--radius-md); background: #fffdf7; color: var(--thai-red-800); font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.ai-mode-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ai-mode-btn:not(:disabled):hover { background: var(--thai-gold-light); }
.ai-mode-btn.is-active { color: #fffdf4; background: #168f89; border-color: #168f89; box-shadow: 0 0 0 3px rgba(22, 143, 137, 0.18); }
.ai-topic-help { margin: 0.35rem 0 0.75rem; color: #52706e; font-size: 0.78rem; text-align: center; }
.ai-comfort-note { margin: 0 0 1rem; padding: 0.85rem 1rem; color: var(--thai-red-900); background: rgba(217, 170, 69, 0.16); border: 1px solid rgba(217, 170, 69, 0.5); border-radius: var(--radius-md); font-size: 0.9rem; line-height: 1.6; }
.ai-comfort-note i { color: var(--color-primary); margin-right: 0.35rem; }
.ai-advisor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.ai-advisor-item { padding: 1rem; border: 1px solid #ead2a1; border-radius: var(--radius-md); background: rgba(255, 253, 247, 0.9); }
.ai-advisor-item.ai-result-live { border-color: #21aaa2; background: #f0fffb; box-shadow: inset 4px 0 0 #21aaa2; }
.ai-advisor-item.ai-focus { border-color: #c38b18; background: #fff8df; box-shadow: 0 0 0 3px rgba(195, 139, 24, 0.2), inset 4px 0 0 #c38b18; }
.ai-advisor-item > i { color: var(--color-primary); font-size: 1.1rem; }
.ai-advisor-item h3 { color: var(--thai-ink); font-size: 0.95rem; margin: 0.3rem 0; }
.ai-advisor-item p { color: var(--color-slate-700); font-size: 0.86rem; line-height: 1.55; }
.ai-advisor-note { margin: 1rem 0 0; padding-top: 0.8rem; border-top: 1px solid #ead2a1; color: var(--color-slate-500); font-size: 0.78rem; }
.ai-advisor-note i { color: var(--color-primary); margin-right: 0.25rem; }
.editorial-note { margin-top: 0.75rem; padding: 0.7rem 0.85rem; border-left: 3px solid var(--color-primary); color: var(--color-slate-600); background: rgba(217, 170, 69, 0.08); font-size: 0.78rem; line-height: 1.55; }
.editorial-note i { color: var(--color-primary); margin-right: 0.25rem; }
@media (max-width: 560px) { .ai-advisor-grid { grid-template-columns: 1fr; } .results-scroll-notice { border-radius: var(--radius-md); } }
@media (max-width: 380px) { .ai-advisor-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 640px) {
  .btn-submit-analyze { min-height: 54px; }
  .btn-submit-analyze i { width: 34px; height: 34px; }
  .results-scroll-notice { max-width: calc(100% - 1rem); margin-left: auto; margin-right: auto; flex-wrap: wrap; line-height: 1.45; }
  .results-scroll-notice span { flex: 1 1 100%; }
  .results-scroll-notice a { margin-left: 0; }
  .ai-advisor-card { padding: 1rem; }
  .ai-advisor-heading { align-items: flex-start; }
  .ai-advisor-heading h2 { font-size: 1.05rem; }
  .ai-advisor-heading p { line-height: 1.45; }
}
