/* =============================================================
   SalatiPal — Qibla calculation-method toggle
   Great Circle (shortest path / initial bearing) vs
   Rhumb Line (constant compass bearing / loxodrome).
   Paired with qibla-method.js. Gated on body[data-sp-route].
   Reuses the enhanced-theme tokens (--sp-emerald-*, --sp-gold-*,
   --sp-grad-hero, --sp-sh-*) defined in ui-lift.css.
   Safe to remove: drop the <link> from index.html.
   ============================================================= */

.sp-qm-card {
  font-family: var(--sp-font, 'Outfit', system-ui, sans-serif);
  background: var(--sp-surface, #fff);
  border: 1px solid var(--sp-line, #E4ECEA);
  border-radius: 18px;
  box-shadow: var(--sp-sh-2, 0 4px 10px -2px rgba(6,78,59,.07));
  padding: 14px 16px 16px;
  margin: 0 auto 16px;
  max-width: 28rem;            /* matches the compass card (max-w-md) */
  width: 100%;
}

/* On settings the card spans the section column */
body[data-sp-route="settings"] .sp-qm-card { max-width: none; margin-bottom: 14px; }

.sp-qm-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.sp-qm-title {
  font-family: var(--sp-font-head, var(--sp-font));
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--sp-ink, #0F1F1C);
}
.sp-qm-ico {
  width: 18px; height: 18px;
  color: var(--sp-emerald-600, #059669);
  flex: 0 0 auto;
}
.sp-qm-sub {
  font-size: 12.5px;
  line-height: 1.5;
  color: #5b6b66;
  margin: 0 0 12px;
}

/* ---- native select (replaces the old segmented toggle, 2026-06-06) ----
   A real <select> so iOS shows its native wheel picker; styled to sit
   alongside the other Settings dropdowns. */
.sp-qm-selectwrap {
  position: relative;
}
.sp-qm-select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 40px 0 14px;
  border: 1px solid var(--sp-line, #E4ECEA);
  border-radius: 12px;
  background: var(--sp-surface, #fff);
  font-family: inherit;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--sp-ink, #0F1F1C);
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sp-qm-select:focus-visible {
  outline: 2px solid var(--sp-gold-400, #E5A93F);
  outline-offset: 2px;
}
/* chevron */
.sp-qm-selectwrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  pointer-events: none;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* ---- dark mode (.dark / html.dark class strategy) ---- */
html.dark .sp-qm-card, .dark .sp-qm-card {
  background: #0F1F1C;
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 4px 14px -4px rgba(0,0,0,.5);
}
html.dark .sp-qm-title, .dark .sp-qm-title { color: #ECFDF5; }
html.dark .sp-qm-sub, .dark .sp-qm-sub { color: #9bb3ac; }
html.dark .sp-qm-select, .dark .sp-qm-select {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.09);
  color: #ECFDF5;
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .sp-qm-thumb { transition: none; }
}
