/* ===== FONT ===== */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&display=swap');

/* ===== ACCENT COLOR PRESETS ===== */
:root {
  --accent-h: 142; --accent-s: 52%; --accent-l: 45%;
}
[data-accent="green"]  { --accent-h: 142; --accent-s: 52%; --accent-l: 45%; }
[data-accent="blue"]   { --accent-h: 210; --accent-s: 70%; --accent-l: 48%; }
[data-accent="purple"] { --accent-h: 270; --accent-s: 60%; --accent-l: 52%; }
[data-accent="red"]    { --accent-h: 4;   --accent-s: 68%; --accent-l: 50%; }
[data-accent="orange"] { --accent-h: 28;  --accent-s: 85%; --accent-l: 50%; }
[data-accent="pink"]   { --accent-h: 330; --accent-s: 65%; --accent-l: 55%; }

/* ===== LIGHT THEME (default) ===== */
[data-theme="light"] {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface2: #f0f2f7;
  --border: #e2e5ed;
  --text: #1a1d23;
  --text2: #5a6075;
  --text3: #9399ab;
  --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-soft: hsl(var(--accent-h), var(--accent-s), 94%);
  --accent-dark: hsl(var(--accent-h), var(--accent-s), 35%);
  --accent-text: #fff;
  --today-bg: hsl(var(--accent-h), var(--accent-s), 93%);
  --today-border: var(--accent);
  --other-month: #c8ccd8;
  --weekend-sat: #d04444;
  --weekend-sun: #e07020;
  --nav-bg: #ffffff;
  --nav-border: #e2e5ed;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --header-gradient: linear-gradient(135deg, hsl(var(--accent-h),var(--accent-s),var(--accent-l)), hsl(var(--accent-h),var(--accent-s),35%));
  --lunar-color: #6b7280;
  --canchi-color: hsl(var(--accent-h), 40%, 42%);
  --holiday-color: #dc2626;
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3347;
  --text: #e8eaf0;
  --text2: #8b91a8;
  --text3: #555e7a;
  --accent: hsl(var(--accent-h), var(--accent-s), 55%);
  --accent-soft: hsl(var(--accent-h), var(--accent-s), 18%);
  --accent-dark: hsl(var(--accent-h), var(--accent-s), 65%);
  --accent-text: #fff;
  --today-bg: hsl(var(--accent-h), var(--accent-s), 16%);
  --today-border: hsl(var(--accent-h), var(--accent-s), 55%);
  --other-month: #383d55;
  --weekend-sat: #f47474;
  --weekend-sun: #f5a054;
  --nav-bg: #1a1d27;
  --nav-border: #2e3347;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --header-gradient: linear-gradient(135deg, hsl(var(--accent-h),var(--accent-s),30%), hsl(var(--accent-h),var(--accent-s),20%));
  --lunar-color: #6b7a9a;
  --canchi-color: hsl(var(--accent-h), 35%, 58%);
  --holiday-color: #f87171;
}

/* ===== NIGHT SHIFT THEME ===== */
[data-theme="night"] {
  --bg: #1a1208;
  --surface: #221a0e;
  --surface2: #2d2210;
  --border: #3d2f18;
  --text: #f5e6c8;
  --text2: #b89d72;
  --text3: #7a6545;
  --accent: hsl(38, 80%, 55%);
  --accent-soft: hsl(38, 80%, 16%);
  --accent-dark: hsl(38, 80%, 65%);
  --accent-text: #1a1208;
  --today-bg: hsl(38, 70%, 15%);
  --today-border: hsl(38, 80%, 55%);
  --other-month: #4a3a22;
  --weekend-sat: #e07a4a;
  --weekend-sun: #d4924a;
  --nav-bg: #221a0e;
  --nav-border: #3d2f18;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --header-gradient: linear-gradient(135deg, #5a3e1a, #3d2810);
  --lunar-color: #9a7a50;
  --canchi-color: hsl(38, 50%, 60%);
  --holiday-color: #e09050;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ===== APP SHELL ===== */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ===== TOP BAR ===== */
.top-bar {
  background: var(--header-gradient);
  color: #fff;
  padding: 12px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.top-bar-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.top-bar-subtitle {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 1px;
}

.top-bar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { transform: scale(0.92); }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 72px;
  -webkit-overflow-scrolling: touch;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  display: flex;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 10px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text3);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 10px;
  font-weight: 500;
  transition: color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  gap: 3px;
}

.nav-item .nav-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item.active .nav-icon {
  transform: translateY(-1px);
}

.nav-item:active { transform: scale(0.93); }

/* ===== TAB PAGES ===== */
.tab-page { display: none; }
.tab-page.active { display: block; }

/* ===== CALENDAR TAB ===== */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.cal-nav-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.cal-nav-btn:active { transform: scale(0.9); background: var(--accent-soft); }

.cal-month-label {
  text-align: center;
}
.cal-month-label .month-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.cal-month-label .lunar-month-text {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
}

/* Calendar grid */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 0;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cal-weekday:nth-child(6) { color: var(--weekend-sat); }
.cal-weekday:nth-child(7) { color: var(--weekend-sun); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
}

.cal-cell {
  background: var(--surface);
  min-height: 68px;
  padding: 5px 4px 4px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.cal-cell:active { background: var(--accent-soft) !important; }

.cal-cell.other-month {
  background: var(--surface2);
}

.cal-cell.other-month .solar-num { color: var(--other-month); }
.cal-cell.other-month .lunar-num { color: var(--other-month); }
.cal-cell.other-month .canchi-day { color: var(--other-month); }

.cal-cell.today {
  background: var(--today-bg) !important;
  outline: 2px solid var(--today-border);
  outline-offset: -2px;
  border-radius: 4px;
}

.cal-cell.selected {
  background: var(--accent-soft) !important;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}

.solar-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  display: block;
}

.sat .solar-num { color: var(--weekend-sat); }
.sun .solar-num { color: var(--weekend-sun); }

.lunar-num {
  font-size: 10px;
  color: var(--lunar-color);
  margin-top: 2px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
}

.canchi-day {
  font-size: 9px;
  color: var(--canchi-color);
  margin-top: 1px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
}

.cell-holiday-dot {
  position: absolute;
  bottom: 3px; right: 4px;
  font-size: 11px;
  line-height: 1;
}

/* ===== DAY DETAIL MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-sheet {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(.32,.72,0,1);
  max-height: 80dvh;
  overflow-y: auto;
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}

.modal-body { padding: 16px 20px 24px; }

.modal-solar-date {
  font-size: 42px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.modal-dow {
  font-size: 14px;
  color: var(--text2);
  margin-top: 4px;
}

.modal-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

.modal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
}

.modal-label {
  font-size: 13px;
  color: var(--text3);
  font-weight: 500;
}

.modal-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.modal-holiday-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
  margin-right: 6px;
}

/* ===== LOOKUP SECTION ===== */
.lookup-card {
  background: var(--surface);
  border-radius: 12px;
  margin: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
}

.lookup-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

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

.lookup-input {
  flex: 1;
  min-width: 60px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.lookup-input:focus { border-color: var(--accent); }

.lookup-btn {
  padding: 9px 16px;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 8px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.lookup-btn:active { transform: scale(0.95); opacity: 0.9; }

.lookup-result {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-dark);
  min-height: 22px;
}

.leap-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
}

.leap-label input { accent-color: var(--accent); width: 15px; height: 15px; }

/* ===== PHONG THUY TAB ===== */
.pt-section {
  margin: 12px;
}

.pt-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 4px 8px;
}

.pt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

.pt-card-header {
  padding: 12px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pt-card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pt-table th {
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.pt-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.pt-table tr:last-child td { border-bottom: none; }
.pt-table tr:hover td { background: var(--surface2); }

.badge-good {
  color: #16a34a;
  font-weight: 600;
  font-size: 12px;
}
[data-theme="dark"] .badge-good,
[data-theme="night"] .badge-good { color: #4ade80; }

.badge-bad {
  color: #dc2626;
  font-weight: 600;
  font-size: 12px;
}
[data-theme="dark"] .badge-bad,
[data-theme="night"] .badge-bad { color: #f87171; }

.badge-warn {
  color: #d97706;
  font-weight: 600;
  font-size: 12px;
}

/* ===== HOLIDAYS TAB ===== */
.hd-next-up {
  margin: 12px;
  background: var(--header-gradient);
  border-radius: 14px;
  padding: 16px;
  color: #fff;
}

.hd-next-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  opacity: 0.8;
  margin-bottom: 10px;
}

.hd-countdown-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}
.hd-countdown-card:last-child { margin-bottom: 0; }

.hd-emoji { font-size: 28px; line-height: 1; }

.hd-info { flex: 1; }
.hd-name { font-size: 15px; font-weight: 700; }
.hd-date { font-size: 12px; opacity: 0.85; margin-top: 2px; }

.hd-days {
  text-align: right;
}
.hd-days-num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.hd-days-label {
  font-size: 10px;
  opacity: 0.75;
}

.hd-section {
  margin: 12px;
}

.hd-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 8px;
}

.hd-section-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.hd-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.hd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.hd-item:last-child { border-bottom: none; }
.hd-item:active { background: var(--surface2); }

.hd-item-emoji { font-size: 22px; width: 30px; text-align: center; }

.hd-item-info { flex: 1; }
.hd-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.hd-item-date {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}
.hd-item-desc {
  font-size: 11px;
  color: var(--text3);
}

.hd-item-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-official { background: #fef3c7; color: #92400e; }
.badge-tet { background: #fee2e2; color: #991b1b; }
.badge-lunar { background: #ede9fe; color: #5b21b6; }
.badge-cultural { background: #dbeafe; color: #1e40af; }
[data-theme="dark"] .badge-official { background: #3d2f0a; color: #fbbf24; }
[data-theme="dark"] .badge-tet { background: #3d0f0f; color: #f87171; }
[data-theme="dark"] .badge-lunar { background: #2e1a4a; color: #c084fc; }
[data-theme="dark"] .badge-cultural { background: #0f2040; color: #60a5fa; }
[data-theme="night"] .badge-official { background: #3d2f0a; color: #fbbf24; }
[data-theme="night"] .badge-tet { background: #3d1a08; color: #f97316; }
[data-theme="night"] .badge-lunar { background: #2e2010; color: #fb923c; }
[data-theme="night"] .badge-cultural { background: #2a1a08; color: #fbbf24; }

/* ===== SETTINGS TAB ===== */
.settings-section {
  margin: 12px;
}

.settings-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.settings-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 14px 16px 6px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.settings-row:last-child { border-bottom: none; }

.settings-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.settings-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

/* Theme selector */
.theme-options {
  display: flex;
  gap: 8px;
}

.theme-opt {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: border-color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.theme-opt.active { border-color: var(--accent); transform: scale(1.1); }
.theme-opt:active { transform: scale(0.9); }

/* Accent color picker */
.accent-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.accent-opt {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.accent-opt.active {
  border-color: var(--text);
  transform: scale(1.15);
}
.accent-opt:active { transform: scale(0.9); }

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 44px; height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }

/* Font size */
.font-size-opts {
  display: flex;
  gap: 6px;
}
.font-size-opt {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.font-size-opt.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* ===== ABOUT TAB ===== */
.about-hero {
  background: var(--header-gradient);
  padding: 32px 20px 24px;
  text-align: center;
  color: #fff;
}

.about-icon {
  width: 72px; height: 72px;
  background: rgba(255,255,255,0.2);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  margin: 0 auto 12px;
}

.about-app-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.about-version {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
}

.about-content {
  margin: 12px;
}

.about-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}

.about-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.about-row:last-child { border-bottom: none; }

.about-row-label {
  font-size: 14px;
  color: var(--text2);
}
.about-row-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.about-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  padding: 0 4px 8px;
}

/* ===== FONT SIZE SCALE ===== */
[data-fontsize="small"] { font-size: 14px; }
[data-fontsize="large"] { font-size: 18px; }
[data-fontsize="large"] .solar-num { font-size: 22px; }
[data-fontsize="large"] .lunar-num { font-size: 11px; }
[data-fontsize="small"] .solar-num { font-size: 15px; }
[data-fontsize="small"] .cal-cell { min-height: 58px; }

/* ===== SWIPE INDICATOR ===== */
.swipe-hint {
  text-align: center;
  padding: 6px;
  font-size: 11px;
  color: var(--text3);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===== PHONG THUY - NEW CLASSES ===== */
.pt-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table header color helpers */
.th-good { color: var(--accent-dark, #2e7d32); }
.th-bad  { color: var(--holiday-color, #c62828); }
.th-warn { color: #b45309; }
.th-sky  { color: #0369a1; }
[data-theme="dark"] .th-good { color: #4ade80; }
[data-theme="dark"] .th-bad  { color: #f87171; }
[data-theme="dark"] .th-warn { color: #fbbf24; }
[data-theme="dark"] .th-sky  { color: #38bdf8; }
[data-theme="night"] .th-good { color: #86efac; }
[data-theme="night"] .th-bad  { color: #fca5a5; }
[data-theme="night"] .th-warn { color: #fcd34d; }
[data-theme="night"] .th-sky  { color: #7dd3fc; }

/* Table cell color helpers */
.td-sky   { color: #0369a1; font-weight: 500; }
.td-rose  { color: #be123c; font-weight: 500; }
.td-center { text-align: center; font-size: 12px; white-space: nowrap; }
[data-theme="dark"] .td-sky  { color: #38bdf8; }
[data-theme="dark"] .td-rose { color: #fb7185; }
[data-theme="night"] .td-sky  { color: #7dd3fc; }
[data-theme="night"] .td-rose { color: #fda4af; }

/* Giờ hoàng đạo grid */
.pt-table-grid th { text-align: center; font-size: 11px; padding: 6px 4px; }
.pt-table-grid td { text-align: center; padding: 7px 4px; min-width: 36px; }
.pt-day { text-align: left !important; white-space: nowrap; font-weight: 500; padding-left: 10px !important; }
.pt-hour { font-size: 9px; font-weight: 400; opacity: 0.7; display: block; }
.pt-note { font-size: 12px; color: var(--text2); padding: 0 12px 8px; }

/* Amber card (thơ sao) */
.pt-card-amber { border-color: rgba(217, 119, 6, 0.4); background: rgba(217, 119, 6, 0.05); }
[data-theme="dark"] .pt-card-amber { border-color: rgba(251,191,36,.25); background: rgba(251,191,36,.05); }
[data-theme="night"] .pt-card-amber { border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.07); }

/* Rose card (thơ hạn) */
.pt-card-rose { border-color: rgba(225, 29, 72, 0.3); background: rgba(225, 29, 72, 0.04); }
[data-theme="dark"] .pt-card-rose { border-color: rgba(251,113,133,.2); background: rgba(251,113,133,.05); }
[data-theme="night"] .pt-card-rose { border-color: rgba(251,113,133,.25); background: rgba(251,113,133,.06); }

/* Thơ / bài thơ */
.pt-poem {
  white-space: pre-wrap;
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text1);
  padding: 4px 14px 12px;
}
.pt-poem-rose { color: var(--holiday-color, #c62828); }
[data-theme="dark"] .pt-poem-rose  { color: #fca5a5; }
[data-theme="night"] .pt-poem-rose { color: #fcd34d; }

/* Ý nghĩa sao */
.pt-prose { padding: 4px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.pt-prose p { font-size: 13.5px; line-height: 1.65; color: var(--text1); }
.pt-star { font-weight: 700; color: #0369a1; }
[data-theme="dark"] .pt-star  { color: #38bdf8; }
[data-theme="night"] .pt-star { color: #7dd3fc; }
