/* ============================================================================
   NakhonSi Smart Health - Medical Neo-Glass UI & Pulse Theme
   Signature Colors:
     Deep Royal Violet & Purple: #581C87, #7E22CE, #9333EA, #A855F7
     Glowing Pure Gold & Amber: #F59E0B, #FBBF24, #FDE68A, #D97706
     Medical ECG Neon Accent: #00F0FF, #34D399, #F43F5E
     Cyber Glass Backdrop: #0F0A1E, #F8FAFC
   ============================================================================ */

:root {
  --primary-purple: #7E22CE;
  --primary-dark: #3B0764;
  --primary-deep: #1E0836;
  --primary-light: #A855F7;
  --primary-soft: #F3E8FF;

  --gold-primary: #F59E0B;
  --gold-rich: #D97706;
  --gold-light: #FDE68A;

  --ecg-pulse: #8B5CF6;
  --neon-cyan: #06B6D4;
  --medical-red: #EF4444;
  --medical-green: #10B981;

  --purple-gold-gradient: linear-gradient(135deg, #7E22CE 0%, #9333EA 50%, #F59E0B 100%);
  --hero-medical-gradient: linear-gradient(155deg, #2E0854 0%, #581C87 50%, #7E22CE 100%);
  --gold-banner-gradient: linear-gradient(135deg, #FDE68A 0%, #F59E0B 60%, #D97706 100%);
  --card-glass: rgba(255, 255, 255, 0.92);
  --card-border: rgba(126, 34, 206, 0.12);

  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-sub: #94A3B8;

  --shadow-lux: 0 14px 36px -6px rgba(126, 34, 206, 0.2), 0 4px 12px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

body, button, input, select, textarea, optgroup {
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ยกเว้น FontAwesome icon fonts เพื่อไม่ให้ไอคอนกลายเป็นตัวอักษรปกติ */
.fa, .fas, .far, .fal, .fad, .fab, [class^="fa-"], [class*=" fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", sans-serif !important;
}
.fab {
  font-family: "Font Awesome 6 Brands" !important;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #F8FAFC;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(126, 34, 206, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(245, 158, 11, 0.06) 0%, transparent 40%);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: calc(115px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  position: relative;
  overflow-x: hidden;
}

/* ============================================================================
   App Splash / Simulated Loading Screen (กำลังโหลด...)
   ============================================================================ */
#appSplashScreen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 30%, #4A0E78 0%, #20053B 65%, #0F021D 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #fff;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s ease;
}

#appSplashScreen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-logo-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
}

.splash-pulse-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(245, 158, 11, 0.4);
  animation: splashRingPulse 2s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
}
.splash-pulse-ring:nth-child(2) {
  animation-delay: 0.6s;
  border-color: rgba(168, 85, 247, 0.5);
}

@keyframes splashRingPulse {
  0%   { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}

.splash-logo-img {
  width: 110px;
  height: 110px;
  border-radius: 28px;
  object-fit: contain;
  background: #fff;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 25px rgba(245, 158, 11, 0.35);
  animation: splashLogoFloat 2.8s ease-in-out infinite alternate;
}

@keyframes splashLogoFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.splash-title-app {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #FFFFFF 0%, #FDE68A 50%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.splash-org-sub {
  font-size: 0.75rem;
  color: #D8B4FE;
  margin-bottom: 20px;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   ECG PULSE WAVEFORM LOADING (เส้นคลื่นไฟฟ้าหัวใจสีทองตามภาพ แทนเส้นตรงตอนกำลังเข้าระบบ)
   ============================================================================ */
.splash-ecg-track-wrap {
  width: 250px;
  max-width: 82vw;
  height: 64px;
  margin: 12px auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.splash-ecg-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

/* เส้นร่างพื้นหลังจางๆ (Track) */
.splash-ecg-bg {
  stroke: rgba(252, 228, 136, 0.25);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* เส้นคลื่นหัวใจหลักสีทองเหลืองเรืองแสงตามในภาพ (Active Progress 0% -> 100%) */
.splash-ecg-active {
  stroke: #FCE488;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.12s linear;
  filter: drop-shadow(0 0 6px #FCE488) drop-shadow(0 0 14px rgba(252, 228, 136, 0.75));
}

/* แสงชีพจรวิ่งวนเรืองแสงตามจังหวะหัวใจ (Pulse Beam Sweep) */
.splash-ecg-pulse-sweep {
  stroke: #FFFFFF;
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: url(#ecgGlowFilter);
  stroke-dasharray: 22 78;
  stroke-dashoffset: 122;
  animation: splashEcgPulseBeam 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes splashEcgPulseBeam {
  0% {
    stroke-dashoffset: 122;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -22;
    opacity: 0;
  }
}

.splash-status-text {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* App Main Container */
.app-container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
}

/* Top App Bar */
.app-top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border-bottom: 0.5px solid rgba(126, 34, 206, 0.1);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 6px 18px rgba(126, 34, 206, 0.2);
  background: #fff;
  padding: 2px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title-main {
  font-size: 1.05rem;
  font-weight: 800;
  color: #3B0764;
  line-height: 1.15;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-title-sub {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold-rich);
}

.top-help-pill {
  font-size: 0.72rem;
  font-weight: 750;
  color: #fff;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  padding: 5px 12px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ============================================================================
   Futuristic Medical Hero Card
   ============================================================================ */
.hero-card {
  margin: 14px 16px 22px;
  background: var(--hero-medical-gradient);
  border-radius: 28px;
  padding: 22px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lux);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.hero-card::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -30px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  border: 0.5px solid rgba(245, 158, 11, 0.5);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--gold-light);
  margin-bottom: 12px;
}

.hero-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

.hero-heading {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 6px;
}
.hero-heading b {
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.hero-desc {
  font-size: 0.8rem;
  opacity: 0.92;
  margin-bottom: 18px;
  max-width: 390px;
  line-height: 1.45;
}

/* Vital Signs / Stats Live Capsule Bar */
.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 10px 8px;
  border: 0.5px solid rgba(255, 255, 255, 0.25);
}

.hero-stat-col {
  text-align: center;
}

.hero-stat-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.hero-stat-lbl {
  font-size: 0.66rem;
  font-weight: 600;
  opacity: 0.88;
}

/* Section Header */
.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 18px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.section-title i {
  color: var(--primary-purple);
}

/* เส้นคั่นหัวข้อแบบมีไอคอน + ชื่อหัวข้อ + เส้นบาง ๆ ต่อท้าย */
.section-title::after {
  content: '';
  flex: 1 1 auto;
  min-width: 14px;
  height: 2px;
  margin-left: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.55) 0%, rgba(148, 163, 184, 0.10) 100%);
}

.section-title-wrap > a {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ============================================================================
   Interactive Medical Screening Cards
   ============================================================================ */
.screening-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 16px;
  margin-bottom: 26px;
}

.screening-card {
  background: var(--card-glass);
  border-radius: 24px;
  border: 0.5px solid var(--card-border);
  box-shadow: 0 8px 24px rgba(126, 34, 206, 0.08), 0 2px 6px rgba(0, 0, 0, 0.02);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.screening-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}
.screening-card.dm::before { background: linear-gradient(180deg, #0284C7, #0369A1); }
.screening-card.ht::before { background: linear-gradient(180deg, #DC2626, #B91C1C); }
.screening-card.depression::before { background: linear-gradient(180deg, #9333EA, #7E22CE); }
.screening-card.stroke::before { background: linear-gradient(180deg, #FB923C, #EA580C); }
.screening-card.ckd::before { background: linear-gradient(180deg, #2DD4BF, #0D9488); }
.screening-card.bmi::before { background: linear-gradient(180deg, #818CF8, #4338CA); }

.screening-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(126, 34, 206, 0.14);
}
.screening-card:active {
  transform: scale(0.975);
}

.screening-icon-box {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}
.screening-icon-box.dm {
  background: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%);
}
.screening-icon-box.ht {
  background: linear-gradient(135deg, #F87171 0%, #DC2626 100%);
}
.screening-icon-box.depression {
  background: linear-gradient(135deg, #C084FC 0%, #7E22CE 100%);
}

.screening-content { flex: 1; }

.screening-card-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.screening-badge {
  font-size: 0.62rem;
  font-weight: 750;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
}
.screening-badge.dm { background: #0284C7; }
.screening-badge.ht { background: #DC2626; }
.screening-badge.depression { background: #7E22CE; }

.screening-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 6px;
}

.screening-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-sub);
}
.screening-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.screening-arrow-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #F3E8FF;
  display: grid;
  place-items: center;
  color: var(--primary-purple);
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.screening-card:hover .screening-arrow-btn {
  background: var(--primary-purple);
  color: #fff;
  transform: translateX(3px);
}

/* ============================================================================
   Knowledge Carousel
   ============================================================================ */
.knowledge-scroll-wrap {
  display: flex;
  gap: 12px;
  padding: 0 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
}
.knowledge-scroll-wrap::-webkit-scrollbar { display: none; }

.knowledge-item-card {
  min-width: 255px;
  max-width: 265px;
  background: #fff;
  border-radius: 24px;
  border: 0.5px solid var(--card-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.knowledge-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(126, 34, 206, 0.1);
}
.knowledge-item-card:active { transform: scale(0.97); }

.knowledge-tag {
  font-size: 0.68rem;
  font-weight: 750;
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
}
.knowledge-tag.dm { background: rgba(2, 132, 199, 0.12); color: #0284C7; }
.knowledge-tag.ht { background: rgba(220, 38, 38, 0.12); color: #DC2626; }
.knowledge-tag.depression { background: rgba(126, 34, 206, 0.12); color: #7E22CE; }

.knowledge-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.knowledge-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 0.5px solid #F1F5F9;
  padding-top: 8px;
}

/* Inset Menu */
.ios-inset-menu {
  margin: 0 16px 20px;
  background: #fff;
  border-radius: 24px;
  border: 0.5px solid var(--card-border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.ios-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text-main);
  border-bottom: 0.5px solid #F1F5F9;
  transition: background 0.12s;
}
.ios-menu-item:last-child { border-bottom: 0; }
.ios-menu-item:active { background: #FAF5FF; }

.ios-menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ios-menu-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.05rem;
}
.ios-menu-icon.purple { background: linear-gradient(135deg, #9333EA, #7E22CE); }
.ios-menu-icon.orange { background: linear-gradient(135deg, #F97316, #EA580C); }
.ios-menu-icon.blue   { background: linear-gradient(135deg, #0284C7, #0369A1); }
.ios-menu-icon.green  { background: linear-gradient(135deg, #10B981, #059669); }

.ios-menu-label {
  font-size: 0.86rem;
  font-weight: 750;
}
.ios-menu-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ios-menu-right {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94A3B8;
  font-size: 0.82rem;
}

/* ============================================================================
   Floating Bottom Dock (iOS & Neo-Glass)
   ============================================================================ */
.bottom-dock {
  position: fixed;
  bottom: calc(26px + env(safe-area-inset-bottom, 0px)); /* เลื่อน bar ขึ้นให้เห็นข้อความเครดิตชัดเจน */
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 480px;
  height: 64px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 0.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 36px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  box-shadow: 0 12px 36px -4px rgba(126, 34, 206, 0.2), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: #8E8E93;
  padding: 6px 12px;
  min-width: 60px;
  border-radius: 20px;
  transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.dock-item:active { transform: scale(0.9); }
.dock-item.active {
  color: var(--primary-purple);
}
.dock-item.active .dock-icon-wrap {
  transform: translateY(-1px) scale(1.1);
  filter: drop-shadow(0 3px 8px rgba(126, 34, 206, 0.4));
}
.dock-item.active span { font-weight: 800; color: #581C87; }

.dock-icon-wrap {
  font-size: 1.2rem;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dock-item span {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.1;
}

/* ============================================================================
   Screening Questionnaires UI
   ============================================================================ */
.screen-header-banner {
  background: var(--hero-medical-gradient);
  color: #fff;
  padding: 24px 20px 28px;
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px rgba(126, 34, 206, 0.2);
  border-bottom: 2px solid rgba(245, 158, 11, 0.3);
}
.screen-header-banner.dm { background: linear-gradient(145deg, #072B68 0%, #0284C7 60%, #38BDF8 100%); }
.screen-header-banner.ht { background: linear-gradient(145deg, #5C0B0B 0%, #DC2626 60%, #F87171 100%); }
.screen-header-banner.depression { background: linear-gradient(145deg, #3B0764 0%, #7E22CE 60%, #C084FC 100%); }

.back-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 750;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  border: 0.5px solid rgba(255, 255, 255, 0.25);
}

.screen-title-big {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.screen-subtitle-text {
  font-size: 0.78rem;
  opacity: 0.92;
  line-height: 1.4;
}

.question-card {
  background: #fff;
  border-radius: 22px;
  border: 0.5px solid var(--card-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  padding: 18px 20px;
  margin: 0 16px 14px;
}

.question-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.4;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}
.option-btn:hover, .option-btn.selected {
  background: #FAF5FF;
  border-color: var(--primary-purple);
  color: var(--primary-purple);
  box-shadow: 0 4px 12px rgba(126, 34, 206, 0.12);
}
.option-btn i.fa-check-circle { display: none; font-size: 1.1rem; }
.option-btn.selected i.fa-check-circle { display: block; }

.btn-submit-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 32px);
  margin: 20px 16px;
  padding: 14px;
  border-radius: 999px;
  background: var(--purple-gold-gradient);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(126, 34, 206, 0.35);
  transition: transform 0.15s ease;
}
.btn-submit-screen:active { transform: scale(0.98); }

/* ============================================================================
   Popup Modal สำหรับแสดงผลลัพธ์ (iOS System Sheet / Dialog)
   ============================================================================ */
.result-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 2, 29, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: resPopFadeIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes resPopFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.result-card-wrap {
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 0;
  background: #ffffff;
  border-radius: 28px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 0 25px rgba(126, 34, 206, 0.15);
  padding: 26px 22px;
  text-align: center;
  position: relative;
  animation: resPopScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes resPopScaleUp {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.result-popup-close-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F1F5F9;
  border: 0;
  color: #64748B;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.result-popup-close-x:active {
  background: #E2E8F0;
}

.result-badge-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 4px auto 12px;
  display: grid;
  place-items: center;
  font-size: 2.1rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.result-badge-circle.green  { background: linear-gradient(135deg, #10B981, #059669); }
.result-badge-circle.yellow { background: linear-gradient(135deg, #FBBF24, #D97706); }
.result-badge-circle.orange { background: linear-gradient(135deg, #F97316, #C2410C); }
.result-badge-circle.red    { background: linear-gradient(135deg, #EF4444, #B91C1C); }

.result-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.result-score {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.result-box-advice {
  background: #FAF5FF;
  border-left: 4px solid var(--primary-purple);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Article Styles */
.article-container { padding: 16px; }
.article-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin: 8px 0;
}
.article-body-card {
  background: #fff;
  border-radius: 24px;
  border: 0.5px solid var(--card-border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  padding: 20px;
  font-size: 0.84rem;
  color: #334155;
  line-height: 1.65;
}
.article-body-card h3 {
  font-size: 0.98rem;
  color: var(--primary-purple);
  margin: 16px 0 8px;
}
.article-body-card ul, .article-body-card ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

/* ============================================================================
   PWA Installation Modal & Interactive Media (Video / Images)
   ============================================================================ */
.pwa-install-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 2, 29, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: pwaFadeIn 0.25s ease;
}

@keyframes pwaFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pwa-install-card {
  width: 100%;
  max-width: 460px;
  background: #FFFFFF;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  padding: 20px 22px calc(28px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.3);
  animation: pwaSlideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes pwaSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.pwa-install-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pwa-app-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 6px 18px rgba(126, 34, 206, 0.25);
  background: #fff;
  padding: 2px;
}

.pwa-close-btn {
  background: #F1F5F9;
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #64748B;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
}

.pwa-step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F8FAFC;
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 8px;
  border: 0.5px solid #E2E8F0;
}

.pwa-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-purple);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* Media Card Video & Infographics */
.video-responsive-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  margin: 12px 0 16px;
  background: #000;
}

/* App Library Grid & Cards */
.app-library-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

.app-lib-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border-radius: 20px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border: 0.5px solid var(--card-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.app-lib-card:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(126, 34, 206, 0.1);
  border-color: rgba(126, 34, 206, 0.3);
}
.app-lib-card:active { transform: scale(0.98); }

.app-lib-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}
.app-lib-icon.dm { background: linear-gradient(135deg, #38BDF8, #0284C7); }
.app-lib-icon.ht { background: linear-gradient(135deg, #F87171, #DC2626); }
.app-lib-icon.depression { background: linear-gradient(135deg, #C084FC, #7E22CE); }
.app-lib-icon.stroke { background: linear-gradient(135deg, #FB923C, #EA580C); }
.app-lib-icon.ckd { background: linear-gradient(135deg, #34D399, #059669); }
.app-lib-icon.purple { background: linear-gradient(135deg, #A855F7, #6B21A8); }
.app-lib-icon.gold { background: linear-gradient(135deg, #FDE68A, #D97706); color: #451A03; }
.app-lib-icon.blue { background: linear-gradient(135deg, #60A5FA, #1D4ED8); }
.app-lib-icon.cyan { background: linear-gradient(135deg, #22D3EE, #0891B2); }
.app-lib-icon.red { background: linear-gradient(135deg, #F87171, #B91C1C); }

.app-lib-text { flex: 1; }
.app-lib-name { font-size: 0.92rem; font-weight: 800; color: var(--text-main); margin-bottom: 2px; }
.app-lib-sub { font-size: 0.72rem; color: var(--text-muted); }
.app-lib-arr { font-size: 0.8rem; color: #CBD5E1; transition: color 0.15s ease; }
.app-lib-card:hover .app-lib-arr { color: var(--primary-purple); }

/* Auto-scrolling Carousel Container */
.carousel-auto-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-bottom: 0;
}

.carousel-auto-track {
  display: flex;
  gap: 14px;
  padding: 4px 16px 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel-auto-track::-webkit-scrollbar { display: none; }

/* Enhanced Section Divider */
.home-section-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 26px;
  margin: 0 14px 16px;
  padding: 16px 14px 12px;
  box-shadow: 0 6px 24px rgba(126, 34, 206, 0.05);
}

.info-banner-img {
  width: 100%;
  border-radius: 18px;
  margin: 10px 0 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  object-fit: cover;
}

/* Floating Mini Install Bar ด้านล่างจอ */
.pwa-bottom-pill-bar {
  position: fixed;
  bottom: calc(98px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 436px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(245, 158, 11, 0.4);
  border-radius: 20px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(126, 34, 206, 0.16);
  z-index: 990;
  animation: pwaBarPop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes pwaBarPop {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.btn-pwa-bar-action {
  background: linear-gradient(135deg, #FDE68A 0%, #F59E0B 100%);
  color: #451A03;
  border: 0;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.btn-pwa-bar-action:active {
  transform: scale(0.95);
}

.btn-pwa-bar-close {
  background: transparent;
  border: 0;
  color: #94A3B8;
  font-size: 1.1rem;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* Medical Assessment Tools Pill Selector */
.interactive-calc-box {
  background: #FAF5FF;
  border: 1px dashed var(--primary-purple);
  border-radius: 18px;
  padding: 14px 16px;
  margin: 14px 0;
}

/* =========================================================
   GEMINI AI HEALTH CHATBOT (หมอพร้อมใจ AI)
   ========================================================= */

/* Floating Chat Trigger Button */
.ai-chat-fab {
  position: fixed;
  bottom: calc(160px + env(safe-area-inset-bottom, 0px)); /* ยกขึ้นเหนือแถบติดตั้งแอป ไม่ทับซ้อน */
  right: 18px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7E22CE 0%, #9333EA 50%, #C084FC 100%);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(126, 34, 206, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.9);
  cursor: pointer;
  z-index: 995;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  animation: fabFloat 3s ease-in-out infinite alternate;
}

.ai-chat-fab:active {
  transform: scale(0.92);
}

.ai-chat-fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #FFF;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1.5px solid #FFF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  letter-spacing: 0.5px;
}

.ai-chat-fab-sparkle {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.7rem;
  color: #FDE047;
  animation: pulseRotate 2s linear infinite;
}

@keyframes fabFloat {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

@keyframes pulseRotate {
  0%   { transform: scale(0.8) rotate(0deg); opacity: 0.7; }
  50%  { transform: scale(1.1) rotate(180deg); opacity: 1; }
  100% { transform: scale(0.8) rotate(360deg); opacity: 0.7; }
}

/* AI Chat Modal Overlay */
.ai-chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10050; /* สูงกว่า bottom-dock (z-index:1000) */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.ai-chat-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.ai-chat-window {
  width: 100%;
  max-width: 460px;
  height: 86vh;
  max-height: 740px;
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.35);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  position: relative;
  z-index: 10051;
}

.ai-chat-modal.active .ai-chat-window {
  transform: translateY(0);
}

/* Chat Header */
.ai-chat-header {
  background: linear-gradient(135deg, #4C1D95 0%, #7E22CE 60%, #9333EA 100%);
  color: #FFFFFF;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.ai-chat-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  color: #FDE047;
  position: relative;
  backdrop-filter: blur(10px);
}

.ai-online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #4C1D95;
}

.ai-chat-close-btn {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #FFFFFF;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.ai-chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Chat Body (Message Stream) */
.ai-chat-body {
  flex: 1;
  padding: 18px 16px;
  overflow-y: auto;
  background: #F8FAFC;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.ai-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: msgFadeIn 0.25s ease-out;
}

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg.bot {
  align-self: flex-start;
}

.ai-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.86rem;
  line-height: 1.55;
  word-break: break-word;
}

.ai-msg.user .ai-bubble {
  background: linear-gradient(135deg, #7E22CE 0%, #6B21A8 100%);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(126, 34, 206, 0.2);
}

.ai-msg.bot .ai-bubble {
  background: #FFFFFF;
  color: #1E293B;
  border-bottom-left-radius: 4px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ai-bubble b, .ai-bubble strong {
  color: #4C1D95;
  font-weight: 800;
}

.ai-msg.user .ai-bubble b, .ai-msg.user .ai-bubble strong {
  color: #FDE047;
}

/* Quick Suggestion Pills */
.ai-quick-topics {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 16px;
  background: #F1F5F9;
  border-top: 1px solid #E2E8F0;
  scrollbar-width: none;
  flex-shrink: 0;
}

.ai-quick-btn {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-quick-btn:hover, .ai-quick-btn:active {
  background: #7E22CE;
  color: #FFFFFF;
  border-color: #7E22CE;
}

/* Chat Input Bar */
.ai-chat-input-bar {
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 8px));
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

.ai-chat-input {
  flex: 1;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 0.88rem;
  color: #0F172A;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.ai-chat-input:focus {
  border-color: #7E22CE;
  background: #FFFFFF;
}

.ai-chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7E22CE 0%, #9333EA 100%);
  color: #FFFFFF;
  border: none;
  display: grid;
  place-items: center;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(126, 34, 206, 0.3);
  transition: transform 0.15s;
}

.ai-chat-send-btn:active {
  transform: scale(0.92);
}

/* Typing Indicator Animation */
.ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
}

.ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94A3B8;
  animation: aiBounce 1.4s infinite ease-in-out both;
}

.ai-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes aiBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* =========================================================
   ULTRA NEO-MEDICAL BANNER ENHANCEMENT (ภาพที่ 1 - ให้สวย แปลกตา)
   ========================================================= */
.screen-header-banner-lux {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #021B45 0%, #0A3A82 45%, #155EBF 80%, #2563EB 100%);
  color: #FFFFFF;
  padding: 26px 20px 32px;
  border-bottom-left-radius: 36px;
  border-bottom-right-radius: 36px;
  box-shadow: 0 16px 36px -6px rgba(10, 58, 130, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  margin-bottom: 22px;
}

/* Dynamic glowing aura background effect */
.screen-header-banner-lux::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, rgba(14, 165, 233, 0.08) 55%, transparent 75%);
  filter: blur(12px);
  pointer-events: none;
  animation: auraFloat 6s ease-in-out infinite alternate;
}

.screen-header-banner-lux::after {
  content: '';
  position: absolute;
  bottom: -50px;
  left: 20%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22) 0%, transparent 70%);
  filter: blur(15px);
  pointer-events: none;
}

@keyframes auraFloat {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-15px, 15px) scale(1.1); }
}

/* Glass Floating Pills inside banner */
.lux-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}

.lux-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.lux-back-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.25);
}

.lux-banner-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #FDE68A;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

/* Title & Decorative Hologram */
.lux-title-wrap {
  position: relative;
  z-index: 2;
}

.lux-title-main {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.lux-title-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.08) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  color: #38BDF8;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.lux-subtitle {
  font-size: 0.82rem;
  color: #E0F2FE;
  line-height: 1.5;
  opacity: 0.95;
  margin-bottom: 16px;
  max-width: 95%;
}

/* 5 Dimension Live Stats Counter Pills within banner */
.lux-stats-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  position: relative;
  z-index: 2;
}

.lux-stat-pill {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lux-stat-pill i {
  font-size: 1.1rem;
}

.lux-stat-pill-val {
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  color: #FFFFFF;
}

.lux-stat-pill-lbl {
  font-size: 0.62rem;
  color: #BAE6FD;
  margin-top: 2px;
}

/* น้องนคร Mascot Image Styling in Chat UI */
.ai-fab-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.ai-header-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.ai-chat-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid #7E22CE;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  align-self: flex-end;
}

/* =========================================================
   KNOWLEDGE MODERN SEGMENTED PILLS TABS
   ========================================================= */
.knowledge-tabs-wrapper {
  padding: 4px 16px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.knowledge-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.knowledge-pills-row {
  display: flex;
  gap: 8px;
  width: max-content;
  align-items: center;
}

.knowledge-pill-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: #475569;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.knowledge-pill-tab i {
  font-size: 0.88rem;
}

.knowledge-pill-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.knowledge-pill-tab:active {
  transform: scale(0.96);
}

/* Active Pill Variations */
.knowledge-pill-tab.active-all {
  background: linear-gradient(135deg, #7E22CE 0%, #9333EA 100%);
  color: #FFFFFF;
  border-color: #7E22CE;
  box-shadow: 0 4px 14px rgba(126, 34, 206, 0.35);
}

.knowledge-pill-tab.active-dm {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: #FFFFFF;
  border-color: #0284C7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.knowledge-pill-tab.active-ht {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  color: #FFFFFF;
  border-color: #DC2626;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.knowledge-pill-tab.active-depression {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  color: #FFFFFF;
  border-color: #8B5CF6;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.knowledge-pill-tab.active-stroke {
  background: linear-gradient(135deg, #EA580C 0%, #C2410C 100%);
  color: #FFFFFF;
  border-color: #EA580C;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.knowledge-pill-tab.active-ckd {
  background: linear-gradient(135deg, #0D9488 0%, #0F766E 100%);
  color: #FFFFFF;
  border-color: #0D9488;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

/* =========================================================
   CREDIT TEXT UNDER FLOATING BOTTOM BAR (แสดงทุกหน้า ตัวเล็กใต้ bar)
   ========================================================= */
.dock-under-credit {
  position: fixed;
  bottom: calc(5px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.2px;
  z-index: 999;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 12px;
}

/* =========================================================
   MEDICAL HUD & CYBER-CLINICAL LUX DESIGN SYSTEM
   (การ์ดด้านบนดีไซน์ใหม่ แปลกตา ไฮเทคการแพทย์ระดับสากล)
   ========================================================= */

/* 1. Futuristic Clinical Dashboard Banner (หน้า Screenings) */
.screen-header-banner-lux {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 85% 15%, #1E1B4B 0%, #0F172A 40%, #020617 100%) !important;
  color: #FFFFFF;
  padding: 24px 18px 26px;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  box-shadow: 0 20px 40px -10px rgba(2, 6, 23, 0.7), 0 0 0 1px rgba(56, 189, 248, 0.25) inset;
  margin-bottom: 20px;
}

/* Grid Line Matrix Pattern Background */
.screen-header-banner-lux::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  opacity: 0.7;
}

.screen-header-banner-lux::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, rgba(99, 102, 241, 0.15) 50%, transparent 75%);
  filter: blur(25px);
  pointer-events: none;
}

/* Medical Hologram HUD Icon Box */
.lux-title-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(99, 102, 241, 0.1) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  color: #38BDF8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35), inset 0 0 12px rgba(56, 189, 248, 0.2);
  flex-shrink: 0;
  position: relative;
}

.lux-title-main {
  font-size: 1.35rem;
  font-weight: 850;
  color: #F8FAFC;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lux-subtitle {
  font-size: 0.78rem;
  color: #94A3B8;
  line-height: 1.45;
  margin: 8px 0 16px;
}

/* Vital Sign Capsule Badges in Banner */
.lux-stats-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  position: relative;
  z-index: 2;
}

.lux-stat-pill {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.lux-stat-pill-val {
  font-size: 0.85rem;
  font-weight: 800;
  color: #F8FAFC;
}

.lux-stat-pill-lbl {
  font-size: 0.6rem;
  color: #38BDF8;
  font-weight: 600;
}

/* 2. Cyber-Medical Glass Hero Card (หน้าแรก Home) */
.hero-card {
  margin: 14px 16px 20px !important;
  background: radial-gradient(circle at 90% 10%, #2E1065 0%, #1E1B4B 50%, #0F172A 100%) !important;
  border-radius: 28px !important;
  padding: 22px 20px !important;
  color: #FFFFFF !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.5), 0 0 0 1px rgba(192, 132, 252, 0.25) inset !important;
  border: none !important;
}

/* Grid Matrix Overlay for Hero */
.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(192, 132, 252, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192, 132, 252, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  opacity: 0.6;
}

.hero-card::after {
  content: '';
  position: absolute;
  bottom: -30px;
  right: -20px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.28) 0%, rgba(168, 85, 247, 0.15) 55%, transparent 75%);
  filter: blur(22px);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #FDE68A;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
}

.hero-heading {
  font-size: 1.4rem;
  font-weight: 850;
  line-height: 1.25;
  margin-bottom: 6px;
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-heading b {
  background: linear-gradient(135deg, #FDE68A 0%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

.hero-desc {
  font-size: 0.78rem;
  color: #CBD5E1;
  line-height: 1.45;
  margin-bottom: 18px;
  opacity: 0.95;
}

/* Vital Signs / Stats HUD Card */
.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.hero-stat-num {
  font-size: 1.15rem;
  font-weight: 850;
  color: #FFFFFF;
}

.hero-stat-lbl {
  font-size: 0.64rem;
  font-weight: 600;
  color: #94A3B8;
  margin-top: 2px;
}

/* 3. Neo-Medical Glowing Screening Cards */
.screening-card {
  background: #FFFFFF !important;
  border-radius: 22px !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(0,0,0,0.02) !important;
  padding: 14px 16px !important;
  position: relative !important;
  transition: all 0.25s cubic-bezier(0.2, 0.9, 0.3, 1) !important;
}

.screening-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 30px rgba(126, 34, 206, 0.12), 0 0 0 1px rgba(126, 34, 206, 0.2) !important;
}

.screening-card:active {
  transform: scale(0.98) !important;
}

.screening-icon-box {
  width: 50px !important;
  height: 50px !important;
  border-radius: 16px !important;
  display: grid !important;
  place-items: center !important;
  font-size: 1.35rem !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1) !important;
}

/* =========================================================
   CLEAN MEDICAL SNOW & OCEAN CYAN HERO CARD
   (การ์ดด้านบนหน้าแรกดีไซน์ใหม่ สไตล์ Clean Hospital Tech)
   ========================================================= */
.hero-card-clean {
  margin: 14px 16px 20px;
  background: linear-gradient(145deg, #FFFFFF 0%, #F0FDF4 40%, #EFF6FF 100%);
  border-radius: 28px;
  padding: 24px 20px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 36px -8px rgba(37, 99, 235, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1.5px solid rgba(147, 197, 253, 0.45);
}

/* Subtle medical light ring aura */
.hero-card-clean::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-card-clean::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -20px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* Header pill inside Clean Hero */
.hero-clean-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #065F46;
  margin-bottom: 12px;
}

.hero-clean-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

.hero-clean-heading {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.25;
  color: #0F172A;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.hero-clean-heading b {
  color: #2563EB;
}

.hero-clean-desc {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 18px;
  max-width: 96%;
}

/* 3 Quick Action / Stats Capsule Row */
.hero-clean-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.hero-clean-stat-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  padding: 10px 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.hero-clean-stat-num {
  font-size: 1.15rem;
  font-weight: 850;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hero-clean-stat-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748B;
  margin-top: 2px;
}

/* Clean CTA action button */
.hero-clean-cta-row {
  display: flex;
  gap: 10px;
}

.hero-btn-primary {
  flex: 1;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
  transition: transform 0.2s;
}

.hero-btn-primary:active {
  transform: scale(0.97);
}

.hero-btn-secondary {
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  color: #334155;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ============================================================================
   SOFT LAVENDER & MILK WHITE MEDICAL THEME (โทนสีม่วงอ่อนมากๆ ม่วง ขาว ทุกหน้า)
   ============================================================================ */

/* 1. Global Background & App Surface */
body {
  background: #FAF8FD !important;
  background-image: 
    radial-gradient(circle at 10% 8%, rgba(216, 180, 254, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 90% 12%, rgba(233, 213, 255, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(243, 232, 255, 0.3) 0%, transparent 50%) !important;
  color: #1E1B4B !important;
}

/* 2. Top Header Navigation (ทุกหน้า) */
.app-top-nav {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(233, 213, 255, 0.8) !important;
}

/* 3. Hero Card หน้าแรก (ม่วงอ่อนมาก + ขาวสว่าง สไตล์มินิมอลการแพทย์) */
.hero-card-clean {
  margin: 14px 16px 20px !important;
  background: linear-gradient(145deg, #FFFFFF 0%, #FAF5FF 55%, #F3E8FF 100%) !important;
  border-radius: 28px !important;
  padding: 24px 20px 22px !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 14px 32px -6px rgba(147, 51, 234, 0.08), 0 2px 8px rgba(0, 0, 0, 0.02) !important;
  border: 1.5px solid rgba(216, 180, 254, 0.45) !important;
}

.hero-card-clean::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-card-clean::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -20px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 213, 255, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-clean-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  background: #FFFFFF !important;
  border: 1px solid #D8B4FE !important;
  padding: 5px 13px !important;
  border-radius: 999px !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  color: #6B21A8 !important;
  box-shadow: 0 2px 6px rgba(147, 51, 234, 0.06) !important;
  margin-bottom: 12px !important;
}

.hero-clean-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #9333EA !important;
  box-shadow: 0 0 8px rgba(147, 51, 234, 0.6) !important;
}

.hero-clean-heading {
  font-size: 1.45rem !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  color: #1E1B4B !important;
  margin-bottom: 6px !important;
}

.hero-clean-heading b {
  color: #7E22CE !important;
}

.hero-clean-desc {
  font-size: 0.8rem !important;
  color: #4B5563 !important;
  line-height: 1.5 !important;
  margin-bottom: 18px !important;
}

.hero-clean-stat-box {
  background: #FFFFFF !important;
  border: 1px solid #E9D5FF !important;
  border-radius: 18px !important;
  padding: 10px 8px !important;
  text-align: center !important;
  box-shadow: 0 3px 10px rgba(126, 34, 206, 0.04) !important;
}

.hero-clean-stat-num {
  font-size: 1.15rem !important;
  font-weight: 850 !important;
}

.hero-btn-primary {
  background: linear-gradient(135deg, #7E22CE 0%, #6B21A8 100%) !important;
  box-shadow: 0 6px 18px rgba(126, 34, 206, 0.28) !important;
}

/* 4. Banner หัวหน้าของทุกหน้า (ม่วงอ่อนมากๆ + ขาว สว่าง ละมุนตา ไม่มืดทึบ) */
.screen-header-banner,
.screen-header-banner-lux {
  background: linear-gradient(145deg, #FFFFFF 0%, #FAF5FF 50%, #F3E8FF 100%) !important;
  color: #1E1B4B !important;
  padding: 24px 20px 24px !important;
  border-bottom-left-radius: 32px !important;
  border-bottom-right-radius: 32px !important;
  margin-bottom: 20px !important;
  box-shadow: 0 10px 25px rgba(126, 34, 206, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  border-bottom: 1.5px solid rgba(216, 180, 254, 0.5) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* เอาเส้นกริดสีดำออก แล้วใช้ประกายม่วงอ่อนแทน */
.screen-header-banner::before,
.screen-header-banner-lux::before {
  content: '' !important;
  position: absolute !important;
  top: -40px !important;
  right: -30px !important;
  width: 180px !important;
  height: 180px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.2) 0%, transparent 70%) !important;
  pointer-events: none !important;
  background-image: none !important; /* เอาเส้นตารางออก */
}

.screen-header-banner::after,
.screen-header-banner-lux::after {
  content: '' !important;
  position: absolute !important;
  bottom: -30px !important;
  left: 10% !important;
  width: 140px !important;
  height: 140px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(233, 213, 255, 0.25) 0%, transparent 70%) !important;
  pointer-events: none !important;
}

/* ปุ่มย้อนกลับสไตล์ Soft Lavender */
.back-link-btn,
.lux-back-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #581C87 !important;
  text-decoration: none !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  background: #FFFFFF !important;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  margin-bottom: 12px !important;
  border: 1px solid #D8B4FE !important;
  box-shadow: 0 2px 6px rgba(126, 34, 206, 0.06) !important;
  transition: all 0.2s !important;
}

.back-link-btn:active,
.lux-back-btn:active {
  transform: scale(0.96) !important;
  background: #F3E8FF !important;
}

/* ป้าย Tag ใน Banner */
.lux-banner-tag {
  background: #FFFFFF !important;
  border: 1px solid #D8B4FE !important;
  color: #6B21A8 !important;
}

/* กล่องไอคอนใน Banner */
.lux-title-icon-box {
  width: 46px !important;
  height: 46px !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, #FAF5FF 0%, #EDE9FE 100%) !important;
  border: 1.5px solid #C084FC !important;
  color: #7E22CE !important;
  box-shadow: 0 4px 12px rgba(126, 34, 206, 0.12) !important;
}

/* หัวข้อและคำอธิบายใน Banner ทุกหน้า */
.screen-title-big,
.lux-title-main {
  font-size: 1.4rem !important;
  font-weight: 850 !important;
  color: #1E1B4B !important;
  text-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.screen-subtitle-text,
.lux-subtitle {
  font-size: 0.8rem !important;
  color: #4B5563 !important;
  opacity: 1 !important;
  line-height: 1.45 !important;
  margin: 6px 0 16px !important;
}

/* กล่องสถิติย่อย 3 มิติใน Banner */
.lux-stat-pill {
  background: #FFFFFF !important;
  border: 1px solid #E9D5FF !important;
  border-radius: 16px !important;
  padding: 8px 10px !important;
  box-shadow: 0 3px 8px rgba(126, 34, 206, 0.04) !important;
}

.lux-stat-pill-val {
  color: #1E1B4B !important;
  font-weight: 800 !important;
}

.lux-stat-pill-lbl {
  color: #6B21A8 !important;
  font-weight: 700 !important;
}

/* 5. การ์ดเนื้อหา Section & Question Cards ในทุกหน้า */
.home-section-card,
.article-body-card,
.question-card,
.ios-inset-menu {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(233, 213, 255, 0.7) !important;
  box-shadow: 0 6px 20px rgba(126, 34, 206, 0.04) !important;
}

/* การ์ดแบบคัดกรองทั้ง 5 */
.screening-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(233, 213, 255, 0.8) !important;
  box-shadow: 0 4px 14px rgba(126, 34, 206, 0.04) !important;
}

.screening-card:hover {
  border-color: #C084FC !important;
  box-shadow: 0 8px 24px rgba(126, 34, 206, 0.1) !important;
}

/* 6. แถบ Bottom Navigation Dock (ขาวนวลประกายม่วงอ่อน) */
.bottom-dock {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(216, 180, 254, 0.5) !important;
  box-shadow: 0 12px 36px -4px rgba(126, 34, 206, 0.12), 0 2px 8px rgba(0, 0, 0, 0.02) !important;
}

.dock-item.active {
  color: #7E22CE !important;
}

.dock-item.active .dock-icon-wrap {
  background: #F3E8FF !important;
  color: #7E22CE !important;
  border-radius: 14px !important;
}

/* ============================================================================
   DEEP ROYAL PURPLE GLASS-NEUMORPHISM THEME (ม่วงเข้ม นูนกระจก มีมิติ ลึกหรู)
   ============================================================================ */

/* 1. Global Background (เฉดสีม่วงนุ่มลึก มีประกายมิติ Neumorphic) */
body {
  background: #F3EEFA !important;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(126, 34, 206, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(147, 51, 234, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(107, 33, 168, 0.10) 0%, transparent 50%) !important;
  color: #1E1B4B !important;
}

/* 2. Glass-Neumorphism Hero Card (การ์ดหน้าแรกสีม่วงเข้มกระจกนูน) */
.hero-card-clean {
  margin: 14px 16px 20px !important;
  /* Deep Royal Violet to Purple Crystal Glass */
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.94) 0%, rgba(107, 33, 168, 0.92) 45%, rgba(126, 34, 206, 0.88) 100%) !important;
  backdrop-filter: blur(24px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
  border-radius: 30px !important;
  padding: 24px 20px 22px !important;
  position: relative !important;
  overflow: hidden !important;
  color: #FFFFFF !important;
  /* Neumorphic Dual Shadow: White upper reflection + Deep Purple soft drop */
  box-shadow: 
    -8px -8px 24px rgba(255, 255, 255, 0.7),
    12px 18px 36px rgba(76, 29, 149, 0.38),
    inset 0 1.5px 2px rgba(255, 255, 255, 0.4),
    inset 0 -1.5px 2px rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
}

/* Glass Spherical Light Reflections */
.hero-card-clean::before {
  content: '' !important;
  position: absolute !important;
  top: -60px !important;
  right: -50px !important;
  width: 200px !important;
  height: 200px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(216, 180, 254, 0.35) 0%, rgba(168, 85, 247, 0.15) 50%, transparent 75%) !important;
  filter: blur(16px) !important;
  pointer-events: none !important;
}

.hero-card-clean::after {
  content: '' !important;
  position: absolute !important;
  bottom: -40px !important;
  left: -30px !important;
  width: 160px !important;
  height: 160px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%) !important;
  filter: blur(20px) !important;
  pointer-events: none !important;
}

/* Glass-Neumorphic Badge */
.hero-clean-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  background: rgba(255, 255, 255, 0.16) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  padding: 5px 14px !important;
  border-radius: 999px !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  color: #FDE68A !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
  margin-bottom: 14px !important;
}

.hero-clean-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #34D399 !important;
  box-shadow: 0 0 10px #34D399 !important;
}

.hero-clean-heading {
  font-size: 1.45rem !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  color: #FFFFFF !important;
  margin-bottom: 6px !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
}

.hero-clean-heading b {
  background: linear-gradient(135deg, #FFFFFF 0%, #FDE68A 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

.hero-clean-heading span {
  color: #E9D5FF !important;
}

.hero-clean-desc {
  font-size: 0.8rem !important;
  color: #F3E8FF !important;
  line-height: 1.5 !important;
  margin-bottom: 18px !important;
  opacity: 0.95 !important;
}

/* Glass-Neumorphic Stats Boxes */
.hero-clean-stats {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px !important;
  margin-bottom: 18px !important;
}

.hero-clean-stat-box {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 20px !important;
  padding: 10px 8px !important;
  text-align: center !important;
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.5),
    inset 0 -1px 1.5px rgba(0, 0, 0, 0.2) !important;
}

.hero-clean-stat-num {
  font-size: 1.2rem !important;
  font-weight: 900 !important;
  color: #FFFFFF !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

.hero-clean-stat-lbl {
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  color: #E9D5FF !important;
  margin-top: 3px !important;
}

/* Glass CTA Buttons */
.hero-btn-primary {
  background: linear-gradient(135deg, #FAF5FF 0%, #EDE9FE 100%) !important;
  color: #581C87 !important;
  border: 1px solid #FFFFFF !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.8) !important;
  font-weight: 850 !important;
}

.hero-btn-secondary {
  background: rgba(255, 255, 255, 0.18) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #FFFFFF !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

/* 3. Deep Purple Glass-Neumorphism Header Banner (สำหรับทุกหน้า) */
.screen-header-banner,
.screen-header-banner-lux {
  background: linear-gradient(135deg, #4C1D95 0%, #6B21A8 50%, #7E22CE 100%) !important;
  color: #FFFFFF !important;
  padding: 24px 20px 26px !important;
  border-bottom-left-radius: 34px !important;
  border-bottom-right-radius: 34px !important;
  margin-bottom: 20px !important;
  box-shadow: 
    0 16px 36px rgba(76, 29, 149, 0.35),
    inset 0 1.5px 2px rgba(255, 255, 255, 0.35),
    inset 0 -1.5px 2px rgba(0, 0, 0, 0.25) !important;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.25) !important;
  position: relative !important;
  overflow: hidden !important;
}

.screen-header-banner::before,
.screen-header-banner-lux::before {
  content: '' !important;
  position: absolute !important;
  top: -50px !important;
  right: -40px !important;
  width: 190px !important;
  height: 190px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(233, 213, 255, 0.35) 0%, transparent 70%) !important;
  filter: blur(18px) !important;
  pointer-events: none !important;
}

.screen-header-banner::after,
.screen-header-banner-lux::after {
  content: '' !important;
  position: absolute !important;
  bottom: -35px !important;
  left: 10% !important;
  width: 150px !important;
  height: 150px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22) 0%, transparent 70%) !important;
  filter: blur(20px) !important;
  pointer-events: none !important;
}

/* Glass-Neumorphic Back Button */
.back-link-btn,
.lux-back-btn {
  background: rgba(255, 255, 255, 0.18) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
}

.lux-banner-tag {
  background: rgba(245, 158, 11, 0.22) !important;
  border: 1px solid rgba(245, 158, 11, 0.5) !important;
  color: #FDE68A !important;
}

.lux-title-icon-box {
  background: rgba(255, 255, 255, 0.18) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  color: #FDE68A !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), inset 0 1px 1.5px rgba(255, 255, 255, 0.5) !important;
}

.screen-title-big,
.lux-title-main {
  color: #FFFFFF !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

.screen-subtitle-text,
.lux-subtitle {
  color: #E9D5FF !important;
  opacity: 0.95 !important;
}

/* Banner Stats Pills */
.lux-stat-pill {
  background: rgba(255, 255, 255, 0.16) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 18px !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
}

.lux-stat-pill-val {
  color: #FFFFFF !important;
}

.lux-stat-pill-lbl {
  color: #E9D5FF !important;
}

/* 4. Glass-Neumorphism Cards ในทุกหน้า */
.home-section-card,
.screening-card,
.article-body-card,
.question-card,
.ios-inset-menu {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-radius: 26px !important;
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  /* Neumorphic Double Shadow */
  box-shadow: 
    -6px -6px 20px rgba(255, 255, 255, 0.95),
    8px 12px 28px rgba(126, 34, 206, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.8) !important;
}

.screening-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 
    -4px -4px 16px rgba(255, 255, 255, 0.9),
    10px 16px 32px rgba(126, 34, 206, 0.16),
    inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
}

/* Bottom Navigation Bar Glass-Neumorphism */
.bottom-dock {
  background: rgba(255, 255, 255, 0.90) !important;
  backdrop-filter: blur(25px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(25px) saturate(200%) !important;
  border-radius: 36px !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 
    -8px -8px 24px rgba(255, 255, 255, 0.95),
    10px 16px 36px rgba(88, 28, 135, 0.16),
    inset 0 1.5px 2px rgba(255, 255, 255, 0.8) !important;
}

/* ============================================================================
   PASTEL PURPLE NEUMORPHISM ATTACHED HERO BANNER (ติดแถบบาร์บน + ม่วงพาสเทล)
   ============================================================================ */

/* 1. Neumorphic Pastel Background */
body {
  background: #F4F0F9 !important;
  background-image: none !important;
  color: #2E1065 !important;
}

/* 2. Top Navigation Bar (เชื่อมต่อกับ Banner ด้านล่างอย่างไร้รอยต่อ) */
.app-top-nav {
  background: #F4F0F9 !important;
  border-bottom: none !important;
  box-shadow: none !important;
  padding: 10px 16px 4px !important;
}

/* 3. Hero Banner หน้าแรก ให้แนบชิดติดกับ Top Nav สไตล์เดียวกับหน้าอื่น */
.hero-card-clean,
.hero-card {
  margin: 0 0 18px 0 !important;
  width: 100% !important;
  /* ม่วงพาสเทล นุ่ม ละมุนตา ไม่มืด ไม่แยงตา */
  background: linear-gradient(150deg, #9333EA 0%, #A855F7 45%, #C084FC 100%) !important;
  border-radius: 0 0 32px 32px !important;
  padding: 16px 18px 20px !important; /* ขนาดเล็กลง ไม่กินพื้นที่ */
  position: relative !important;
  overflow: hidden !important;
  color: #FFFFFF !important;
  border: none !important;
  /* Neumorphic Soft Drop Shadow */
  box-shadow: 
    0 12px 28px rgba(147, 51, 234, 0.22),
    inset 0 -2px 3px rgba(0, 0, 0, 0.1) !important;
}

/* แสงประกายนุ่มนวลด้านหลัง */
.hero-card-clean::before,
.hero-card::before {
  content: '' !important;
  position: absolute !important;
  top: -30px !important;
  right: -20px !important;
  width: 150px !important;
  height: 150px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%) !important;
  pointer-events: none !important;
}

.hero-card-clean::after,
.hero-card::after {
  content: '' !important;
  position: absolute !important;
  bottom: -20px !important;
  left: -20px !important;
  width: 120px !important;
  height: 120px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(253, 230, 138, 0.25) 0%, transparent 70%) !important;
  pointer-events: none !important;
}

/* ป้ายข้อความหัวเรื่อง ขนาดกะทัดรัด */
.hero-clean-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(255, 255, 255, 0.22) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  margin-bottom: 8px !important;
}

.hero-clean-dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background: #34D399 !important;
  box-shadow: 0 0 6px #34D399 !important;
}

.hero-clean-heading {
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  color: #FFFFFF !important;
  margin-bottom: 4px !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15) !important;
}

.hero-clean-heading b {
  color: #FDE68A !important;
  -webkit-text-fill-color: #FDE68A !important;
}

.hero-clean-heading span {
  font-size: 0.82rem !important;
  color: #DBEAFE !important;
  display: block !important;
  margin-top: 2px !important;
  font-weight: 700 !important;
}

.hero-clean-desc {
  font-size: 0.74rem !important;
  color: #EFF6FF !important;
  line-height: 1.35 !important;
  margin-bottom: 12px !important;
  opacity: 0.95 !important;
}

/* สถิติ 3 มิติย่อย ปรับให้เล็กลง ไม่กินพื้นที่หน้าจอ */
.hero-clean-stats {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
  margin-bottom: 0 !important;
}

.hero-clean-stat-box {
  background: rgba(255, 255, 255, 0.20) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 16px !important;
  padding: 8px 6px !important;
  text-align: center !important;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
}

.hero-clean-stat-num {
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  color: #FFFFFF !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
}

.hero-clean-stat-lbl {
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  color: #F3E8FF !important;
  margin-top: 2px !important;
}

/* 4. แบนเนอร์หัวหน้าของทุกหน้า (ม่วงพาสเทล แนบติด Top Bar เสมอกันทุกหน้า) */
.screen-header-banner,
.screen-header-banner-lux {
  margin: 0 0 18px 0 !important;
  border-radius: 0 0 32px 32px !important;
  background: linear-gradient(150deg, #9333EA 0%, #A855F7 45%, #C084FC 100%) !important;
  padding: 16px 18px 20px !important;
  box-shadow: 0 12px 28px rgba(147, 51, 234, 0.22) !important;
  border-bottom: none !important;
  color: #FFFFFF !important;
}

.screen-title-big,
.lux-title-main {
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  color: #FFFFFF !important;
}

.screen-subtitle-text,
.lux-subtitle {
  font-size: 0.74rem !important;
  color: #F3E8FF !important;
  margin: 4px 0 12px !important;
}

.lux-title-icon-box {
  width: 40px !important;
  height: 40px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  color: #FDE68A !important;
  font-size: 1.15rem !important;
}

.lux-stat-pill {
  background: rgba(255, 255, 255, 0.20) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 14px !important;
  padding: 6px 8px !important;
}

.lux-stat-pill-val {
  color: #FFFFFF !important;
  font-size: 0.82rem !important;
}

.lux-stat-pill-lbl {
  color: #F3E8FF !important;
  font-size: 0.58rem !important;
}

/* 5. Neumorphism Cards & Surfaces ทั้งระบบ (นูน นุ่ม สบายตา) */
.home-section-card,
.screening-card,
.article-body-card,
.question-card,
.ios-inset-menu {
  background: #FFFFFF !important;
  border-radius: 22px !important;
  border: 1px solid rgba(233, 213, 255, 0.7) !important;
  box-shadow: 
    -5px -5px 15px rgba(255, 255, 255, 0.9),
    6px 10px 24px rgba(147, 51, 234, 0.08) !important;
}

/* Bottom Navigation Bar Neumorphism */
.bottom-dock {
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(233, 213, 255, 0.8) !important;
  box-shadow: 
    -6px -6px 18px rgba(255, 255, 255, 0.95),
    8px 12px 28px rgba(147, 51, 234, 0.12) !important;
}

/* ============================================================================
   FUTURISTIC MEDICAL BANNER GRAPHIC THEME (นำภาพที่ 2 มาใช้กับการ์ด & ทั้งระบบ)
   ============================================================================ */

/* 1. Hero Card หน้าแรก ใช้ภาพแบ็คกราวด์กราฟิกการแพทย์ไซเบอร์พาสเทล (โทนสีน้ำเงิน) */
.hero-card-clean,
.hero-card {
  margin: 0 0 18px 0 !important;
  width: 100% !important;
  background: 
    linear-gradient(135deg, rgba(29, 78, 216, 0.90) 0%, rgba(37, 99, 235, 0.84) 50%, rgba(59, 130, 246, 0.78) 100%),
    url('../img/medical_banner_bg.jpg') center center / cover no-repeat !important;
  border-radius: 0 0 32px 32px !important;
  padding: 18px 18px 22px !important;
  position: relative !important;
  overflow: hidden !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 
    0 14px 34px rgba(29, 78, 216, 0.30),
    inset 0 1.5px 2px rgba(255, 255, 255, 0.4),
    inset 0 -2px 3px rgba(0, 0, 0, 0.15) !important;
}

/* 2. แบนเนอร์หัวหน้าจอของทุกหน้า ใช้ภาพกราฟิกการแพทย์แบบเดียวกัน */
.screen-header-banner,
.screen-header-banner-lux {
  margin: 0 0 18px 0 !important;
  border-radius: 0 0 32px 32px !important;
  background: 
    linear-gradient(135deg, rgba(88, 28, 135, 0.88) 0%, rgba(126, 34, 206, 0.82) 50%, rgba(168, 85, 247, 0.78) 100%),
    url('../img/medical_banner_bg.jpg') center center / cover no-repeat !important;
  padding: 18px 18px 22px !important;
  box-shadow: 
    0 14px 34px rgba(107, 33, 168, 0.3),
    inset 0 1.5px 2px rgba(255, 255, 255, 0.4) !important;
  border-bottom: none !important;
  color: #FFFFFF !important;
}

/* 3. การ์ดเนื้อหาทั้งระบบ (Cards Glass-Neumorphism + คอนทราสต์และขอบเงาคมชัด ชัดเจน โดดเด่น) */
.home-section-card,
.screening-card,
.article-body-card,
.question-card,
.ios-inset-menu,
.interactive-calc-box,
.knowledge-item-card,
.app-lib-card {
  background: #FFFFFF !important;
  border-radius: 24px !important;
  border: 1.5px solid #E9D5FF !important;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 12px 28px -4px rgba(126, 34, 206, 0.14),
    inset 0 1px 1px rgba(255, 255, 255, 1) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* 4. เมนูบาร์ด้านล่าง (Bottom Dock) สไตล์ Glass-Neumorphism หรูหรา คมชัด ลอยเด่นเห็นชัดเจน */
.bottom-dock {
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(28px) saturate(210%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(210%) !important;
  border-radius: 36px !important;
  border: 2px solid rgba(168, 85, 247, 0.45) !important;
  box-shadow: 
    0 16px 40px -6px rgba(88, 28, 135, 0.28),
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1.5px 2px rgba(255, 255, 255, 1) !important;
}

.dock-item {
  color: #64748B !important;
}

.dock-item span {
  color: #475569 !important;
  font-weight: 700 !important;
  font-size: 0.68rem !important;
}

.dock-item.active {
  color: #7E22CE !important;
}

.dock-item.active .dock-icon-wrap {
  color: #6B21A8 !important;
  transform: translateY(-2px) scale(1.15) !important;
  filter: drop-shadow(0 4px 10px rgba(126, 34, 206, 0.45)) !important;
}

.dock-item.active span {
  color: #581C87 !important;
  font-weight: 850 !important;
}

.dock-under-credit {
  color: #334155 !important;
  font-weight: 750 !important;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 0 0 8px rgba(255, 255, 255, 0.9) !important;
}

/* ============================================================================
   HERO BANNER CAROUSEL & SLIDER (สไตล์ MyMOPH เลื่อนอัตโนมัติ สวยงามระดับพรีเมียม)
   ============================================================================ */
.hero-slider-section {
  padding: 0 14px;
  margin-bottom: 22px;
}

.hero-slider-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 
    0 10px 28px -4px rgba(126, 34, 206, 0.16),
    0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1.5px solid #E9D5FF;
  background: #000;
}

.hero-slider-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.hero-slide-item {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.hero-slide-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8.5;
  overflow: hidden;
  display: block;
  text-decoration: none;
  background: #0F0A1E;
}

.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.hero-slide-card:hover .hero-slide-img {
  transform: scale(1.02);
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(15, 10, 30, 0.88) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 14px;
  color: #FFFFFF;
}

.hero-slide-overlay.royal {
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(10, 5, 20, 0.75) 50%, rgba(10, 5, 20, 0.95) 100%);
}

/* สไลด์วิดีโอ: ภาพปกมีข้อความในตัวอยู่แล้ว → ลดเงาลงและแสดงปุ่มเล่นกลางภาพ */
.hero-slide-overlay.cover-only {
  background: linear-gradient(180deg, rgba(15,10,30,0.10) 0%, rgba(15,10,30,0.06) 45%, rgba(15,10,30,0.30) 100%);
  justify-content: flex-start;
}
.hero-slide-img.contain { object-fit: contain; background: #2E1065; }
/* ปกมีข้อความ/ป้ายในตัวเองแล้ว → ซ่อนป้ายแดงไม่ให้ทับโลโก้ */
.hero-slide-overlay.cover-only .hero-slide-tag { display: none; }
.hero-cover-play {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  color: #7E22CE;
  font-size: 1.35rem;
  padding-left: 4px;
  transition: transform 0.18s ease;
}
.hero-slide-card:hover .hero-cover-play { transform: scale(1.08); }

.hero-slide-tag {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.4);
}

.hero-slide-tag.royal {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #3B1602;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
}

.hero-slide-info {
  margin-top: auto;
}

.hero-slide-title {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.3;
  color: #FFFFFF;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  margin-bottom: 2px;
}

.hero-slide-sub {
  font-size: 0.7rem;
  color: #E2E8F0;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* จุด Indicators ด้านล่าง Slider สไตล์ MyMOPH */
.hero-slider-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #CBD5E1;
  transition: all 0.28s ease;
  cursor: pointer;
}

.slider-dot.active {
  width: 24px;
  background: linear-gradient(135deg, #7E22CE 0%, #9333EA 100%);
  box-shadow: 0 2px 8px rgba(126, 34, 206, 0.35);
}

/* ============================================================================
   TOP SCENIC BUILDING BANNER (ภาพสำนักงานสาธารณสุขจังหวัดนครศรีธรรมราช สไตล์ MyMOPH)
   ============================================================================ */
.moph-scenic-header {
  width: 100%;
  margin-top: -6px;
  margin-bottom: -18px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.moph-scenic-header {
  aspect-ratio: 16 / 9;
  max-height: 260px;
  background: linear-gradient(160deg,#EAF6FF,#A9DCFB);
}
.moph-scenic-img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ============================================================================
   RESPONSIVE DESIGN BREAKPOINTS (Mobile App Only Shell — รองรับมือถือทุกรุ่น)
   ============================================================================ */

/* 1. จอมือถือขนาดเล็กมาก (Small Phones เช่น iPhone SE, Galaxy A series ขนาดจอ < 380px) */
@media screen and (max-width: 380px) {
  .app-top-nav {
    padding: 8px 12px !important;
  }
  .brand-logo-img {
    width: 38px !important;
    height: 38px !important;
  }
  .brand-title-main {
    font-size: 0.95rem !important;
  }
  .top-help-pill {
    padding: 4px 10px !important;
    font-size: 0.72rem !important;
  }
  .hero-clean-heading {
    font-size: 1.15rem !important;
  }
  .hero-clean-stats {
    gap: 6px !important;
  }
  .hero-clean-stat-box {
    padding: 8px 6px !important;
  }
  .hero-clean-stat-num {
    font-size: 0.95rem !important;
  }
  .hero-clean-stat-lbl {
    font-size: 0.58rem !important;
  }
  .screening-card {
    padding: 12px 14px !important;
    gap: 12px !important;
  }
  .screening-icon-box {
    width: 46px !important;
    height: 46px !important;
    font-size: 1.25rem !important;
  }
  .screening-card-title {
    font-size: 0.9rem !important;
  }
  .bottom-dock {
    width: calc(100% - 16px) !important;
    height: 58px !important;
  }
  .dock-item {
    min-width: 48px !important;
    padding: 4px 6px !important;
  }
  .dock-icon-wrap {
    font-size: 1.05rem !important;
  }
  .dock-item span {
    font-size: 0.6rem !important;
  }
}

/* 1.5. สมาร์ตโฟน / มือถือทุกรุ่น (ขนาดจอ <= 480px) ให้แสดงผลเต็มจอสัดส่วน Mobile App เต็มรูปแบบ */
@media screen and (max-width: 480px) {
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  .app-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 0 calc(95px + env(safe-area-inset-bottom, 0px)) 0 !important;
    box-shadow: none !important;
    overflow-x: hidden !important;
  }
  .app-top-nav {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 14px !important;
  }
  .bottom-dock {
    width: calc(100% - 20px) !important;
    max-width: 440px !important;
    height: 60px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .dock-item {
    min-width: 44px !important;
    padding: 4px 2px !important;
  }
  .dock-item span {
    font-size: 0.62rem !important;
    white-space: nowrap !important;
  }
  .dock-under-credit {
    width: 100% !important;
    max-width: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: calc(4px + env(safe-area-inset-bottom, 0px)) !important;
    font-size: 0.62rem !important;
    padding: 0 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .pwa-bottom-pill-bar {
    width: calc(100% - 20px) !important;
    max-width: 440px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .screening-grid {
    padding: 0 14px !important;
    gap: 12px !important;
  }
  .section-title-wrap {
    padding: 0 14px !important;
  }
  .hero-slider-section {
    padding: 0 14px !important;
  }
  .app-library-grid {
    padding: 0 14px !important;
  }
  .ios-inset-menu {
    margin-left: 14px !important;
    margin-right: 14px !important;
  }
  .home-section-card {
    margin-left: 14px !important;
    margin-right: 14px !important;
  }
  .moph-scenic-header {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ============================================================================
   MOBILE APP CONTAINER (ดีไซน์แอปพลิเคชันมือถือแท้จริง สวยงามทั้งบนมือถือและจอคอม)
   - หน้าจอมือถือจริง: กว้างเต็มหน้าจอ 100% ใช้งานถนัดมือ
   - หน้าจอคอมพิวเตอร์ / โน้ตบุ๊ก: จำลองเป็น Smartphone Frame กึ่งกลางหน้าจออย่างหรูหรา
   ============================================================================ */
.app-container {
  width: 100% !important;
  max-width: 460px !important;
  margin: 0 auto !important;
  min-height: 100vh !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 40px rgba(15, 23, 42, 0.08) !important;
  position: relative !important;
  padding: 0 0 calc(115px + env(safe-area-inset-bottom, 0px)) 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 480px) {
  .app-container {
    max-width: 100% !important;
    box-shadow: none !important;
  }
}

.app-top-nav {
  width: 100% !important;
  max-width: 460px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

.screening-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  padding: 0 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.screening-card {
  width: 100% !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
}

.bottom-dock {
  position: fixed !important;
  bottom: 24px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: calc(100% - 24px) !important;
  max-width: 436px !important;
  z-index: 999 !important;
  border-radius: 28px !important;
  box-shadow: 0 10px 30px rgba(126, 34, 206, 0.15) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

.dock-under-credit {
  position: fixed !important;
  bottom: 5px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100% !important;
  max-width: 460px !important;
  text-align: center !important;
  font-size: 0.65rem !important;
  font-weight: 500 !important;
  color: #64748B !important;
  z-index: 998 !important;
  pointer-events: none !important;
}

.ai-chat-fab {
  position: fixed !important;
  right: max(16px, calc(50% - 214px)) !important;
  bottom: calc(95px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 1000 !important;
}

.ai-chat-window {
  position: relative !important;
  width: 100% !important;
  max-width: 460px !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 10051 !important;
}

/* ============================================================================
   PARTICIPANT INFO CARD (ข้อมูลผู้รับการคัดกรอง — ไม่บังคับ)
   ============================================================================ */
.participant-info-card {
  background: #FFFFFF !important;
  border: 1.5px dashed #C4B5FD !important;
  border-radius: 20px !important;
  padding: 14px 14px 16px !important;
  margin-bottom: 14px !important;
  box-shadow: 0 6px 18px rgba(126, 34, 206, 0.06) !important;
}

.participant-info-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 800;
  color: #3B0764;
}
.participant-info-head i {
  color: #7E22CE;
}
.participant-info-hint {
  font-size: 0.66rem;
  font-weight: 600;
  color: #94A3B8;
}

.participant-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.participant-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.participant-field-full {
  grid-column: 1 / -1;
}
.participant-field > span {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748B;
}
.participant-field input,
.participant-field select {
  width: 100%;
  padding: 9px 11px;
  font-size: 0.8rem;
  font-family: inherit;
  color: #1E293B;
  background: #FAF5FF;
  border: 1px solid #E9D5FF;
  border-radius: 12px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.participant-field input:focus,
.participant-field select:focus {
  border-color: #A855F7;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}


/* ============================================================================
   MOBILE APP STANDARDIZED LAYOUT (คงรูปทรงแอปพลิเคชันมือถือ 100% สไตล์เดิม)
   ============================================================================ */
:root {
  --shell-w: 460px;
  --shell-pad: 16px;
}

.app-container {
  width: 100% !important;
  max-width: 460px !important;
  margin: 0 auto !important;
  overflow-x: hidden !important;
}

@media (max-width: 480px) {
  .app-container {
    max-width: 100% !important;
    margin: 0 !important;
  }
}

.section-title-wrap {
  padding: 0 16px !important;
}

.screening-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  padding: 0 16px !important;
  width: 100% !important;
}

.screening-card {
  width: 100% !important;
  margin-bottom: 0 !important;
}

.app-library-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  padding: 0 16px !important;
}

.hero-slider-section {
  padding: 0 16px !important;
}

.knowledge-scroll-wrap {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.home-section-card {
  margin-left: 16px !important;
  margin-right: 16px !important;
}

/* ============================================================================
   REPORT PAGE (/reports.php)
   ============================================================================ */
.report-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px;
  margin: 14px 0 12px;
}
.report-stat {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(29, 78, 216, 0.06);
}
.report-stat-num {
  font-size: 1.3rem;
  font-weight: 900;
  color: #1D4ED8;
  line-height: 1.2;
}
.report-stat.danger .report-stat-num { color: #DC2626; }
.report-stat-lbl {
  font-size: 0.64rem;
  font-weight: 700;
  color: #64748B;
  margin-top: 3px;
  line-height: 1.3;
}

.report-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 14px;
}
.report-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 700;
}
.report-chip i { font-size: 0.35rem; color: #3B82F6; }
.report-chip b { color: #1D4ED8; font-weight: 900; }

.report-filters {
  background: #FFFFFF;
  margin: 0 16px 14px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}
.report-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.report-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.report-field-full { grid-column: 1 / -1; }
.report-field > span {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748B;
}
.report-field input,
.report-field select {
  width: 100%;
  padding: 9px 11px;
  font-size: 0.8rem;
  font-family: inherit;
  color: #1E293B;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  outline: none;
}
.report-field input:focus,
.report-field select:focus {
  border-color: #3B82F6;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 800;
  font-family: inherit;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
}
.report-btn.primary { background: linear-gradient(135deg, #1D4ED8, #3B82F6); color: #FFFFFF; box-shadow: 0 6px 16px rgba(29, 78, 216, 0.25); }
.report-btn.success { background: linear-gradient(135deg, #059669, #10B981); color: #FFFFFF; box-shadow: 0 6px 16px rgba(5, 150, 105, 0.22); }
.report-btn.ghost { background: #FFFFFF; color: #475569; border-color: #E2E8F0; }
.report-btn:active { transform: scale(0.97); }

.report-table-wrap {
  margin: 0 16px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  overflow-x: auto;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}
table.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  color: #1E293B;
}
table.report-table th {
  background: #F1F5F9;
  color: #475569;
  font-weight: 800;
  text-align: left;
  padding: 9px 10px;
  white-space: nowrap;
  border-bottom: 1px solid #E2E8F0;
}
table.report-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: top;
}
table.report-table tbody tr:nth-child(even) { background: #FCFDFF; }
table.report-table tbody tr:hover { background: #F0F7FF; }
table.report-table .nowrap { white-space: nowrap; }
table.report-table .num { color: #94A3B8; font-weight: 700; }
table.report-table .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.66rem; color: #475569; }

.risk-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  white-space: nowrap;
}
.risk-pill.green  { background: #DCFCE7; color: #15803D; }
.risk-pill.yellow { background: #FEF9C3; color: #A16207; }
.risk-pill.orange { background: #FFEDD5; color: #C2410C; }
.risk-pill.red    { background: #FEE2E2; color: #B91C1C; }

.report-empty {
  padding: 40px 16px;
  text-align: center;
  color: #94A3B8;
  font-size: 0.82rem;
  font-weight: 700;
}
.report-empty i { font-size: 1.8rem; display: block; margin-bottom: 8px; color: #CBD5E1; }
.report-empty-sub { font-size: 0.7rem; font-weight: 600; margin-top: 6px; color: #F87171; }

.report-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px 6px;
}
.report-pager-info { font-size: 0.72rem; font-weight: 700; color: #64748B; }

@media (max-width: 400px) {
  .report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-stat:last-child { grid-column: 1 / -1; }
}

@media print {
  .bottom-dock, .ai-chat-fab, .pwa-bottom-pill-bar, .back-link-btn,
  .report-filters, .report-actions, .report-pager, #appSplashScreen { display: none !important; }
  .report-table-wrap { border: none; box-shadow: none; }
  .app-container { max-width: 100% !important; box-shadow: none !important; }
}

html.nrt-force-mobile body {
  background: #F4F0F9 !important;
}
html.nrt-force-mobile .app-container {
  width: 100% !important;
  max-width: 460px !important;
  margin: 0 auto !important;
  padding: 0 0 calc(95px + env(safe-area-inset-bottom, 0px)) 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  box-shadow: none !important;
  overflow-x: hidden !important;
}
html.nrt-force-mobile .app-top-nav { width: 100% !important; max-width: 460px !important; margin: 0 auto !important; padding: 10px 14px !important; }
html.nrt-force-mobile .screening-grid { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; padding: 0 14px !important; gap: 12px !important; }
html.nrt-force-mobile .app-library-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; padding: 0 14px !important; gap: 12px !important; }
html.nrt-force-mobile .section-title-wrap,
html.nrt-force-mobile .hero-slider-section { padding-left: 14px !important; padding-right: 14px !important; }
html.nrt-force-mobile .home-section-card { margin-left: 14px !important; margin-right: 14px !important; }
html.nrt-force-mobile .moph-scenic-header { width: 100% !important; max-width: 100% !important; }
html.nrt-force-mobile .bottom-dock {
  width: calc(100% - 20px) !important;
  max-width: 436px !important;
  height: 60px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
}
html.nrt-force-mobile .dock-item { min-width: 44px !important; padding: 4px 2px !important; }
html.nrt-force-mobile .dock-item span { font-size: 0.62rem !important; white-space: nowrap !important; }
html.nrt-force-mobile .ai-chat-fab { right: 16px !important; }

.home-page {
  background: #F7F1FA !important;
}

@media (min-width: 481px) {
  body {
    background: linear-gradient(135deg, #EDE9FE 0%, #E2E8F0 100%) !important;
  }
  .app-container {
    border-left: 1px solid rgba(15, 23, 42, 0.1);
    border-right: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.16) !important;
  }
}

/* Mobile-only card layout for screening reports table (no wide horizontal scroll) */
@media screen {
  .report-table-wrap {
    overflow-x: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  table.report-table,
  table.report-table tbody,
  table.report-table tr,
  table.report-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  table.report-table thead {
    display: none;
  }
  table.report-table tbody tr {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 10px 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  }
  table.report-table td {
    border: 0;
    padding: 2px 0;
    font-size: 0.76rem;
    white-space: normal !important;
  }
  table.report-table td:nth-child(1) {
    display: inline-block;
    width: auto;
    font-size: 0.68rem;
    margin-right: 6px;
  }
  table.report-table td:nth-child(2) {
    display: inline-block;
    width: auto;
    font-size: 0.68rem;
    color: #64748B;
  }
  table.report-table td:nth-child(3) {
    font-size: 0.66rem;
  }
  table.report-table td:nth-child(5) {
    font-size: 0.86rem;
    color: #0F172A;
    margin: 3px 0;
  }
  table.report-table td:nth-child(9) {
    display: inline-block;
    width: auto;
    margin-right: 8px;
  }
  table.report-table td:nth-child(10) {
    display: inline-block;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page .screening-card,
  .home-page .knowledge-item-card,
  .home-page .hero-slide-img {
    transition: none;
  }
}
