        /* ======================================================================
           Prayer times — restyled onto the design tokens.

           The page previously mixed a 4px and a 5px spacing ramp, six radii
           (8/10/12/15/16/20/30), hand-rolled shadows and 10-12px body copy.
           Everything below now derives from tokens so both themes read
           correctly and the page shares one card language with the rest of
           the app.
           ====================================================================== */

        .prayer-times-container {
            max-width: var(--container-narrow);
            margin: 0 auto;
            padding-inline: var(--space-4);
            padding-block: var(--space-5) var(--space-10);
        }

        /* ---- Location ------------------------------------------------------ */

        .location-section {
            background: var(--surface-1);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            padding: var(--space-5);
            margin-bottom: var(--space-5);
            text-align: center;
            box-shadow: var(--elev-2);
        }

        .location-buttons {
            display: flex;
            gap: var(--space-3);
            justify-content: center;
            margin-top: var(--space-4);
            flex-wrap: wrap;
        }

        .location-btn {
            background: var(--primary-color);
            color: var(--on-primary);
            border: 1px solid transparent;
            border-radius: var(--radius-sm);
            padding-block: var(--space-3);
            padding-inline: var(--space-5);
            min-height: var(--tap-target);
            font-size: var(--text-base);
            font-weight: var(--weight-semibold);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: var(--space-2);
            /* `all` also animated layout properties; name what actually moves. */
            transition:
                background-color var(--transition-fast),
                border-color var(--transition-fast),
                color var(--transition-fast),
                box-shadow var(--transition-fast),
                transform var(--transition-fast);
            flex: 1;
            max-width: 220px;
            justify-content: center;
            font-family: var(--font-ui);
        }

        .location-btn:hover {
            background: var(--primary-light);
            transform: translateY(-2px);
            box-shadow: var(--elev-3);
        }

        .location-btn:active {
            transform: translateY(0);
            box-shadow: var(--elev-1);
        }

        .location-btn.secondary {
            background: rgba(var(--primary-rgb), 0.1);
            color: var(--primary-color);
            border: 1px solid rgba(var(--primary-rgb), 0.35);
        }

        .location-btn.secondary:hover {
            background: var(--primary-color);
            color: var(--on-primary);
            border-color: var(--primary-color);
        }

        .location-selected {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: var(--space-3);
        }

        .location-info {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            flex: 1;
            min-width: 0;
            text-align: start;
            font-size: var(--text-md);
            font-weight: var(--weight-semibold);
            color: var(--text-color);
        }

        .location-info i {
            color: var(--primary-color);
            flex-shrink: 0;
        }

        .reset-location-btn {
            background: var(--surface-3);
            color: var(--text-secondary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-full);
            padding-block: var(--space-2);
            padding-inline: var(--space-3);
            min-height: var(--tap-target);
            font-size: var(--text-sm);
            font-weight: var(--weight-semibold);
            font-family: var(--font-ui);
            cursor: pointer;
            flex-shrink: 0;
            transition:
                background-color var(--transition-fast),
                color var(--transition-fast),
                border-color var(--transition-fast);
        }

        .reset-location-btn:hover {
            background: var(--surface-2);
            border-color: var(--border-strong);
            color: var(--text-color);
        }

        .location-text {
            font-size: var(--text-md);
            color: var(--text-color);
            line-height: var(--leading-normal);
            margin-bottom: var(--space-3);
        }

        .location-loading {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: var(--space-2);
            font-size: var(--text-base);
            color: var(--text-secondary);
        }

        .location-loading i {
            animation: spin 1s linear infinite;
        }

        /* ---- Next prayer ---------------------------------------------------
           The focal point of the page, so it gets a real panel treatment
           instead of a bordered white box. Local foreground roles keep dark
           mode from becoming a glaring bright slab — the same technique the
           home hero uses; the global --on-primary is near-black in dark mode
           and would be unreadable here. */

        .next-prayer-highlight {
            /* Paper panel with an accent edge. These locals held white for
               the old green panel, which left .tahajjud-label invisible once
               the surface became paper. */
            --np-fg: var(--text-color);
            --np-fg-muted: var(--text-secondary);

            position: relative;
            overflow: hidden;
            background: var(--surface-1);
            border: 1px solid rgba(255, 255, 255, 0.14);
            color: var(--np-fg);
            padding: var(--space-6);
            border-radius: var(--radius-lg);
            margin-bottom: var(--space-5);
            text-align: center;
            box-shadow: var(--elev-3);
        }

        [data-theme="dark"] .next-prayer-highlight {
            --np-fg: var(--text-color);
            --np-fg-muted: var(--text-secondary);

            border-color: var(--border-color);
            background: var(--surface-1);
            box-shadow: none;
        }

        .next-prayer-highlight::before {
            content: none;
            position: absolute;
            inset-inline-end: -70px;
            inset-block-start: -90px;
            width: 220px;
            height: 220px;
            border-radius: var(--radius-full);
            background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 70%);
            pointer-events: none;
        }

        /* An <h2>: reset the UA heading metrics so it keeps its label look. */
        .next-prayer-title {
            position: relative;
            font-size: var(--text-sm);
            font-weight: var(--weight-semibold);
            letter-spacing: 0.06em;
            color: var(--np-fg-muted);
            opacity: 1;
            margin: 0 0 var(--space-2);
        }

        .next-prayer-time {
            position: relative;
            font-size: var(--text-3xl);
            font-weight: var(--weight-bold);
            line-height: var(--leading-tight);
            letter-spacing: -0.02em;
            font-feature-settings: "tnum";
            margin-bottom: var(--space-1);
        }

        .next-prayer-remaining {
            position: relative;
            font-size: var(--text-md);
            font-weight: var(--weight-medium);
            color: var(--np-fg-muted);
            opacity: 1;
        }

        .tahajjud-info {
            position: relative;
            margin-top: var(--space-5);
            padding-top: var(--space-4);
            border-top: 1px solid rgba(255, 255, 255, 0.18);
        }

        .tahajjud-label {
            font-size: var(--text-xs);
            font-weight: var(--weight-semibold);
            letter-spacing: 0.04em;
            color: var(--np-fg-muted);
            opacity: 1;
            margin-bottom: var(--space-1);
        }

        .tahajjud-time {
            font-size: var(--text-lg);
            font-weight: var(--weight-semibold);
            font-feature-settings: "tnum";
        }

        /* ---- Prayer timeline -----------------------------------------------
           Was a grid of centred boxes where every prayer looked identical.
           It now reads as a single-column timeline: icon tile, name, time — so
           the eye scans one column of times instead of hunting across a grid. */

        .prayer-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: var(--space-2);
            margin-bottom: var(--space-5);
        }

        .prayer-card {
            background: var(--surface-1);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            padding: var(--space-4);
            text-align: start;
            position: relative;
            overflow: hidden;
            display: grid;
            grid-template-columns: auto minmax(0, 1fr) auto;
            grid-template-areas:
                "icon name time"
                "icon meta time";
            align-items: center;
            column-gap: var(--space-4);
            box-shadow: var(--elev-1);
            /* Not an interactive element — no pointer affordance, no lift. */
            cursor: default;
            transition:
                border-color var(--transition-fast),
                background-color var(--transition-fast),
                box-shadow var(--transition-fast);
        }

        .prayer-card:hover {
            border-color: var(--border-strong);
            box-shadow: var(--elev-2);
        }

        /* The next prayer is distinguished by weight, fill and a start-edge
           accent bar as well as colour, so the state does not depend on hue
           alone. */
        .prayer-card.next {
            border-color: rgba(var(--primary-rgb), 0.55);
            background: rgba(var(--primary-rgb), 0.09);
            box-shadow: var(--elev-2);
        }

        .prayer-card.next::before {
            content: '';
            position: absolute;
            inset-block: 0;
            inset-inline-start: 0;
            width: 4px;
            background: var(--primary-color);
            pointer-events: none;
        }

        .prayer-card.next .prayer-name,
        .prayer-card.next .prayer-time,
        .prayer-card.next .prayer-remaining {
            color: var(--primary-color);
        }

        .prayer-card.next .prayer-name,
        .prayer-card.next .prayer-time {
            font-weight: var(--weight-bold);
        }

        .prayer-card.next .prayer-icon {
            background: rgba(var(--primary-rgb), 0.2);
            border-color: rgba(var(--primary-rgb), 0.35);
        }

        /* Was a hardcoded slate #34495e, which sat at roughly 2:1 against the
           dark surface. Tokens flip with the theme. A dashed edge marks the
           voluntary prayer without inventing a second accent colour. */
        .prayer-card.tahajjud {
            border-style: dashed;
            border-color: var(--border-strong);
            background: var(--surface-2);
        }

        .prayer-card.tahajjud .prayer-name,
        .prayer-card.tahajjud .prayer-time,
        .prayer-card.tahajjud .prayer-remaining {
            color: var(--text-color);
        }

        .prayer-name {
            grid-area: name;
            font-size: var(--text-md);
            font-weight: var(--weight-semibold);
            color: var(--text-color);
            margin-bottom: 0;
            opacity: 1;
            text-align: start;
        }

        .prayer-time {
            grid-area: time;
            font-size: var(--text-lg);
            font-weight: var(--weight-bold);
            color: var(--text-color);
            letter-spacing: -0.01em;
            font-feature-settings: "tnum";
            margin-bottom: 0;
            text-align: end;
        }

        /* Was 11px — below anything readable for body copy. */
        .prayer-remaining {
            grid-area: meta;
            font-size: var(--text-sm);
            color: var(--text-secondary);
            opacity: 1;
            margin-top: 2px;
            text-align: start;
        }

        .prayer-icon {
            grid-area: icon;
            width: 40px;
            height: 40px;
            display: grid;
            place-items: center;
            border-radius: var(--radius-sm);
            background: rgba(var(--primary-rgb), 0.1);
            border: 1px solid rgba(var(--primary-rgb), 0.16);
            color: var(--primary-color);
            font-size: 1.125rem;
            margin-bottom: 0;
            opacity: 1;
            transition:
                background-color var(--transition-fast),
                border-color var(--transition-fast);
        }

        /* ---- Qibla ---------------------------------------------------------- */

        .qibla-section {
            background: var(--surface-1);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            padding: var(--space-5);
            margin-bottom: var(--space-5);
            text-align: center;
            box-shadow: var(--elev-2);
        }

        /* An <h2>: reset the UA heading metrics. */
        .qibla-title {
            font-size: var(--text-xl);
            font-weight: var(--weight-bold);
            letter-spacing: -0.01em;
            color: var(--text-color);
            margin: 0 0 var(--space-1);
        }

        .qibla-title i {
            color: var(--primary-color);
            margin-inline-end: var(--space-1);
        }

        .qibla-subtitle {
            font-size: var(--text-base);
            color: var(--text-secondary);
            line-height: var(--leading-normal);
            margin-bottom: var(--space-5);
        }

        .qibla-compass-wrap {
            display: flex;
            justify-content: center;
            margin-bottom: var(--space-5);
        }

        .qibla-compass {
            width: 190px;
            height: 190px;
            border-radius: 50%;
            border: 2px solid rgba(var(--primary-rgb), 0.45);
            background:
                radial-gradient(circle at center, rgba(var(--primary-rgb), 0.18), rgba(var(--primary-rgb), 0.04) 70%),
                var(--surface-2);
            position: relative;
            box-shadow:
                inset 0 0 24px rgba(var(--primary-rgb), 0.14),
                var(--elev-2);
        }

        /* ------------------------------------------------------------------
           Compass internals deliberately keep PHYSICAL properties.

           The dial is a magnetic instrument: `left: 50%` + `translateX(-50%)`
           is a physical centring idiom, and the needle is rotated by an
           absolute bearing computed in JS (`rotate(${qiblaBearing - heading}deg)`)
           against a physically-fixed north marker. `transform` is never
           direction-flipped by the UA, so swapping `left` for
           `inset-inline-start` under dir="rtl" would resolve to the right edge
           while the translate still moved left — pushing every element off
           centre and desynchronising the needle from north.
           Do not convert these to logical properties.
           ------------------------------------------------------------------ */
        .qibla-north {
            position: absolute;
            top: 10px;
            left: 50%;
            transform: translateX(-50%);
            font-weight: var(--weight-bold);
            color: var(--primary-color);
            font-size: var(--text-md);
        }

        .qibla-marker {
            position: absolute;
            top: -4px;
            left: 50%;
            transform: translateX(-50%);
            color: var(--warning);
            font-size: var(--text-lg);
        }

        .qibla-needle {
            position: absolute;
            left: 50%;
            top: 14px;
            width: 4px;
            height: 80px;
            border-radius: var(--radius-full);
            /* Kept literal: a three-stop metallic amber has no token equivalent,
               and amber reads against the primary-tinted dial in both themes. */
            background: linear-gradient(to bottom, #d4820a 0%, #f9d423 70%, rgba(212, 130, 10, 0.2) 100%);
            transform-origin: 50% 82px;
            transform: translateX(-50%) rotate(0deg);
            transition: transform 0.18s linear;
            box-shadow: 0 0 10px rgba(212, 130, 10, 0.45);
        }

        .qibla-center-dot {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: var(--primary-color);
            transform: translate(-50%, -50%);
            /* Surface-coloured, not --on-primary: in dark mode --on-primary is
               near-black and the separating ring disappeared into the dial. */
            border: 2px solid var(--surface-1);
            box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.22);
        }

        .qibla-meta {
            font-size: var(--text-base);
            line-height: var(--leading-normal);
            color: var(--text-color);
            background: rgba(var(--primary-rgb), 0.08);
            border: 1px solid rgba(var(--primary-rgb), 0.18);
            border-radius: var(--radius-sm);
            padding-block: var(--space-3);
            padding-inline: var(--space-4);
            margin-bottom: var(--space-3);
        }

        .qibla-permission-btn {
            margin-top: var(--space-2);
            max-width: 240px;
            margin-inline: auto;
        }

        .qibla-calibration {
            display: none;
            grid-template-columns: 110px 1fr;
            align-items: center;
            column-gap: var(--space-3);
            background: rgba(var(--primary-rgb), 0.06);
            border: 1px dashed rgba(var(--primary-rgb), 0.28);
            border-radius: var(--radius-sm);
            padding: var(--space-3);
            margin-bottom: var(--space-3);
        }

        .qibla-calibration.active {
            display: grid;
        }

        .qibla-eight-track {
            width: 110px;
            height: 56px;
            position: relative;
            flex-shrink: 0;
        }

        /* Same reasoning as the compass above: `left: 50%` here pairs with a
           `translate(-50%, …)` centring transform, which the UA never flips for
           RTL, so these stay physical. */
        .qibla-eight-track::before {
            content: '∞';
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -56%);
            font-size: 78px;
            line-height: 1;
            color: rgba(var(--primary-rgb), 0.32);
            font-weight: var(--weight-bold);
            letter-spacing: -5px;
            /* A white lift only makes sense on a light surface. */
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
        }

        [data-theme="dark"] .qibla-eight-track::before {
            text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
        }

        .qibla-eight-track::after {
            content: '';
            position: absolute;
            inset-inline: 8px;
            top: 26px;
            height: 2px;
            border-radius: var(--radius-full);
            background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.26), transparent);
        }

        .qibla-phone-dot {
            position: absolute;
            width: 18px;
            height: 30px;
            border-radius: var(--radius-xs);
            background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
            box-shadow: 0 5px 12px rgba(var(--primary-rgb), 0.35);
            top: 10px;
            /* Physical: the figure-8 keyframes translate this dot along a fixed
               path, so its origin must not flip with the writing direction. */
            right: 47px;
            animation: qiblaFigureEight 2s ease-in-out infinite;
            border: 1px solid rgba(255, 255, 255, 0.45);
        }

        .qibla-phone-dot::before {
            content: '';
            position: absolute;
            width: 8px;
            height: 2px;
            border-radius: var(--radius-full);
            background: rgba(255, 255, 255, 0.65);
            top: 3px;
            /* Physical centring idiom paired with translateX(-50%). */
            left: 50%;
            transform: translateX(-50%);
        }

        .qibla-phone-dot::after {
            content: '';
            position: absolute;
            width: 4px;
            height: 4px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.75);
            bottom: 3px;
            /* Physical centring idiom paired with translateX(-50%). */
            left: 50%;
            transform: translateX(-50%);
        }

        .qibla-calibration-text {
            font-size: var(--text-sm);
            line-height: var(--leading-snug);
            color: var(--text-secondary);
            text-align: start;
            margin: 0 0 var(--space-2);
        }

        .qibla-calibration-content {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: var(--space-1);
            min-width: 0;
        }

        .qibla-calibration-actions {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            justify-content: flex-start;
            flex-wrap: wrap;
        }

        .qibla-calibration-btn {
            border: 1px solid transparent;
            border-radius: var(--radius-sm);
            background: var(--primary-color);
            color: var(--on-primary);
            font-size: var(--text-sm);
            font-weight: var(--weight-bold);
            line-height: 1.2;
            padding-block: var(--space-2);
            padding-inline: var(--space-4);
            min-height: 38px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            white-space: nowrap;
            transition:
                background-color var(--transition-fast),
                box-shadow var(--transition-fast);
        }

        .qibla-calibration-btn:hover {
            background: var(--primary-light);
        }

        .qibla-calibration-btn:disabled {
            opacity: 0.75;
            cursor: default;
        }

        .qibla-recalibrate-btn {
            margin-block: var(--space-1) var(--space-2);
            margin-inline: auto;
            min-width: 150px;
            display: inline-flex;
        }

        .qibla-calibration-controls {
            display: flex;
            justify-content: center;
            gap: var(--space-2);
            flex-wrap: wrap;
            margin-bottom: var(--space-2);
        }

        .qibla-toggle-btn {
            min-width: 150px;
        }

        .qibla-calibration-countdown {
            font-size: var(--text-sm);
            font-weight: var(--weight-bold);
            color: var(--primary-color);
            min-width: 60px;
            text-align: center;
            font-feature-settings: "tnum";
        }

        @media (max-width: 520px) {
            .qibla-calibration {
                grid-template-columns: 1fr;
                row-gap: var(--space-2);
                padding-block: var(--space-3);
                padding-inline: var(--space-2);
            }

            .qibla-eight-track {
                margin: 0 auto;
            }

            .qibla-calibration-content {
                align-items: center;
            }

            .qibla-calibration-text {
                text-align: center;
                margin-bottom: var(--space-2);
            }

            .qibla-calibration-actions {
                justify-content: center;
            }

            .qibla-calibration-btn {
                min-width: 128px;
            }
        }

        @keyframes qiblaFigureEight {
            0% {
                transform: translate(0, 0) rotate(-14deg);
            }

            25% {
                transform: translate(30px, -10px) rotate(8deg);
            }

            50% {
                transform: translate(0, 0) rotate(18deg);
            }

            75% {
                transform: translate(-30px, 10px) rotate(-8deg);
            }

            100% {
                transform: translate(0, 0) rotate(-14deg);
            }
        }

        /* ---- States --------------------------------------------------------- */

        /* Was an opaque light-red panel (#ffebee / #c62828) with no dark
           override, so in dark mode it rendered as a bright block. */
        .error-message {
            background: var(--danger-surface);
            border: 1px solid var(--danger);
            border-radius: var(--radius-lg);
            padding: var(--space-5);
            text-align: center;
            font-size: var(--text-base);
            line-height: var(--leading-normal);
            color: var(--danger);
            margin-bottom: var(--space-5);
        }

        .retry-btn {
            background: var(--danger);
            color: var(--on-primary);
            border: none;
            border-radius: var(--radius-sm);
            padding-block: var(--space-2);
            padding-inline: var(--space-5);
            min-height: var(--tap-target);
            font-size: var(--text-base);
            font-weight: var(--weight-semibold);
            font-family: var(--font-ui);
            cursor: pointer;
            margin-top: var(--space-3);
            transition: opacity var(--transition-fast);
        }

        .retry-btn:hover {
            opacity: 0.88;
        }

        .loading-spinner {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: var(--space-10);
            color: var(--text-secondary);
            width: 100%;
            min-height: 200px;
            font-family: var(--font-ui);
        }

        .loading-spinner i {
            animation: spin 1s linear infinite;
            font-size: 1.5rem;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        @media (max-width: 768px) {
            .prayer-times-container {
                padding-inline: var(--space-3);
                padding-block: var(--space-4) var(--space-8);
            }

            .qibla-compass {
                width: 170px;
                height: 170px;
            }

            .qibla-needle {
                height: 70px;
                transform-origin: 50% 72px;
            }

            .prayer-card {
                padding-block: var(--space-3);
                padding-inline: var(--space-4);
                column-gap: var(--space-3);
            }

            .prayer-icon {
                width: 36px;
                height: 36px;
                font-size: 1rem;
            }

            .prayer-name {
                font-size: var(--text-base);
            }

            .prayer-time {
                font-size: var(--text-md);
            }

            .prayer-remaining {
                font-size: var(--text-xs);
            }
        }

        /* ---- Country picker -------------------------------------------------- */

        .country-modal-content {
            background: var(--surface-1);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            max-width: 500px;
            width: 90%;
            max-height: 80vh;
            overflow: hidden;
            box-shadow: var(--elev-5);
            animation: modalSlideUp var(--duration-slow) var(--ease-out);
        }

        .country-modal-content .modal-header {
            padding: var(--space-5);
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: var(--space-3);
        }

        .country-modal-content h2 {
            margin: 0;
            color: var(--text-color);
            font-size: var(--text-lg);
            font-weight: var(--weight-bold);
            letter-spacing: -0.01em;
        }

        .modal-close-btn {
            background: var(--surface-2);
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
            font-size: var(--text-lg);
            cursor: pointer;
            padding: 0;
            width: var(--tap-target);
            height: var(--tap-target);
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            transition:
                background-color var(--transition-fast),
                color var(--transition-fast),
                border-color var(--transition-fast),
                transform var(--transition-fast);
            border-radius: 50%;
        }

        .modal-close-btn:hover {
            background: var(--surface-3);
            border-color: var(--border-strong);
            color: var(--text-color);
        }

        .modal-close-btn:active {
            transform: scale(0.92);
        }

        .country-list {
            /* The panel is capped at 80vh; a fixed 400px list overflowed it on
               landscape phones and the bottom entries were unreachable. */
            max-height: min(400px, 50vh);
            overflow-y: auto;
            padding: 0;
        }

        .country-search-wrap {
            padding-block: var(--space-3);
            padding-inline: var(--space-4);
            border-bottom: 1px solid var(--border-color);
            background: var(--surface-1);
        }

        .country-search {
            width: 100%;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            background: var(--surface-2);
            color: var(--text-color);
            padding-block: var(--space-3);
            padding-inline: var(--space-4);
            /* 16px minimum so iOS does not zoom the page on focus. */
            font-size: var(--text-md);
            font-family: inherit;
            transition:
                border-color var(--transition-fast),
                box-shadow var(--transition-fast);
        }

        .country-search:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.15);
        }

        /* Replaces a bare `outline: none`, which left keyboard users with only
           a 2px tinted glow that disappears against the primary-tinted panel. */
        .country-search:focus-visible {
            outline: 2px solid var(--primary-color);
            outline-offset: 2px;
        }

        .country-empty {
            text-align: center;
            color: var(--text-secondary);
            font-size: var(--text-base);
            padding-block: var(--space-5);
            padding-inline: var(--space-3);
        }

        /* Rendered as a real <button> — these resets keep the previous <div>
           layout while gaining keyboard activation and button semantics. */
        .country-item {
            display: flex;
            align-items: center;
            width: 100%;
            padding-block: var(--space-4);
            padding-inline: var(--space-5);
            min-height: var(--tap-target);
            cursor: pointer;
            transition:
                background-color var(--transition-fast),
                color var(--transition-fast);
            background: none;
            border: none;
            border-block-end: 1px solid var(--border-color);
            font: inherit;
            font-size: var(--text-md);
            font-weight: var(--weight-medium);
            color: var(--text-color);
            text-align: start;
        }

        .country-item:hover {
            background: var(--surface-2);
        }

        .country-item:active {
            background: var(--surface-3);
        }

        .country-item i {
            font-size: 1.25rem;
            color: var(--text-secondary);
            margin-inline-end: var(--space-3);
        }

        .country-item span {
            color: var(--text-color);
            font-size: var(--text-md);
            font-weight: var(--weight-medium);
        }

        .country-item .country-check {
            margin-inline-start: auto;
            color: var(--primary-color);
            opacity: 0;
            transition: opacity var(--transition-fast);
        }

        .country-item.active .country-check {
            opacity: 1;
        }

        /* --primary-color-rgb never existed, so this always fell back to the
           stock green regardless of the user's chosen accent. */
        .country-item.active {
            background: rgba(var(--primary-rgb), 0.12);
            border-inline-start: 3px solid var(--primary-color);
            font-weight: var(--weight-semibold);
        }

        @keyframes modalSlideUp {
            from {
                opacity: 0;
                transform: translateY(20px) scale(0.95);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        /* ==================================================================
           Prayer rows — each prayer as a window (start → end), plus the day
           navigator and the disliked-time rows beneath the list.
           ================================================================== */

        .day-nav {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            padding: var(--space-2) var(--space-3);
            margin-bottom: var(--space-3);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            background: var(--surface-1);
        }

        .day-nav-btn {
            flex: 0 0 auto;
            width: var(--tap-target, 44px);
            height: var(--tap-target, 44px);
            display: grid;
            place-items: center;
            border: 1px solid var(--border-color);
            border-radius: 50%;
            background: var(--surface-2);
            color: var(--primary-dark);
            font-size: 1rem;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
        }

        .day-nav-btn:hover { background: var(--green-50); border-color: var(--green-200); }
        .day-nav-btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }

        .day-nav-label {
            flex: 1 1 auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            min-width: 0;
        }

        .day-nav-date {
            font-size: var(--text-md);
            font-weight: var(--weight-semibold);
            color: var(--text-color);
        }

        .day-nav-hijri {
            font-size: var(--text-xs);
            color: var(--text-muted);
        }

        .day-nav-today {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin: 0 auto var(--space-4);
            padding: var(--space-2) var(--space-4);
            border: 1px solid var(--green-200);
            border-radius: 999px;
            background: var(--green-50);
            color: var(--primary-dark);
            font: inherit;
            font-size: var(--text-base);
            font-weight: var(--weight-medium);
            cursor: pointer;
        }

        .day-nav-today:focus-visible { box-shadow: var(--focus-ring); outline: none; }

        .prayer-row {
            display: flex;
            align-items: center;
            gap: var(--space-4);
            padding: var(--space-3) var(--space-4);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            background: var(--surface-1);
            transition: border-color 0.15s, background 0.15s;
        }

        .prayer-row-icon {
            flex: 0 0 auto;
            width: 40px;
            height: 40px;
            display: grid;
            place-items: center;
            border-radius: 50%;
            background: var(--green-50);
            color: var(--primary-color);
            font-size: 1.05rem;
        }

        .prayer-row-body {
            flex: 1 1 auto;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .prayer-row-name {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            font-size: var(--text-md);
            font-weight: var(--weight-semibold);
            color: var(--text-color);
        }

        .prayer-row-badge {
            padding: 1px 8px;
            border-radius: 999px;
            background: var(--success-surface);
            color: var(--success);
            font-size: var(--text-2xs);
            font-weight: var(--weight-medium);
        }

        .prayer-row-range {
            font-size: var(--text-xs);
            color: var(--text-muted);
        }

        .prayer-row-times {
            flex: 0 0 auto;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 2px;
            text-align: end;
        }

        .prayer-row-start {
            font-size: var(--text-lg);
            font-weight: var(--weight-bold);
            color: var(--primary-dark);
            font-variant-numeric: tabular-nums;
            white-space: nowrap;
        }

        .prayer-row-remaining {
            font-size: var(--text-xs);
            color: var(--secondary-color);
            white-space: nowrap;
        }

        /* The window the clock is inside right now. */
        .prayer-row.is-current {
            border-color: var(--green-300);
            background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(var(--primary-rgb), 0.02));
        }

        .prayer-row.is-current .prayer-row-icon {
            background: var(--primary-color);
            color: var(--on-primary);
        }

        /* The one coming up next. */
        .prayer-row.next {
            border-color: var(--secondary-color);
        }

        .prayer-row.next .prayer-row-icon {
            background: var(--warning-surface);
            color: var(--warning);
        }

        /* Sunrise is a boundary, not a prayer. */
        .prayer-row.is-moment {
            background: var(--surface-2);
        }

        .prayer-row.is-moment .prayer-row-start {
            color: var(--text-secondary);
        }

        .prayer-row.tahajjud {
            border-style: dashed;
        }

        /* Disliked times ---------------------------------------------------- */
        .forbidden-section {
            padding: var(--space-4);
            margin-bottom: var(--space-5);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            background: var(--surface-1);
        }

        .forbidden-title {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            margin: 0 0 var(--space-1);
            font-size: var(--text-md);
            font-weight: var(--weight-bold);
            color: var(--text-color);
        }

        .forbidden-title > i { color: var(--danger); }

        .forbidden-note {
            margin: 0 0 var(--space-3);
            font-size: var(--text-xs);
            color: var(--text-muted);
            line-height: var(--leading-snug);
        }

        .forbidden-list {
            display: flex;
            flex-direction: column;
            gap: var(--space-2);
        }

        .forbidden-row {
            padding: var(--space-3);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            background: var(--surface-2);
        }

        .forbidden-row.is-active {
            border-color: var(--danger);
            background: var(--danger-surface);
        }

        .forbidden-row-head {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: var(--space-3);
        }

        .forbidden-row-label {
            font-size: var(--text-base);
            font-weight: var(--weight-semibold);
            color: var(--text-color);
        }

        .forbidden-row-time {
            font-size: var(--text-base);
            color: var(--text-secondary);
            font-variant-numeric: tabular-nums;
            white-space: nowrap;
        }

        .forbidden-row.is-active .forbidden-row-label,
        .forbidden-row.is-active .forbidden-row-time {
            color: var(--danger);
        }

        .forbidden-row-note {
            margin-top: 2px;
            font-size: var(--text-xs);
            color: var(--text-muted);
        }

        /* Qibla guidance ---------------------------------------------------- */
        .qibla-guidance {
            margin-block: var(--space-3) var(--space-2);
            padding: var(--space-3) var(--space-4);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            background: var(--surface-2);
            color: var(--text-secondary);
            font-size: var(--text-md);
            font-weight: var(--weight-semibold);
            text-align: center;
            transition: background 0.2s, color 0.2s, border-color 0.2s;
        }

        .qibla-guidance.is-aligned {
            border-color: var(--success);
            background: var(--success-surface);
            color: var(--success);
        }

        .qibla-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: var(--space-2);
            margin-block-end: var(--space-3);
        }

        .qibla-stat {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            padding: var(--space-3) var(--space-2);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            background: var(--surface-1);
        }

        .qibla-stat-value {
            font-size: var(--text-base);
            font-weight: var(--weight-bold);
            color: var(--primary-dark);
            font-variant-numeric: tabular-nums;
            text-align: center;
        }

        .qibla-stat-label {
            font-size: var(--text-2xs);
            color: var(--text-muted);
            text-align: center;
        }

        /* The dial itself confirms the lock, so the phone can be glanced at. */
        .qibla-compass.is-aligned {
            box-shadow: 0 0 0 3px var(--success), 0 0 24px rgba(27, 127, 59, 0.35);
        }

        @media (prefers-reduced-motion: reduce) {
            .qibla-guidance { transition: none; }
        }

/* ---- Location hint + inline day error ---------------------------------- */
.location-hint {
    margin: var(--space-3) 0 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
}

.prayer-grid-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-4);
    color: var(--text-secondary);
    text-align: center;
    font-size: var(--text-sm);
}

.prayer-grid-error i {
    font-size: 1.6rem;
}
