/* ── Google Fonts (Noto Sans Arabic + Noto Naskh Arabic) ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Noto+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* ── Design tokens ─────────────────────────────────────── */
:root {
  --bg-start:      #1a4731;
  --bg-end:        #2d6a4f;
  --bg-card:       rgba(0, 0, 0, 0.22);
  --gold:          #ffd700;
  --gold-dim:      rgba(255, 215, 0, 0.45);
  --gold-faint:    rgba(255, 215, 0, 0.12);
  --surface:       rgba(0, 0, 0, 0.22);
  --border:        rgba(255, 215, 0, 0.22);
  --text:          #ffffff;
  --text-muted:    rgba(255, 255, 255, 0.55);
  --text-dim:      rgba(255, 255, 255, 0.30);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --font-body:     'Noto Sans Arabic', system-ui, -apple-system, sans-serif;
  --font-display:  'Noto Naskh Arabic', 'Noto Sans Arabic', serif;
  --transition:    150ms ease;
  --z-modal:       200;
  --z-tabbar:      100;
  --z-content:     1;
}

/* ── Reset & base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Author display values (e.g. display:flex) silently defeat the UA's
   [hidden] rule — restore the attribute's meaning */
[hidden] { display: none !important; }

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-end) 100%);
  min-height: 100vh;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

/* Focus ring — visible on keyboard nav */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Geometric circle decorations */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 320px; height: 320px;
  top: -100px; right: -100px;
  border: 1px solid rgba(255, 215, 0, 0.08);
  box-shadow: 0 0 0 50px rgba(255, 215, 0, 0.03);
}
body::after {
  width: 240px; height: 240px;
  bottom: -80px; left: -80px;
  border: 1px solid rgba(255, 215, 0, 0.05);
  box-shadow: 0 0 0 30px rgba(255, 215, 0, 0.02);
}

/* ── App shell ─────────────────────────────────────────── */
#app {
  position: relative;
  z-index: var(--z-content);
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh; /* dynamic viewport — accounts for mobile address bar */
  display: flex;
  flex-direction: column;
}

/* Scrollable content area between header and tab bar */
.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Thin themed scrollbars on inner scroll areas */
.content,
.cal-table-wrap,
.modal {
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}
.content::-webkit-scrollbar,
.cal-table-wrap::-webkit-scrollbar,
.modal::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.content::-webkit-scrollbar-track,
.cal-table-wrap::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track {
  background: transparent;
}
.content::-webkit-scrollbar-thumb,
.cal-table-wrap::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 3px;
}
.content::-webkit-scrollbar-thumb:hover,
.cal-table-wrap::-webkit-scrollbar-thumb:hover,
.modal::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ── Header ────────────────────────────────────────────── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-brand {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
}
.header-sub {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

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

.gps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--gold);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.gps-btn:hover { background: rgba(0,0,0,0.38); border-color: var(--gold-dim); }
.gps-btn.locating svg { animation: gpsSpin 1s linear infinite; }
.gps-btn.done { border-color: #4ade80; color: #4ade80; }
@keyframes gpsSpin { to { transform: rotate(360deg); } }

.zone-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 14px;
  min-height: 44px;
  font-size: 11px;
  font-family: var(--font-body);
  color: var(--gold);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
  min-width: 0;
  max-width: 200px;
  overflow: hidden;
}
.zone-pill:hover { background: rgba(0,0,0,0.38); border-color: var(--gold-dim); }
.zone-pill svg { flex-shrink: 0; }
#zonePillText {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Tab bar ────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  width: 100%;
  flex-shrink: 0;
  background: rgba(12, 30, 18, 0.97);
  border-top: 1px solid rgba(255, 215, 0, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 0 8px;
  min-height: 56px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.8px;
  font-weight: 500;
  cursor: pointer;
  border-top: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn svg { transition: opacity var(--transition); opacity: 0.4; }
.tab-btn.active { color: var(--gold); border-top-color: var(--gold); }
.tab-btn.active svg { opacity: 1; }
.tab-btn:hover:not(.active) { color: var(--text-muted); }
.tab-btn:hover:not(.active) svg { opacity: 0.65; }

/* ── Tab panels ─────────────────────────────────────────── */
.tab-panel { display: none; flex: 1; padding: 0 0 8px; }
.tab-panel.active { display: block; }

/* ── Today tab ──────────────────────────────────────────── */
.hijri-bar {
  text-align: center;
  padding: 16px 20px 0;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--gold);
  text-transform: uppercase;
  font-family: var(--font-body);
}

.next-prayer-card {
  margin: 14px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px 18px;
  text-align: center;
  backdrop-filter: blur(4px);
}
.next-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.next-name-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}
.next-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text);
}
.next-pada {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-muted);
}
.next-time {
  font-size: 20px;
  font-weight: 600;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.next-lagi {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin: 8px 0 2px;
}
.next-timer {
  font-family: var(--font-body);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.progress-bar-wrap {
  margin-top: 16px;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), rgba(255,215,0,0.5));
  border-radius: 2px;
  transition: width 1s linear;
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 5px;
}

.prayer-grid-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--gold);
  text-transform: uppercase;
  padding: 0 16px;
  margin-bottom: 8px;
}
.prayer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 16px 14px;
}
.prayer-cell {
  text-align: center;
  padding: 10px 4px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background var(--transition), border-color var(--transition);
}
.prayer-cell.active {
  background: var(--gold-faint);
  border-color: var(--gold-dim);
}
.prayer-cell.past { opacity: 0.40; }
.prayer-cell .pname {
  font-size: 8px;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.prayer-cell.active .pname { color: var(--gold); }
.prayer-cell .ptime {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.prayer-cell.active .ptime { color: var(--gold); font-weight: 700; }

/* ── Notification toggle ────────────────────────────────── */
.notif-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 16px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  gap: 12px;
}
.notif-info { display: flex; align-items: center; gap: 10px; }
.notif-info svg { flex-shrink: 0; color: var(--gold-dim); }
.notif-label { font-size: 12px; font-weight: 600; line-height: 1.3; }
.notif-sub   { font-size: 9px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.toggle {
  width: 44px;
  height: 26px;
  background: rgba(255,255,255,0.15);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background 0.25s ease;
  border: none;
  flex-shrink: 0;
  min-width: 44px;
}
.toggle.on { background: var(--gold); }
.toggle::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 4px; left: 4px;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle.on::after { transform: translateX(18px); }

/* ── Calendar tab ───────────────────────────────────────── */
.cal-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cal-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}
.cal-sub { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

.cal-table-wrap {
  overflow-x: auto;
  padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
}
.cal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  min-width: 340px;
  font-variant-numeric: tabular-nums;
}
.cal-table th {
  padding: 8px 5px;
  text-align: center;
  color: var(--gold-dim);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cal-table th:first-child { text-align: left; }
.cal-table td {
  padding: 7px 5px;
  text-align: center;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cal-table td:first-child {
  text-align: left;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 600;
}
.cal-table tr.today td { color: var(--text); }
.cal-table tr.today td:first-child {
  color: var(--gold);
  font-weight: 700;
  border-left: 2px solid var(--gold);
  padding-left: 7px;
}
.cal-table tr.today { background: var(--gold-faint); }
.cal-table tr.past  { opacity: 0.38; }

.cal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 16px 16px;
}
.print-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  min-height: 44px;
  background: var(--gold-faint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.print-btn:hover { background: rgba(255,215,0,0.2); }

.cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cal-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--gold);
  cursor: pointer;
  transition: background var(--transition);
}
.cal-nav-btn:hover:not(:disabled) { background: rgba(255,215,0,0.15); }
.cal-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Qibla tab ──────────────────────────────────────────── */
.qibla-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 20px 24px;
  gap: 18px;
}
.compass {
  width: 190px; height: 190px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  position: relative;
  box-shadow:
    0 0 0 8px rgba(255,215,0,0.04),
    0 0 0 16px rgba(255,215,0,0.02);
}
.compass-ring {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255,215,0,0.1);
}
.compass-label {
  position: absolute;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.compass-label.n { top: 8px;   left: 50%; transform: translateX(-50%); }
.compass-label.s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.compass-label.e { right: 10px; top: 50%; transform: translateY(-50%); }
.compass-label.w { left: 10px;  top: 50%; transform: translateY(-50%); }
.compass-needle {
  position: absolute;
  width: 3px;
  height: 78px;
  background: linear-gradient(to bottom, var(--gold) 0%, var(--gold) 65%, transparent 100%);
  border-radius: 3px 3px 0 0;
  top: 50%; left: 50%;
  transform-origin: bottom center;
  transform: translate(-50%, -100%) rotate(0deg);
  filter: drop-shadow(0 0 4px rgba(255,215,0,0.6));
}
.compass-dot {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(255,215,0,0.8);
}
.qibla-bearing {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
}
.qibla-sub { font-size: 11px; color: var(--text-muted); text-align: center; }
.qibla-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 10px;
  color: var(--text-dim);
  text-align: left;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  line-height: 1.6;
  max-width: 300px;
}
.qibla-note svg { flex-shrink: 0; margin-top: 1px; color: var(--gold-dim); }

/* Live compass face — rotates with device heading */
.compass-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: transform 0.08s linear;
}

/* LIVE badge shown when sensor is active */
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #4ade80;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* Explanation card — shown on first visit if sensor available */
.qibla-live-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.live-card-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
}
.live-card-msg {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}
.btn-activate {
  padding: 10px 16px;
  min-height: 44px;
  background: var(--gold);
  color: #152e1f;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: filter var(--transition);
  align-self: stretch;
}
.btn-activate:hover { filter: brightness(1.1); }
.btn-activate:disabled { opacity: 0.5; cursor: not-allowed; }

/* Mouse-driven devices have no gyroscope — static bearing applies,
   so the live-sensor card is noise even though desktop Chrome
   defines DeviceOrientationEvent */
@media (hover: hover) and (pointer: fine) {
  .qibla-live-card { display: none; }
}

/* ── Zone selector modal ────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: var(--z-modal);
  align-items: flex-end;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #152e1f;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}
.modal select {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  min-height: 48px;
  font-size: 13px;
  font-family: var(--font-body);
  appearance: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.modal select:focus { border-color: var(--gold); }
.modal select option { background: #1a4731; color: #fff; }
.modal-btns { display: flex; gap: 10px; }
.btn-primary {
  flex: 1;
  padding: 13px;
  min-height: 48px;
  background: var(--gold);
  color: #152e1f;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: filter var(--transition);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  padding: 13px 18px;
  min-height: 48px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* ── Loading / error states ─────────────────────────────── */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}
.loading::after {
  content: '';
  display: block;
  width: 24px; height: 24px;
  margin: 12px auto 0;
  border: 2px solid rgba(255,215,0,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  margin: 16px;
  padding: 14px 16px;
  background: rgba(180,40,40,0.18);
  border: 1px solid rgba(220,80,80,0.35);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #ffaaaa;
  line-height: 1.5;
}

/* ── Print styles ───────────────────────────────────────── */
@media print {
  body { background: #fff; color: #000; font-family: Arial, sans-serif; }
  body::before, body::after { display: none; }
  .header, .tab-bar, .print-btn, .cal-nav, .notif-row { display: none !important; }
  #tab-today, #tab-qibla { display: none !important; }
  #tab-calendar { display: block !important; padding: 0; }
  .cal-header { border-bottom: 1px solid #ccc; }
  .cal-title { color: #1a4731; }
  .cal-sub   { color: #666; }
  .cal-table { font-size: 11px; }
  .cal-table th { color: #444; border-bottom: 1px solid #ccc; }
  .cal-table td { color: #222; border-bottom: 1px solid #eee; }
  .cal-table tr.today { background: #fff9db; }
  .cal-table tr.today td:first-child { border-left: 2px solid #1a4731; color: #1a4731; }
  .cal-table tr.past  { opacity: 1; color: #888; }
}

/* ── Responsive — 768px (tablet) ─────────────────────────── */
@media (min-width: 768px) {
  body {
    background-attachment: fixed;
    min-height: 100dvh;
    padding: 24px 0; /* outer gap lives on body, not #app — margins collapse past body and create a phantom page scrollbar */
  }

  #app {
    max-width: 540px;
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  }

  .tab-bar {
    border-radius: 0 0 20px 20px;
  }

  .next-timer { font-size: 48px; }

  .prayer-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .compass { width: 220px; height: 220px; }
  .compass-needle { height: 90px; }
}

/* ── Responsive — laptops with short viewports ────────────
   Compress vertical rhythm so the SOLAT tab fits without
   inner scrolling down to ~640px of viewport height. */
@media (min-width: 768px) and (max-height: 820px) {
  .header { padding: 12px 20px 10px; }
  .hijri-bar { padding-top: 8px; }
  .next-prayer-card { margin: 10px 16px 10px; padding: 14px 20px 12px; }
  .next-name { font-size: 20px; }
  .next-pada { font-size: 17px; }
  .next-time { font-size: 17px; }
  .next-lagi { margin-top: 6px; }
  .next-timer { font-size: 36px; }
  .progress-bar-wrap { margin-top: 8px; }
  .prayer-grid-label { margin-bottom: 6px; }
  .prayer-cell { padding: 8px 4px; }
  .prayer-grid { padding-bottom: 10px; }
  .notif-row { padding: 10px 16px; margin-bottom: 10px; }
  .tab-btn { min-height: 50px; padding: 8px 0 6px; }
  .qibla-wrap { padding: 20px 20px 16px; gap: 12px; }
  .compass { width: 170px; height: 170px; }
  .compass-needle { height: 68px; }
}

/* ── Responsive — 480px ───────────────────────────────────── */
@media (min-width: 480px) and (max-width: 767px) {
  body { background-attachment: fixed; }
}

/* ── Responsive — narrow phones (≤430px): keep header on one line ── */
@media (max-width: 430px) {
  .header-brand { white-space: nowrap; }
  .zone-pill { max-width: 150px; }
  .gps-btn { width: 40px; height: 40px; }
}

/* ── Responsive — small phones (≤360px) ──────────────────── */
@media (max-width: 360px) {
  .next-timer { font-size: 34px; letter-spacing: 2px; }
  .next-name  { font-size: 20px; }
  .next-pada  { font-size: 16px; }
  .next-time  { font-size: 16px; }
  .prayer-cell .ptime { font-size: 11px; }
  .prayer-cell .pname { font-size: 7px; }
  .header-brand { font-size: 13px; }
  .zone-pill { max-width: 160px; padding: 7px 10px; }
}
