/* ============================================================
   Salaat Calendar – design tokens
   ============================================================ */
:root {
  /* Palette: deep evergreen with warm parchment cream */
  --ink: #0f1f1a;
  --ink-2: #2a3b34;
  --muted: #6c7a73;
  --line: #dcd6c8;
  --line-2: #e8e3d6;
  --bg: #f6f1e3;
  --bg-2: #fbf7ec;
  --card: #ffffff;
  --accent: #1a4d3a;
  --accent-2: #2c6e54;
  --accent-soft: #e6efe9;
  --gold: #b58a3b;

  /* Type */
  --font-sans: "Satoshi", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Zodiak", "Iowan Old Style", "Apple Garamond", Georgia, serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(15, 31, 26, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 31, 26, 0.08);
}

/* ============================================================
   Reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
ul, ol { padding-left: 1.2em; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--ink); color: var(--bg); padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { top: 0; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background-color: rgba(246, 241, 227, 0.9);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 600; letter-spacing: -0.01em;
}
.brand:hover { color: var(--accent); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; color: var(--accent); }
.brand-name { font-family: var(--font-display); font-size: 19px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  color: var(--ink-2);
  font-size: 14px; font-weight: 500;
  line-height: 1;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0;
  margin-right: 4px;
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle-bar {
  display: block;
  width: 18px; height: 1.75px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6.75px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6.75px) rotate(-45deg);
}

@media (max-width: 720px) {
  .header-row { position: relative; }
  .nav-toggle {
    display: inline-flex;
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 0;
  }
  .brand { margin-left: 76px; }
  .site-nav {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
  }
  .site-nav.is-open { display: flex; }
  .site-nav > a,
  .site-nav .nav-dropdown-btn {
    padding: 14px 24px;
    font-size: 15px;
    border-bottom: 1px solid var(--line-2);
    width: 100%;
    justify-content: space-between;
  }
  .site-nav > a:last-child { border-bottom: none; }
  .site-nav .nav-dropdown { width: 100%; display: block; }
  .site-nav .nav-dropdown-btn {
    display: flex;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line-2);
    text-align: left;
  }
  .site-nav .nav-dropdown-menu {
    position: static;
    display: block;
    width: 100%;
    box-shadow: none;
    border: none;
    background: var(--bg-2);
    padding: 0;
    margin: 0;
    border-radius: 0;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height .2s ease;
  }
  .site-nav .nav-dropdown.open .nav-dropdown-menu {
    max-height: 200px;
    border-bottom: 1px solid var(--line-2);
  }
  .site-nav .nav-dropdown-menu a {
    padding: 12px 40px;
    font-size: 14px;
  }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 72px 0 64px;
  background:
    radial-gradient(ellipse 600px 400px at 80% 20%, rgba(26, 77, 58, 0.06), transparent),
    var(--bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 880px) {
  .hero { padding: 48px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 16px;
}
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}
.display em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 28px;
}
.hero-cta {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.hero-meta {
  font-size: 13px; color: var(--muted); margin: 16px 0 0;
}
.hero-meta .source-note {
  display: inline-block; margin-left: 6px; opacity: 0.85; font-style: normal;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r-md);
  font-weight: 600; font-size: 15px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform .12s, background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-2); color: #fff; }
.btn-secondary {
  background: var(--card); color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Today card */
.today-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.today-header {
  display: flex; flex-direction: column; gap: 4px;
  padding-bottom: 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
}
.today-eyebrow {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.today-date {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: -0.01em;
}
.today-hijri {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 400;
  margin-top: 2px;
}
.today-hijri:empty { display: none; }
/* Eyebrow row: city picker on the left, live local time on the right */
.today-eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.today-clock {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.85;
}
.today-clock-label {
  opacity: 0.6;
  margin-right: 6px;
  font-weight: 500;
}

/* ---- Inline city picker (in today-card eyebrow) ---- */
.today-eyebrow-label {
  margin-right: 4px;
}
.city-picker {
  position: relative;
  display: inline-block;
}
.city-picker-trigger {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 2px 8px;
  margin: -2px -8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
}
.city-picker-trigger:hover,
.city-picker-trigger:focus-visible {
  background: rgba(26, 77, 58, 0.08);
  outline: none;
}
.city-picker-trigger[aria-expanded="true"] {
  background: rgba(26, 77, 58, 0.10);
}
.city-picker-chev {
  opacity: 0.7;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.city-picker-trigger[aria-expanded="true"] .city-picker-chev {
  transform: rotate(180deg);
}
.city-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  min-width: 220px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 30, 25, 0.14), 0 2px 8px rgba(15, 30, 25, 0.06);
  padding: 6px;
  opacity: 0;
  transform: translateY(-4px) scale(0.985);
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
  text-transform: none;
  letter-spacing: 0;
}
.city-picker-menu[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.city-picker-menu[hidden] { display: none; }
.city-picker-group-label {
  display: block;
  padding: 8px 10px 4px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 600;
  font-family: var(--font-sans);
}
.city-picker-group + .city-picker-group .city-picker-group-label {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line-2);
}
.city-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  font: inherit;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease;
}
.city-picker-option:hover,
.city-picker-option:focus-visible {
  background: var(--bg-2, rgba(0, 0, 0, 0.035));
  outline: none;
}
.city-picker-option[aria-selected="true"] {
  color: var(--accent);
}
.city-picker-option .city-picker-check {
  width: 14px;
  height: 14px;
  opacity: 0;
  color: var(--accent);
  flex-shrink: 0;
}
.city-picker-option[aria-selected="true"] .city-picker-check {
  opacity: 1;
}
.city-picker-tz {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-2);
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  padding-right: 4px;
}
.city-picker-option[aria-selected="true"] .city-picker-tz {
  color: var(--accent);
  opacity: 0.85;
}
@media (max-width: 480px) {
  .city-picker-menu {
    min-width: 200px;
  }
}

/* Country optgroup labels in city selectors */
#city-select optgroup,
#display-city optgroup {
  font-weight: 600;
  font-style: normal;
  color: var(--ink-2);
}
.prayer-list {
  list-style: none; padding: 0; margin: 0;
}
.prayer-list li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-2);
}
.prayer-list li[hidden] { display: none; }
.prayer-list li:last-child { border-bottom: none; }
/* Make the last *visible* item lose its bottom border too */
.prayer-list li:not([hidden]):last-of-type { border-bottom: none; }
.p-name {
  font-size: 14px; color: var(--ink-2); font-weight: 500;
}
.p-name.highlight { color: var(--accent); font-weight: 600; }
.p-time {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 18px; letter-spacing: -0.01em;
}
.p-time.highlight { color: var(--accent); }
.today-footer {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px;
}
.next-label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; font-weight: 600; }
.next-prayer { font-weight: 600; color: var(--ink); }

/* ============================================================
   Features
   ============================================================ */
.features {
  padding: 64px 0;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
@media (max-width: 880px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features-grid { grid-template-columns: 1fr; } }
.feature h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 20px; margin: 8px 0 6px; letter-spacing: -0.01em;
}
.feature p {
  margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55;
}
.feature-num {
  font-family: var(--font-display); font-style: italic;
  font-size: 13px; color: var(--gold);
  letter-spacing: 0.08em;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: inline-block;
}

/* ============================================================
   Section head
   ============================================================ */
.section-head {
  margin-bottom: 36px;
  max-width: 60ch;
}
.preview .section-head { max-width: none; }
.preview .section-lede { max-width: 80ch; }
.section-head h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
}
.section-lede {
  font-size: 17px; color: var(--ink-2); margin: 0;
}

/* ============================================================
   Downloads
   ============================================================ */
.downloads { padding: 80px 0; }

.controls {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 36px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.control { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.control-mode { flex: 1 1 320px; }
.control label {
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  font-weight: 600;
}
.control select {
  font: inherit;
  font-size: 15px; font-weight: 500;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231a4d3a' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
  transition: border-color .15s;
}
.control select:hover, .control select:focus {
  border-color: var(--accent); outline: none;
}
.control-hint {
  font-size: 13px; color: var(--muted); margin: 4px 0 0; line-height: 1.5;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 880px) { .download-grid { grid-template-columns: 1fr; } }

.download-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative;
}
.download-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.download-primary {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--card) 60%);
}
.download-card header h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em;
}
.download-card header p {
  margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5;
}
.dl-tag {
  position: absolute;
  top: -12px;
  left: 28px;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600;
  background: var(--accent); color: #fff;
  padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(26, 77, 58, 0.18);
}
.dl-meta {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  padding: 14px 0;
}
.dl-meta li {
  display: flex; flex-direction: column; gap: 2px;
}
.dl-meta span {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.dl-meta strong {
  font-family: var(--font-display); font-size: 15px; color: var(--ink); font-weight: 500;
}
.card-fineprint {
  margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5;
}
.card-fineprint a {
  color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
}
.card-fineprint a:hover { color: var(--ink); }

/* ============================================================
   Quarter picker (dropdown + button)
   ============================================================ */
.quarter-picker {
  margin-bottom: 14px;
}
.quarter-picker .q-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.quarter-picker .q-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}
.quarter-picker .q-select {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  height: 46px;
  padding: 0 36px 0 14px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231a4d3a' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
  transition: border-color .15s;
}
.quarter-picker .q-select:hover, .quarter-picker .q-select:focus { border-color: var(--accent); outline: none; }
.quarter-picker .q-btn {
  font-size: 13px;
  padding: 0 18px;
  text-align: center;
  white-space: nowrap;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 480px) {
  .quarter-picker .q-row { grid-template-columns: 1fr; }
  .quarter-picker .q-btn { padding: 0 12px; }
}

/* ============================================================
   Info icon with hover tooltip
   ============================================================ */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--muted);
  color: #fff;
  font-family: var(--font-display);
  font-size: 9px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  position: relative;
  vertical-align: 1px;
  transition: background 0.15s ease;
}
.info-icon:hover, .info-icon:focus { background: var(--accent); outline: none; }
.info-icon .tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  z-index: 10;
  text-align: left;
  white-space: normal;
}
.info-icon .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.info-icon:hover .tooltip,
.info-icon:focus .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}
@media (max-width: 480px) {
  .info-icon .tooltip { width: 220px; }
}

/* ============================================================
   Import
   ============================================================ */
.import {
  padding: 80px 0;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.import-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  background: var(--card);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 24px;
  width: fit-content;
}
.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-weight: 500; font-size: 14px;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.is-active {
  background: var(--accent); color: #fff;
}
.tab-panels {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.tab-panel ol, .tab-panel ul { margin: 0 0 16px; padding-left: 1.4em; }
.tab-panel li { padding: 5px 0; line-height: 1.55; }
.hint {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  font-size: 14.5px;
  color: var(--ink-2);
}
.hint-callout {
  margin-top: 0; margin-bottom: 18px;
  background: #fff5e1;
  border-left-color: #c4923f;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
}
.other-list { list-style: none; padding: 0; }
.other-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.other-list li:last-child { border-bottom: none; }

/* ============================================================
   Preview
   ============================================================ */
.preview { padding: 80px 0; }
.month-picker {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.month-picker label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.month-picker select {
  font: inherit; font-size: 15px; font-weight: 500;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231a4d3a' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
}
.month-picker select:hover, .month-picker select:focus {
  border-color: var(--accent); outline: none;
}
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  overflow-x: auto;
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.schedule-table th[hidden], .schedule-table td[hidden] { display: none; }
.schedule-table th, .schedule-table td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--line-2);
  font-size: 14.5px;
}
.schedule-table th:first-child, .schedule-table td:first-child {
  text-align: left;
}
.schedule-table thead th {
  background: var(--bg-2);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; color: var(--muted);
}
.schedule-table tbody tr.is-today {
  background: var(--accent-soft);
}
.schedule-table tbody tr.is-today td:first-child {
  font-weight: 600; color: var(--accent);
}
.schedule-table tbody tr:last-child td { border-bottom: none; }
.schedule-table td.maghrib-col { font-weight: 600; color: var(--accent); }

/* ============================================================
   About
   ============================================================ */
.about { padding: 80px 0; background: var(--bg-2); border-top: 1px solid var(--line); }
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
}
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }
.about p { line-height: 1.7; color: var(--ink-2); margin: 0 0 16px; }
.about .muted { color: var(--muted); font-size: 14.5px; }
.about-side {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  height: fit-content;
}
.about-side h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 18px; margin: 0 0 16px; letter-spacing: -0.01em;
}
.about-side dl {
  display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px;
  margin: 0; font-size: 14.5px;
}
.about-side dt { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; align-self: center; }
.about-side dd { margin: 0; color: var(--ink-2); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer-row {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 14px;
}
.footer-row p { margin: 0; }
.footer-row .muted { color: var(--muted); }

/* CSV warning */
.csv-warning {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(184, 134, 11, 0.08);
  border-left: 3px solid #b8860b;
  border-radius: 4px;
  color: var(--ink);
}
.csv-warning strong { font-weight: 600; }

/* ===== Adhan toggle ===== */
.adhan-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-left: 16px;
  background: transparent;
  border: 1px solid var(--line, rgba(0,0,0,0.12));
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.adhan-toggle:hover {
  background: rgba(26, 77, 58, 0.06);
  border-color: rgba(26, 77, 58, 0.4);
}
.adhan-toggle:focus-visible {
  outline: 2px solid #1a4d3a;
  outline-offset: 2px;
}
.adhan-toggle .adhan-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.adhan-toggle .adhan-icon-on { display: none; }
.adhan-toggle .adhan-icon-off { display: block; }
.adhan-toggle[aria-pressed="true"] {
  background: #1a4d3a;
  border-color: #1a4d3a;
  color: #fff;
}
.adhan-toggle[aria-pressed="true"] .adhan-icon-on { display: block; }
.adhan-toggle[aria-pressed="true"] .adhan-icon-off { display: none; }
.adhan-toggle.is-playing {
  animation: adhan-pulse 1.6s ease-in-out infinite;
}
@keyframes adhan-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26, 77, 58, 0.45); }
  50%      { box-shadow: 0 0 0 8px rgba(26, 77, 58, 0); }
}

/* Adhan banner */
.adhan-banner[hidden] { display: none !important; }
.adhan-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 10px 14px 10px 18px;
  background: #1a4d3a;
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  animation: adhan-banner-in 0.3s ease-out;
}
@keyframes adhan-banner-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.adhan-banner-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
}
.adhan-banner-close:hover { opacity: 1; }

@media (max-width: 640px) {
  .adhan-toggle {
    margin-left: 0;
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* Make adhan banner not collide with nav: shift it slightly down on desktop */
@media (min-width: 721px) {
  .adhan-banner { top: 84px; }
}

/* ============================================================
   Pill button (display toggle in header) — matches .adhan-toggle
   ============================================================ */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-left: 8px;
  background: transparent;
  border: 1px solid var(--line, rgba(0,0,0,0.12));
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pill-btn:hover {
  background: rgba(26, 77, 58, 0.06);
  border-color: rgba(26, 77, 58, 0.4);
}
.pill-btn:focus-visible {
  outline: 2px solid #1a4d3a;
  outline-offset: 2px;
}
.pill-btn-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* Compact icon-only round button (used for the exit X in display mode) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover {
  background: rgba(26, 77, 58, 0.06);
  border-color: rgba(26, 77, 58, 0.4);
  color: var(--accent);
}
.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.icon-btn svg { width: 18px; height: 18px; }

/* ============================================================
   Tighter step list (used in import section)
   ============================================================ */
ol.steps {
  margin: 0 0 16px;
  padding-left: 22px;
}
ol.steps li {
  margin: 6px 0;
  line-height: 1.55;
  color: var(--ink-2);
}
ol.steps li strong { color: var(--ink); }

/* ============================================================
   Display mode (kiosk view for tablets/phones)
   ============================================================ */
body.display-mode { overflow: hidden; }
body.display-mode > .site-header,
body.display-mode > main,
body.display-mode > .site-footer { display: none !important; }
body.display-mode > .adhan-banner { top: 80px; }

.display-view[hidden] { display: none !important; }
.display-view {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 500px at 75% 15%, rgba(26, 77, 58, 0.08), transparent),
    var(--bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow: hidden;
}

.display-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex: 0 0 auto;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 241, 227, 0.85);
  backdrop-filter: blur(8px);
}
.display-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.display-brand .brand-mark { width: 28px; height: 28px; color: var(--accent); }

.display-controls {
  display: inline-flex; align-items: center; gap: 8px;
}
.display-city {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: transparent;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%231a4d3a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding: 0 34px 0 14px;
  font-size: 14px; font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: inherit;
}
.display-city:hover {
  background-color: rgba(26, 77, 58, 0.06);
  border-color: rgba(26, 77, 58, 0.4);
}
.display-city:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.display-adhan { margin-left: 0; }

.display-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  justify-content: safe center;
  padding: clamp(12px, 2.5vh, 24px) clamp(20px, 5vw, 56px);
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  gap: clamp(10px, 2vh, 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.display-headline { text-align: center; flex-shrink: 0; min-width: 0; }
.display-eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.display-date {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 4.5vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 6px 0 2px;
}
.display-hijri {
  font-size: clamp(14px, 2.2vw, 17px);
  color: var(--ink-2);
  margin: 0;
}
.display-hijri:empty { display: none; }

.display-prayer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  /* Never shrink the card below its rows: small screens must scroll, not clip. */
  flex: 0 0 auto;
  min-width: 0;
}
.display-prayer-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: clamp(8px, 1.4vh, 14px) clamp(18px, 4vw, 28px);
  border-bottom: 1px solid var(--line-2);
}
.display-prayer-list li:last-child { border-bottom: none; }
.display-prayer-list li.is-next {
  background: linear-gradient(90deg, rgba(26, 77, 58, 0.06), transparent 60%);
}
.display-prayer-list li.is-passed .dp-time,
.display-prayer-list li.is-passed .dp-name {
  color: var(--muted);
}
.dp-name {
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 500;
  color: var(--ink-2);
}
.display-prayer-list li.is-next .dp-name,
.display-prayer-list li.is-next .dp-time {
  color: var(--accent);
  font-weight: 600;
}
.dp-time {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: clamp(18px, 2.6vw, 24px);
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.display-next {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(12px, 1.8vh, 18px) 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-2);
  flex-shrink: 0;
}
.display-next-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.display-next-name {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.8vw, 24px);
  letter-spacing: -0.01em;
  color: var(--accent);
  margin-top: 4px;
}
.display-next-countdown {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: clamp(14px, 2.4vw, 17px);
  color: var(--ink-2);
  margin-top: 2px;
}

@media (max-width: 480px) {
  .display-bar { padding: 10px 14px; }
  .display-brand span { display: none; }
  .display-controls { gap: 6px; }
  .display-city { padding: 0 28px 0 12px; font-size: 13px; background-position: right 10px center; }
  .display-adhan .adhan-label { display: none; }
  .display-adhan { padding: 6px 10px; }
}

/* Use the width of a tablet in landscape instead of stacking three tall cards.
   Height queries use the browser viewport, including when its bars are visible. */
@media (min-width: 640px) and (orientation: landscape) {
  .display-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-rows: auto auto;
    align-content: start;
    align-content: safe center;
    align-items: center;
    max-width: 1120px;
    padding: clamp(12px, 3vh, 32px) clamp(20px, 4vw, 56px);
    column-gap: clamp(20px, 4vw, 48px);
    row-gap: clamp(12px, 3vh, 24px);
  }
  .display-headline { grid-column: 1; grid-row: 1; }
  .display-date { font-size: clamp(24px, 3.3vw, 40px); line-height: 1.2; }
  .display-prayer-list {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }
  .display-prayer-list li { align-items: center; line-height: 1.3; }
  .display-next { grid-column: 1; grid-row: 2; min-width: 0; }
}

@media (min-width: 640px) and (orientation: landscape) and (max-height: 500px) {
  .display-bar { padding: 8px 20px; }
  .display-main { padding-top: 12px; padding-bottom: 12px; row-gap: 12px; }
  .display-date { font-size: clamp(24px, 3vw, 32px); }
  .display-prayer-list li { padding: 6px 18px; }
  .dp-name { font-size: 16px; }
  .dp-time { font-size: 22px; }
  .display-next { padding: 12px 16px; }
}

/* ============================================================
   Settings dropdown
   ============================================================ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.settings { position: relative; margin-left: 16px; }
.settings #settings-toggle { margin-left: 0; }
.settings #settings-toggle[aria-expanded="true"] {
  background: rgba(26, 77, 58, 0.06);
  border-color: rgba(26, 77, 58, 0.4);
}

.settings-menu[hidden] { display: none !important; }
.settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 320px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 8px;
  z-index: 60;
  animation: settings-pop .14s ease-out;
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}

body.display-mode #shia-player-bar { display: none !important; }
.display-preview { min-height: 38px; }
@media (max-width: 480px) {
  .display-preview { font-size: 12px; padding: 0 9px; }
  .display-city { max-width: 120px; }
}
@keyframes settings-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px;
  border-radius: 8px;
}
.settings-row + .settings-row {
  border-top: 1px solid var(--line-2);
}
.settings-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.settings-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.settings-row-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.settings-action {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.settings-action:hover {
  background: var(--accent);
  color: #fff;
}
.settings-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* iOS-style switch */
.switch {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.switch:focus-visible { outline: none; }
.switch:focus-visible .switch-track {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
.switch-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  transition: background .18s ease;
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform .18s ease;
}
.switch[aria-checked="true"] .switch-track {
  background: var(--accent);
}
.switch[aria-checked="true"] .switch-thumb {
  transform: translateX(18px);
}
.switch.is-playing .switch-track {
  animation: adhan-pulse 1.6s ease-in-out infinite;
}

/* Per-prayer adhan sub-toggle group */
.settings-subgroup[hidden] { display: none !important; }
.settings-subgroup {
  padding: 4px 0 8px 28px;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.015);
}
.settings-row-sub {
  padding: 8px 16px 8px 0;
  border-bottom: none !important;
}
.settings-row-sub + .settings-row-sub {
  border-top: 1px dashed var(--line-2);
}
.settings-row-sub-label {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.switch.switch-sm .switch-track {
  width: 34px; height: 20px;
}
.switch.switch-sm .switch-thumb {
  width: 14px; height: 14px;
  top: 3px; left: 3px;
}
.switch.switch-sm[aria-checked="true"] .switch-thumb {
  transform: translateX(14px);
}

/* Display-mode adhan icon button (small icon-only inside the kiosk bar) */
.display-adhan-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.display-adhan-icon svg { width: 18px; height: 18px; }
.display-adhan-icon .adhan-icon-on { display: none; }
.display-adhan-icon .adhan-icon-off { display: block; }
.display-adhan-icon:hover {
  background: rgba(26, 77, 58, 0.06);
  border-color: rgba(26, 77, 58, 0.4);
  color: var(--accent);
}
.display-adhan-icon[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.display-adhan-icon[aria-pressed="true"] .adhan-icon-on { display: block; }
.display-adhan-icon[aria-pressed="true"] .adhan-icon-off { display: none; }
.display-adhan-icon.is-playing {
  animation: adhan-pulse 1.6s ease-in-out infinite;
}

/* Hide the Settings button label on small screens (keep icon only) */
@media (max-width: 720px) {
  #settings-toggle .pill-btn-label { display: none; }
  #settings-toggle { padding: 8px; width: 38px; height: 38px; justify-content: center; }
  .settings-menu { right: -8px; min-width: 280px; }
}

/* ============================================================
   WELCOME MODAL — first-visit city picker w/ geolocation
   ============================================================ */
.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: welcome-fade-in .25s ease-out;
}
.welcome-modal[hidden] { display: none; }
.welcome-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 31, 26, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.welcome-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--bg-2);
  border: 1px solid rgba(15, 31, 26, 0.08);
  border-radius: 16px;
  padding: 32px 28px 24px;
  box-shadow: 0 30px 60px -20px rgba(15, 31, 26, 0.45);
  animation: welcome-slide-up .35s cubic-bezier(.2,.8,.2,1);
}
.welcome-header { margin-bottom: 22px; }
.welcome-header .eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}
.welcome-header h2 {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.welcome-sub {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0;
}
.welcome-actions { margin-bottom: 10px; }
.welcome-locate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .2s;
}
.welcome-locate:hover {
  background: var(--accent-2);
  box-shadow: 0 6px 18px -6px rgba(26, 77, 58, 0.5);
}
.welcome-locate:active { transform: translateY(1px); }
.welcome-locate:disabled {
  opacity: 0.6;
  cursor: progress;
}
.welcome-locate-icon { display: inline-flex; }
.welcome-locate.is-loading .welcome-locate-icon {
  animation: welcome-spin 1s linear infinite;
}
.welcome-locate-status {
  margin: 8px 2px 0;
  min-height: 18px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.4;
}
.welcome-locate-status.is-error { color: #a64242; }
.welcome-locate-status.is-success { color: var(--accent-2); }

.welcome-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.welcome-divider::before,
.welcome-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(15, 31, 26, 0.12);
}

.welcome-select-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 6px 2px;
}
.welcome-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(15, 31, 26, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232a3b34' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  transition: border-color .15s;
}
.welcome-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 77, 58, 0.15);
}

.welcome-footer {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.welcome-confirm {
  flex: 1 1 auto;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.welcome-confirm:hover { background: var(--ink-2); }
.welcome-skip {
  padding: 12px 14px;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid rgba(15, 31, 26, 0.18);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.welcome-skip:hover { color: var(--ink); border-color: rgba(15, 31, 26, 0.3); }

@keyframes welcome-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes welcome-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes welcome-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  .welcome-card { padding: 26px 22px 20px; border-radius: 14px; }
  .welcome-header h2 { font-size: 24px; }
  .welcome-footer { flex-direction: column-reverse; }
  .welcome-confirm, .welcome-skip { width: 100%; }
}

/* ============================================================
   View Transitions (progressive enhancement)
   ============================================================ */
@view-transition { navigation: auto; }
:root::view-transition-old(root),
:root::view-transition-new(root) {
  animation-duration: 280ms;
  animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
}

/* === App banner === */
.app-banner {
  position: relative;
  z-index: 60; /* above sticky header */
  background: linear-gradient(90deg, #143d2f 0%, #1a4d3a 50%, #2c6e54 100%);
  color: #fbf7ec;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.app-banner-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  line-height: 1.3;
}
.app-banner-text {
  flex: 1 1 auto;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: rgba(251, 247, 236, 0.95);
}
.app-banner-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.app-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(251, 247, 236, 0.12);
  color: #fbf7ec;
  border: 1px solid rgba(251, 247, 236, 0.22);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: background .15s, border-color .15s, transform .15s;
}
.app-banner-btn:hover {
  background: rgba(251, 247, 236, 0.2);
  border-color: rgba(251, 247, 236, 0.4);
  color: #fbf7ec;
  text-decoration: none;
}
.app-banner-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}
.app-banner-notify {
  font-size: 12px;
  color: rgba(251, 247, 236, 0.78);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}
.app-banner-notify:hover { color: #fbf7ec; }
.app-banner-close {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: rgba(251, 247, 236, 0.7);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: -6px;
  transition: background .15s, color .15s;
}
.app-banner-close:hover {
  background: rgba(251, 247, 236, 0.12);
  color: #fbf7ec;
}
@media (max-width: 720px) {
  .app-banner-inner { gap: 10px; padding: 6px 16px; }
  .app-banner-text { font-size: 12px; }
  .app-banner-notify { display: none; }
}
@media (max-width: 480px) {
  .app-banner-inner { gap: 8px; padding: 6px 12px; }
  .app-banner-btn { padding: 5px 8px; }
  .app-banner-btn-label { display: none; }
  .app-banner-icon { width: 14px; height: 14px; }
}

/* === Skeleton loaders === */
.skeleton {
  position: relative;
  display: inline-block;
  min-width: 56px;
  color: transparent !important;
  background: linear-gradient(90deg, var(--line-2) 0%, #f3eedf 50%, var(--line-2) 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shia-skeleton-shimmer 1.4s ease-in-out infinite;
  vertical-align: middle;
  user-select: none;
}
.skeleton > * { visibility: hidden; }
.skeleton::after { content: ""; }
.p-time.skeleton { min-width: 64px; height: 1.1em; }
#today-date.skeleton { min-width: 160px; height: 1.1em; }
#today-hijri.skeleton { min-width: 140px; height: 0.9em; }
#today-clock-time.skeleton { min-width: 56px; height: 1em; }
#next-prayer.skeleton { min-width: 100px; height: 1em; }
@keyframes shia-skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* === Countdown ring (today-card) === */
.today-footer { gap: 12px; }
.next-up {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  justify-content: flex-end;
}
.countdown-ring {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  color: var(--accent);
}
.countdown-ring .ring-track {
  stroke: var(--line);
  fill: none;
  stroke-width: 3;
}
.countdown-ring .ring-progress {
  stroke: currentColor;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset .6s ease;
}
.countdown-ring.pulse {
  animation: shia-ring-pulse 1.5s ease-in-out infinite;
}
@keyframes shia-ring-pulse {
  0%, 100% { transform: rotate(-90deg) scale(1); }
  50% { transform: rotate(-90deg) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .countdown-ring.pulse { animation: none; }
  .countdown-ring .ring-progress { transition: none; }
}
