/*
Theme Name: Flatsome Child - Material 3 Phong Thủy Hoàng Cung
Theme URI: https://lichviet.docungtrongoi.vn/
Description: Giao diện Flatsome Child chuẩn Material Design 3 (M3) kết hợp Visual Semantic và Lý số cổ thư hoàng gia. Tích hợp giải pháp chuyển đổi Đồ Cúng Trọn Gói KTH.
Author: Hội đồng Chuyên gia CRO, AI SEO & Lịch Việt Suite x KTH
Author URI: https://docungtrongoi.vn/
Template: flatsome
Version: 2.0.0
Text Domain: flatsome-child
*/

/* ==========================================================================
   1. GOOGLE FONTS (Visual Semantic Typography)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Inter:wght@400;500;600;700;800&family=Noto+Serif:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

/* ==========================================================================
   2. MATERIAL DESIGN 3 (M3) DESIGN TOKENS (HCT Tonal Palettes)
   ========================================================================== */
:root {
  /* M3 Primary - Đỏ Chu Sa Hoàng Triều (Tone 40) */
  --md-sys-color-primary: #8B1E1E;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #FFDAD6;
  --md-sys-color-on-primary-container: #410002;

  /* M3 Secondary - Vàng Hoàng Đế Phú Quý (Tone 50) */
  --md-sys-color-secondary: #855400;
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #FFDDB0;
  --md-sys-color-on-secondary-container: #2A1700;

  /* M3 Tertiary - Xanh Ngọc Bích Sinh Khí (Tone 40) */
  --md-sys-color-tertiary: #006C47;
  --md-sys-color-on-tertiary: #FFFFFF;
  --md-sys-color-tertiary-container: #8EF6C0;
  --md-sys-color-on-tertiary-container: #002113;

  /* M3 Surface & Background - Giấy Xuyến Cổ Điển */
  --md-sys-color-surface: #FFF8F6;
  --md-sys-color-on-surface: #231918;
  --md-sys-color-surface-variant: #F5DDD8;
  --md-sys-color-on-surface-variant: #534341;
  --md-sys-color-surface-container-lowest: #FFFFFF;
  --md-sys-color-surface-container-low: #FFF0ED;
  --md-sys-color-surface-container: #FCEAE6;
  --md-sys-color-surface-container-high: #F6E4E0;
  --md-sys-color-surface-container-highest: #F1DFDC;

  /* M3 Outline */
  --md-sys-color-outline: #857370;
  --md-sys-color-outline-variant: #D8C2BE;

  /* M3 Shape Scales */
  --md-sys-shape-corner-none: 0px;
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-full: 9999px;

  /* M3 Elevation via Tonal Tint Layers */
  --md-sys-elevation-1: 0 1px 3px 1px rgba(139, 30, 30, 0.08), 0 1px 2px 0 rgba(139, 30, 30, 0.12);
  --md-sys-elevation-2: 0 2px 6px 2px rgba(139, 30, 30, 0.08), 0 1px 2px 0 rgba(139, 30, 30, 0.12);
  --md-sys-elevation-3: 0 4px 14px 3px rgba(139, 30, 30, 0.10), 0 1px 3px 0 rgba(139, 30, 30, 0.14);
  --md-sys-elevation-4: 0 8px 24px 4px rgba(139, 30, 30, 0.12), 0 2px 6px 0 rgba(139, 30, 30, 0.16);

  /* M3 Motion Easing */
  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-duration-short: 200ms;
  --md-sys-motion-duration-medium: 300ms;
}

/* ==========================================================================
   3. BASE RESET & VISUAL SEMANTIC TYPOGRAPHY
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--md-sys-color-surface) !important;
  color: var(--md-sys-color-on-surface) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .m3-headline, .m3-title {
  font-family: 'Noto Serif', serif !important;
  color: var(--md-sys-color-on-surface);
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* ==========================================================================
   4. M3 TOP APP BAR & FLATSOME HEADER
   ========================================================================== */
#top-bar {
  background: linear-gradient(90deg, #5b1010 0%, #8B1E1E 50%, #5b1010 100%) !important;
  color: var(--md-sys-color-secondary-container) !important;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.4);
}

#header {
  background: var(--md-sys-color-surface-container-lowest);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-1);
}

.header-nav a {
  font-family: 'Noto Serif', serif;
  font-weight: 700;
  color: var(--md-sys-color-on-surface) !important;
  transition: color var(--md-sys-motion-duration-short) ease;
}

.header-nav a:hover {
  color: var(--md-sys-color-primary) !important;
}

/* ==========================================================================
   5. M3 HERO CALENDAR SPLIT-CARD (28px Extra-Large Shape)
   ========================================================================== */
.m3-hero-card {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-extra-large);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-3);
  overflow: hidden;
  margin-bottom: 35px;
  position: relative;
  transition: box-shadow var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

.m3-hero-card:hover {
  box-shadow: var(--md-sys-elevation-4);
}

.m3-hero-card-header {
  background: linear-gradient(135deg, #681111 0%, #8B1E1E 50%, #991B1B 100%);
  color: #FFFFFF;
  padding: 30px 24px;
  text-align: center;
  position: relative;
  border-bottom: 2px solid var(--md-sys-color-secondary);
}

.m3-split-calendar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #FFFFFF;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.m3-cal-solar, .m3-cal-lunar {
  padding: 28px 24px;
  text-align: center;
}

.m3-cal-solar {
  border-right: 1px solid var(--md-sys-color-outline-variant);
  background: #FFFDFD;
}

.m3-cal-lunar {
  background: #FCFBF7;
}

.m3-cal-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 14px;
  border-radius: var(--md-sys-shape-corner-full);
  margin-bottom: 12px;
}

.label-solar {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.label-lunar {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.m3-big-number {
  font-family: 'Cinzel', serif;
  font-size: 80px;
  line-height: 1;
  font-weight: 900;
  margin: 6px 0;
}

.number-solar {
  color: var(--md-sys-color-primary);
}

.number-lunar {
  color: var(--md-sys-color-secondary);
}

/* Day Energy Gauge Meter (Thước Đo Năng Lượng Cát Hung) */
.m3-energy-meter {
  padding: 16px 24px;
  background: var(--md-sys-color-surface-container-low);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.meter-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--md-sys-shape-corner-full);
  font-weight: 700;
  font-size: 13px;
}

.meter-great {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}

/* Auspicious Hours Grid with Star Rating (M3 Star Rating) */
.m3-hours-container {
  padding: 24px;
  background: #FFFFFF;
}

.m3-hours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.m3-hour-chip {
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--md-sys-motion-duration-short) ease;
}

.m3-hour-chip:hover {
  background: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary);
  transform: translateY(-2px);
}

.hour-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--md-sys-color-on-surface);
}

.hour-stars {
  color: #EAB308;
  font-size: 12px;
  letter-spacing: 2px;
}

/* ==========================================================================
   6. M3 ACTION & FILTER CHIPS (Bo tròn 9999px cuộn ngang)
   ========================================================================== */
.m3-chips-scroll-wrap {
  position: sticky;
  top: 72px;
  z-index: 997;
  background: rgba(255, 248, 246, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 0;
  margin-bottom: 30px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.m3-chips-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 10px;
}

.m3-chips-row::-webkit-scrollbar {
  display: none;
}

.m3-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: var(--md-sys-elevation-1);
  transition: all var(--md-sys-motion-duration-short) ease;
}

.m3-filter-chip:hover {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container) !important;
  border-color: var(--md-sys-color-primary);
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-2);
}

.m3-filter-chip.chip-highlight {
  background: linear-gradient(135deg, #8B1E1E 0%, #B91C1C 100%);
  color: #FFFFFF !important;
  border-color: #D4AF37;
  box-shadow: 0 4px 12px rgba(139, 30, 30, 0.25);
}

/* ==========================================================================
   7. M3 CONVERSION CORE: ĐỒ CÚNG TRỌN GÓI KTH CARDS
   ========================================================================== */
.m3-conversion-card {
  background: linear-gradient(180deg, #FFFDFD 0%, #FCFBF7 100%);
  border-radius: var(--md-sys-shape-corner-extra-large);
  border: 1px solid var(--md-sys-color-outline-variant);
  padding: 36px 28px;
  margin-bottom: 45px;
  box-shadow: var(--md-sys-elevation-3);
  position: relative;
  overflow: hidden;
}

.m3-conversion-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, #8B1E1E 0%, #D4AF37 50%, #8B1E1E 100%);
}

.m3-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.m3-offering-item {
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid var(--md-sys-color-outline-variant);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--md-sys-elevation-1);
  transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
  position: relative;
}

.m3-offering-item:hover {
  transform: translateY(-5px);
  border-color: var(--md-sys-color-secondary);
  box-shadow: var(--md-sys-elevation-3);
}

.m3-offering-icon {
  width: 64px;
  height: 64px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 14px;
}

.m3-btn-filled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #8B1E1E 0%, #681111 100%);
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--md-sys-shape-corner-full);
  text-decoration: none !important;
  border: 1px solid var(--md-sys-color-secondary);
  box-shadow: var(--md-sys-elevation-1);
  transition: all var(--md-sys-motion-duration-short) ease;
}

.m3-btn-filled:hover {
  background: linear-gradient(135deg, #991B1B 0%, #8B1E1E 100%);
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(139, 30, 30, 0.35);
}

/* ==========================================================================
   8. M3 NAVIGATION BAR (Mobile Bottom App Bar - Thumb Zone)
   ========================================================================== */
#m3-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  #m3-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: rgba(255, 248, 246, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    box-shadow: 0 -3px 16px rgba(0,0,0,0.06);
    z-index: 9999;
    justify-content: space-around;
    align-items: center;
    padding: 0 6px;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .m3-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 11px;
    font-weight: 600;
    gap: 3px;
    flex: 1;
    position: relative;
    transition: color var(--md-sys-motion-duration-short) ease;
  }

  .m3-nav-pill {
    padding: 4px 16px;
    border-radius: var(--md-sys-shape-corner-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--md-sys-motion-duration-short) ease;
  }

  .m3-nav-item.active .m3-nav-pill, .m3-nav-item:hover .m3-nav-pill {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
  }

  .m3-nav-item.special-kth .m3-nav-pill {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border: 1px solid #D4AF37;
  }

  body {
    padding-bottom: 75px !important;
  }

  .m3-split-calendar {
    grid-template-columns: 1fr;
  }

  .m3-cal-solar {
    border-right: none;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
  }

  .m3-big-number {
    font-size: 64px;
  }
}

/* ==========================================================================
   M3 RIPPLE & STATE LAYER ANIMATIONS
   ========================================================================== */
.lichviet-btn, .m3-filter-chip, .m3-nav-item, .lv-tab-btn, .m3-offering-btn, .lv-btn-action {
  position: relative;
  overflow: hidden;
}

.m3-ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.22;
  pointer-events: none;
  transform: scale(0);
  animation: m3-ripple-animation 600ms cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes m3-ripple-animation {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* M3 Target Pulse Glow */
.m3-target-highlight {
  animation: m3-pulse-glow 2s ease forwards !important;
}

@keyframes m3-pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(139, 30, 30, 0.6);
    transform: scale(1.02);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(139, 30, 30, 0);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(139, 30, 30, 0);
    transform: scale(1);
  }
}

/* ==========================================================================
   M3 CALENDAR SEGMENTED TABS (DAY / MONTH / FINDER)
   ========================================================================== */
.m3-cal-tabs-bar {
  display: flex;
  gap: 8px;
  background: var(--md-sys-color-surface-container);
  padding: 6px;
  border-radius: var(--md-sys-shape-corner-full);
  margin-bottom: 20px;
  border: 1px solid var(--md-sys-color-outline-variant);
  flex-wrap: wrap;
}

.m3-cal-tab-btn {
  flex: 1;
  min-width: 140px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.m3-cal-tab-btn:hover {
  color: var(--md-sys-color-primary);
  background: rgba(139, 30, 30, 0.06);
}

.m3-cal-tab-btn.active {
  background: var(--md-sys-color-primary);
  color: #FFFFFF !important;
  box-shadow: var(--md-sys-elevation-2);
}

.m3-cal-panel {
  display: none;
  animation: m3FadeIn 0.3s ease;
}

.m3-cal-panel.active {
  display: block;
}

@keyframes m3FadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   M3 MONTH GRID (7x5 LƯỚI LỊCH THÁNG)
   ========================================================================== */
.m3-month-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px 16px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-month-current-title {
  font-size: 18px;
  color: var(--md-sys-color-primary);
  letter-spacing: 0.5px;
}

.m3-month-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 14px;
}

.m3-dot-legend {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

.dot-green { background: #16A34A; }
.dot-red { background: #DC2626; }
.dot-blue { background: #2563EB; }
.dot-gold { background: #D97706; }

.m3-month-grid-wrapper {
  background: #FFFFFF;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 14px;
  box-shadow: var(--md-sys-elevation-1);
  overflow-x: auto;
}

.m3-month-weekdays-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--md-sys-color-outline-variant);
  margin-bottom: 8px;
}

.m3-month-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.m3-month-day-cell {
  min-height: 64px;
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.m3-month-day-cell:hover {
  background: var(--md-sys-color-surface-container);
  border-color: var(--md-sys-color-primary);
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-2);
}

.m3-month-day-cell.other-month {
  opacity: 0.35;
  background: transparent;
  cursor: default;
}

.m3-month-day-cell.today {
  border: 2px solid #2563EB !important;
  background: #EFF6FF !important;
}

.m3-month-day-cell.selected {
  border: 2px solid var(--md-sys-color-primary) !important;
  background: var(--md-sys-color-primary-container) !important;
  box-shadow: 0 0 0 2px var(--md-sys-color-primary);
}

.m3-cell-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.m3-cell-solar-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--md-sys-color-on-surface);
}

.m3-cell-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.m3-cell-lunar-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--md-sys-color-secondary);
  text-align: right;
}

/* ==========================================================================
   M3 DATE FINDER TOOL (TÌM NGÀY ĐẸP KHỞI SỰ)
   ========================================================================== */
.m3-finder-card {
  background: #FFFFFF;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 24px;
  box-shadow: var(--md-sys-elevation-1);
}

.m3-finder-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.lv-good-day-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 14px 18px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.lv-good-day-card:hover {
  border-color: var(--md-sys-color-tertiary);
  background: #F0FDF4;
  transform: translateX(4px);
}

.lv-good-day-score {
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--md-sys-shape-corner-full);
}

/* ==========================================================================
   M3 MODAL CHI TIẾT MÂM CÚNG & FORM ĐẶT NHANH KTH
   ========================================================================== */
.m3-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 10, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.m3-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.m3-modal-dialog {
  background: #FFFFFF;
  border-radius: 28px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  border: 2px solid #D4AF37;
  position: relative;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.m3-modal-backdrop.open .m3-modal-dialog {
  transform: scale(1);
}

.m3-modal-close-btn {
  position: absolute;
  top: 18px;
  right: 20px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all 0.2s;
}

.m3-modal-close-btn:hover {
  background: var(--md-sys-color-primary);
  color: #FFFFFF;
}

.m3-offering-items-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.m3-offering-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #44403C;
  background: var(--md-sys-color-surface);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #F3ECE8;
}

.m3-zalo-btn {
  background: #0068FF;
  color: #FFFFFF !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--md-sys-shape-corner-full);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none !important;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 104, 255, 0.3);
}

.m3-zalo-btn:hover {
  background: #0054CC;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 104, 255, 0.4);
}

/* ==========================================================================
   M3 HERO NAV BUTTONS
   ========================================================================== */
.m3-hero-nav-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 4px 8px;
  border-radius: var(--md-sys-shape-corner-full);
  margin-top: 12px;
}

.m3-hero-nav-btn {
  background: transparent;
  border: none;
  color: #FEF3C7;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--md-sys-shape-corner-full);
  cursor: pointer;
  transition: all 0.2s;
}

.m3-hero-nav-btn:hover, .m3-hero-nav-btn.active {
  background: #8B1E1E;
  color: #FFFFFF;
}

/* ==========================================================================
   TOP ANNOUNCEMENT BAR (HOTLINE & CAM KẾT KTH)
   ========================================================================== */
.m3-top-announcement-bar {
  background: linear-gradient(90deg, #681111 0%, #8B1E1E 50%, #681111 100%);
  color: #FFFFFF;
  padding: 8px 0;
  border-bottom: 1px solid #D4AF37;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
}

.m3-top-cta-btn {
  background: #D4AF37;
  color: #5B1414 !important;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: var(--md-sys-shape-corner-full);
  text-decoration: none !important;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.m3-top-cta-btn:hover {
  background: #FEF3C7;
  transform: translateY(-1px);
}

/* ==========================================================================
   CHÂN TRANG HOÀNG GIA ĐỒ CÚNG TRỌN GÓI KTH
   ========================================================================== */
.m3-kth-master-footer {
  background: #1C1917;
  color: #FFFFFF;
  padding: 55px 0 25px 0;
  border-top: 3px solid #D4AF37;
  font-family: 'Inter', sans-serif;
  margin-top: 50px;
}

.m3-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-bottom: 35px;
}

.m3-footer-title {
  color: #D4AF37;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.m3-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.m3-footer-links li {
  margin-bottom: 9px;
}

.m3-footer-links a {
  color: #D6D3D1;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.m3-footer-links a:hover {
  color: #D4AF37;
}

.m3-footer-commitments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
  color: #D6D3D1;
}

.m3-commit-item {
  display: flex;
  gap: 8px;
  line-height: 1.5;
}

.m3-footer-btn-zalo {
  background: #0068FF;
  color: #FFFFFF !important;
  padding: 8px 18px;
  border-radius: var(--md-sys-shape-corner-full);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.m3-footer-btn-web {
  background: #8B1E1E;
  color: #FFFFFF !important;
  padding: 8px 18px;
  border-radius: var(--md-sys-shape-corner-full);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none !important;
  border: 1px solid #D4AF37;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.m3-footer-bottom {
  border-top: 1px solid #44403C;
  padding-top: 20px;
  font-size: 12px;
  color: #A8A29E;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   THƯ VIỆN VĂN KHẤN CỔ TRUYỀN KHÂM THIÊN GIÁM
   ========================================================================== */
.m3-vankhan-card {
  background: #FFFDFD;
  border-radius: var(--md-sys-shape-corner-extra-large);
  border: 1px solid var(--md-sys-color-outline-variant);
  padding: 35px 28px;
  box-shadow: var(--md-sys-elevation-3);
  margin-bottom: 45px;
}

.m3-vankhan-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--md-sys-color-surface-container);
  padding: 12px 18px;
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid var(--md-sys-color-outline-variant);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.m3-vankhan-body {
  background: #FFFDF7;
  border: 1px solid #E7E0D3;
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 28px;
  font-family: 'Noto Serif', serif;
  line-height: 1.85;
  color: #292524;
  position: relative;
  font-size: 15px;
  white-space: pre-line;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.03);
}

.m3-vankhan-body.font-lg {
  font-size: 18px;
  line-height: 2.0;
}

.m3-vankhan-body.font-xl {
  font-size: 21px;
  line-height: 2.2;
}

/* ==========================================================================
   PRINT OPTIMIZATION (@media print)
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  #m3-bottom-nav, .m3-top-announcement-bar, header, footer, .m3-hero-nav-bar, .m3-chips-scroll-wrap, .m3-vankhan-toolbar, .lichviet-actions {
    display: none !important;
  }
  .lichviet-tuvi-result, .lichviet-tuvi-result *,
  .m3-vankhan-body, .m3-vankhan-body * {
    visibility: visible !important;
  }
  .lichviet-tuvi-result, .m3-vankhan-body {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }
}





/* ==========================================================================
   11. KTH BRAIN KNOWLEDGE ASSISTANT (AI) - MATERIAL DESIGN 3 STYLES
   ========================================================================== */
.m3-kth-brain-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  background: linear-gradient(135deg, #8B1E1E 0%, #681111 50%, #4A0808 100%);
  border: 2px solid #D4AF37;
  border-radius: 50px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(139, 30, 30, 0.45), 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  user-select: none;
}

.m3-kth-brain-trigger:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(139, 30, 30, 0.6), 0 0 16px rgba(212, 175, 55, 0.5);
  border-color: #FEF3C7;
}

.m3-brain-icon {
  font-size: 24px;
  display: inline-block;
  animation: m3BrainPulseIcon 2.4s infinite ease-in-out;
}

@keyframes m3BrainPulseIcon {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.18) rotate(8deg); }
}

.m3-brain-label {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.m3-brain-title {
  color: #FEF3C7;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.m3-brain-sub {
  color: #FDE68A;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.92;
  white-space: nowrap;
}

.m3-brain-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 54px;
  border: 2px solid rgba(212, 175, 55, 0.7);
  animation: m3PulseRing 2.2s infinite cubic-bezier(0.2, 0, 0, 1);
  pointer-events: none;
}

@keyframes m3PulseRing {
  0% { transform: scale(0.96); opacity: 0.9; }
  70% { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(1.16); opacity: 0; }
}

/* Modal Dialog */
.m3-kth-brain-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.m3-kth-brain-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.m3-kth-brain-dialog {
  background: #FFFFFF;
  border-radius: 26px;
  max-width: 660px;
  width: 100%;
  height: 86vh;
  max-height: 740px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.45);
  border: 2px solid #D4AF37;
  overflow: hidden;
  position: relative;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.m3-kth-brain-modal.is-open .m3-kth-brain-dialog {
  transform: scale(1);
}

.m3-kth-brain-header {
  background: linear-gradient(135deg, #681111 0%, #8B1E1E 60%, #4A0808 100%);
  color: #FFFFFF;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #D4AF37;
  flex-shrink: 0;
}

.m3-kth-brain-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.m3-brain-header-icon {
  font-size: 28px;
}

.m3-brain-header-title {
  font-size: 16px;
  font-weight: 800;
  color: #FEF3C7;
  margin: 0 0 2px 0;
  letter-spacing: 0.3px;
}

.m3-brain-header-status {
  font-size: 11px;
  color: #86EFAC;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.dot-online {
  width: 8px;
  height: 8px;
  background: #22C55E;
  border-radius: 50%;
  box-shadow: 0 0 6px #22C55E;
  animation: m3BlinkOnline 1.8s infinite;
  display: inline-block;
}

@keyframes m3BlinkOnline {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.m3-brain-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}

.m3-brain-close-btn:hover {
  background: #FFFFFF;
  color: #8B1E1E;
}

.m3-kth-brain-chips {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: #FFF8F6;
  border-bottom: 1px solid #F3ECE8;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
}

.m3-kth-brain-chips::-webkit-scrollbar {
  display: none;
}

.m3-brain-chip {
  background: #FFFFFF;
  border: 1px solid #E5D5D0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #8B1E1E;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.m3-brain-chip:hover {
  background: #8B1E1E;
  color: #FFFFFF;
  border-color: #8B1E1E;
  transform: translateY(-1px);
}

.m3-kth-brain-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #FDFBF7;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.m3-brain-msg {
  display: flex;
  flex-direction: column;
}

.m3-brain-msg.user-msg {
  align-self: flex-end;
  max-width: 85%;
}

.m3-brain-msg.user-msg .m3-brain-msg-content {
  background: linear-gradient(135deg, #8B1E1E 0%, #701414 100%);
  color: #FFFFFF;
  border-radius: 20px 20px 4px 20px;
  padding: 12px 18px;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: 0 4px 12px rgba(139, 30, 30, 0.25);
}

.m3-brain-msg.bot-msg {
  align-self: flex-start;
  max-width: 96%;
  width: 100%;
}

.m3-brain-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.badge-agent {
  background: #FEF3C7;
  color: #92400E;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #FCD34D;
}

.badge-source {
  background: #DCFCE7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #86EFAC;
}

.m3-brain-msg.bot-msg .m3-brain-msg-content {
  background: #FFFFFF;
  border: 1px solid #E8E2D9;
  border-radius: 4px 22px 22px 22px;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: #292524;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.m3-brain-msg.bot-msg .m3-brain-msg-content strong {
  color: #8B1E1E;
}

.m3-brain-subhead {
  color: #8B1E1E;
  font-size: 15px;
  font-weight: 800;
  margin: 12px 0 6px 0;
}

.m3-brain-head {
  color: #701414;
  font-size: 16px;
  font-weight: 800;
  margin: 14px 0 8px 0;
  border-bottom: 1px dashed #D4AF37;
  padding-bottom: 4px;
}

.m3-brain-title-lg {
  color: #580E0E;
  font-size: 18px;
  font-weight: 900;
  margin: 16px 0 10px 0;
}

.m3-brain-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #78716C;
  font-style: italic;
  padding: 12px 16px;
  background: #FFFFFF;
  border: 1px dashed #D4AF37;
  border-radius: 18px;
}

.spinner-dot {
  width: 8px;
  height: 8px;
  background: #8B1E1E;
  border-radius: 50%;
  animation: m3DotBounce 1.4s infinite ease-in-out both;
  display: inline-block;
}

.spinner-dot:nth-child(1) { animation-delay: -0.32s; }
.spinner-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes m3DotBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Offering packages recommendations */
.m3-brain-packages-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #D4AF37;
}

.m3-brain-pkg-title {
  font-size: 13px;
  font-weight: 800;
  color: #855400;
  margin-bottom: 10px;
}

.m3-brain-pkg-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m3-brain-pkg-card {
  background: #FFF9F5;
  border: 1px solid #FED7AA;
  border-radius: 14px;
  padding: 12px 16px;
  transition: all 0.2s;
}

.m3-brain-pkg-card:hover {
  border-color: #EA580C;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.15);
  transform: translateY(-1px);
}

.m3-brain-pkg-tag {
  background: #F97316;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.m3-brain-pkg-name {
  font-size: 14px;
  font-weight: 800;
  color: #7C2D12;
  margin: 6px 0 4px 0;
}

.m3-brain-pkg-body {
  font-size: 12px;
  color: #57534E;
  line-height: 1.5;
}

.m3-brain-pkg-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-call {
  background: #16A34A;
  color: #FFFFFF !important;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-call:hover {
  background: #15803D;
  transform: translateY(-1px);
}

.btn-zalo {
  background: #0068FF;
  color: #FFFFFF !important;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-zalo:hover {
  background: #0052CC;
  transform: translateY(-1px);
}

/* Modal Footer & Input */
.m3-kth-brain-footer {
  display: flex;
  gap: 10px;
  padding: 12px 18px;
  background: #FFFFFF;
  border-top: 1px solid #E8E2D9;
  flex-shrink: 0;
}

.m3-brain-input {
  flex: 1;
  border: 1px solid #D6D3D1;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  background: #FAFAF9;
}

.m3-brain-input:focus {
  border-color: #8B1E1E;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.12);
}

.m3-brain-send-btn {
  background: linear-gradient(135deg, #8B1E1E 0%, #681111 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.m3-brain-send-btn:hover {
  background: #681111;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 30, 30, 0.3);
}

/* In-Page Văn Khấn AI Search Bar */
.m3-vankhan-ai-search {
  margin: 16px 0 22px 0;
  background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%);
  border: 1.5px dashed #D4AF37;
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.15);
}

.m3-vk-ai-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.m3-vk-ai-icon {
  font-size: 22px;
}

.m3-vk-ai-input {
  flex: 1;
  border: 1px solid #E2D9C8;
  border-radius: 24px;
  padding: 9px 16px;
  font-size: 13px;
  background: #FFFFFF;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

.m3-vk-ai-input:focus {
  border-color: #8B1E1E;
  box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.12);
}

.m3-vk-ai-btn {
  background: #8B1E1E;
  color: #FFFFFF;
  border: none;
  border-radius: 24px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.m3-vk-ai-btn:hover {
  background: #681111;
  transform: translateY(-1px);
}

/* Responsive Mobile Rules */
@media (max-width: 768px) {
  .m3-kth-brain-trigger {
    bottom: 82px;
    right: 14px;
    padding: 8px 14px;
    gap: 8px;
  }

  .m3-brain-icon {
    font-size: 20px;
  }

  .m3-brain-title {
    font-size: 12px;
  }

  .m3-brain-sub {
    font-size: 9px;
  }

  .m3-kth-brain-dialog {
    height: 92vh;
    border-radius: 20px;
  }

  .m3-kth-brain-header {
    padding: 12px 16px;
  }

  .m3-brain-header-title {
    font-size: 14px;
  }

  .m3-kth-brain-body {
    padding: 14px 12px;
  }

  .m3-brain-msg.user-msg {
    max-width: 90%;
  }

  .m3-brain-msg.bot-msg {
    max-width: 100%;
  }

  .m3-kth-brain-footer {
    padding: 10px 12px;
  }

  .m3-brain-input {
    padding: 8px 14px;
    font-size: 13px;
  }

  .m3-brain-send-btn {
    padding: 8px 14px;
    font-size: 12px;
  }

  .m3-vk-ai-inner {
    flex-wrap: wrap;
  }

  .m3-vk-ai-input {
    width: 100%;
  }

  .m3-vk-ai-btn {
    width: 100%;
    text-align: center;
  }
}



/* ==========================================================================
   M3 VĂN KHẤN 163 CEREMONIES - EXPANDED CATALOG & KTH BRAIN API
   ========================================================================== */
.lv-vk-category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px 12px 4px;
  margin-bottom: 12px;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.lv-vk-category-chips::-webkit-scrollbar {
  height: 4px;
}
.lv-vk-category-chips::-webkit-scrollbar-thumb {
  background: #D4AF37;
  border-radius: 4px;
}
.lv-vk-cat-chip {
  background: #FFFFFF;
  border: 1px solid #D8C2BE;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #57534E;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  flex-shrink: 0;
}
.lv-vk-cat-chip:hover {
  background: #FFF5F2;
  border-color: #8B1E1E;
  color: #8B1E1E;
  transform: translateY(-1px);
}
.lv-vk-cat-chip.active {
  background: linear-gradient(135deg, #8B1E1E 0%, #681111 100%);
  color: #FFFFFF !important;
  border-color: #8B1E1E;
  box-shadow: 0 2px 8px rgba(139, 30, 30, 0.3);
}

.lv-vk-search-wrap {
  position: relative;
  margin-bottom: 14px;
  width: 100%;
}
.lv-vk-search-input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  border-radius: 24px;
  border: 1.5px solid #D4AF37;
  background: #FFFFFF;
  font-size: 13px;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.lv-vk-search-input:focus {
  border-color: #8B1E1E;
  box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.12);
}
.lv-vk-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  color: #855400;
}
.lv-vk-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: #E5E0D8;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  line-height: 1;
}
.lv-vk-search-clear:hover {
  background: #8B1E1E;
  color: #fff;
}

.lv-vk-badge-source {
  background: #FEF3C7;
  color: #92400E;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #FCD34D;
  display: inline-block;
  margin-right: 6px;
}
.lv-vk-badge-cat {
  background: #DCFCE7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #86EFAC;
  display: inline-block;
}

.lv-vk-info-card {
  background: #FFFDF7;
  border: 1px solid #EADDC9;
  border-radius: 12px;
  padding: 14px 18px;
  margin: 14px 0 16px 0;
  font-size: 13px;
  line-height: 1.6;
  color: #44403C;
  border-left: 4px solid #D4AF37;
}

@media (max-width: 768px) {
  .lv-vk-category-chips {
    padding-bottom: 8px;
  }
  .lv-vk-cat-chip {
    padding: 5px 12px;
    font-size: 11px;
  }
  .lv-vk-search-input {
    font-size: 12px;
    padding: 8px 36px 8px 36px;
  }
}



/* ==========================================================================
   MODERN ORIENTAL DIGITAL ALMANAC (LỊCH VẠN NIÊN HIỆN ĐẠI)
   Palette: Trắng ngà (#F7F5F0) + Đen than (#171717) + Đỏ son (#8B1E1E) tiết chế
   ========================================================================== */

/* Universal Background & Typography */
body {
  background-color: #F7F5F0 !important;
  color: #171717 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Sections Base */
.da-section {
  max-width: 1140px;
  margin: 0 auto 36px auto;
  padding: 0 16px;
}

.da-section-header {
  text-align: center;
  margin-bottom: 24px;
}

.da-section-title {
  font-size: 24px;
  font-weight: 800;
  color: #171717;
  letter-spacing: -0.3px;
  margin: 0 0 6px 0;
}

.da-section-sub {
  font-size: 14px;
  color: #57534E;
  margin: 0;
  line-height: 1.5;
}

/* ==========================================================================
   1. UNIVERSAL SEARCH (Header / Top Banner)
   ========================================================================== */
.da-search-container {
  max-width: 760px;
  margin: 0 auto 28px auto;
  padding: 0 16px;
}

.da-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1.5px solid #D8C2BE;
  border-radius: 9999px;
  padding: 4px 6px 4px 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
}

.da-search-wrap:focus-within {
  border-color: #8B1E1E;
  box-shadow: 0 0 0 4px rgba(139, 30, 30, 0.08);
}

.da-search-icon {
  font-size: 18px;
  color: #8B1E1E;
  margin-right: 10px;
  flex-shrink: 0;
}

.da-search-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 14px;
  color: #171717;
  padding: 8px 0;
}

.da-search-input::placeholder {
  color: #78716C;
  font-size: 13px;
}

.da-search-btn {
  background: #8B1E1E;
  color: #FFFFFF !important;
  border: none;
  border-radius: 9999px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.da-search-btn:hover {
  background: #701414;
  transform: translateY(-1px);
}

/* ==========================================================================
   2. HERO: TODAY CARD (Hôm Nay Là Ngày Gì?)
   ========================================================================== */
.da-today-card {
  background: #FFFFFF;
  border: 1px solid #E5E0D8;
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.da-today-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #8B1E1E;
}

.da-today-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #8B1E1E;
  background: #FFF5F2;
  padding: 4px 14px;
  border-radius: 9999px;
  margin-bottom: 12px;
  border: 1px solid #F3ECE8;
}

.da-today-dayname {
  font-size: 16px;
  font-weight: 600;
  color: #57534E;
  margin-bottom: 4px;
}

.da-today-solar-num {
  font-size: 72px;
  font-weight: 900;
  color: #171717;
  line-height: 1;
  letter-spacing: -2px;
  margin: 8px 0;
}

.da-today-lunar-date {
  font-size: 16px;
  font-weight: 700;
  color: #8B1E1E;
  margin-bottom: 16px;
}

.da-today-pills-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.da-pill {
  background: #F7F5F0;
  border: 1px solid #E5E0D8;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  color: #44403C;
  font-weight: 600;
}

.da-today-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 9999px;
  margin-bottom: 22px;
}

.da-status-good {
  background: #F0FDF4;
  color: #166534;
  border: 1px solid #BBF7D0;
}

.da-status-bad {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.da-btn-primary {
  background: #8B1E1E;
  color: #FFFFFF !important;
  border: none;
  border-radius: 9999px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
}

.da-btn-primary:hover {
  background: #701414;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 30, 30, 0.25);
}

.da-btn-secondary {
  background: #FFFFFF;
  color: #171717 !important;
  border: 1px solid #D8C2BE;
  border-radius: 9999px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
}

.da-btn-secondary:hover {
  border-color: #8B1E1E;
  color: #8B1E1E !important;
  background: #FFF9F7;
}

/* ==========================================================================
   3. INTENT GRID ("Bạn muốn xem ngày cho việc gì?")
   ========================================================================== */
.da-intent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.da-intent-card {
  background: #FFFFFF;
  border: 1px solid #E5E0D8;
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
  user-select: none;
}

.da-intent-card:hover {
  border-color: #8B1E1E;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(139, 30, 30, 0.08);
}

.da-intent-card.active {
  background: #FFF8F6;
  border: 2px solid #8B1E1E;
  box-shadow: 0 4px 14px rgba(139, 30, 30, 0.12);
}

.da-intent-icon {
  font-size: 32px;
  margin-bottom: 10px;
  line-height: 1;
}

.da-intent-name {
  font-size: 15px;
  font-weight: 800;
  color: #171717;
  margin-bottom: 4px;
}

.da-intent-desc {
  font-size: 11px;
  color: #78716C;
  line-height: 1.4;
}

/* ==========================================================================
   4. CENTRAL DECISION ENGINE: FINDER BOX & SCORING
   ========================================================================== */
.da-finder-box {
  background: #FFFFFF;
  border: 1px solid #E5E0D8;
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.da-finder-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
  background: #FAF8F5;
  border: 1px solid #EBE5DF;
  padding: 20px;
  border-radius: 18px;
}

.da-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.da-form-label {
  font-size: 12px;
  font-weight: 700;
  color: #57534E;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.da-form-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #D8C2BE;
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  color: #171717;
  outline: none;
  transition: border-color 0.2s;
}

.da-form-select:focus {
  border-color: #8B1E1E;
}

/* Finder Results */
.da-results-title {
  font-size: 18px;
  font-weight: 800;
  color: #171717;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.da-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.da-day-card {
  background: #FFFFFF;
  border: 1px solid #E5E0D8;
  border-radius: 18px;
  padding: 20px;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.da-day-card:hover {
  border-color: #8B1E1E;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.da-day-card.top-rank {
  border: 2px solid #8B1E1E;
  background: #FFFDFD;
}

.da-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.da-card-solar {
  font-size: 18px;
  font-weight: 800;
  color: #171717;
}

.da-card-lunar {
  font-size: 13px;
  font-weight: 600;
  color: #8B1E1E;
  margin-top: 2px;
}

.da-score-badge {
  font-size: 13px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 9999px;
  background: #16A34A;
  color: #FFFFFF;
  letter-spacing: 0.3px;
}

.da-score-badge.high {
  background: linear-gradient(135deg, #15803D 0%, #16A34A 100%);
}

.da-score-badge.mid {
  background: #D97706;
}

.da-reasons-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
  font-size: 12px;
  color: #44403C;
}

.da-reasons-list li {
  margin-bottom: 5px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

.da-reasons-list li span {
  color: #16A34A;
  font-weight: 800;
}

.da-hours-snippet {
  background: #FAF8F5;
  border: 1px solid #EBE5DF;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: #78350F;
  margin-bottom: 16px;
  font-weight: 600;
}

.da-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   5. DAY DETAIL MODAL & TIMELINE
   ========================================================================== */
.da-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 10, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.da-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.da-modal-dialog {
  background: #FFFFFF;
  border-radius: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: 1.5px solid #E5E0D8;
  position: relative;
  transform: scale(0.94);
  transition: transform 0.25s ease;
}

.da-modal-backdrop.open .da-modal-dialog {
  transform: scale(1);
}

.da-modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #F7F5F0;
  border: 1px solid #E5E0D8;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #57534E;
  transition: all 0.2s;
}

.da-modal-close-btn:hover {
  background: #8B1E1E;
  color: #FFFFFF;
}

/* Two-column Nên Làm vs Không Nên Làm */
.da-activities-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0;
}

.da-act-box {
  border-radius: 16px;
  padding: 16px;
}

.da-act-good {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
}

.da-act-bad {
  background: #FEF2F2;
  border: 1px solid #FECACA;
}

.da-act-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.da-act-good .da-act-title { color: #166534; }
.da-act-bad .da-act-title { color: #991B1B; }

.da-act-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: #292524;
}

.da-act-list li {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 24h Timeline Giờ Hoàng Đạo */
.da-timeline-container {
  margin: 24px 0;
  background: #FAF8F5;
  border: 1px solid #EBE5DF;
  border-radius: 18px;
  padding: 18px;
}

.da-timeline-title {
  font-size: 14px;
  font-weight: 800;
  color: #171717;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.da-timeline-hours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.da-hour-chip {
  background: #FFFFFF;
  border: 1px solid #E5E0D8;
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
  transition: all 0.2s;
}

.da-hour-chip.auspicious {
  border-color: #16A34A;
  background: #F0FDF4;
}

.da-hour-chip.auspicious .da-hour-star {
  color: #166534;
  font-weight: 800;
}

.da-hour-name {
  font-size: 13px;
  font-weight: 700;
  color: #171717;
}

.da-hour-time {
  font-size: 11px;
  color: #78716C;
}

.da-hour-star {
  font-size: 11px;
  font-weight: 600;
  color: #A8A29E;
  margin-top: 3px;
}

/* Widget "Ngày này có hợp tuổi bạn?" */
.da-compat-box {
  background: #FFFDF7;
  border: 1px solid #EADDC9;
  border-radius: 16px;
  padding: 18px;
  margin-top: 20px;
}

.da-compat-input-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* ==========================================================================
   6. COMPARISON MATRIX (So sánh 2-3 ngày)
   ========================================================================== */
.da-compare-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #171717;
  color: #FFFFFF;
  border-radius: 9999px;
  padding: 8px 18px 8px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 9999;
  animation: m3FadeIn 0.3s ease;
}

.da-compare-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.da-compare-table th, .da-compare-table td {
  padding: 12px 14px;
  border: 1px solid #E5E0D8;
  text-align: center;
  font-size: 13px;
}

.da-compare-table th {
  background: #FAF8F5;
  font-weight: 700;
  color: #57534E;
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .da-today-solar-num {
    font-size: 56px;
  }
  .da-activities-grid {
    grid-template-columns: 1fr;
  }
  .da-modal-dialog {
    padding: 22px 18px;
    height: 94vh;
  }
  .da-compare-bar {
    bottom: 80px;
    width: 90%;
    justify-content: space-between;
  }
}
