* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1e6cb5;
  --primary-dark: #1558a0;
  --primary-light: #dbeafe;
  --success: #10b981;
  --danger: #f56565;
  --warning: #ed8936;
  --gray-100: #f0f5fa;
  --gray-200: #e2eaf3;
  --gray-300: #d0dae8;
  --gray-600: #5b7494;
  --gray-800: #1a2a42;
  --bg: var(--gray-100);
  --card-bg: white;
  --text: var(--gray-800);
  --text-secondary: var(--gray-600);
}

body.dark-mode {
  --bg: #060d1a;
  --card-bg: #0c1929;
  --text: #d4e3f5;
  --text-secondary: #6889b0;
  --gray-100: #0c1929;
  --gray-200: #152640;
  --gray-300: #1e3355;
  --primary: #4da8f0;
  --primary-dark: #3a8fd6;
  --primary-light: rgba(77, 168, 240, 0.08);
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

/* Light mode: soft water gradient */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(30, 108, 181, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
}

/* Dark mode: deep ocean gradient */
body.dark-mode::after {
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(77, 168, 240, 0.10) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 85% 20%, rgba(59, 130, 246, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(30, 108, 181, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 80%, rgba(96, 165, 250, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 40% 50% at 10% 85%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 100px;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 16px;
}

header h1 {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #1e6cb5, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-logo {
  height: 90px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(30, 108, 181, 0.3));
}

body.dark-mode .header-logo {
  filter: drop-shadow(0 2px 8px rgba(77, 168, 240, 0.4)) brightness(1.1);
}

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

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--card-bg);
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  text-decoration: none;
  color: var(--text);
}

.icon-btn:hover {
  background: var(--gray-200);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 10px;
  padding: 4px 6px;
  transition: color 0.2s;
}

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

.nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Toggle items */
.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
}

.toggle-item:last-child {
  border-bottom: none;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.toggle-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
}

.prayer-time {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gray-300);
  border-radius: 28px;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* 3-state prayer button */
.state-btn {
  width: 44px;
  height: 44px;
  border: 2.5px solid var(--gray-300);
  background: transparent;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.state-btn:active { transform: scale(0.85); }

.state-btn.done {
  border-color: transparent;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

.state-btn.missed {
  border-color: transparent;
  background: linear-gradient(135deg, #f56565, #dc2626);
  color: white;
  box-shadow: 0 2px 10px rgba(245, 101, 101, 0.4);
}

.state-btn.readonly,
.istighfar-btn.readonly {
  opacity: 0.35;
  pointer-events: none;
}

/* Istighfar counter */
.istighfar-total {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  padding: 8px 0 12px;
}

.istighfar-add {
  display: flex;
  gap: 8px;
  align-items: center;
}

.istighfar-btn {
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.istighfar-btn:hover { opacity: 0.9; }
.istighfar-btn:active { transform: scale(0.97); }

/* Progress bar */
.progress-bar-container {
  background: var(--gray-200);
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 8px;
  transition: width 0.4s ease;
}

/* Date header */
.date-header {
  text-align: center;
  margin-bottom: 16px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

.date-header-day {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.date-header-info {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.date-today-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.date-today-btn:active { opacity: 0.8; }

/* Date slide animations */
.slide-out-left {
  animation: slideOutLeft 0.15s ease-in forwards;
}
.slide-out-right {
  animation: slideOutRight 0.15s ease-in forwards;
}
.slide-in-left {
  animation: slideInLeft 0.2s ease-out forwards;
}
.slide-in-right {
  animation: slideInRight 0.2s ease-out forwards;
}

@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(-40px); opacity: 0; }
}
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(40px); opacity: 0; }
}
@keyframes slideInLeft {
  from { transform: translateX(-40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 2px;
}

/* Text input in card */
.text-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
}

.text-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gray-800);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
  white-space: nowrap;
}

body.dark-mode .toast {
  background: var(--gray-100);
  color: var(--text);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

/* Calendar grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}

.calendar-header {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.calendar-day.empty {
  cursor: default;
}

.calendar-day.today {
  border: 2px solid var(--primary);
  font-weight: 700;
}

.calendar-day.full {
  background: var(--primary);
  color: white;
}

.calendar-day.partial {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.calendar-day.none {
  background: var(--gray-200);
}

.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-nav-btn {
  background: var(--card-bg);
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
}

.calendar-month {
  font-size: 16px;
  font-weight: 600;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Progress rows */
.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-200);
}

.progress-row:last-child {
  border-bottom: none;
}

.progress-row-label {
  font-size: 14px;
  width: 100px;
  flex-shrink: 0;
}

.progress-row-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-row-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.4s;
}

.progress-row-fill-missed {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--danger);
  border-radius: 4px;
  opacity: 0.4;
  transition: width 0.4s;
}

.progress-row-pct {
  font-size: 13px;
  font-weight: 600;
  width: 40px;
  text-align: right;
  color: var(--primary);
}

/* ============ HISTORY: Cyberpunk Design ============ */

/* Tabs — neon segmented bar */
.history-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

body.dark-mode .history-tabs {
  border: 1px solid rgba(77, 168, 240, 0.1);
  box-shadow: 0 0 20px rgba(77, 168, 240, 0.05);
}

.history-tab {
  flex: 1;
  padding: 10px 4px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
}

.history-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
  transform: scale(1.02);
}

body.dark-mode .history-tab.active {
  background: rgba(77, 168, 240, 0.12);
  color: #4da8f0;
  border: 1px solid rgba(77, 168, 240, 0.4);
  box-shadow: 0 0 16px rgba(77, 168, 240, 0.2), inset 0 0 16px rgba(77, 168, 240, 0.05);
}

.history-tab:not(.active):active {
  background: var(--gray-200);
  transform: scale(0.97);
}

/* Summary — neon glass cards (force layout, override any conflicts) */
.history-summary {
  margin-bottom: 16px !important;
  width: 100% !important;
  display: block !important;
  padding: 0 !important;
}
.summary-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.summary-row:has(.summary-item:nth-child(2):last-child) {
  grid-template-columns: 1fr 1fr !important;
}

.summary-item {
  min-width: 0 !important;
  width: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  background: var(--card-bg);
  border-radius: 14px;
  padding: 12px 4px !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
  box-sizing: border-box !important;
}

.summary-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gray-300);
  border-radius: 16px 16px 0 0;
}

.summary-item:nth-child(2)::before { background: linear-gradient(90deg, #10b981, #059669); }
.summary-item:nth-child(3)::before { background: linear-gradient(90deg, #f56565, #e53e3e); }

body.dark-mode .summary-item {
  border: 1px solid rgba(77, 168, 240, 0.08);
  background: rgba(17, 26, 46, 0.8);
}

body.dark-mode .summary-item::before { background: rgba(77, 168, 240, 0.3); }
body.dark-mode .summary-item:nth-child(2)::before { background: linear-gradient(90deg, #34d399, #00cc6a); }
body.dark-mode .summary-item:nth-child(3)::before { background: linear-gradient(90deg, #f87171, #cc1a5a); }

.summary-num {
  font-size: clamp(14px, 4.5vw, 22px) !important;
  font-weight: 800 !important;
  color: var(--text);
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -1.2px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  display: block !important;
  text-align: center !important;
  width: 100% !important;
}

.summary-num.s-done { color: var(--success); }
.summary-num.s-miss { color: var(--danger); }

body.dark-mode .summary-num {
  text-shadow: 0 0 8px rgba(77, 168, 240, 0.3);
}
body.dark-mode .summary-num.s-done {
  text-shadow: 0 0 12px rgba(96, 165, 250, 0.5);
}
body.dark-mode .summary-num.s-miss {
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

.summary-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Table card — neon border */
.history-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.dark-mode .history-card {
  border: 1px solid rgba(77, 168, 240, 0.08);
  box-shadow: 0 0 30px rgba(77, 168, 240, 0.04), 0 4px 20px rgba(0,0,0,0.3);
}

/* Table */
.history-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 2px;
  font-size: 13px;
  white-space: nowrap;
}

.history-table th {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  padding: 12px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: none;
}

body.dark-mode .history-table th {
  color: rgba(77, 168, 240, 0.5);
  letter-spacing: 1px;
  font-size: 10px;
}

.history-table td {
  padding: 6px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: none;
  vertical-align: middle;
}

.history-table tbody tr {
  border-radius: 12px;
  transition: background 0.15s;
}

.history-table tbody tr td:first-child { border-radius: 12px 0 0 12px; }
.history-table tbody tr td:last-child { border-radius: 0 12px 12px 0; }

.history-table tbody tr:nth-child(odd) td { background: rgba(0,0,0,0.01); }
body.dark-mode .history-table tbody tr:nth-child(odd) td { background: rgba(77, 168, 240, 0.02); }
body.dark-mode .history-table tbody tr:nth-child(even) td { background: rgba(0,0,0,0.15); }

/* Today row — neon accent */
.history-table tr.row-today td {
  background: rgba(13,148,136,0.08) !important;
}
.history-table tr.row-today .sticky-col {
  background: rgba(13,148,136,0.08) !important;
}
.history-table tr.row-today td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}

body.dark-mode .history-table tr.row-today td {
  background: rgba(77, 168, 240, 0.06) !important;
}
body.dark-mode .history-table tr.row-today .sticky-col {
  background: rgba(77, 168, 240, 0.06) !important;
}
body.dark-mode .history-table tr.row-today td:first-child {
  box-shadow: inset 3px 0 0 #4da8f0, inset 8px 0 16px rgba(77, 168, 240, 0.1);
}

.sticky-col {
  position: sticky;
  left: 0;
  background: var(--card-bg);
  z-index: 1;
}

/* Date column */
.date-cell {
  text-align: left !important;
  font-weight: 600;
  font-size: 14px;
  min-width: 62px;
  padding-left: 8px !important;
  padding-right: 6px !important;
}

.date-num {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.row-today .date-num {
  color: var(--primary);
  font-weight: 800;
}

body.dark-mode .row-today .date-num {
  text-shadow: 0 0 8px rgba(77, 168, 240, 0.6);
}

.day-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

body.dark-mode .day-label {
  letter-spacing: 1px;
  font-size: 8px;
}

/* Mini progress bar */
.date-mini-bar {
  height: 3px;
  background: var(--gray-200);
  border-radius: 2px;
  margin-top: 3px;
  overflow: hidden;
}

.date-mini-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

body.dark-mode .date-mini-bar {
  background: rgba(77, 168, 240, 0.08);
}

/* ============ Cell Circles — Neon Cyberpunk ============ */
.h-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-user-select: none;
  user-select: none;
}

.h-dot:active { transform: scale(0.75); }

.h-done {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.h-miss {
  background: linear-gradient(135deg, #f56565, #dc2626);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 101, 101, 0.4);
}

.h-empty {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: none;
  border: 2px solid var(--gray-300);
  opacity: 0.35;
  box-shadow: none;
}

/* Neon glow in dark mode */
body.dark-mode .h-done {
  background: linear-gradient(135deg, #34d399, #00cc6a);
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.5), 0 0 20px rgba(96, 165, 250, 0.2), 0 0 4px rgba(96, 165, 250, 0.8);
}

body.dark-mode .h-miss {
  background: linear-gradient(135deg, #f87171, #e8145a);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.2), 0 0 4px rgba(59, 130, 246, 0.8);
}

body.dark-mode .h-empty {
  border-color: rgba(77, 168, 240, 0.2);
  opacity: 0.5;
}

.cell-done, .cell-missed, .cell-empty { vertical-align: middle; }

/* Istighfar number cells */
.cell-ist {
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.cell-ist-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(13, 148, 136, 0.12);
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

body.dark-mode .cell-ist-badge {
  background: rgba(77, 168, 240, 0.1);
  border: 1px solid rgba(77, 168, 240, 0.25);
  color: #4da8f0;
  text-shadow: 0 0 6px rgba(77, 168, 240, 0.5);
  box-shadow: 0 0 8px rgba(77, 168, 240, 0.15);
}

/* ============ Day Detail Modal — Premium ============ */
.day-detail {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.day-detail.show {
  opacity: 1;
  pointer-events: auto;
}

.day-detail-card {
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  padding: 8px 20px 24px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.day-detail.show .day-detail-card {
  transform: translateY(0);
}

.day-detail-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--gray-300);
  margin: 0 auto 16px;
}

.day-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.day-detail-title {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.day-detail-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-200);
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.day-detail-close:active { background: var(--gray-300); }

.detail-section-title {
  margin: 16px 0 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-secondary);
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 15px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

body.dark-mode .detail-item { border-bottom-color: rgba(255,255,255,0.04); }

.detail-item:last-child { border-bottom: none; }

.detail-item.detail-editable {
  cursor: pointer;
  border-radius: 12px;
  margin: 0 -10px;
  padding: 10px;
  transition: background 0.15s;
  border-bottom: none;
}

.detail-item.detail-editable:active {
  background: var(--gray-200);
}

.detail-check {
  font-size: 20px;
}

.detail-time {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  opacity: 0.85;
}

.cell-time {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--primary);
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  line-height: 1;
  margin-top: 1px;
  opacity: 0.8;
}

.detail-edit-btn {
  margin-left: auto;
  padding: 6px 16px;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.detail-edit-btn:active { opacity: 0.7; }

/* Sync status bar */
.sync-status {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  z-index: 150;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.sync-status.sync-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

/* Bottom sync bar fully retired — header ON AIR pill replaces it. */
.sync-status,
.sync-synced,
.sync-syncing,
.sync-offline,
.sync-error,
.sync-pending {
  display: none !important;
}

/* ===== Sync indicator pill (in header) — ON AIR style ===== */
.sync-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #10b981;
  text-transform: uppercase;
  font-family: 'Geist Mono', 'JetBrains Mono', monospace;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.sync-dot:hover { filter: brightness(1.15); }

.sync-dot-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s;
}

/* States */
.sync-dot.dot-synced {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
}
.sync-dot.dot-synced .sync-dot-led {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
  animation: dotPulseSlow 2.5s ease-in-out infinite;
}
.sync-dot.dot-pending {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}
.sync-dot.dot-pending .sync-dot-led {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
  animation: dotPulseSlow 1.5s ease-in-out infinite;
}
.sync-dot.dot-syncing {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}
.sync-dot.dot-syncing .sync-dot-led {
  background: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
  animation: dotPulseFast 0.7s ease-in-out infinite;
}
.sync-dot.dot-offline {
  border-color: rgba(107, 114, 128, 0.4);
  background: rgba(107, 114, 128, 0.08);
  color: #9ca3af;
}
.sync-dot.dot-offline .sync-dot-led {
  background: #6b7280;
  box-shadow: none;
  animation: none;
}
.sync-dot.dot-error {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.sync-dot.dot-error .sync-dot-led {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
  animation: dotPulseFast 0.7s ease-in-out infinite;
}

@keyframes dotPulseSlow {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
@keyframes dotPulseFast {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.85); }
}

.sync-syncing {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  animation: syncPulse 1.5s ease-in-out infinite;
}

.sync-offline {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

.sync-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

body.dark-mode .sync-synced { background: rgba(16,185,129,0.15); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
body.dark-mode .sync-syncing { background: rgba(245,158,11,0.15); color: #fcd34d; border-color: rgba(245,158,11,0.3); }
body.dark-mode .sync-offline { background: rgba(107,114,128,0.15); color: #9ca3af; border-color: rgba(107,114,128,0.3); }
body.dark-mode .sync-error { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.3); }

.sync-retry {
  margin-left: 8px;
  padding: 2px 10px;
  border: 1px solid currentColor;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

@keyframes syncPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============ DATE PICKER (iOS-style drum roller) ============ */
.date-picker-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.date-picker-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.date-picker-modal {
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.date-picker-overlay.show .date-picker-modal {
  transform: translateY(0);
}

.date-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
}

.date-picker-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.date-picker-btn {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
}

.date-picker-btn.confirm {
  color: var(--primary);
}

.date-picker-wheels {
  display: flex;
  height: 220px;
  position: relative;
  padding: 0 12px;
}

.picker-col {
  flex: 1;
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
}

.picker-col.wide { flex: 1.4; }

.picker-wheel {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.picker-wheel::-webkit-scrollbar { display: none; }

.picker-item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-secondary);
  scroll-snap-align: center;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.15s, font-weight 0.15s;
}

.picker-item.active {
  color: var(--text);
  font-weight: 700;
}

.picker-highlight {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
  border-top: 1.5px solid var(--primary);
  border-bottom: 1.5px solid var(--primary);
  background: var(--primary-light);
  opacity: 0.25;
  pointer-events: none;
  border-radius: 8px;
}

/* ============ MAIN PAGE: Prayer Times ============ */

/* Location bar */
/* Location chip (header) */
.location-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 12px;
  background: var(--card-bg);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  max-width: 140px;
}

.location-chip:active { background: var(--gray-200); }

.location-chip-icon { font-size: 14px; flex-shrink: 0; }

.location-chip-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hijri date */
.hijri-date {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Hero card */
.prayer-hero-card {
  background: linear-gradient(135deg, #1e6cb5, #2563eb);
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(30, 108, 181, 0.35);
}

body.dark-mode .prayer-hero-card {
  box-shadow: 0 4px 20px rgba(30, 108, 181, 0.2);
}

.prayer-hero-label {
  font-size: 13px;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.prayer-hero-name {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.prayer-hero-time {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.prayer-hero-countdown {
  font-size: 16px;
  opacity: 0.9;
  font-weight: 500;
}

/* Prayer times list */
.prayer-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-200);
}

.prayer-time-row:last-child { border-bottom: none; }

.prayer-time-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prayer-time-icon {
  font-size: 22px;
  width: 30px;
  text-align: center;
}

.prayer-time-label {
  font-size: 16px;
  font-weight: 500;
}

.prayer-time-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prayer-time-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: right;
}

/* Small state button inside prayer time row */
.prayer-time-row .state-btn {
  width: 36px;
  height: 36px;
  font-size: 18px;
  border-radius: 50%;
}

/* Prayer completion time (shown when ✅) */
.prayer-done-at {
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.prayer-done-at:empty {
  min-width: 0;
}

/* Highlighted: next prayer */
.prayer-next {
  background: var(--primary-light);
  margin: 0 -16px;
  padding: 14px 16px;
  border-radius: 12px;
  border-bottom-color: transparent;
}

.prayer-next .prayer-time-label {
  color: var(--primary-dark);
  font-weight: 700;
}

.prayer-next .prayer-time-value {
  color: var(--primary);
  font-weight: 800;
}

/* Passed prayers */
.prayer-passed {
  opacity: 0.45;
}

/* Info rows (Sunrise, Ishraq) */
.prayer-info .prayer-time-label {
  font-style: italic;
}

/* Location modal */
.location-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.location-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.location-modal {
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.location-modal-overlay.show .location-modal {
  transform: translateY(0);
}

.location-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
}

.location-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.location-modal-btn {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
}

.location-modal-btn.confirm {
  color: var(--primary);
}

.location-modal-body {
  padding: 16px;
}

/* Location search results */
.location-results {
  max-height: 320px;
  overflow-y: auto;
  margin-top: 12px;
  -webkit-overflow-scrolling: touch;
}

.location-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
  cursor: pointer;
  transition: background 0.15s;
}

.location-result-item:last-child { border-bottom: none; }

.location-result-item:active {
  background: var(--gray-200);
  margin: 0 -16px;
  padding: 12px 16px;
  border-radius: 10px;
}

.location-result-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.location-result-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.location-result-country {
  font-size: 13px;
  color: var(--text-secondary);
}

.location-result-tz {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.location-no-results {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Swipe area — only this part slides on date navigation */
.swipe-area {
  overflow: hidden;
}

/* ============ MAIN PAGE: Date Header ============ */
.prayer-date-header {
  text-align: center;
  margin-bottom: 12px;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.prayer-date-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.prayer-date-arrow {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border, rgba(120,140,180,0.20));
  background: transparent;
  color: var(--text);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.prayer-date-arrow:hover {
  background: rgba(120,140,180,0.08);
  border-color: var(--primary, #1e6cb5);
}
.prayer-date-arrow:active { transform: scale(0.92); }

.prayer-date-today-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.prayer-date-today-btn:active { opacity: 0.8; }

/* ============ Countdown Overlay ============ */
.countdown-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.countdown-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.countdown-content {
  text-align: center;
  color: white;
}

.countdown-prayer-name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.countdown-prayer-time {
  font-size: 18px;
  opacity: 0.7;
  margin-bottom: 32px;
}

.countdown-boxes {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 40px;
}

.countdown-box {
  background: rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 20px 24px;
  min-width: 80px;
}

.countdown-box span {
  font-size: 48px;
  font-weight: 700;
  display: block;
  font-variant-numeric: tabular-nums;
}

.countdown-box small {
  font-size: 14px;
  opacity: 0.7;
  display: block;
  margin-top: 4px;
}

.countdown-close {
  padding: 12px 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.countdown-close:active { opacity: 0.8; }

/* Clickable prayer rows */
.prayer-time-row.clickable {
  cursor: pointer;
  transition: background 0.15s;
}

.prayer-time-row.clickable:active {
  background: var(--gray-200);
  margin: 0 -16px;
  padding: 14px 16px;
  border-radius: 12px;
}

/* ============ CYBERPUNK: Global Neon Dark Mode ============ */

/* Bottom nav — neon border-top glow */
body.dark-mode .bottom-nav {
  background: rgba(8, 12, 24, 0.95);
  border-top: 1px solid rgba(77, 168, 240, 0.12);
  box-shadow: 0 -4px 24px rgba(77, 168, 240, 0.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.dark-mode .nav-item.active {
  color: #4da8f0;
  text-shadow: 0 0 8px rgba(77, 168, 240, 0.5);
}

/* Header — neon gradient title */
body.dark-mode header h1 {
  background: linear-gradient(135deg, #4da8f0, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Cards — neon border glow */
body.dark-mode .card {
  border: 1px solid rgba(77, 168, 240, 0.08);
  box-shadow: 0 0 20px rgba(77, 168, 240, 0.03), 0 4px 16px rgba(0,0,0,0.3);
}

/* Card titles — neon cyan */
body.dark-mode .card-title {
  color: rgba(77, 168, 240, 0.7);
  letter-spacing: 0.5px;
}

/* Icon buttons — neon border */
body.dark-mode .icon-btn {
  border: 1px solid rgba(77, 168, 240, 0.1);
}

body.dark-mode .icon-btn:hover {
  border-color: rgba(77, 168, 240, 0.3);
  box-shadow: 0 0 10px rgba(77, 168, 240, 0.1);
}

/* Text inputs — neon focus */
body.dark-mode .text-input {
  border-color: rgba(77, 168, 240, 0.1);
}

body.dark-mode .text-input:focus {
  border-color: #4da8f0;
  box-shadow: 0 0 12px rgba(77, 168, 240, 0.2);
}

/* Toast — neon */
body.dark-mode .toast {
  background: rgba(17, 26, 46, 0.95);
  border: 1px solid rgba(77, 168, 240, 0.2);
  box-shadow: 0 0 16px rgba(77, 168, 240, 0.1);
}

/* ============ CYBERPUNK: Main Page ============ */

/* Hero card — water glass */
body.dark-mode .prayer-hero-card {
  background: linear-gradient(135deg, rgba(30, 108, 181, 0.25), rgba(59, 130, 246, 0.10));
  border: 1px solid rgba(77, 168, 240, 0.20);
  box-shadow: 0 0 30px rgba(77, 168, 240, 0.10), 0 0 60px rgba(30, 108, 181, 0.04);
}

body.dark-mode .prayer-hero-name {
  text-shadow: 0 0 20px rgba(77, 168, 240, 0.5);
}

body.dark-mode .prayer-hero-time {
  text-shadow: 0 0 30px rgba(77, 168, 240, 0.6);
}

body.dark-mode .prayer-hero-countdown {
  text-shadow: 0 0 10px rgba(77, 168, 240, 0.4);
}

/* Location chip — neon border */
body.dark-mode .location-chip {
  border: 1px solid rgba(77, 168, 240, 0.1);
}

body.dark-mode .location-chip:hover {
  border-color: rgba(77, 168, 240, 0.3);
  box-shadow: 0 0 10px rgba(77, 168, 240, 0.1);
}

/* Hijri date — neon subtle */
body.dark-mode .hijri-date {
  color: rgba(77, 168, 240, 0.4);
  letter-spacing: 0.5px;
}

/* Prayer rows — neon borders */
body.dark-mode .prayer-time-row {
  border-bottom-color: rgba(77, 168, 240, 0.06);
}

/* Next prayer — neon highlight */
body.dark-mode .prayer-next {
  background: rgba(77, 168, 240, 0.08);
  border: 1px solid rgba(77, 168, 240, 0.15);
  box-shadow: inset 0 0 20px rgba(77, 168, 240, 0.05);
}

body.dark-mode .prayer-next .prayer-time-label {
  color: #4da8f0;
  text-shadow: 0 0 8px rgba(77, 168, 240, 0.4);
}

body.dark-mode .prayer-next .prayer-time-value {
  color: #4da8f0;
  text-shadow: 0 0 8px rgba(77, 168, 240, 0.5);
}

/* Prayer done time — neon green */
body.dark-mode .prayer-done-at {
  color: #34d399;
  text-shadow: 0 0 6px rgba(96, 165, 250, 0.5);
}

/* Prayer time badge — neon */
body.dark-mode .prayer-time {
  background: rgba(77, 168, 240, 0.1);
  border: 1px solid rgba(77, 168, 240, 0.2);
}

/* Countdown overlay — neon boxes */
body.dark-mode .countdown-overlay {
  background: rgba(8, 12, 24, 0.92);
}

body.dark-mode .countdown-box {
  background: rgba(77, 168, 240, 0.08);
  border: 1px solid rgba(77, 168, 240, 0.2);
  box-shadow: 0 0 20px rgba(77, 168, 240, 0.1);
}

body.dark-mode .countdown-box span {
  text-shadow: 0 0 20px rgba(77, 168, 240, 0.6);
}

body.dark-mode .countdown-prayer-name {
  text-shadow: 0 0 16px rgba(77, 168, 240, 0.5);
}

body.dark-mode .countdown-close {
  background: rgba(77, 168, 240, 0.12);
  border: 1px solid rgba(77, 168, 240, 0.4);
  box-shadow: 0 0 16px rgba(77, 168, 240, 0.2);
}

/* Location modal — neon */
body.dark-mode .location-modal-header {
  border-bottom-color: rgba(77, 168, 240, 0.1);
}

body.dark-mode .location-result-item {
  border-bottom-color: rgba(77, 168, 240, 0.06);
}

body.dark-mode .location-result-item:active {
  background: rgba(77, 168, 240, 0.08);
}

body.dark-mode .location-result-tz {
  background: rgba(77, 168, 240, 0.1);
  border: 1px solid rgba(77, 168, 240, 0.2);
  color: #4da8f0;
}

/* Prayer date nav — neon Today button */
body.dark-mode .prayer-date-today-btn {
  background: rgba(77, 168, 240, 0.12);
  border: 1px solid rgba(77, 168, 240, 0.4);
  box-shadow: 0 0 10px rgba(77, 168, 240, 0.15);
}

/* ============ CYBERPUNK: Today Page ============ */

/* State buttons — neon glow */
body.dark-mode .state-btn {
  border-color: rgba(77, 168, 240, 0.2);
  background: transparent;
}

body.dark-mode .state-btn.done {
  border-color: transparent;
  background: linear-gradient(135deg, #34d399, #00cc6a);
  color: white;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.5), 0 0 20px rgba(96, 165, 250, 0.2), 0 0 4px rgba(96, 165, 250, 0.8);
}

body.dark-mode .state-btn.missed {
  border-color: transparent;
  background: linear-gradient(135deg, #f87171, #e8145a);
  color: white;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.2), 0 0 4px rgba(59, 130, 246, 0.8);
}

/* Toggle items — neon borders */
body.dark-mode .toggle-item {
  border-bottom-color: rgba(77, 168, 240, 0.06);
}

/* Progress bar — neon glow */
body.dark-mode .progress-bar-container {
  background: rgba(77, 168, 240, 0.08);
}

body.dark-mode .progress-bar-fill {
  background: linear-gradient(90deg, #4da8f0, #34d399);
  box-shadow: 0 0 12px rgba(77, 168, 240, 0.4);
}

/* Date header day — neon glow */
body.dark-mode .date-header-day {
  text-shadow: 0 0 12px rgba(77, 168, 240, 0.5);
}

/* Today button — neon */
body.dark-mode .date-today-btn {
  background: rgba(77, 168, 240, 0.12);
  border: 1px solid rgba(77, 168, 240, 0.4);
  box-shadow: 0 0 10px rgba(77, 168, 240, 0.15);
}

/* Istighfar — neon */
body.dark-mode .istighfar-total {
  text-shadow: 0 0 16px rgba(77, 168, 240, 0.4);
}

body.dark-mode .istighfar-btn {
  background: rgba(77, 168, 240, 0.12);
  border: 1px solid rgba(77, 168, 240, 0.4);
  box-shadow: 0 0 12px rgba(77, 168, 240, 0.15);
}

/* Date picker — neon */
body.dark-mode .date-picker-header {
  border-bottom-color: rgba(77, 168, 240, 0.1);
}

body.dark-mode .picker-highlight {
  border-color: rgba(77, 168, 240, 0.4);
  background: rgba(77, 168, 240, 0.08);
}

body.dark-mode .picker-item.active {
  text-shadow: 0 0 8px rgba(77, 168, 240, 0.4);
}

/* ============ RTL SUPPORT (Arabic) ============ */
html[dir="rtl"] .header-actions { flex-direction: row-reverse; }
html[dir="rtl"] .prayer-time-row { flex-direction: row-reverse; }
html[dir="rtl"] .toggle-item { flex-direction: row-reverse; }
html[dir="rtl"] .settings-item { flex-direction: row-reverse; }
html[dir="rtl"] .location-result-item { flex-direction: row-reverse; }
html[dir="rtl"] .bottom-nav { direction: ltr; }
html[dir="rtl"] .istighfar-add { flex-direction: row-reverse; }
html[dir="rtl"] .heatmap-legend { flex-direction: row-reverse; }
html[dir="rtl"] .ramadan-times { flex-direction: row-reverse; }
html[dir="rtl"] .stat-grid { direction: ltr; }
html[dir="rtl"] .qibla-info { direction: ltr; }

/* ============ QIBLA COMPASS ============ */
.qibla-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
}
.qibla-compass {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.qibla-directions {
  position: absolute;
  inset: 0;
  transform: rotate(var(--compass-rotation, 0deg));
  /* match qibla.js throttle (220ms) — linear so each frame finishes
     cleanly before the next render arrives, no mid-air interruption */
  transition: transform 0.22s linear;
}
.qibla-dir {
  position: absolute;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}
.qibla-n { top: 12px; left: 50%; transform: translateX(-50%); color: var(--danger); }
.qibla-e { right: 12px; top: 50%; transform: translateY(-50%); }
.qibla-s { bottom: 12px; left: 50%; transform: translateX(-50%); }
.qibla-w { left: 12px; top: 50%; transform: translateY(-50%); }
.qibla-needle {
  position: absolute;
  width: 4px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}
.qibla-needle-tip {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 24px solid var(--success);
}
.qibla-kaaba {
  font-size: 24px;
  margin-top: -4px;
}
.qibla-center-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
}
.qibla-info {
  text-align: center;
  margin-top: 24px;
}
.qibla-bearing {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
}
.qibla-distance {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.qibla-enable-btn {
  margin-top: 24px;
  padding: 14px 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.qibla-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Qibla dark mode */
body.dark-mode .qibla-compass {
  border-color: rgba(77, 168, 240, 0.4);
  box-shadow: 0 0 30px rgba(77, 168, 240, 0.1), inset 0 0 30px rgba(77, 168, 240, 0.03);
}
body.dark-mode .qibla-bearing {
  color: #4da8f0;
  text-shadow: 0 0 16px rgba(77, 168, 240, 0.5);
}
body.dark-mode .qibla-needle-tip {
  border-bottom-color: #34d399;
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.5));
}
body.dark-mode .qibla-center-dot {
  background: #4da8f0;
  box-shadow: 0 0 8px rgba(77, 168, 240, 0.5);
}
body.dark-mode .qibla-enable-btn {
  background: rgba(77, 168, 240, 0.15);
  border: 1px solid rgba(77, 168, 240, 0.4);
  color: #4da8f0;
  box-shadow: 0 0 12px rgba(77, 168, 240, 0.15);
}

/* ============ ISLAMIC EVENTS BADGE ============ */
.islamic-event-badge {
  text-align: center;
  padding: 10px 16px;
  margin-bottom: 12px;
  border-radius: 12px;
  font-size: 14px;
  background: var(--primary-light);
  color: var(--text);
  border: 1px solid rgba(13, 148, 136, 0.2);
}
body.dark-mode .islamic-event-badge {
  background: rgba(77, 168, 240, 0.06);
  border: 1px solid rgba(77, 168, 240, 0.2);
  color: #4da8f0;
  box-shadow: 0 0 12px rgba(77, 168, 240, 0.08);
}

/* ============ RAMADAN BANNER ============ */
.ramadan-banner {
  text-align: center;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(16, 185, 129, 0.06));
  border: 1px solid rgba(13, 148, 136, 0.2);
}
.ramadan-header {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.ramadan-times {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 12px;
}
.ramadan-time-item { text-align: center; }
.ramadan-time-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ramadan-time-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}
.ramadan-countdown {
  font-size: 16px;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 12px;
}
.ramadan-progress {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ramadan-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.3s;
}
.ramadan-day-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Ramadan dark mode */
body.dark-mode .ramadan-banner {
  background: linear-gradient(135deg, rgba(77, 168, 240, 0.06), rgba(96, 165, 250, 0.04));
  border-color: rgba(77, 168, 240, 0.2);
  box-shadow: 0 0 20px rgba(77, 168, 240, 0.06);
}
body.dark-mode .ramadan-time-val {
  color: #4da8f0;
  text-shadow: 0 0 12px rgba(77, 168, 240, 0.4);
}
body.dark-mode .ramadan-countdown {
  color: #34d399;
  text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}
body.dark-mode .ramadan-progress-fill {
  background: linear-gradient(90deg, #4da8f0, #34d399);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

/* ============ HEATMAP CALENDAR ============ */
.heatmap-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}
.heatmap-grid {
  display: flex;
  gap: 2px;
}
.heatmap-day-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 4px;
  flex-shrink: 0;
}
.heatmap-day-label {
  width: 24px;
  height: 12px;
  font-size: 9px;
  color: var(--text-secondary);
  line-height: 12px;
}
.heatmap-cols {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.heatmap-months {
  height: 14px;
}
.heatmap-month-label {
  width: 12px;
  font-size: 9px;
  color: var(--text-secondary);
  text-align: center;
  flex-shrink: 0;
}
.heatmap-row {
  display: flex;
  gap: 2px;
}
.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.heatmap-cell.l0 { background: var(--gray-200); }
.heatmap-cell.l1 { background: #6ee7b7; }
.heatmap-cell.l2 { background: #34d399; }
.heatmap-cell.l3 { background: var(--success); }
.heatmap-cell.future { background: transparent; }
.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}
.heatmap-legend .heatmap-cell {
  width: 12px;
  height: 12px;
}

/* Heatmap dark mode */
body.dark-mode .heatmap-cell.l0 { background: rgba(77, 168, 240, 0.06); }
body.dark-mode .heatmap-cell.l1 { background: rgba(96, 165, 250, 0.2); }
body.dark-mode .heatmap-cell.l2 { background: rgba(96, 165, 250, 0.45); }
body.dark-mode .heatmap-cell.l3 {
  background: #34d399;
  box-shadow: 0 0 4px rgba(96, 165, 250, 0.3);
}

/* ============ CYBERPUNK: Stats Page ============ */

/* Stat cards — neon border + glow values */
body.dark-mode .stat-card {
  border: 1px solid rgba(77, 168, 240, 0.08);
  box-shadow: 0 0 20px rgba(77, 168, 240, 0.03);
}

body.dark-mode .stat-value {
  text-shadow: 0 0 12px rgba(77, 168, 240, 0.4);
}

body.dark-mode .stat-value[style*="color:var(--danger)"] {
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

/* Progress rows — neon */
body.dark-mode .progress-row {
  border-bottom-color: rgba(77, 168, 240, 0.06);
}

body.dark-mode .progress-row-bar {
  background: rgba(77, 168, 240, 0.08);
}

body.dark-mode .progress-row-fill {
  box-shadow: 0 0 8px rgba(77, 168, 240, 0.4);
}

body.dark-mode .progress-row-fill-missed {
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

body.dark-mode .progress-row-pct {
  text-shadow: 0 0 6px rgba(77, 168, 240, 0.4);
}

/* On Time card stat labels — neon */
body.dark-mode .stat-label {
  letter-spacing: 0.5px;
}

/* Sync status — neon overrides */
body.dark-mode .sync-synced {
  background: rgba(96, 165, 250, 0.1);
  color: #34d399;
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.1);
}

body.dark-mode .sync-error {
  background: rgba(59, 130, 246, 0.1);
  color: #ff6b9d;
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.1);
}
