@import url('https://fonts.googleapis.com/css2?family=Itim&family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --primary: #F06292;
  --primary-light: #FCE4EC;
  --primary-dark: #C2185B;
  --primary-soft: #FFF0F4;
  
  --secondary: #FF8A80;
  --secondary-light: #FFEBEE;
  
  --accent-peach: #FFB74D;
  --accent-peach-light: #FFF3E0;
  
  --accent-mint: #4DB6AC;
  --accent-mint-light: #E0F2F1;
  
  --accent-lavender: #BA68C8;
  --accent-lavender-light: #F3E5F5;
  
  --accent-blue: #64B5F6;
  --accent-blue-light: #E3F2FD;

  --accent-amber: #FFD54F;
  --accent-amber-light: #FFF9C4;

  --bg-page: #FFFBF9;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #FFFDFD;
  
  --text-main: #3E3236;
  --text-secondary: #756267;
  --text-muted: #A39196;
  --text-primary: #C2185B;
  
  --border-light: #F7E7EB;
  --border-hover: #F8BBD0;
  --border-active: #F06292;

  --shadow-sm: 0 2px 8px rgba(194, 24, 91, 0.05);
  --top-bar-height: 48px;
  --shadow-md: 0 4px 16px rgba(194, 24, 91, 0.08);
  --shadow-lg: 0 10px 30px rgba(194, 24, 91, 0.12);
  --shadow-float: 0 14px 34px rgba(240, 98, 146, 0.18);

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

  --font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-cute: 'Itim', 'Prompt', cursive, sans-serif;
}

/* Root Typography & Compact Scaling (85%) */
html {
  font-size: 14px;
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 40px;
  zoom: 0.85; /* Reliable cross-browser 85% compact scale on body */
  background-image: 
    radial-gradient(#F8BBD0 0.85px, transparent 0.85px), 
    radial-gradient(#FFE0B2 0.85px, var(--bg-page) 0.85px);
  background-size: 34px 34px;
  background-position: 0 0, 17px 17px;
}

/* Ensure pure fullscreen modals are not distorted by zoom */
.slideshow-theater,
#photoViewerModalOverlay.gallery-fullscreen-theater {
  zoom: calc(1 / 0.85);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #FFF0F4;
}
::-webkit-scrollbar-thumb {
  background: #F8BBD0;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #F06292;
}

/* Container */
.container {
  max-width: 1440px; /* Wider container in compact mode so tables and columns breathe easily */
  margin: 0 auto;
  padding: 0 16px;
}

/* Top Sticky Milestone & Header Bar */
.top-notice-bar {
  background: linear-gradient(90deg, #FCE4EC 0%, #FFF3E0 50%, #F3E5F5 100%);
  padding: 5px 10px;
  border-bottom: 1.5px solid #F8BBD0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  min-height: var(--top-bar-height);
  display: flex;
  align-items: center;
}

.top-bar-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap;
}

.top-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.app-title-top {
  font-family: var(--font-cute);
  font-size: 1.05rem;
  font-weight: 700;
  color: #C2185B;
  letter-spacing: 0.2px;
  margin: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  text-shadow: 1px 1px 0 #FFF;
}

/* Center Top Journey Bar */
.top-journey-bar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(248, 187, 208, 0.65);
  box-shadow: 0 1px 4px rgba(233, 30, 99, 0.05);
  max-width: 660px;
  min-width: 240px;
  margin: 0 4px;
}

.top-journey-bar .journey-milestone {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.top-journey-bar .milestone-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.top-journey-bar .milestone-detail small {
  font-size: 0.64rem;
  color: var(--text-muted);
  display: block;
  line-height: 1.15;
}

.top-journey-bar .milestone-detail strong {
  font-size: 0.74rem;
  color: var(--primary-dark);
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.top-journey-bar .progress-track {
  flex: 1;
  min-width: 120px;
  height: 22px;
  background: #FFF0F4;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 1px solid #F8BBD0;
  box-shadow: inset 0 1px 3px rgba(233, 30, 99, 0.08);
  display: flex;
  align-items: center;
}

.top-journey-bar .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #F8BBD0 0%, #F48FB1 40%, #EC407A 100%);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 8px rgba(233, 30, 99, 0.3);
}

.top-journey-bar .progress-track-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  font-size: 0.70rem;
  font-weight: 600;
  color: #880E4F;
  text-shadow: 0 0 6px #FFFFFF, 0 1px 2px rgba(255, 255, 255, 0.95);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.2px;
  padding: 0 6px;
}

.top-notice-bar .header-badge-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
  margin-bottom: 0;
}

.top-notice-bar .cute-pill {
  padding: 3px 8px;
  font-size: 0.70rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  white-space: nowrap;
}

.notice-status {
  position: absolute;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.82rem;
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #4CAF50;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(76, 175, 80, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-mini {
  background: white;
  border: 1px solid #F8BBD0;
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-mini:hover {
  background: #FFF0F4;
  border-color: #F06292;
  transform: translateY(-1px);
}

/* Header Section */
.app-header {
  padding: 16px 0 0 0;
  text-align: center;
  position: relative;
}

.header-badge-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cute-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  background: white;
  border: 1px solid var(--border-light);
}

.pill-pink {
  background: #FFF0F4;
  color: #C2185B;
  border-color: #F8BBD0;
}

.pill-amber {
  background: #FFF8E1;
  color: #F57F17;
  border-color: #FFE082;
}

.pill-mint {
  background: #E0F2F1;
  color: #00796B;
  border-color: #80CBC4;
}

.pill-purple {
  background: #F3E5F5;
  color: #7B1FA2;
  border-color: #CE93D8;
}

.app-title {
  font-family: var(--font-cute);
  font-size: 2.3rem;
  color: #C2185B;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  text-shadow: 1px 1px 0 #FFF, 2px 2px 0 rgba(240, 98, 146, 0.15);
}

.app-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 400;
  max-width: 700px;
  margin: 0 auto 16px auto;
}

.journey-bar-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 14px 22px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin: 0 auto 24px auto;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.journey-milestone {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.milestone-icon {
  font-size: 1.5rem;
}

.milestone-detail small {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: block;
  line-height: 1.25;
}

.milestone-detail strong {
  font-size: 0.88rem;
  color: var(--primary-dark);
  font-weight: 700;
}

.progress-track {
  flex: 1;
  min-width: 220px;
  height: 34px;
  background: #FFF0F4;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  border: 1.5px solid #F8BBD0;
  box-shadow: inset 0 2px 5px rgba(233, 30, 99, 0.08);
  display: flex;
  align-items: center;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #F8BBD0 0%, #F48FB1 40%, #EC407A 100%);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 12px rgba(233, 30, 99, 0.35);
}

.progress-track-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  font-size: 0.88rem;
  font-weight: 600;
  color: #880E4F;
  text-shadow: 0 0 8px #FFFFFF, 0 1px 3px rgba(255, 255, 255, 0.95);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.3px;
  padding: 0 14px;
}

.progress-track-label strong {
  color: #880E4F;
  font-weight: 700;
}

/* Main Navigation Tabs */
.main-nav-tabs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 16px;
  position: sticky;
  top: var(--top-bar-height, 48px);
  z-index: 95;
  background: rgba(255, 251, 249, 0.96);
  backdrop-filter: blur(12px);
  padding: 7px 8px;
  width: 100%;
  border-bottom: 1px solid rgba(248, 187, 208, 0.45);
  box-shadow: 0 4px 14px rgba(233, 30, 99, 0.04);
}

.main-nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab-btn {
  background: white;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 6px 13px;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.nav-tab-btn:hover {
  background: #FFF5F7;
  color: var(--primary-dark);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, #F06292 0%, #E91E63 100%);
  color: white;
  border-color: #E91E63;
  box-shadow: var(--shadow-md);
  font-weight: 600;
}

.nav-tab-btn .badge-count {
  background: #FCE4EC;
  color: #C2185B;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid rgba(233, 30, 99, 0.15);
}

.nav-tab-btn.active .badge-count {
  background: white;
  color: #C2185B;
  border-color: white;
}

/* Sub-Tab Navigation for Weeks / Pages */
.week-sub-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 8px;
  padding: 0 0 12px 0;
  margin-bottom: 0;
  border-bottom: 1.5px dashed #F8BBD0;
  width: 100%;
}

.week-sub-nav::-webkit-scrollbar {
  display: none;
}

.week-nav-arrow {
  background: white;
  border: 1.5px solid #F8BBD0;
  color: #C2185B;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.80rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(233, 30, 99, 0.08);
  user-select: none;
  padding: 0;
}

.week-nav-arrow:hover:not(:disabled) {
  background: #FCE4EC;
  border-color: #EC407A;
  color: #880E4F;
  transform: scale(1.1);
}

.week-nav-arrow:active:not(:disabled) {
  transform: scale(0.95);
}

.week-nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
  background: #FAFAFA;
  border-color: #E0E0E0;
  color: #BDBDBD;
}

.week-btn {
  white-space: nowrap;
  background: #FFF9FA;
  border: 1.5px solid #FCE4EC;
  padding: 5px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.76rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.week-btn .week-name {
  font-weight: 600;
  font-size: 0.80rem;
  color: var(--text-main);
  line-height: 1.2;
  text-align: center;
}

.week-btn .week-date {
  font-size: 0.70rem;
  color: var(--text-muted);
  line-height: 1.15;
  text-align: center;
}

.week-btn:hover {
  background: #FFF0F4;
  border-color: #F8BBD0;
  color: #C2185B;
  transform: translateY(-1px);
}

.week-btn.active {
  background: linear-gradient(135deg, #FFF0F4 0%, #FCE4EC 100%);
  border-color: #EC407A;
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.15);
}

.week-btn.active .week-name {
  color: #C2185B;
  font-weight: 700;
}

/* Card Components */
.cute-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  padding: 18px 20px;
  margin-bottom: 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cute-card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px dashed var(--border-light);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  font-size: 1.8rem;
  background: #FFF0F4;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.card-title {
  font-family: var(--font-cute);
  font-size: 1.35rem;
  color: var(--primary-dark);
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Page Layout for Maternal Journal (Mimicking the PDF) */
.maternal-journal-page {
  background: white;
  border-radius: var(--radius-xl);
  border: 2px solid #FCE4EC;
  box-shadow: var(--shadow-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}

.page-sheet-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 2px solid #F8BBD0;
  margin-bottom: 18px;
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.page-hero-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-hero-title h2 {
  font-family: var(--font-cute);
  font-size: 1.55rem;
  color: #C2185B;
  margin: 0;
}

.page-hero-title span {
  display: block;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-family: var(--font-family);
}

.page-meta-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Dual Calendar Grid (Like in PDF) */
.calendars-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.calendar-box {
  background: #FFFDFD;
  border: 1px solid #FCE4EC;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.calendar-header {
  background: linear-gradient(135deg, #FCE4EC 0%, #FFF0F4 100%);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-align: center;
  font-weight: 600;
  color: #C2185B;
  margin-bottom: 12px;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: 46px repeat(7, 1fr);
  gap: 3px;
  text-align: center;
  font-size: 0.85rem;
}

.cal-day-head {
  font-weight: 600;
  color: #A39196;
  padding: 4px 0;
  font-size: 0.78rem;
}

.cal-week-head {
  color: #8E24AA;
  font-weight: 700;
  font-size: 0.74rem;
  background: #F3E5F5;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-week-cell {
  background: #FAF7F9;
  border: 1px dashed #F8BBD0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  cursor: help;
  transition: all 0.2s;
  user-select: none;
}

.cal-week-cell:hover {
  background: #FFF0F4;
  border-color: #F06292;
  transform: translateY(-1px);
}

.cal-week-cell .week-pill {
  font-family: var(--font-cute);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  display: inline-block;
  line-height: 1.1;
}

.cal-week-cell.w-start .week-pill {
  background: #FFE082;
  color: #5D4037;
  border: 1px solid #FFD54F;
  box-shadow: 0 1px 4px rgba(255, 193, 7, 0.3);
}

.cal-week-cell.w-normal .week-pill {
  background: #FCE4EC;
  color: #C2185B;
}

.cal-week-cell.w-edd .week-pill {
  background: linear-gradient(135deg, #FF4081 0%, #E91E63 100%);
  color: white;
  box-shadow: 0 2px 6px rgba(233, 30, 99, 0.35);
  animation: pulse-ring 2s infinite ease-in-out;
}

.cal-week-cell.w-pre .week-pill {
  color: #BDBDBD;
  background: transparent;
}

.cal-week-cell.w-post .week-pill {
  background: #E0F2F1;
  color: #00796B;
}

/* Current Week Highlight (วีคปัจจุบันที่อยู่ ณ วันนี้) */
.cal-week-cell.is-current-week {
  background: linear-gradient(135deg, #FFE8F0 0%, #FFF3E0 100%) !important;
  border: 2px solid #E91E63 !important;
  box-shadow: 0 0 14px rgba(233, 30, 99, 0.45) !important;
  transform: scale(1.06);
  z-index: 5;
  position: relative;
  animation: current-week-glow 2.5s infinite ease-in-out;
}

@keyframes current-week-glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(233, 30, 99, 0.35);
  }
  50% {
    box-shadow: 0 0 18px rgba(233, 30, 99, 0.65);
    border-color: #C2185B;
  }
}

.cal-week-cell.is-current-week .week-pill {
  background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%) !important;
  color: white !important;
  font-weight: 800 !important;
  font-size: 0.76rem !important;
  box-shadow: 0 2px 8px rgba(194, 24, 91, 0.4);
  padding: 3px 5px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.current-week-tag {
  font-size: 0.56rem;
  background: #FFE082;
  color: #5D4037;
  padding: 1px 4px;
  border-radius: var(--radius-full);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.cal-day-cell.is-today {
  border: 2px solid #FFA000 !important;
  background: linear-gradient(135deg, #FFF9C4 0%, #FFFDE7 100%) !important;
  box-shadow: 0 0 10px rgba(255, 179, 0, 0.45);
  font-weight: 700;
}

.cal-day-cell.is-today:hover {
  background: linear-gradient(135deg, #FFF59D 0%, #FFF9C4 100%) !important;
  border-color: #FF8F00 !important;
}

.today-indicator {
  font-size: 0.58rem;
  background: #FFE082;
  color: #5D4037;
  padding: 1px 4px;
  border-radius: var(--radius-full);
  line-height: 1.1;
  margin-top: 1px;
  font-weight: 700;
  border: 1px solid #FFD54F;
  white-space: nowrap;
}

.cal-day-cell {
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  border: 1px solid transparent;
}

.cal-day-cell:hover {
  background: #FFF0F4;
  border-color: #F8BBD0;
  transform: translateY(-1px);
}

.cal-day-number {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
}

.cal-expense-badge {
  font-size: 0.70rem;
  background: transparent;
  color: #C2185B !important;
  border: none;
  border-radius: 0;
  padding: 0;
  font-weight: 700;
  white-space: nowrap;
  max-width: 98%;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none;
  margin-top: 1px;
  line-height: 1.2;
  display: block;
  text-align: center;
}

/* วันที่มีข้อมูล/รายการค่าใช้จ่าย: พื้นหลังสีส้มสดใสเด่นชัด */
.cal-day-cell.has-expense,
.cal-day-cell.has-details {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%) !important;
  border: 1.5px solid #FFA726 !important;
  box-shadow: 0 2px 7px rgba(255, 152, 0, 0.25) !important;
}

.cal-day-cell.has-expense:hover,
.cal-day-cell.has-details:hover {
  background: linear-gradient(135deg, #FFE0B2 0%, #FFCC80 100%) !important;
  border-color: #FB8C00 !important;
  box-shadow: 0 4px 12px rgba(251, 140, 0, 0.38) !important;
  transform: translateY(-2px);
}

.cal-day-cell.has-expense .cal-day-number,
.cal-day-cell.has-details .cal-day-number {
  color: #E65100 !important;
  font-weight: 700 !important;
}

.cal-day-cell.has-expense .cal-expense-badge,
.cal-day-cell.has-details .cal-expense-badge {
  color: #D84315 !important;
  font-weight: 700 !important;
}

.cal-has-data-dot {
  display: none !important;
}

.cal-photo-tag {
  display: none !important;
}

.cal-day-cell.pulse-highlight {
  animation: pulse-ring 1.2s infinite ease-in-out;
  border: 2px solid #E91E63 !important;
  background: #FFF0F4 !important;
  box-shadow: 0 0 16px rgba(233, 30, 99, 0.5) !important;
  z-index: 10;
}

@keyframes pulse-ring {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.btn-date-link {
  background: #FFF0F4;
  border: 1px solid #F8BBD0;
  color: #C2185B;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-date-link:hover {
  background: #F06292;
  color: white;
  border-color: #E91E63;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(233, 30, 99, 0.25);
}

.cal-day-cell.empty {
  cursor: default;
  background: transparent !important;
  min-height: 46px;
}

/* วันสำคัญ / วันหยุดประจำปี: พื้นหลังสีแดงเด่นชัดตามแบบปฏิทินไทย */
.cal-day-cell.holiday {
  background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%) !important;
  border: 1.5px solid #EF9A9A !important;
  color: #C62828 !important;
  box-shadow: 0 2px 6px rgba(239, 83, 80, 0.22) !important;
}

.cal-day-cell.holiday .cal-day-number {
  color: #C62828 !important;
  font-weight: 700 !important;
}

.cal-day-cell.holiday:hover {
  background: linear-gradient(135deg, #FFCDD2 0%, #EF9A9A 100%) !important;
  border-color: #E53935 !important;
  box-shadow: 0 4px 10px rgba(229, 57, 53, 0.35) !important;
  transform: translateY(-2px);
}

.cal-day-cell.holiday.has-expense,
.cal-day-cell.holiday.has-details {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%) !important;
  border: 1.5px solid #FF9800 !important;
  box-shadow: 0 3px 8px rgba(255, 152, 0, 0.28) !important;
}

.cal-day-cell.holiday.has-expense .cal-day-number,
.cal-day-cell.holiday.has-details .cal-day-number {
  color: #E65100 !important;
  font-weight: 700 !important;
}

.cal-holiday-dot {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 0.52rem;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

.cal-day-cell.special-highlight {
  background: #FFE082 !important;
  color: #5D4037 !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(255, 179, 0, 0.4) !important;
  border-radius: var(--radius-sm);
}

.cal-day-cell.due-date-highlight {
  background: #FF80AB !important;
  color: white !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(255, 64, 129, 0.4) !important;
  border-radius: var(--radius-sm);
  animation: bounce-subtle 2s infinite ease-in-out;
}

.cal-day-cell.due-date-highlight .cal-day-number {
  color: white !important;
  font-weight: 700;
  white-space: nowrap;
}

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* ========================================================================= */
/* 2-MONTH ACTIVITIES & TIMELINE SUMMARY BELOW CALENDAR                      */
/* ========================================================================= */

.page-activities-summary {
  background: #FFFDFD;
  border: 1px solid #FCE4EC;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 3px 12px rgba(240, 98, 146, 0.08);
}

.summary-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px dashed #FCE4EC;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-block-title {
  font-family: var(--font-cute);
  font-size: 1.15rem;
  font-weight: 700;
  color: #C2185B;
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-block-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-count-badge {
  background: #FFF0F4;
  color: #C2185B;
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.80rem;
  font-weight: 600;
}

.summary-total-badge {
  background: linear-gradient(135deg, #FFF0F4 0%, #FFF8E1 100%);
  color: #C2185B;
  border: 1.5px solid #FF80AB;
  border-radius: var(--radius-full);
  padding: 3px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-cute);
}

.summary-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-activity-row {
  background: white;
  border: 1px solid #FCE4EC;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.summary-activity-row:hover {
  border-color: #F8BBD0;
  background: #FFF9FA;
  box-shadow: 0 3px 8px rgba(240, 98, 146, 0.14);
  transform: translateY(-1px);
}

.summary-date-badge {
  background: linear-gradient(135deg, #FFF0F4 0%, #FFE4EC 100%);
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-md);
  padding: 6px 10px;
  text-align: center;
  min-width: 82px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.summary-date-num {
  font-family: var(--font-cute);
  font-size: 1.05rem;
  font-weight: 700;
  color: #C2185B;
  line-height: 1;
}

.summary-date-week {
  font-size: 0.65rem;
  background: #FFE082;
  color: #5D4037;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.summary-content {
  flex: 1;
  min-width: 0;
}

.summary-item-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.35;
  margin-bottom: 4px;
}

.summary-tags-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.76rem;
}

.summary-notes-row {
  margin-top: 4px;
  font-size: 0.80rem;
  color: #5D4037;
  background: #FFF8E1;
  border-left: 2px solid #FFD54F;
  padding: 2px 8px;
  border-radius: 3px;
  line-height: 1.3;
}

.summary-amount-actions {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.summary-item-amount {
  font-family: var(--font-cute);
  font-size: 1.15rem;
  font-weight: 700;
  color: #C2185B;
  white-space: nowrap;
}

.summary-btn-open {
  background: #FFF0F4;
  border: 1px solid #F8BBD0;
  color: #C2185B;
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.summary-btn-open:hover {
  background: #E91E63;
  color: white;
  border-color: #E91E63;
}

.summary-activity-row.is-milestone {
  background: linear-gradient(135deg, #FFFDF5 0%, #FFF8E1 100%);
  border: 1.5px solid #FFE082;
}

.summary-activity-row.is-milestone .summary-date-badge {
  background: linear-gradient(135deg, #FFE082 0%, #FFD54F 100%);
  border-color: #FFA000;
}

.summary-activity-row.is-milestone .summary-date-num {
  color: #5D4037;
}

.summary-empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 18px 12px;
  background: #FFFDFD;
  border-radius: var(--radius-md);
  border: 1px dashed #FCE4EC;
}

@media (max-width: 600px) {
  .summary-activity-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .summary-date-badge {
    flex-direction: row;
    gap: 6px;
    width: 100%;
    justify-content: space-between;
  }
  .summary-amount-actions {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed #FCE4EC;
    padding-top: 6px;
  }
}

/* Appointment / Medical Record Cards */
.medical-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.med-card {
  background: #FFFFFF;
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.med-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #C2185B;
  font-size: 1rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #F8BBD0;
}

.field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.field-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cute-input, .cute-select, .cute-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #F3D2DC;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.9rem;
  color: var(--text-main);
  background: #FFFDFD;
  transition: all 0.2s ease;
  outline: none;
}

.cute-input:focus, .cute-select:focus, .cute-textarea:focus {
  border-color: #F06292;
  background: white;
  box-shadow: 0 0 0 3px rgba(240, 98, 146, 0.15);
}

.cute-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}

.cute-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #F48FB1;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  transition: all 0.2s;
}

.cute-checkbox:checked {
  background: #F06292;
  border-color: #F06292;
}

.cute-checkbox:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 14px;
  font-weight: bold;
  left: 3px;
  top: -2px;
}

/* Holidays Notice Box */
.holidays-box {
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #5D4037;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.holidays-box strong {
  color: #E65100;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Care Checklist & Journaling Notes */
.checklist-section {
  background: #FFF9FA;
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.checklist-title {
  color: #C2185B;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.checklist-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.checklist-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: white;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #FCE4EC;
  font-size: 0.9rem;
  line-height: 1.45;
  transition: all 0.15s;
}

.check-item:hover {
  background: #FFF5F7;
  border-color: #F8BBD0;
}

.check-item.completed {
  background: #F9FBE7;
  border-color: #DCEDC8;
  color: #558B2F;
}

.check-item.completed .item-text {
  text-decoration: line-through;
  color: #7CB342;
}

.journal-notes-box {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid #FCE4EC;
  padding: 14px;
  margin-top: 10px;
}

.journal-notes-box label {
  font-weight: 600;
  color: #C2185B;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 6px;
}

.journal-notes-box textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.9rem;
  background: #FFFDFD;
  resize: vertical;
  outline: none;
}

.journal-notes-box textarea:focus {
  border-color: #F06292;
  box-shadow: 0 0 0 3px rgba(240, 98, 146, 0.15);
}

/* ========================================================= */
/* EXPENSE TRACKER SECTION (Page 7-10 PDF Specific Styling)  */
/* ========================================================= */

.expense-budget-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.budget-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.budget-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.budget-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.budget-card.b-pink::before { background: #F06292; }
.budget-card.b-amber::before { background: #FFB74D; }
.budget-card.b-mint::before { background: #4DB6AC; }
.budget-card.b-purple::before { background: #BA68C8; }

.budget-header {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.budget-amount {
  font-family: var(--font-cute);
  font-size: 1.6rem;
  color: var(--primary-dark);
  font-weight: 700;
}

.budget-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.budget-input-mini {
  width: 100%;
  border: 1px dashed #F48FB1;
  background: #FFFDFD;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 1.1rem;
  font-family: var(--font-cute);
  font-weight: 600;
  color: #C2185B;
  outline: none;
}

.budget-input-mini:focus {
  border-style: solid;
  border-color: #F06292;
  background: white;
}

/* Category & Hospital Summary Section */
.breakdown-toggle-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.btn-toggle {
  background: white;
  border: 1.5px solid var(--border-light);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-toggle.active {
  background: #FCE4EC;
  border-color: #F06292;
  color: #C2185B;
  font-weight: 600;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.breakdown-card {
  background: white;
  border: 1px solid #FCE4EC;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.breakdown-card.selected-filter {
  border-color: #F06292;
  background: #FFF5F8;
  box-shadow: 0 4px 12px rgba(240, 98, 146, 0.2);
}

.breakdown-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breakdown-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.breakdown-count {
  font-size: 0.75rem;
  background: #FFF0F4;
  color: #C2185B;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.breakdown-amount {
  font-family: var(--font-cute);
  font-size: 1.25rem;
  color: #C2185B;
  font-weight: 700;
}

.breakdown-bar-track {
  height: 6px;
  background: #FCE4EC;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: #F06292;
}

/* Expenses Filters & Action Bar */
.expense-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  background: white;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.filter-inputs-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box-wrap {
  position: relative;
  min-width: 220px;
}

.search-box-wrap input {
  padding-left: 32px;
}

.search-box-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #A39196;
  font-size: 0.85rem;
}

.filter-select {
  padding: 6px 10px;
  border: 1.5px solid #F3D2DC;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.82rem;
  color: var(--text-main);
  background: white;
  outline: none;
}

.btn-add-primary {
  background: linear-gradient(135deg, #F06292 0%, #E91E63 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(233, 30, 99, 0.3);
  transition: all 0.2s;
}

.btn-add-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(233, 30, 99, 0.4);
}

/* Modern Minimal Expense Table */
.expense-table-container {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  margin-bottom: 18px;
}

.cute-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.cute-table th {
  background: #FFF5F7;
  color: #C2185B;
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1.5px solid #F8BBD0;
  white-space: nowrap;
}

.cute-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease-in-out;
}

.cute-table th.sortable:hover {
  background: #FCE4EC;
  color: #880E4F;
}

.cute-table th.sorted {
  background: #FCE4EC;
  color: #880E4F;
  border-bottom: 2.5px solid #E91E63;
}

.th-sort-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

.sort-icon {
  font-size: 0.78rem;
  opacity: 0.45;
  transition: all 0.15s;
  display: inline-block;
}

.cute-table th.sorted .sort-icon {
  opacity: 1;
  font-size: 0.85rem;
  font-weight: 700;
  color: #C2185B;
}

.cute-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #FCE4EC;
  color: var(--text-main);
  vertical-align: middle;
}

.cute-table tbody tr {
  transition: background 0.15s;
}

.cute-table tbody tr:hover {
  background: #FFFBFD;
}

.badge-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
}

.cat-antenatal { background: #E0F2F1; color: #00796B; }
.cat-screen { background: #E1F5FE; color: #0277BD; }
.cat-ultrasound { background: #F3E5F5; color: #7B1FA2; }
.cat-delivery { background: #FCE4EC; color: #C2185B; }
.cat-vaccine { background: #E8F5E9; color: #2E7D32; }
.cat-bigitems { background: #FFF8E1; color: #E65100; }
.cat-safety { background: #FFEBEE; color: #C62828; }
.cat-mom { background: #F8BBD0; color: #880E4F; }
.cat-baby { background: #FFE082; color: #6D4C41; }
.cat-other { background: #ECEFF1; color: #37474F; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
}

.status-paid { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }
.status-deposit { background: #FFF8E1; color: #F57F17; border: 1px solid #FFE082; }

/* Payer and Payment Method Badges */
.expense-meta-tags {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.badge-payer {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.4;
}

.payer-pong {
  background: #E0F2F1;
  color: #00796B;
  border: 1px solid #B2DFDB;
}

.payer-mew {
  background: #FCE4EC;
  color: #C2185B;
  border: 1px solid #F8BBD0;
}

.payer-both {
  background: #EDE7F6;
  color: #5E35B1;
  border: 1px solid #D1C4E9;
}

.badge-paymethod {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 500;
  background: #FFF8E1;
  color: #E65100;
  border: 1px solid #FFE082;
  line-height: 1.4;
}

.btn-text-action {
  background: #FFF0F5;
  border: 1px solid #F8BBD0;
  color: #C2185B;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-text-action:hover {
  background: #F8BBD0;
  color: white;
}
.status-pending { background: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }
.status-bought { background: #E0F2F1; color: #00796B; border: 1px solid #B2DFDB; }

.amount-text {
  font-family: var(--font-cute);
  font-size: 1.15rem;
  font-weight: 700;
  color: #C2185B;
  white-space: nowrap;
}

.amount-cell-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
}

.btn-receipt-amount-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px 7px;
  background: #E8F5E9;
  border: 1px solid #A5D6A7;
  border-radius: var(--radius-sm);
  color: #2E7D32;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.btn-receipt-amount-icon:hover {
  background: #C8E6C9;
  border-color: #66BB6A;
  transform: translateY(-1px) scale(1.08);
  box-shadow: 0 3px 8px rgba(46, 125, 50, 0.25);
}

.receipt-mini-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: #2E7D32;
  color: white;
  border-radius: 8px;
  padding: 1px 4px;
  line-height: 1;
  font-family: var(--font-family);
}

.media-upload-card {
  background: #FFF5F7;
  border: 1.5px solid #F8BBD0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.receipt-upload-card {
  background: #F1F8E9;
  border: 1.5px solid #C8E6C9;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.table-row-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  background: white;
  border: 1px solid #F8BBD0;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.85rem;
}

.btn-icon:hover {
  background: #FFF0F4;
  color: #C2185B;
  border-color: #F06292;
  transform: scale(1.08);
}

.btn-icon.delete:hover {
  background: #FFEBEE;
  color: #C62828;
  border-color: #E57373;
}

/* Grand Total Footer in Table / Summary */
.table-grand-total-row {
  background: #FFF0F4;
  font-weight: bold;
}

.table-grand-total-row td {
  padding: 16px;
  border-top: 2px solid #F8BBD0;
  border-bottom: none;
}

.grand-total-highlight {
  font-family: var(--font-cute);
  font-size: 1.45rem;
  color: #C2185B;
}

/* Major Essentials & Benefits Checklist (Page 7 & 10) */
.essentials-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.essential-item-card {
  background: white;
  border: 1px solid #FCE4EC;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.essential-item-card:hover {
  border-color: #F8BBD0;
  box-shadow: var(--shadow-md);
}

.essential-item-card.checked {
  background: #F9FBE7;
  border-color: #DCEDC8;
}

/* Kick Counter & Pregnancy Tools Widget */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.tool-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.kick-display {
  font-family: var(--font-cute);
  font-size: 4rem;
  text-align: center;
  color: #C2185B;
  margin: 12px 0;
  line-height: 1;
}

.kick-btn-big {
  width: 100%;
  background: linear-gradient(135deg, #FF4081 0%, #F50057 100%);
  color: white;
  border: none;
  padding: 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-cute);
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 0, 87, 0.35);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.kick-btn-big:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 0, 87, 0.45);
}

.kick-btn-big:active {
  transform: scale(0.97);
}

.kick-history-list {
  max-height: 140px;
  overflow-y: auto;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kick-history-item {
  font-size: 0.82rem;
  background: #FFF5F7;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
}

/* Daily Expense & Details Modal Styles */
#dailyExpenseModalOverlay .modal-card {
  max-width: 580px;
}

.daily-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding: 4px;
}

/* Image Upload & Photo Lightbox Styles */
.upload-btn-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
}

.cute-file-input {
  width: 100%;
  padding: 8px 10px;
  background: white;
  border: 1.5px dashed #F8BBD0;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.image-preview-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 8px 12px;
  background: #FFF5F8;
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-md);
}

/* Multi-image preview grid in modals */
.multi-image-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  background: #FFF9FA;
  border: 1.5px dashed #F8BBD0;
  border-radius: var(--radius-md);
}

.preview-thumb-chip {
  position: relative;
  display: inline-flex;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}

.preview-thumb-chip:hover {
  transform: scale(1.05);
}

.preview-thumb-chip .preview-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1.5px solid #F8BBD0;
  cursor: pointer;
}

.btn-remove-thumb {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: #E91E63;
  color: white;
  border: 1.5px solid white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background 0.15s;
}

.btn-remove-thumb:hover {
  background: #C2185B;
  transform: scale(1.15);
}

/* Existing Uploads in Server Dropdown Picker */
.existing-uploads-section {
  margin-top: 10px;
  padding: 10px 12px;
  background: #FFF5F8;
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(244, 143, 177, 0.1);
}

.existing-uploads-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.existing-uploads-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #C2185B;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-refresh-uploads {
  background: white;
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary-pink);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-refresh-uploads:hover {
  background: var(--primary-pink);
  color: white;
  border-color: var(--primary-pink);
}

.existing-uploads-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.existing-uploads-select {
  flex: 1;
  font-size: 0.82rem;
  padding: 7px 10px;
  background: white;
  border: 1.5px solid #F48FB1;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  min-width: 0;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.2s;
}

.existing-uploads-select:focus {
  border-color: #D81B60;
  box-shadow: 0 0 0 2px rgba(236, 64, 122, 0.15);
}

.btn-attach-existing {
  background: linear-gradient(135deg, #EC407A, #D81B60);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(216, 27, 96, 0.2);
  transition: all 0.2s;
}

.btn-attach-existing:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-attach-existing:active {
  transform: translateY(0);
}

.existing-uploads-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.35;
}

.existing-uploads-hint code {
  background: rgba(255, 255, 255, 0.85);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid #F8BBD0;
  color: #C2185B;
  font-family: monospace;
  font-weight: 600;
}

/* ========================================================================== */
/* MULTI-SELECT PICKER FOR EXISTING UPLOADS & RECEIPTS                        */
/* ========================================================================== */
.multiselect-wrapper {
  position: relative;
  width: 100%;
}

.multiselect-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: white;
  border: 1.5px solid #F48FB1;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(236, 64, 122, 0.08);
}

.multiselect-toggle-btn:hover {
  border-color: #D81B60;
  background: #FFF9FA;
}

.multiselect-toggle-btn.green {
  border-color: #A5D6A7;
  box-shadow: 0 1px 3px rgba(46, 125, 50, 0.08);
}

.multiselect-toggle-btn.green:hover {
  border-color: #2E7D32;
  background: #F1F8E9;
}

.multiselect-toggle-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.multiselect-arrow-icon {
  font-size: 0.85rem;
  color: #C2185B;
  transition: transform 0.2s;
  font-weight: bold;
}

.multiselect-toggle-btn.green .multiselect-arrow-icon {
  color: #2E7D32;
}

.multiselect-badge {
  background: #F8BBD0;
  color: #880E4F;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
}

.multiselect-badge.green {
  background: #C8E6C9;
  color: #1B5E20;
}

.multiselect-panel {
  margin-top: 6px;
  background: #FFFFFF;
  border: 1.5px solid #F8BBD0;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(216, 27, 96, 0.12);
  padding: 10px;
  animation: fadeInDown 0.2s ease-out;
}

.multiselect-panel.green {
  border-color: #C8E6C9;
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.12);
}

.multiselect-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.multiselect-search-input {
  flex: 1;
  font-size: 0.78rem !important;
  padding: 5px 9px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid #F48FB1 !important;
}

.multiselect-search-input.green {
  border-color: #A5D6A7 !important;
}

.multiselect-quick-buttons {
  display: flex;
  gap: 4px;
}

.btn-quick-action {
  background: #FCE4EC;
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #C2185B;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-quick-action:hover {
  background: #F8BBD0;
}

.btn-quick-action.outline {
  background: white;
  color: var(--text-muted);
}

.btn-quick-action.outline:hover {
  background: #F5F5F5;
  color: #333;
}

.btn-quick-action.green {
  background: #E8F5E9;
  border-color: #C8E6C9;
  color: #2E7D32;
}

.btn-quick-action.green:hover {
  background: #C8E6C9;
}

.btn-quick-action.outline.green {
  background: white;
  color: var(--text-muted);
}

.btn-quick-action.outline.green:hover {
  background: #F1F8E9;
  color: #2E7D32;
}

.multiselect-list-box {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #FCE4EC;
  border-radius: var(--radius-sm);
  background: #FFF9FA;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.multiselect-panel.green .multiselect-list-box {
  border-color: #E8F5E9;
  background: #F9FBF9;
}

.multiselect-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  border: 1px solid transparent;
}

.multiselect-item-row:hover {
  background: rgba(236, 64, 122, 0.08);
  border-color: #F8BBD0;
}

.multiselect-panel.green .multiselect-item-row:hover {
  background: rgba(46, 125, 50, 0.08);
  border-color: #C8E6C9;
}

.multiselect-item-row.selected {
  background: #FCE4EC;
  border-color: #F48FB1;
  font-weight: 500;
}

.multiselect-panel.green .multiselect-item-row.selected {
  background: #E8F5E9;
  border-color: #A5D6A7;
  font-weight: 500;
}

.multiselect-item-cb {
  width: 16px;
  height: 16px;
  accent-color: #E91E63;
  cursor: pointer;
  pointer-events: none;
}

.multiselect-panel.green .multiselect-item-cb {
  accent-color: #2E7D32;
}

.multiselect-item-icon {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
}

.multiselect-item-thumb {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #F8BBD0;
  flex-shrink: 0;
}

.multiselect-item-name {
  flex: 1;
  font-size: 0.79rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.multiselect-item-size {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.multiselect-item-attached-tag {
  font-size: 0.68rem;
  background: #E0E0E0;
  color: #616161;
  padding: 1px 5px;
  border-radius: 6px;
  white-space: nowrap;
}

.multiselect-empty-state {
  text-align: center;
  padding: 14px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.multiselect-footer-action {
  margin-top: 8px;
  padding-top: 6px;
}

/* ========================================================================== */
/* REORDERABLE PREVIEWS (Images, Videos, YouTube clips, Slips)                */
/* ========================================================================== */
.preview-thumb-chip[draggable="true"] {
  cursor: grab;
}

.preview-thumb-chip[draggable="true"]:active {
  cursor: grabbing;
}

.preview-thumb-chip.drag-over {
  border: 2px dashed #E91E63 !important;
  opacity: 0.65;
  transform: scale(1.08);
}

.thumb-order-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #C2185B;
  color: white;
  border: 1.5px solid white;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  z-index: 4;
  pointer-events: none;
}

.thumb-order-badge.is-primary {
  background: #E91E63;
  box-shadow: 0 0 0 1px #FFF, 0 2px 5px rgba(233, 30, 99, 0.45);
}

.thumb-order-badge.receipt {
  background: #2E7D32;
}

.thumb-reorder-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 20, 20, 0.75);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px;
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  z-index: 3;
  backdrop-filter: blur(2px);
}

.thumb-reorder-bar.green {
  background: rgba(20, 45, 20, 0.8);
}

.btn-thumb-nav {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: none;
  border-radius: 3px;
  width: 18px;
  height: 16px;
  font-size: 9px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.btn-thumb-nav:hover:not(:disabled) {
  background: #FFF;
  color: #C2185B;
  transform: scale(1.15);
}

.btn-thumb-nav.green:hover:not(:disabled) {
  color: #2E7D32;
}

.btn-thumb-nav:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.thumb-reorder-hint {
  width: 100%;
  font-size: 0.74rem;
  color: #C2185B;
  background: #FFF5F8;
  border: 1px dashed #F8BBD0;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  margin-bottom: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.thumb-reorder-hint.green {
  color: #2E7D32;
  background: #F1F8E9;
  border-color: #C8E6C9;
}

/* ========================================================================== */
/* UPLOAD PROGRESS BAR & PERCENTAGE                                           */
/* ========================================================================== */
.upload-progress-container {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #FFF0F5;
  border: 1px solid #F8BBD0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.upload-progress-container.green {
  background: #E8F5E9;
  border-color: #A5D6A7;
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #C2185B;
}

.upload-progress-container.green .upload-progress-header {
  color: #2E7D32;
}

.upload-progress-percent {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #D81B60;
  background: white;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid #F48FB1;
}

.upload-progress-percent.green {
  color: #2E7D32;
  border-color: #A5D6A7;
}

.upload-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.upload-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.15s ease-out;
}

.upload-progress-fill.pink {
  background: linear-gradient(90deg, #F06292, #E91E63);
}

.upload-progress-fill.green {
  background: linear-gradient(90deg, #66BB6A, #2E7D32);
}

/* Table multi-thumb display */
.table-multi-thumbs {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 4px;
}

.table-thumb-badge {
  background: #E91E63;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Daily modal photos strip */
.daily-item-photos-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.photos-count-badge {
  font-size: 0.72rem;
  color: #C2185B;
  background: #FCE4EC;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

/* Calendar photo tags */
.cal-photo-tag {
  font-size: 0.72rem;
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
}

.cal-photo-tag small {
  font-size: 0.65rem;
  font-weight: 700;
  color: #C2185B;
  margin-left: 1px;
}

/* Essentials Photos & Actions */
.essential-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.essential-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-attach-essential {
  background: #FFF0F5;
  border: 1px solid #F8BBD0;
  color: #C2185B;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-attach-essential:hover {
  background: #F8BBD0;
  color: white;
}

.essential-photos-gallery {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin-top: 6px;
  background: #FFF8FA;
  border: 1px dashed #F8BBD0;
  border-radius: var(--radius-sm);
  width: 100%;
}

.essential-photo-thumb-wrap {
  position: relative;
  display: inline-flex;
}

.essential-photo-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid #F8BBD0;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: transform 0.15s;
}

.essential-photo-thumb:hover {
  transform: scale(1.08);
}

.btn-remove-essential-photo {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  background: #E91E63;
  color: white;
  border: 1px solid white;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-remove-essential-photo:hover {
  background: #C2185B;
  transform: scale(1.15);
}

.essential-photos-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Lightbox Gallery Navigation */
.photo-viewer-main-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid #F8BBD0;
  color: #C2185B;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transition: all 0.18s;
  z-index: 10;
}

.gallery-nav-btn:hover {
  background: #C2185B;
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn.prev {
  left: 10px;
}

.gallery-nav-btn.next {
  right: 10px;
}

.gallery-counter {
  font-size: 0.85rem;
  font-weight: 700;
  color: #C2185B;
  background: #FCE4EC;
  padding: 3px 10px;
  border-radius: 12px;
}

.gallery-thumb-strip {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #FCE4EC;
  overflow-x: auto;
  max-width: 100%;
}

.gallery-thumb-item {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s;
  flex-shrink: 0;
}

.gallery-thumb-item:hover {
  opacity: 0.9;
}

.gallery-thumb-item.active {
  border-color: #E91E63;
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(233, 30, 99, 0.3);
}

.preview-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid #FCE4EC;
  box-shadow: var(--shadow-sm);
}

.btn-remove-img {
  background: #FFEBEE;
  border: 1px solid #FFCDD2;
  color: #C62828;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-remove-img:hover {
  background: #EF5350;
  color: white;
}

.table-img-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid #F8BBD0;
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  vertical-align: middle;
}

.table-img-thumb:hover {
  transform: scale(1.15);
  border-color: #E91E63;
}

.daily-item-img-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid #F8BBD0;
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.daily-item-img-thumb:hover {
  transform: scale(1.1);
}

.photo-viewer-card {
  max-width: 600px !important;
  text-align: center;
  padding: 20px !important;
}

.photo-viewer-body {
  margin-top: 10px;
}

.photo-viewer-full {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid #F8BBD0;
  box-shadow: var(--shadow-md);
  touch-action: none;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1);
}

.photo-viewer-full.is-zoomed {
  cursor: grab !important;
}

.photo-viewer-full.is-dragging {
  cursor: grabbing !important;
  transition: none !important;
}

.photo-viewer-caption {
  margin-top: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  background: #FFF5F7;
  padding: 8px 14px;
  border-radius: var(--radius-md);
}

.photo-viewer-video {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid #F8BBD0;
  box-shadow: var(--shadow-md);
  background: black;
  display: block;
  margin: 0 auto;
}

.video-thumb-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.65);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  pointer-events: none;
}

.video-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: rgba(0, 0, 0, 0.75);
  color: #FFF;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  pointer-events: none;
}

.daily-item-card {
  background: #FFFDFD;
  border: 1px solid #FCE4EC;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s;
}

.daily-item-card:hover {
  border-color: #F8BBD0;
  background: white;
  box-shadow: 0 3px 10px rgba(240, 98, 146, 0.12);
}

.daily-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.daily-item-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.35;
  flex: 1;
}

.daily-item-price-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.daily-item-amount {
  font-family: var(--font-cute);
  font-weight: 700;
  color: #C2185B;
  font-size: 1.15rem;
}

.daily-item-media-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-daily-media {
  background: #FFF0F4;
  border: 1px solid #F8BBD0;
  color: #C2185B;
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-family);
  transition: all 0.15s;
}

.btn-daily-media:hover {
  background: #E91E63;
  color: white;
  border-color: #E91E63;
  transform: translateY(-1px);
}

.daily-item-thumbs-strip {
  display: flex;
  align-items: center;
  gap: 5px;
}

.daily-thumb-item {
  cursor: pointer;
  display: inline-flex;
}

.thumb-vid-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: #37474F;
  color: #FFF;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  border: 1.5px solid #F8BBD0;
}

.daily-item-tags-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

.daily-tag-loc {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #C8E6C9;
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.daily-tag-cat {
  background: #EDE7F6;
  color: #512DA8;
  border: 1px solid #D1C4E9;
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.daily-item-notes-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.82rem;
  color: #5D4037;
  background: #FFF8E1;
  border-left: 3px solid #FFD54F;
  padding: 5px 10px;
  border-radius: 4px;
  line-height: 1.4;
  word-break: break-word;
}

.daily-item-notes-row .notes-bullet {
  color: #FFA000;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
}

.daily-item-notes-row .notes-text {
  flex: 1;
}

.daily-quick-add-box {
  background: #FFF9FA;
  border: 1.5px dashed #F8BBD0;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 14px;
}

.daily-quick-add-title {
  font-family: var(--font-cute);
  font-size: 1.1rem;
  color: #C2185B;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.daily-summary-banner {
  background: linear-gradient(135deg, #FFF0F4 0%, #FFF8E1 100%);
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.daily-summary-banner strong {
  font-family: var(--font-cute);
  font-size: 1.35rem;
  color: #C2185B;
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(62, 50, 54, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--shadow-float);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1.5px dashed var(--border-light);
}

.modal-title {
  font-family: var(--font-cute);
  font-size: 1.4rem;
  color: #C2185B;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: #FFF0F4;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #C2185B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.btn-secondary {
  background: #F5F5F5;
  border: 1px solid #E0E0E0;
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #F06292 0%, #E91E63 100%);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #3E3236;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}

/* Footer */
.app-footer {
  text-align: center;
  margin-top: 40px;
  padding: 24px 16px 32px 16px;
  border-top: 1px dashed #F8BBD0;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.app-footer .notice-status {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #2E7D32;
  font-weight: 500;
  font-size: 0.84rem;
  background: #E8F5E9;
  border: 1px solid #C8E6C9;
  border-radius: var(--radius-full);
  padding: 4px 14px;
}

/* Print Stylesheet */
@media print {
  body {
    background: white;
    background-image: none;
    color: black;
  }
  .top-notice-bar, .main-nav-tabs, .expense-action-bar, .btn-icon, .btn-mini, .btn-add-primary, .app-footer, .modal-overlay {
    display: none !important;
  }
  .maternal-journal-page, .cute-card {
    box-shadow: none !important;
    border: 1px solid #CCC !important;
    page-break-inside: avoid;
  }
}

/* Responsive adjustments */
@media (max-width: 960px) {
  .top-bar-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding: 0 4px;
  }
  .top-bar-container::-webkit-scrollbar {
    display: none;
  }
  .app-title-top {
    font-size: 0.95rem;
  }
  .top-journey-bar {
    min-width: 200px;
    padding: 2px 6px;
    gap: 5px;
  }
  .top-journey-bar .milestone-detail small {
    display: none;
  }
  .top-journey-bar .progress-track {
    min-width: 90px;
    height: 20px;
  }
  .top-journey-bar .progress-track-label {
    font-size: 0.65rem;
  }
  .top-notice-bar .cute-pill {
    padding: 2px 6px;
    font-size: 0.68rem;
  }
}

@media (max-width: 768px) {
  .top-notice-bar {
    padding: 4px 6px;
  }
  .app-title-top {
    font-size: 0.88rem;
  }
  .top-journey-bar {
    min-width: 170px;
    gap: 4px;
    padding: 2px 5px;
  }
  .top-journey-bar .milestone-detail strong {
    font-size: 0.68rem;
  }
  .top-journey-bar .progress-track {
    min-width: 80px;
    height: 18px;
  }
  .top-journey-bar .progress-track-label {
    font-size: 0.62rem;
  }
  .top-notice-bar .header-badge-row {
    gap: 4px;
  }
  .top-notice-bar .cute-pill {
    padding: 2px 5px;
    font-size: 0.65rem;
  }
  .main-nav-tabs {
    justify-content: flex-start;
    padding: 8px 6px;
    gap: 6px;
    top: var(--top-bar-height, 48px);
  }
  .week-sub-nav {
    justify-content: flex-start;
  }
  .nav-tab-btn {
    padding: 6px 11px;
    font-size: 0.80rem;
    gap: 5px;
  }
}

@media (max-width: 540px) {
  .calendar-grid {
    grid-template-columns: 36px repeat(7, 1fr);
    gap: 2px;
  }
  .cal-week-head {
    font-size: 0.65rem;
  }
  .cal-week-cell .week-pill {
    font-size: 0.65rem;
    padding: 1px 3px;
  }
  .cal-day-cell {
    min-height: 42px;
  }
  .cal-expense-badge {
    font-size: 0.58rem;
  }
  .cal-holiday-dot {
    top: 1px;
    right: 2px;
    font-size: 0.46rem;
  }
}


/* ========================================================================= */
/* TAB 5: ALL PHOTOS & VIDEOS GALLERY STYLES                                 */
/* ========================================================================= */

.gallery-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-stat-pills {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.gallery-stat-pill {
  flex: 1;
  min-width: 130px;
  background: #FFF9FA;
  border: 1px solid #FCE4EC;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.gallery-stat-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(240, 98, 146, 0.15);
  border-color: #F8BBD0;
}

.gallery-stat-pill.pill-photos {
  background: #FFF5F7;
  border-color: #FFCDD2;
}

.gallery-stat-pill.pill-videos {
  background: #F3E5F5;
  border-color: #E1BEE7;
}

.gallery-stat-pill.pill-sources {
  background: #E0F2F1;
  border-color: #B2DFDB;
}

.gallery-stat-pill.pill-receipts {
  background: #F1F8E9;
  border-color: #C8E6C9;
}

.stat-pill-icon {
  font-size: 1.6rem;
}

.stat-pill-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-pill-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.gallery-toolbar {
  background: #FFFFFF;
  border: 1px solid #FCE4EC;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-type-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-type-btn {
  background: #F5F5F5;
  border: 1px solid #E0E0E0;
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.gallery-type-btn:hover {
  background: #FCE4EC;
  color: #C2185B;
  border-color: #F8BBD0;
}

.gallery-type-btn.active {
  background: linear-gradient(135deg, #FF80AB 0%, #F06292 100%);
  color: white;
  border-color: #E91E63;
  box-shadow: 0 2px 8px rgba(240, 98, 146, 0.35);
  font-weight: 600;
}

.gallery-secondary-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.gallery-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gallery-filter-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.gallery-search-item {
  flex: 1;
  min-width: 220px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.gallery-card {
  background: white;
  border: 1.5px solid #FCE4EC;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(233, 30, 99, 0.12);
  border-color: #F48FB1;
}

.gallery-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #263238;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-card:hover .gallery-card-preview img {
  transform: scale(1.05);
}

.gallery-card-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card-badge-top-left {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  z-index: 2;
  pointer-events: none;
}

.gallery-card-badge-top-right {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
  color: #C2185B;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  z-index: 2;
  pointer-events: none;
}

.gallery-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(233, 30, 99, 0.88);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, background 0.2s;
  pointer-events: none;
}

.gallery-card:hover .gallery-play-overlay {
  transform: translate(-50%, -50%) scale(1.15);
  background: #E91E63;
}

.gallery-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.gallery-card-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.gallery-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  align-items: center;
}

.gallery-card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed #FCE4EC;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.gallery-btn-action {
  background: #FFF0F4;
  border: 1px solid #F8BBD0;
  color: #C2185B;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gallery-btn-action:hover {
  background: #C2185B;
  color: white;
}

.gallery-empty {
  text-align: center;
  padding: 50px 20px;
  background: white;
  border-radius: var(--radius-md);
  border: 2px dashed #F8BBD0;
  grid-column: 1 / -1;
}

.video-thumb-pill {
  width: 44px;
  height: 44px;
  background: #212121;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  color: white;
  border: 2px solid transparent;
}

.video-thumb-pill.active {
  border-color: #E91E63;
}

/* =========================================================================
   GALLERY VIEW MODE CONTROLS & NEW DISPLAY LAYOUTS
   ========================================================================= */

/* View Mode Selector Bar */
.gallery-view-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #FFF5F7 0%, #FFFFFF 100%);
  border: 1.5px solid #F8BBD0;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  box-shadow: 0 2px 6px rgba(233, 30, 99, 0.05);
}

.gallery-view-mode-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #C2185B;
}

.gallery-view-mode-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-view-btn {
  background: white;
  border: 1.5px solid #FCE4EC;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.gallery-view-btn:hover {
  background: #FFF0F5;
  border-color: #F48FB1;
  color: #C2185B;
  transform: translateY(-1px);
}

.gallery-view-btn.active {
  background: linear-gradient(135deg, #E91E63 0%, #C2185B 100%);
  color: white;
  border-color: #AD1457;
  box-shadow: 0 3px 10px rgba(233, 30, 99, 0.35);
}

.gallery-view-btn .btn-icon {
  font-size: 1rem;
}

/* -------------------------------------------------------------------------
   แบบที่ 1: ตารางรูปภาพล้วน ติดๆ กัน ไม่มีข้อมูล (Wall Grid View)
   ------------------------------------------------------------------------- */
.gallery-wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  padding: 6px;
  background: #FAF8F9;
  border-radius: var(--radius-md);
  border: 1px solid #FCE4EC;
}

@media (min-width: 600px) {
  .gallery-wall-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
  }
}

@media (min-width: 992px) {
  .gallery-wall-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 10px;
    padding: 10px;
  }
}

.gallery-wall-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #2D2730;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.gallery-wall-item:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 18px rgba(233, 30, 99, 0.28);
  z-index: 3;
}

.gallery-wall-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.2s ease;
}

.gallery-wall-item:hover img {
  filter: brightness(1.05);
}

.gallery-wall-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.gallery-wall-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}

.gallery-wall-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(233, 30, 99, 0.9);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: transform 0.2s ease;
  z-index: 2;
}

.gallery-wall-item:hover .gallery-wall-play {
  transform: translate(-50%, -50%) scale(1.15);
}

/* -------------------------------------------------------------------------
   แบบที่ 2: แกลเลอรีรูปใหญ่ตรงกลาง เลื่อนซ้ายขวา (Center Stage Showcase)
   ------------------------------------------------------------------------- */
.gallery-showcase-container {
  width: 100%;
}

.gallery-showcase-wrapper {
  background: #FFFFFF;
  border: 1.5px solid #FCE4EC;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.showcase-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px dashed #F8BBD0;
}

.showcase-counter-badge {
  background: #FCE4EC;
  color: #C2185B;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.showcase-title-info {
  flex: 1;
  min-width: 220px;
  text-align: center;
}

.showcase-item-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #880E4F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.showcase-item-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.showcase-quick-actions {
  display: flex;
  gap: 8px;
}

.btn-showcase-action {
  background: #FFF0F4;
  border: 1px solid #F8BBD0;
  color: #C2185B;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.btn-showcase-action:hover {
  background: #E91E63;
  color: white;
  border-color: #C2185B;
}

/* Big Center Stage */
.showcase-stage {
  position: relative;
  width: 100%;
  height: 520px;
  background: radial-gradient(circle at center, #261D2B 0%, #151019 100%);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45);
  outline: none;
}

@media (max-width: 768px) {
  .showcase-stage {
    height: 380px;
  }
}

.showcase-media-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.showcase-media-container img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  animation: showcaseFadeIn 0.28s ease;
}

.showcase-media-container video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  outline: none;
  animation: showcaseFadeIn 0.28s ease;
}

.showcase-media-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  animation: showcaseFadeIn 0.28s ease;
}

@keyframes showcaseFadeIn {
  from { opacity: 0.25; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Floating Navigation Arrows */
.showcase-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  color: white;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  user-select: none;
}

.showcase-nav-arrow:hover {
  background: rgba(233, 30, 99, 0.92);
  border-color: white;
  transform: translateY(-50%) scale(1.12);
  box-shadow: 0 4px 18px rgba(233, 30, 99, 0.5);
}

.showcase-nav-arrow.prev {
  left: 14px;
}

.showcase-nav-arrow.next {
  right: 14px;
}

/* Thumbnail Filmstrip at bottom */
.showcase-filmstrip-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFF5F7;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid #FCE4EC;
}

.showcase-filmstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 2px;
  flex: 1;
  scrollbar-width: thin;
}

.showcase-filmstrip::-webkit-scrollbar {
  height: 6px;
}

.showcase-filmstrip::-webkit-scrollbar-thumb {
  background: #F48FB1;
  border-radius: 4px;
}

.showcase-thumb-item {
  flex: 0 0 68px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  background: #2D2730;
  position: relative;
  transition: all 0.2s ease;
  opacity: 0.65;
}

.showcase-thumb-item:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  border-color: #F8BBD0;
}

.showcase-thumb-item.active {
  opacity: 1;
  border-color: #E91E63;
  box-shadow: 0 0 10px rgba(233, 30, 99, 0.55);
  transform: scale(1.06);
}

.showcase-thumb-item img,
.showcase-thumb-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.showcase-thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 11px;
  background: rgba(233, 30, 99, 0.88);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.filmstrip-scroll-btn {
  background: white;
  border: 1px solid #F8BBD0;
  color: #C2185B;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  transition: all 0.15s;
  flex-shrink: 0;
}

.filmstrip-scroll-btn:hover {
  background: #E91E63;
  color: white;
}

/* Location Manager Modal Styles */
#locationManagerModalOverlay {
  z-index: 1100;
}

.location-manage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: white;
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.location-manage-row:hover {
  border-color: #EC407A;
  background: #FFF9FA;
}

.btn-delete-loc-item {
  background: #FFEBEE;
  border: 1px solid #EF9A9A;
  color: #C62828;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-delete-loc-item:hover {
  background: #C62828;
  color: white;
  border-color: #C62828;
  transform: scale(1.04);
}

/* YouTube Input Section */
.youtube-input-section {
  margin-top: 10px;
  padding: 10px 12px;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(255, 193, 7, 0.1);
}

.youtube-input-header {
  margin-bottom: 6px;
}

.youtube-input-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #D84315;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.youtube-input-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.youtube-url-input {
  flex: 1;
  font-size: 0.82rem;
  padding: 7px 10px;
  background: white;
  border: 1.5px solid #FFD54F;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  min-width: 0;
  transition: border-color 0.2s;
}

.youtube-url-input:focus {
  border-color: #E64A19;
  box-shadow: 0 0 0 2px rgba(255, 112, 67, 0.2);
}

.btn-attach-youtube {
  background: linear-gradient(135deg, #FF3D00, #D50000);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(213, 0, 0, 0.2);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-attach-youtube:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-attach-youtube:active {
  transform: translateY(0);
}

.youtube-input-hint {
  font-size: 0.73rem;
  color: #795548;
  margin-top: 6px;
  line-height: 1.35;
}

/* Lightbox Iframe for YouTube Player */
.photo-viewer-iframe {
  width: 100%;
  max-width: 780px;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 280px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ========================================================================= */
/* MEMORY SLIDESHOW THEATER (สไลด์โชว์ความทรงจำ เต็มจอพื้นหลังสีดำ)          */
/* ========================================================================= */

body.slideshow-open {
  overflow: hidden !important;
}

.slideshow-theater {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  font-family: inherit;
  color: #FFFFFF;
  transition: cursor 0.2s ease;
}

.slideshow-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 1000002;
}

.slideshow-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FF4081, #FF80AB);
  box-shadow: 0 0 8px rgba(255, 64, 129, 0.8);
}

.slideshow-header-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px 28px;
  z-index: 1000001;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.45) 70%, transparent 100%);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.slideshow-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slideshow-title-tag {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.slideshow-counter-badge {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.slideshow-type-badge {
  background: rgba(233, 30, 99, 0.35);
  backdrop-filter: blur(8px);
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #FF80AB;
  border: 1px solid rgba(255, 128, 171, 0.45);
}

.slideshow-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slideshow-btn {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.slideshow-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

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

.slideshow-btn-close {
  background: rgba(244, 67, 54, 0.25);
  border-color: rgba(244, 67, 54, 0.45);
}

.slideshow-btn-close:hover {
  background: rgba(244, 67, 54, 0.5);
}

.slideshow-stage {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  user-select: none;
}

.slideshow-media-viewport {
  max-width: 95vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
}

@keyframes slideshowImgIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.slideshow-media-img {
  max-width: 95vw;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
  animation: slideshowImgIn 0.35s ease-out;
}

.slideshow-media-video {
  max-width: 95vw;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
  background: #000000;
  outline: none;
}

.slideshow-media-iframe {
  width: 88vw;
  max-width: 1100px;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 72vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
  background: #000000;
  border: none;
}

.slideshow-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  color: #FFFFFF;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.22);
  z-index: 1000001;
  transition: all 0.25s ease;
  user-select: none;
}

.slideshow-nav-arrow.prev {
  left: 24px;
}

.slideshow-nav-arrow.next {
  right: 24px;
}

.slideshow-nav-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.slideshow-nav-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.slideshow-caption-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px 24px 14px;
  z-index: 1000001;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.6) 75%, transparent 100%);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.slideshow-caption-inner {
  max-width: 850px;
  margin: 0 auto;
  pointer-events: auto;
}

.slideshow-caption-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.slideshow-badge-meta {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.slideshow-badge-meta.badge-date {
  background: rgba(33, 150, 243, 0.25);
  border-color: rgba(33, 150, 243, 0.4);
  color: #90CAF9;
}

.slideshow-badge-meta.badge-loc {
  background: rgba(76, 175, 80, 0.25);
  border-color: rgba(76, 175, 80, 0.4);
  color: #A5D6A7;
}

.slideshow-badge-meta.badge-cat {
  background: rgba(156, 39, 176, 0.25);
  border-color: rgba(156, 39, 176, 0.4);
  color: #CE93D8;
}

.slideshow-badge-meta.badge-amount {
  background: rgba(255, 193, 7, 0.25);
  border-color: rgba(255, 193, 7, 0.4);
  color: #FFE082;
}

.slideshow-badge-meta.badge-src {
  background: rgba(233, 30, 99, 0.25);
  border-color: rgba(233, 30, 99, 0.4);
  color: #F48FB1;
}

.slideshow-caption-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.slideshow-caption-notes {
  font-size: 0.88rem;
  color: #E0E0E0;
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  max-width: 650px;
  margin: 0 auto;
}

/* Slideshow Thumbnail Preview Strip */
.slideshow-thumb-strip {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
  margin: 12px auto 0;
  max-width: min(850px, 92vw);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(18, 18, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 128, 171, 0.4) transparent;
}

.slideshow-thumb-strip::-webkit-scrollbar {
  height: 4px;
}

.slideshow-thumb-strip::-webkit-scrollbar-thumb {
  background: rgba(255, 128, 171, 0.5);
  border-radius: 4px;
}

.slideshow-thumb-item {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
  background: #212121;
}

.slideshow-thumb-item:hover {
  opacity: 0.95;
  transform: scale(1.08);
}

.slideshow-thumb-item.active {
  opacity: 1;
  border-color: #FF4081;
  box-shadow: 0 0 10px rgba(255, 64, 129, 0.85);
  transform: scale(1.08);
}

.slideshow-thumb-item.video-thumb-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 1.15rem;
}

.slideshow-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 20, 0.85);
  color: #FFFFFF;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  text-align: center;
  backdrop-filter: blur(6px);
  z-index: 20;
}

.slideshow-spinner-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

/* Idle mode: Hide controls after inactivity */
.slideshow-theater.slideshow-idle {
  cursor: none !important;
}

.slideshow-theater.slideshow-idle .slideshow-ctrl-overlay {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .slideshow-header-bar {
    padding: 12px 16px;
  }
  .slideshow-title-tag {
    font-size: 0.9rem;
  }
  .slideshow-btn {
    padding: 5px 10px;
    font-size: 0.76rem;
  }
  .slideshow-nav-arrow {
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
  }
  .slideshow-nav-arrow.prev {
    left: 12px;
  }
  .slideshow-nav-arrow.next {
    right: 12px;
  }
  .slideshow-caption-bar {
    padding: 18px 20px 16px;
  }
  .slideshow-caption-title {
    font-size: 1.05rem;
  }
  .slideshow-caption-notes {
    font-size: 0.78rem;
  }
}

/* ========================================================================= */
/* PHOTO VIEWER LIGHTBOX: FULLSCREEN THEATER MODE (ขยายเต็มจอ พื้นหลังสีดำ)  */
/* ========================================================================= */

/* Gallery Zoom Controls */
.gallery-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #FFF0F4;
  border: 1px solid #F8BBD0;
  border-radius: var(--radius-full);
  padding: 2px 5px;
  user-select: none;
}

.btn-gallery-zoom {
  background: transparent;
  border: none;
  color: #C2185B;
  font-family: var(--font-family);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn-gallery-zoom:hover {
  background: #FCE4EC;
  color: #880E4F;
  transform: scale(1.08);
}

.btn-gallery-zoom:active {
  transform: scale(0.95);
}

.gallery-zoom-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #C2185B;
  padding: 2px 6px;
  border-radius: 10px;
  background: white;
  border: 1px solid #F8BBD0;
  cursor: pointer;
  min-width: 44px;
  text-align: center;
  user-select: none;
}

.gallery-zoom-badge:hover {
  background: #FCE4EC;
}

.btn-zoom-reset {
  background: #FCE4EC;
  color: #880E4F;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 2px 6px;
}

/* In Theater Mode (Dark Theater) */
#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-zoom-controls {
  background: rgba(30, 30, 30, 0.75);
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
}

#photoViewerModalOverlay.gallery-fullscreen-theater .btn-gallery-zoom {
  color: #FFFFFF;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .btn-gallery-zoom:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FF80AB;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-zoom-badge {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-zoom-badge:hover {
  background: rgba(255, 255, 255, 0.3);
}

#photoViewerModalOverlay.gallery-fullscreen-theater .btn-zoom-reset {
  background: rgba(233, 30, 99, 0.5);
  border: 1px solid rgba(255, 64, 129, 0.6);
  color: #FFFFFF;
}

#photoViewerModalOverlay.gallery-fullscreen-theater.gallery-idle .gallery-zoom-controls {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Normal Mode: Fullscreen Toggle Button */
.btn-gallery-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFF0F5;
  color: #D81B60;
  border: 1px solid #F8BBD0;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-gallery-fullscreen:hover {
  background: #FF80AB;
  color: #FFFFFF;
  border-color: #FF4081;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.25);
}

.btn-gallery-fullscreen:active {
  transform: scale(0.96);
}

.btn-gallery-fullscreen .fs-icon {
  font-size: 0.98rem;
  line-height: 1;
}

/* --- THEATER MODE: Fullscreen Dark Overlay --- */
#photoViewerModalOverlay.gallery-fullscreen-theater {
  background: #000000 !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  z-index: 1000005 !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-card {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  background: #000000 !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  position: relative !important;
  overflow: hidden !important;
  transform: none !important;
}

/* Header floating on top of theater */
#photoViewerModalOverlay.gallery-fullscreen-theater .modal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000010;
  padding: 16px 28px;
  margin-bottom: 0;
  border-bottom: none !important;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 70%, transparent 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: opacity 0.3s ease;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .modal-title {
  color: #FFFFFF !important;
  font-size: 1.15rem !important;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.3px;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-counter {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .btn-gallery-fullscreen {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
}

#photoViewerModalOverlay.gallery-fullscreen-theater .btn-gallery-fullscreen:hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

#photoViewerModalOverlay.gallery-fullscreen-theater .btn-close-modal {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  font-size: 1.1rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.2s ease;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .btn-close-modal:hover {
  background: rgba(244, 67, 54, 0.65) !important;
  border-color: rgba(244, 67, 54, 0.85) !important;
  transform: scale(1.08);
}

/* Stage & Media Area */
#photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-body {
  flex: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-main-wrap {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 60px 80px 75px;
  box-sizing: border-box;
  overflow: hidden;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-full {
  max-width: 96vw !important;
  max-height: 82vh !important;
  width: auto;
  height: auto;
  object-fit: contain !important;
  border: none !important;
  border-radius: 6px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85) !important;
  cursor: grab;
  touch-action: none;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-video {
  max-width: 96vw !important;
  max-height: 82vh !important;
  width: auto;
  height: auto;
  object-fit: contain !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85) !important;
  background: #000000 !important;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-iframe {
  width: 86vw !important;
  height: 78vh !important;
  max-width: 1200px !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85) !important;
}

/* Cinema Nav Buttons */
#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-nav-btn {
  width: 52px;
  height: 52px;
  font-size: 1.6rem;
  background: rgba(255, 255, 255, 0.14) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000008;
  transition: all 0.2s ease;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-nav-btn:hover {
  background: rgba(255, 255, 255, 0.32) !important;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8) !important;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-nav-btn.prev {
  left: 20px;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-nav-btn.next {
  right: 20px;
}

/* Floating Caption Pill */
#photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-caption {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(850px, 92vw);
  background: rgba(18, 18, 18, 0.82) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(14px);
  border-radius: 20px !important;
  padding: 10px 22px !important;
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  z-index: 1000007;
  margin: 0 !important;
  transition: bottom 0.25s ease;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-caption.no-thumbs {
  bottom: 24px !important;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-caption strong {
  color: #FF80AB !important;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-caption small {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Floating Thumb Strip */
#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-thumb-strip {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 92vw;
  background: rgba(15, 15, 15, 0.75) !important;
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 24px !important;
  padding: 6px 14px !important;
  margin: 0 !important;
  z-index: 1000007;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-thumb-item {
  border-color: transparent;
  opacity: 0.55;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-thumb-item:hover {
  opacity: 0.9;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-thumb-item.active {
  border-color: #FF4081 !important;
  box-shadow: 0 0 10px rgba(255, 64, 129, 0.75);
  opacity: 1;
}

/* Mobile Responsiveness for Theater Mode */
@media (max-width: 768px) {
  #photoViewerModalOverlay.gallery-fullscreen-theater .modal-header {
    padding: 12px 16px;
  }
  #photoViewerModalOverlay.gallery-fullscreen-theater .modal-title {
    font-size: 0.95rem !important;
  }
  #photoViewerModalOverlay.gallery-fullscreen-theater .btn-gallery-fullscreen {
    padding: 4px 9px;
    font-size: 0.76rem;
  }
  #photoViewerModalOverlay.gallery-fullscreen-theater .gallery-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
  #photoViewerModalOverlay.gallery-fullscreen-theater .gallery-nav-btn.prev {
    left: 8px;
  }
  #photoViewerModalOverlay.gallery-fullscreen-theater .gallery-nav-btn.next {
    right: 8px;
  }
  #photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-main-wrap {
    padding: 55px 12px 70px;
  }
  #photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-caption {
    font-size: 0.8rem;
    padding: 6px 14px !important;
    max-width: 95vw;
  }
}

/* ========================================================================= */
/* GALLERY THEATER IDLE MODE (จางหายอัตโนมัติเมื่อดูรูป ไม่บังสายตา)        */
/* ========================================================================= */

#photoViewerModalOverlay.gallery-fullscreen-theater.gallery-idle {
  cursor: none !important;
}

#photoViewerModalOverlay.gallery-fullscreen-theater .modal-header,
#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-nav-btn,
#photoViewerModalOverlay.gallery-fullscreen-theater .photo-viewer-caption,
#photoViewerModalOverlay.gallery-fullscreen-theater .gallery-thumb-strip {
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease !important;
}

#photoViewerModalOverlay.gallery-fullscreen-theater.gallery-idle .modal-header {
  opacity: 0 !important;
  transform: translateY(-24px) !important;
  pointer-events: none !important;
}

#photoViewerModalOverlay.gallery-fullscreen-theater.gallery-idle .gallery-nav-btn {
  opacity: 0 !important;
  pointer-events: none !important;
}

#photoViewerModalOverlay.gallery-fullscreen-theater.gallery-idle .photo-viewer-caption {
  opacity: 0 !important;
  transform: translateX(-50%) translateY(24px) !important;
  pointer-events: none !important;
}

#photoViewerModalOverlay.gallery-fullscreen-theater.gallery-idle .gallery-thumb-strip {
  opacity: 0 !important;
  transform: translateX(-50%) translateY(24px) !important;
  pointer-events: none !important;
}

/* If user hovers over caption or thumbnails, keep them visible */
#photoViewerModalOverlay.gallery-fullscreen-theater.gallery-idle .photo-viewer-caption:hover,
#photoViewerModalOverlay.gallery-fullscreen-theater.gallery-idle .gallery-thumb-strip:hover {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateX(-50%) translateY(0) !important;
}
