/* Public pages only (home page with prayer times, month table).
   Loaded by includes/public_layout.php and by no staff page. Flat design, same colours as the login page. */

:root {
    --ph-primary: #1e475d;
    --ph-primary-700: #183a4c;
    --ph-primary-800: #132e3c;
    --ph-primary-50: #eef3f6;
    --ph-primary-100: #d5e1e8;
    --ph-primary-200: #aec5d1;
    --ph-canvas: #f4f6f8;
    --ph-card: #ffffff;
    --ph-text: #0f172a;
    --ph-muted: #5b6875;
    --ph-border: #e3e8ec;
    --ph-border-strong: #cbd4db;
    --ph-radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

.ph-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ph-text);
    background: var(--ph-canvas);
    -webkit-font-smoothing: antialiased;
}

.ph-wrap {
    width: 100%;
    max-width: 60rem;
    margin: 0 auto;
    padding-inline: 1rem;
}

.ph-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ph-skip {
    position: absolute;
    inset-inline-start: .5rem;
    top: -4rem;
    z-index: 10;
    padding: .5rem .9rem;
    border-radius: 8px;
    background: #fff;
    color: var(--ph-primary);
    font-weight: 700;
    text-decoration: none;
}
.ph-skip:focus { top: .5rem; }

.ph-ico {
    width: 1.15em;
    height: 1.15em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

a:focus-visible, button:focus-visible {
    outline: 3px solid #f0b429;
    outline-offset: 2px;
}

/* ---------- top bar ---------- */
.ph-top {
    background: var(--ph-primary);
    color: #fff;
}
.ph-top-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 4rem;
    padding-block: .6rem;
}
.ph-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}
.ph-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: none;
    padding: .3rem;
    border-radius: 10px;
    background: var(--ph-primary-800);
    border: 1px solid rgba(255, 255, 255, .14);
}
.ph-brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ph-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ph-brand-name { font-size: .95rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-brand-sub { font-size: .75rem; color: rgba(255, 255, 255, .78); }

.ph-login {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex: none;
    min-height: 2.75rem;
    padding: .45rem 1rem;
    border-radius: 10px;
    background: #fff;
    color: var(--ph-primary);
    font-size: .95rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease;
}
.ph-login:hover { background: var(--ph-primary-50); }

/* ---------- main ---------- */
.ph-main {
    flex: 1 0 auto;
    padding-block: 1.25rem 2rem;
}

.ph-card {
    background: var(--ph-card);
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius);
    padding: 1rem;
    margin-top: 1rem;
}
.ph-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
}
.ph-card-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.ph-card-note { font-size: .8rem; color: var(--ph-muted); }

.ph-sep { margin-inline: .45rem; opacity: .6; }

/* ---------- next prayer ---------- */
.ph-hero {
    background: var(--ph-primary);
    color: #fff;
    border-radius: var(--ph-radius);
    padding: 1.4rem 1rem 1.5rem;
    text-align: center;
}
.ph-hero p { margin: 0; }
.ph-hero-date { font-size: .9rem; color: rgba(255, 255, 255, .85); }
.ph-hero-label {
    margin-top: 1rem !important;
    font-size: .9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .78);
}
.ph-hero-name {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.25;
}
.ph-hero-tomorrow {
    display: inline-block;
    margin-inline-start: .4rem;
    padding: .05rem .6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: .85rem;
    font-weight: 600;
    vertical-align: middle;
}
.ph-hero-tomorrow[hidden] { display: none; }
.ph-hero-time { font-size: 1.35rem; font-weight: 600; color: rgba(255, 255, 255, .92); }
.ph-hero-count {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem !important;
    padding: .55rem 1.4rem .6rem;
    border-radius: 12px;
    background: var(--ph-primary-800);
    border: 1px solid rgba(255, 255, 255, .12);
}
.ph-hero-count-label { font-size: .78rem; color: rgba(255, 255, 255, .78); }
.ph-count {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

/* ---------- today's times ---------- */
.ph-times {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
}
.ph-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    padding: .7rem .4rem;
    border: 1px solid var(--ph-border);
    border-radius: 12px;
    background: #fff;
    text-align: center;
}
.ph-time-name { font-size: .9rem; font-weight: 600; color: var(--ph-muted); }
.ph-time-val { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-ap { font-size: .8rem; font-weight: 600; color: var(--ph-muted); }
.ph-time.is-past { background: var(--ph-canvas); }
.ph-time.is-past .ph-time-val { color: var(--ph-muted); font-weight: 600; }
.ph-time.is-next {
    background: var(--ph-primary-50);
    border-color: var(--ph-primary);
    box-shadow: inset 0 0 0 1px var(--ph-primary);
}
.ph-time.is-next .ph-time-name, .ph-time.is-next .ph-ap { color: var(--ph-primary); }
.ph-time.is-next .ph-time-val { color: var(--ph-primary); }
.ph-time.is-sunrise { border-style: dashed; }

/* ---------- buttons ---------- */
.ph-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1rem;
}
.ph-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.9rem;
    padding: .5rem 1.1rem;
    border: 1px solid var(--ph-primary);
    border-radius: 10px;
    background: var(--ph-primary);
    color: #fff;
    font: inherit;
    font-size: .95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease;
}
.ph-btn:hover { background: var(--ph-primary-700); }
.ph-btn[hidden] { display: none; }
.ph-btn-ghost { background: #fff; color: var(--ph-primary); border-color: var(--ph-border-strong); }
.ph-btn-ghost:hover { background: var(--ph-primary-50); }
.ph-actions .ph-btn { flex: 1 1 14rem; }

/* ---------- notice ---------- */
.ph-notice { text-align: center; padding: 2rem 1rem; }
.ph-notice p { margin: 0; }
.ph-notice-title { font-size: 1.1rem; font-weight: 700; }
.ph-notice-text { margin-top: .4rem !important; color: var(--ph-muted); }

/* ---------- month table ---------- */
.ph-month-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.ph-month-title { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.4; }
.ph-month-sub { margin: 0; font-size: .9rem; color: var(--ph-muted); }
.ph-month-sub span:last-child { white-space: nowrap; }
.ph-month-tools { display: flex; gap: .5rem; }
.ph-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: 1rem;
}
.ph-month-step {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .35rem .8rem;
    border: 1px solid var(--ph-border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--ph-primary);
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
}
.ph-month-step:hover { background: var(--ph-primary-50); }
.ph-estimate {
    margin: 1rem 0 0;
    padding: .6rem .9rem;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    color: #7c4a03;
    font-size: .9rem;
}
.ph-table-card { padding: 0; overflow: hidden; }
.ph-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    font-size: .95rem;
}
.ph-table th, .ph-table td {
    padding: .5rem .35rem;
    text-align: center;
    border-bottom: 1px solid var(--ph-border);
    white-space: nowrap;
}
.ph-table thead th {
    background: var(--ph-primary);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
}
.ph-table tbody th { font-weight: 600; text-align: start; padding-inline-start: .8rem; }
.ph-table tbody tr:last-child th, .ph-table tbody tr:last-child td { border-bottom: 0; }
.ph-day-num { display: inline-block; min-width: 1.4em; font-weight: 800; }
.ph-day-name { color: var(--ph-muted); font-weight: 600; }
.ph-col-hijri { color: var(--ph-muted); font-size: .88rem; }
.ph-col-sunrise { color: var(--ph-muted); }
.ph-table thead .ph-col-sunrise { color: rgba(255, 255, 255, .85); }
.ph-table tr.is-friday th, .ph-table tr.is-friday td { background: #f7f9fa; }
.ph-table tr.is-today th, .ph-table tr.is-today td {
    background: var(--ph-primary-50);
    font-weight: 800;
    color: var(--ph-primary);
    border-block: 2px solid var(--ph-primary);
}
.ph-table tr.is-today .ph-day-name, .ph-table tr.is-today .ph-col-hijri { color: var(--ph-primary); }
.ph-table-note { margin: .7rem 0 0; font-size: .85rem; color: var(--ph-muted); }

/* ---------- footer ---------- */
.ph-foot {
    flex: none;
    border-top: 1px solid var(--ph-border);
    background: #fff;
    padding-block: 1rem;
    text-align: center;
}
.ph-foot-line { margin: 0; font-size: .85rem; color: var(--ph-text); }
.ph-foot-muted { margin-top: .2rem; color: var(--ph-muted); }
.ph-foot a { color: var(--ph-primary); font-weight: 700; }

/* ---------- phones ---------- */
@media (max-width: 420px) {
    .ph-brand-name { font-size: .82rem; white-space: normal; line-height: 1.35; }
    .ph-brand-sub { display: none; }
    .ph-brand-logo { width: 2.5rem; height: 2.5rem; }
    .ph-login { padding-inline: .7rem; font-size: .88rem; }
    .ph-hero-name { font-size: 2.3rem; }
    .ph-time-val { font-size: 1.15rem; }
}
@media (max-width: 640px) {
    .ph-table { font-size: .82rem; }
    .ph-table th, .ph-table td { padding: .45rem .12rem; }
    .ph-table thead th { font-size: .78rem; }
    .ph-table tbody th { padding-inline-start: .4rem; }
    .ph-col-hijri { display: none; }
    .ph-day-name { font-size: .74rem; }
    .ph-month-tools { width: 100%; }
    .ph-month-tools .ph-btn { flex: 1 1 0; }
}

/* ---------- wide screens ---------- */
@media (min-width: 768px) {
    .ph-main { padding-block: 2rem 3rem; }
    .ph-card { padding: 1.4rem; }
    .ph-table-card { padding: 0; }
    .ph-hero { padding: 2.2rem 1.5rem 2.4rem; }
    .ph-hero-name { font-size: 3.4rem; }
    .ph-hero-time { font-size: 1.6rem; }
    .ph-count { font-size: 2.5rem; }
    .ph-times { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .8rem; }
    .ph-time { padding: 1rem .5rem; }
    .ph-time-val { font-size: 1.45rem; }
    .ph-actions .ph-btn { flex: 0 0 auto; }
    .ph-brand-name { font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ---------- printing the month table ---------- */
@media print {
    @page { size: A4 portrait; margin: 12mm; }
    .ph-body { background: #fff; display: block; min-height: 0; font-size: 11pt; }
    .ph-noprint, .ph-login, .ph-skip, .ph-foot-muted { display: none !important; }
    .ph-top { background: #fff; color: #000; border-bottom: 2px solid #000; }
    .ph-brand-logo { display: none; }
    .ph-brand-sub { color: #000; }
    .ph-main { padding-block: 4mm 0; }
    .ph-wrap { max-width: none; padding-inline: 0; }
    .ph-card { border: 0; border-radius: 0; margin-top: 3mm; }
    .ph-table { font-size: 10pt; }
    .ph-table th, .ph-table td { padding: 1.1mm 1mm; border: 1px solid #555; }
    .ph-table thead th { background: #e6e6e6 !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ph-table thead .ph-col-sunrise { color: #000; }
    .ph-col-hijri { display: table-cell !important; color: #000; }
    .ph-day-name, .ph-col-sunrise { color: #000; }
    .ph-table tr.is-today th, .ph-table tr.is-today td { background: #fff; color: #000; font-weight: 600; border: 1px solid #555; }
    .ph-table tr.is-today .ph-day-name, .ph-table tr.is-today .ph-col-hijri { color: #000; }
    .ph-table tr.is-friday th, .ph-table tr.is-friday td { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ph-foot { border: 0; padding: 2mm 0 0; }
    .ph-table tr { break-inside: avoid; }
}

/* =====================================================================================
   Step B: page tabs, the mosques list, one mosque, the map
   ===================================================================================== */

/* ---------- tabs under the top bar ---------- */
.ph-nav {
    background: #fff;
    border-bottom: 1px solid var(--ph-border);
}
.ph-nav-in {
    display: flex;
    gap: .25rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.ph-nav-in::-webkit-scrollbar { display: none; }
.ph-nav-link {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: 2.9rem;
    padding: .3rem .95rem;
    border-bottom: 3px solid transparent;
    color: var(--ph-muted);
    font-size: .95rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.ph-nav-link:hover { color: var(--ph-primary); }
.ph-nav-link.is-active { color: var(--ph-primary); border-bottom-color: var(--ph-primary); }

.ph-page-title { margin: 0 0 .8rem; font-size: 1.4rem; font-weight: 800; line-height: 1.4; }

/* ---------- search ---------- */
.ph-search { display: flex; gap: .5rem; }
.ph-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2.9rem;
    padding: .45rem .9rem;
    border: 1px solid var(--ph-border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--ph-text);
    font: inherit;
    font-size: 1rem;
}
.ph-input:focus { outline: 3px solid rgba(30, 71, 93, .3); outline-offset: 0; border-color: var(--ph-primary); }
.ph-search .ph-btn { flex: none; }
.ph-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.ph-tools .ph-btn { flex: 1 1 9rem; }
.ph-btn[disabled] { opacity: .6; cursor: progress; }
.ph-btn-ghost.is-on { background: var(--ph-primary-50); border-color: var(--ph-primary); }
.ph-status { margin: .6rem 0 0; min-height: 1.3rem; font-size: .88rem; color: var(--ph-primary); font-weight: 600; }
.ph-status:empty { display: none; }
.ph-list-count { margin: .7rem 0 .4rem; font-size: .88rem; color: var(--ph-muted); }   /* "عرض 30 من 577" (not the home countdown .ph-count) */

/* ---------- the map ---------- */
.ph-map-box {
    height: 22rem;
    max-height: 60vh;
    margin-top: .7rem;
    border: 1px solid var(--ph-border-strong);
    border-radius: var(--ph-radius);
    overflow: hidden;
    background: #e8edf0;
    direction: ltr;
}
.ph-map-box[hidden] { display: none; }
.ph-map-box .leaflet-container { font: inherit; }
.ph-pop { display: flex; flex-direction: column; gap: .35rem; min-width: 9rem; direction: rtl; text-align: right; font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif; }
.ph-pop-name { color: var(--ph-primary); font-size: .95rem; font-weight: 800; text-decoration: none; line-height: 1.5; }
.ph-pop-dir { align-self: flex-start; padding: .15rem .7rem; border-radius: 8px; background: var(--ph-primary); color: #fff !important; font-size: .82rem; font-weight: 700; text-decoration: none; }

/* ---------- the list of mosques ---------- */
.ph-mosques { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ph-m {
    display: flex;
    align-items: stretch;
    gap: .5rem;
    padding: .2rem .2rem .2rem .7rem;
    border: 1px solid var(--ph-border);
    border-radius: 12px;
    background: #fff;
}
.ph-m[hidden] { display: none; }
.ph-m-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: .55rem .6rem;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
}
.ph-m-main:hover { background: var(--ph-primary-50); }
.ph-m-name { font-size: 1rem; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.ph-m-place { font-size: .85rem; color: var(--ph-muted); }
.ph-m-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem 0 0; }
.ph-tag {
    display: inline-block;
    padding: 0 .55rem;
    border: 1px solid var(--ph-primary-200);
    border-radius: 999px;
    background: var(--ph-primary-50);
    color: var(--ph-primary);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.7;
}
.ph-tag-soft { background: #fff; border-color: var(--ph-border-strong); color: var(--ph-text); font-weight: 600; }
.ph-tag-warn { background: #fffbeb; border-color: #fde68a; color: #7c4a03; }
.ph-m-side {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: .3rem;
}
.ph-m-dist { font-size: .88rem; font-weight: 800; color: var(--ph-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-m-dist:empty { display: none; }
.ph-m-dir {
    display: inline-flex;
    align-items: center;
    min-height: 2.4rem;
    padding: .2rem .75rem;
    border: 1px solid var(--ph-border-strong);
    border-radius: 9px;
    color: var(--ph-primary);
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.ph-m-dir:hover { background: var(--ph-primary-50); }
.ph-more-box { margin: .8rem 0 0; text-align: center; }
.ph-more-box .ph-btn { min-width: 12rem; }

/* ---------- one mosque ---------- */
.ph-back { margin: 0 0 .2rem; }
.ph-back a { color: var(--ph-primary); font-size: .9rem; font-weight: 700; text-decoration: none; }
.ph-mosque-head { margin-top: .5rem; }
.ph-mosque-name { margin: 0; font-size: 1.45rem; font-weight: 800; line-height: 1.5; overflow-wrap: anywhere; }
.ph-mosque-famous, .ph-mosque-place { margin: .1rem 0 0; color: var(--ph-muted); font-size: .95rem; }
.ph-mosque-head .ph-m-tags { margin-top: .6rem; }
.ph-closed {
    margin: .8rem 0 0;
    padding: .55rem .9rem;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    color: #7c4a03;
    font-weight: 700;
}
.ph-muted-note { align-self: center; color: var(--ph-muted); font-size: .9rem; }
.ph-notice-action { margin-top: 1rem !important; }

/* ---------- home: two big buttons ---------- */
.ph-actions-2 .ph-btn { flex: 1 1 14rem; }

@media (max-width: 420px) {
    .ph-nav-link { padding-inline: .75rem; font-size: .9rem; }
    .ph-m { padding-inline-start: .3rem; }
    .ph-m-main { padding-inline: .45rem; }
}
@media (min-width: 768px) {
    .ph-page-title { font-size: 1.6rem; }
    .ph-tools .ph-btn { flex: 0 0 auto; }
    .ph-map-box { height: 28rem; }
    .ph-mosques { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
    .ph-nav, .ph-search, .ph-tools, .ph-map-box, .ph-more-box, .ph-m-dir, .ph-back { display: none !important; }
}

/* =====================================================================================
   Top bar with a menu (staff login inside it), and the four sections as a bottom bar on phones
   ===================================================================================== */
.ph-top-side { display: flex; align-items: center; gap: .5rem; flex: none; }
.ph-login-quick {
    display: inline-flex;
    align-items: center;
    min-height: 2.6rem;
    padding: .3rem .8rem;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 10px;
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.ph-login-quick:hover { background: rgba(255, 255, 255, .12); }
.ph-login-quick[hidden] { display: none; }

.ph-menu { position: relative; }
.ph-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 10px;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    list-style: none;
}
.ph-menu-btn::-webkit-details-marker { display: none; }
.ph-menu-btn::marker { content: ''; }
.ph-menu-btn:hover, .ph-menu[open] .ph-menu-btn { background: rgba(255, 255, 255, .14); }
.ph-menu-panel {
    position: absolute;
    top: calc(100% + .5rem);
    inset-inline-end: 0;
    z-index: 30;
    width: 16.5rem;
    max-width: calc(100vw - 2rem);
    padding: .4rem;
    border: 1px solid var(--ph-border-strong);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
}
.ph-menu-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 2.9rem;
    padding: .45rem .8rem;
    border-radius: 10px;
    color: var(--ph-text);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
}
.ph-menu-link .ph-ico { font-size: 1.15rem; color: var(--ph-primary); }
.ph-menu-link:hover { background: var(--ph-primary-50); }
.ph-menu-link.is-active { color: var(--ph-primary); background: var(--ph-primary-50); }
.ph-menu-login {
    margin-top: .4rem;
    padding-top: .6rem;
    border-top: 1px solid var(--ph-border);
    border-radius: 0 0 10px 10px;
    font-size: .92rem;
    color: var(--ph-muted);
}
.ph-menu-login small { display: block; font-size: .74rem; font-weight: 500; color: var(--ph-muted); line-height: 1.5; }
.ph-menu-login .ph-ico { color: var(--ph-muted); }

/* the old big login button is gone from the top bar */
.ph-login { display: none; }

.ph-nav-link { gap: .4rem; }
.ph-nav-link .ph-ico { display: none; }

/* ----- phones: the four sections become a bar at the bottom of the screen, like an app ----- */
@media (max-width: 767px) {
    .ph-nav {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 20;
        border-bottom: 0;
        border-top: 1px solid var(--ph-border-strong);
        padding-bottom: env(safe-area-inset-bottom, 0);
        box-shadow: 0 -4px 14px rgba(15, 23, 42, .06);
    }
    .ph-nav-in { gap: 0; padding-inline: .25rem; overflow: visible; }
    .ph-nav-link {
        flex: 1 1 0;
        flex-direction: column;
        justify-content: center;
        gap: .1rem;
        min-height: 3.6rem;
        padding: .3rem .1rem;
        border-bottom: 0;
        border-top: 3px solid transparent;
        font-size: .8rem;
    }
    .ph-nav-link .ph-ico { display: block; font-size: 1.35rem; }
    .ph-nav-link.is-active { border-bottom-color: transparent; border-top-color: var(--ph-primary); }
    .ph-body { padding-bottom: calc(3.6rem + env(safe-area-inset-bottom, 0)); }
    .ph-foot { padding-bottom: 1.2rem; }
}
@media print {
    .ph-top-side { display: none !important; }
    .ph-body { padding-bottom: 0; }
}

/* =====================================================================================
   Iqama times and lessons
   ===================================================================================== */
.ph-time-iqama { margin-top: .15rem; font-size: .8rem; font-weight: 700; color: var(--ph-primary); white-space: nowrap; }
.ph-time.is-past .ph-time-iqama { color: var(--ph-muted); font-weight: 600; }
.ph-m-iqama { margin-top: .1rem; font-size: .85rem; font-weight: 700; color: var(--ph-primary); }

.ph-days { display: flex; gap: .4rem; margin: 0 0 .7rem; padding-bottom: .2rem; overflow-x: auto; scrollbar-width: none; }
.ph-days::-webkit-scrollbar { display: none; }
.ph-day {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6rem;
    min-width: 4.2rem;
    padding: .2rem .8rem;
    border: 1px solid var(--ph-border-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--ph-text);
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.ph-day:hover { background: var(--ph-primary-50); }
.ph-day.is-active { background: var(--ph-primary); border-color: var(--ph-primary); color: #fff; }

.ph-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ph-lesson {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    padding: .7rem .9rem;
    border: 1px solid var(--ph-border);
    border-radius: 12px;
    background: #fff;
}
.ph-lesson[hidden] { display: none; }
.ph-lesson.is-today { border-color: var(--ph-primary-200); background: var(--ph-primary-50); }
.ph-lesson-time { align-self: flex-start; padding: 0 .65rem; border-radius: 999px; background: var(--ph-primary); color: #fff; font-size: .82rem; font-weight: 700; line-height: 1.8; }
.ph-lesson-title { font-size: 1.05rem; font-weight: 800; line-height: 1.6; overflow-wrap: anywhere; }
.ph-lesson-teacher { font-size: .95rem; font-weight: 600; }
.ph-lesson-when, .ph-lesson-notes { font-size: .88rem; color: var(--ph-muted); overflow-wrap: anywhere; }
.ph-lesson-place {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .6rem;
    margin-top: .45rem;
    padding-top: .45rem;
    border-top: 1px dashed var(--ph-border-strong);
}
.ph-lesson-mosque { color: var(--ph-primary); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.ph-lesson-mosque:hover { text-decoration: underline; }
.ph-lesson-place .ph-m-dir { margin-inline-start: auto; }
.ph-lessons-all .ph-lesson { padding: .8rem .9rem; }
@media (min-width: 768px) {
    .ph-lessons-all { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ph-actions-3 .ph-btn { flex: 1 1 0; }
}

/* ----- home page: my mosque, and the mosques near me (public-near.js) ----- */
.ph-near[hidden] { display: none; }
.ph-near { display: grid; gap: .9rem; }
.ph-near-intro { margin: 0 0 .7rem; color: var(--ph-muted); font-size: .92rem; }
.ph-near-msg { margin: .6rem 0 0; color: var(--ph-muted); font-size: .92rem; }
.ph-near-label { margin: 0 0 .4rem; font-weight: 800; color: #9a6b12; }
.ph-near-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .6rem; }
.ph-near-item { padding: .75rem .85rem; border: 1px solid var(--ph-border); border-radius: 12px; background: #fff; min-width: 0; }
.ph-near-item.is-mine { border: 2px solid #d4a64a; background: #fffcf3; }
.ph-near-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.ph-near-name { font-weight: 800; color: var(--ph-primary); text-decoration: none; overflow-wrap: anywhere; }
.ph-near-name:hover { text-decoration: underline; }
.ph-near-dist { flex: none; font-size: .85rem; color: var(--ph-muted); font-weight: 700; }
.ph-near-area { margin: 0; font-size: .85rem; color: var(--ph-muted); }
.ph-near-next { margin: .35rem 0 0; font-size: .98rem; }
.ph-near-time { font-weight: 800; }
.ph-near-arrive { margin: .3rem 0 0; padding: .3rem .6rem; border-radius: 8px; background: var(--ph-primary-50); font-size: .9rem; font-weight: 700; }
.ph-near-arrive.is-ok { background: #ecfdf3; color: #14532d; }
.ph-near-arrive.is-close { background: #fffbeb; color: #7c4a03; }
.ph-near-arrive.is-late { background: #fef2f2; color: #7f1d1d; }
.ph-near-arrive.is-ok::before { content: '● '; color: #16a34a; }
.ph-near-arrive.is-close::before { content: '● '; color: #d97706; }
.ph-near-arrive.is-late::before { content: '● '; color: #dc2626; }
.ph-near-buttons { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.ph-btn-small { min-height: 2.6rem; padding: .3rem .9rem; font-size: .9rem; }
.ph-btn[data-ph="make-mine"].is-on { background: #fffcf3; border-color: #d4a64a; color: #7c4a03; }
/* one row: «خذني إليه», «صفحة المسجد» and a small ☆ star ("make it my mosque") */
.ph-near-list .ph-near-buttons { flex-wrap: nowrap; }
.ph-near-list .ph-near-buttons > .ph-btn { flex: 1 1 auto; min-width: 0; padding-inline: .6rem; white-space: nowrap; }
.ph-near-list .ph-near-buttons > .ph-near-star { flex: 0 0 2.75rem; min-height: 2.75rem; padding: 0; font-size: 1.35rem; line-height: 1; color: #9a6b12; }
.ph-near-noiq { display: block; margin-top: .1rem; font-size: .82rem; font-weight: 400; color: var(--ph-muted); }
.ph-near-list > li[hidden], .ph-near-more[hidden] { display: none; }
.ph-near-more { width: 100%; margin-top: .6rem; }
.ph-near-msg-link { color: var(--ph-primary); font-weight: 700; }

/* ----- the mosques map: a mosque's box (public-mosques.js + public-near.js) ----- */
.ph-pop { min-width: 12rem; max-width: 16rem; }
.ph-pop-now:empty { display: none; }
.ph-pop-now .ph-near-next { margin: 0; font-size: .88rem; line-height: 1.6; }
.ph-pop-now .ph-near-arrive { margin: .3rem 0 0; font-size: .82rem; line-height: 1.6; }
.ph-pop-when { margin-top: .35rem; padding: .2rem .75rem; border: 1px solid var(--ph-primary); border-radius: 8px; background: #fff; color: var(--ph-primary); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.ph-pop-when:hover, .ph-pop-when:focus-visible { background: var(--ph-primary-50); }
.ph-pop-note { margin: .3rem 0 0; font-size: .8rem; color: var(--ph-muted); line-height: 1.6; }

/* the countdown to the iqama (mosque page): big, at the top of the times */
.ph-iq-count { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: .2rem .6rem; margin: 0 0 .8rem; padding: .7rem 1rem; border-radius: 12px; background: var(--ph-primary); color: #fff; text-align: center; }
.ph-iq-count[hidden] { display: none; }
.ph-iq-count-label { font-size: 1rem; font-weight: 700; }
.ph-iq-count-clock { font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.ph-iq-count.is-held { background: var(--ph-primary-50); color: var(--ph-primary-800); border: 1px solid var(--ph-primary-100); }
/* the countdown inside "near me", "my mosque" and the map boxes */
.ph-near-next.is-waiting { font-weight: 700; }
.ph-near-count { font-variant-numeric: tabular-nums; color: var(--ph-primary); font-weight: 800; }
.ph-near-held { margin: .3rem 0 0; font-size: .88rem; color: var(--ph-primary-700); font-weight: 700; }

/* the women's prayer hall and toilets: a quiet note (mosque page, and a mosque's box on the map) */
.ph-women-note { margin: .5rem 0 0; font-size: .88rem; color: var(--ph-muted); }
.ph-women-date { font-size: .8rem; }
.ph-pop-women { margin: .2rem 0 0; font-size: .8rem; color: var(--ph-muted); }

/* ================= a calmer, cleaner home page (19 Nov) =================
   One strong top card for prayer time (next prayer + time left side by side, today's six times in one strip),
   then "my mosque" and "near me" in roomy white cards, then three soft tiles. */
.ph-card { border-radius: 16px; padding: 1.15rem 1.1rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.ph-card-title { font-size: 1.1rem; font-weight: 800; }

.ph-hero { border-radius: 20px; padding: 1.1rem 1rem 1rem; text-align: start; box-shadow: 0 8px 24px rgba(30, 71, 93, .18); }
.ph-hero-date { font-size: .84rem; }
.ph-hero-main { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: .7rem; }
.ph-hero-next { min-width: 0; }
.ph-hero-label { margin-top: 0 !important; font-size: .82rem; }
.ph-hero-name { font-size: 2.4rem; line-height: 1.15; }
.ph-hero-time { font-size: 1.15rem; }
.ph-hero-count { flex: none; margin-top: 0 !important; padding: .6rem 1rem .65rem; border-radius: 14px; }
.ph-hero-foot { margin-top: .6rem !important; font-size: .72rem; color: rgba(255, 255, 255, .62); text-align: center; }
.ph-strip { margin: 1rem 0 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .15rem; padding: .3rem;
            border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px; }
.ph-strip .ph-time { gap: .1rem; padding: .5rem .1rem .45rem; border: 0; border-radius: 12px; background: transparent; box-shadow: none; }
.ph-strip .ph-time-name { font-size: .74rem; font-weight: 600; color: rgba(255, 255, 255, .8); }
.ph-strip .ph-time-val { display: flex; flex-direction: column; align-items: center; line-height: 1.15; font-size: 1rem; color: #fff; }
.ph-strip .ph-ap { font-size: .64rem; color: rgba(255, 255, 255, .7); }
.ph-strip .ph-time.is-past { background: transparent; opacity: .55; }
.ph-strip .ph-time.is-past .ph-time-val { color: #fff; font-weight: 600; }
.ph-strip .ph-time.is-next { background: #fff; border: 0; box-shadow: 0 2px 8px rgba(15, 23, 42, .18); opacity: 1; }
.ph-strip .ph-time.is-next .ph-time-name, .ph-strip .ph-time.is-next .ph-time-val, .ph-strip .ph-time.is-next .ph-ap { color: var(--ph-primary); }
.ph-strip .ph-time.is-sunrise .ph-time-val { font-weight: 600; }

/* "my mosque" and "near me" */
.ph-near { padding: 1.15rem 1.1rem; gap: 1.1rem; }
.ph-near-intro { font-size: .88rem; line-height: 1.7; }
.ph-near-box > .ph-btn[data-ph="near-go"] { width: 100%; min-height: 3.1rem; border-radius: 12px; }
.ph-near-label { display: inline-flex; align-items: center; gap: .3rem; margin: 0 0 .55rem; padding: .1rem .7rem; border-radius: 999px;
                 background: #fff6e0; color: #8a5a00; font-size: .8rem; font-weight: 800; }
.ph-near-list { gap: .7rem; }
.ph-near-item { padding: .9rem .95rem; border-radius: 14px; }
.ph-near-item.is-mine { border: 1px solid var(--ph-border); background: #fff; box-shadow: 0 2px 12px rgba(15, 23, 42, .07); }
.ph-near-name { font-size: 1.02rem; }
.ph-near-dist { padding: .05rem .6rem; border-radius: 999px; background: var(--ph-canvas); font-size: .78rem; }
.ph-near-area { margin-top: .1rem; }
.ph-near-next { margin-top: .5rem; }
.ph-near-arrive { display: inline-flex; align-items: center; margin-top: .45rem; padding: .25rem .75rem; border-radius: 999px; font-size: .82rem; }
.ph-near-buttons { gap: .5rem; margin-top: .75rem; }
.ph-near-buttons .ph-btn { border-radius: 10px; }

/* three soft tiles: icon above, words below */
.ph-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: 1rem; }
.ph-tiles .ph-btn { flex-direction: column; gap: .4rem; min-height: 5.4rem; padding: .85rem .4rem; border: 0; border-radius: 16px;
                    background: var(--ph-primary-50); color: var(--ph-primary); font-size: .84rem; line-height: 1.35; text-align: center; }
.ph-tiles .ph-btn:hover { background: var(--ph-primary-100); }
.ph-tiles .ph-ico { width: 1.6rem; height: 1.6rem; }

@media (max-width: 359px) {
    .ph-hero-main { flex-direction: column; align-items: stretch; text-align: center; }
    .ph-hero-name { font-size: 2.1rem; }
    .ph-strip .ph-time-val { font-size: .9rem; }
}
@media (min-width: 768px) {
    .ph-hero { padding: 1.6rem 1.6rem 1.3rem; }
    .ph-hero-name { font-size: 3.1rem; }
    .ph-hero-time { font-size: 1.4rem; }
    .ph-hero-count { padding: .8rem 1.6rem .85rem; }
    .ph-count { font-size: 2.5rem; }
    .ph-strip { gap: .5rem; padding: .45rem; }
    .ph-strip .ph-time { padding: .75rem .3rem .7rem; }
    .ph-strip .ph-time-name { font-size: .9rem; }
    .ph-strip .ph-time-val { font-size: 1.35rem; }
    .ph-strip .ph-ap { font-size: .75rem; }
    .ph-tiles .ph-btn { flex-direction: row; min-height: 3.6rem; font-size: .95rem; }
}
/* "my mosque": its three buttons on one row, like the nearby ones */
.ph-near-mine .ph-near-buttons { flex-wrap: nowrap; }
.ph-near-mine .ph-near-buttons > .ph-btn { flex: 1 1 auto; min-width: 0; padding-inline: .55rem; white-space: nowrap; font-size: .86rem; }
/* "my mosque" and "near me" are two cards of their own (no card inside a card) */
.ph-near { padding: 0; border: 0; background: transparent; box-shadow: none; gap: 1rem; }
.ph-near > * { min-width: 0; }
.ph-near-mine, .ph-near-box { padding: 1.1rem 1.05rem; border: 1px solid var(--ph-border); border-radius: 16px; background: var(--ph-card);
                              box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.ph-near-mine[hidden] { display: none; }
.ph-near-mine .ph-near-item.is-mine { padding: 0; border: 0; box-shadow: none; background: transparent; }
@media (min-width: 768px) {
    .ph-near-mine .ph-near-buttons > .ph-btn, .ph-near-list .ph-near-buttons > .ph-btn { flex: 0 1 auto; padding-inline: 1.1rem; }
    .ph-near-box > .ph-btn[data-ph="near-go"] { width: auto; }
}

/* the filter chips of the mosques list and map: small rounded pills, one row (it scrolls sideways on a narrow phone) */
.ph-chips { display: flex; gap: .45rem; margin: .8rem 0 0; padding-bottom: .15rem; overflow-x: auto; scrollbar-width: none; }
.ph-chips::-webkit-scrollbar { display: none; }
.ph-chip { display: inline-flex; flex: none; align-items: center; gap: .35rem; min-height: 2.5rem; padding: .3rem .95rem; border: 1px solid var(--ph-border-strong);
           border-radius: 999px; background: #fff; color: var(--ph-text); font-size: .86rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.ph-chip:hover { background: var(--ph-primary-50); }
.ph-chip .ph-ico { color: var(--ph-primary); }
.ph-chip.is-on { border-color: var(--ph-primary); background: var(--ph-primary); color: #fff; }
.ph-chip.is-on .ph-ico { color: #fff; }
.ph-chip:focus-visible { outline: 3px solid rgba(30, 71, 93, .35); outline-offset: 2px; }
@media (max-width: 420px) {
    .ph-chips { gap: .35rem; }
    .ph-chip { gap: .25rem; padding: .3rem .7rem; font-size: .82rem; }
    .ph-chip .ph-ico { width: 1em; height: 1em; }
}
/* chips wrap to a second line rather than hide off the screen */
.ph-chips { flex-wrap: wrap; overflow: visible; }
@media (max-width: 420px) {
    .ph-chip .ph-ico { display: none; }
    .ph-chip { padding: .3rem .85rem; }
}

/* one line, always: the date in the top card and the name in the top bar shrink a little on small phones instead of breaking */
.ph-hero-date { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: min(.84rem, 3.45vw); }
@media (max-width: 420px) {
    .ph-brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: min(.82rem, 3.7vw); }
}
/* smooth on phones: no grey flash on tap, no double-tap zoom delay, text size kept when the phone turns sideways,
   and the bottom bar drawn on its own layer so it does not jitter while the page scrolls */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, .ph-chip, .ph-nav-link { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (max-width: 767px) {
    .ph-nav { transform: translateZ(0); backface-visibility: hidden; }
    .ph-nav-link { white-space: nowrap; }
}

/* the footer: centred, short lines, the staff login on a line of its own */
.ph-foot-in { text-align: center; }
.ph-foot-line { line-height: 1.8; text-wrap: balance; }
.ph-foot-muted { margin-top: .35rem; font-size: .8rem; }
.ph-foot-muted a { display: inline-block; margin-top: .15rem; }
@media (max-width: 767px) {
    .ph-foot-muted a { display: block; width: max-content; margin: .3rem auto 0; padding: .2rem .9rem; border: 1px solid var(--ph-border-strong);
                       border-radius: 999px; background: #fff; text-decoration: none; }
}
@media (max-width: 767px) { .ph-foot-dot { display: none; } }
.ph-near-intro { text-wrap: pretty; }

/* ================= the mosque page, cleaner (19 Nov) =================
   small line icons drawn with masks: the page keeps its plain text, the icon takes the text colour */
.ph-mo-times > li::before, .ph-fac-ico { content: ""; display: block; width: 1.4rem; height: 1.4rem; background: currentColor; -webkit-mask: var(--ph-icon) center / contain no-repeat; mask: var(--ph-icon) center / contain no-repeat; }
.ph-mo-times > li[data-key="fajr"] { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%2019h18M6%2015a6%206%200%200%201%2012%200'%2F%3E%3Cpath%20d%3D'M12%203v6M9%206l3-3%203%203'%2F%3E%3C%2Fsvg%3E"); }
.ph-mo-times > li[data-key="sunrise"] { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%2019h18M7%2015a5%205%200%200%201%2010%200'%2F%3E%3Cpath%20d%3D'M12%206v3M5.5%209.5l1.5%201.5M18.5%209.5L17%2011'%2F%3E%3C%2Fsvg%3E"); }
.ph-mo-times > li[data-key="dhuhr"] { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'12'%20cy%3D'12'%20r%3D'4'%2F%3E%3Cpath%20d%3D'M12%202v2M12%2020v2M4.9%204.9l1.4%201.4M17.7%2017.7l1.4%201.4M2%2012h2M20%2012h2M4.9%2019.1l1.4-1.4M17.7%206.3l1.4-1.4'%2F%3E%3C%2Fsvg%3E"); }
.ph-mo-times > li[data-key="asr"] { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'9'%20cy%3D'9'%20r%3D'3'%2F%3E%3Cpath%20d%3D'M9%202v1.5M3.5%209H2M4.6%204.6l1%201M13.4%204.6l-1%201'%2F%3E%3Cpath%20d%3D'M8%2020h9a4%204%200%200%200%200-8%205%205%200%200%200-9.6%201.5A3.3%203.3%200%200%200%208%2020z'%2F%3E%3C%2Fsvg%3E"); }
.ph-mo-times > li[data-key="maghrib"] { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%2019h18M6%2019a6%206%200%200%201%2012%200'%2F%3E%3Cpath%20d%3D'M12%209v4M9%2012l3%203%203-3'%2F%3E%3C%2Fsvg%3E"); }
.ph-mo-times > li[data-key="isha"] { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M20%2014.5A8%208%200%201%201%209.5%204a6.5%206.5%200%200%200%2010.5%2010.5z'%2F%3E%3C%2Fsvg%3E"); }
.ph-fac-friday { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'8'%20cy%3D'8'%20r%3D'2.5'%2F%3E%3Ccircle%20cx%3D'16'%20cy%3D'8'%20r%3D'2.5'%2F%3E%3Cpath%20d%3D'M3%2019c0-3%202.2-5%205-5s5%202%205%205M11%2019c0-3%202.2-5%205-5s5%202%205%205'%2F%3E%3C%2Fsvg%3E"); }
.ph-fac-parking { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20x%3D'4'%20y%3D'3'%20width%3D'16'%20height%3D'18'%20rx%3D'3'%2F%3E%3Cpath%20d%3D'M10%2017V7h3a3%203%200%200%201%200%206h-3'%2F%3E%3C%2Fsvg%3E"); }
.ph-fac-women { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'12'%20cy%3D'5'%20r%3D'2.5'%2F%3E%3Cpath%20d%3D'M12%209l-4%208h8z'%2F%3E%3Cpath%20d%3D'M10%2017v4M14%2017v4'%2F%3E%3C%2Fsvg%3E"); }
.ph-fac-wc { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'7'%20cy%3D'5'%20r%3D'2'%2F%3E%3Ccircle%20cx%3D'17'%20cy%3D'5'%20r%3D'2'%2F%3E%3Cpath%20d%3D'M7%209v12M5%209h4v7H5zM17%209l-3%207h6zM16%2016v5M18%2016v5'%2F%3E%3C%2Fsvg%3E"); }
.ph-fac-hall { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%2021h18M5%2021V9l7-5%207%205v12'%2F%3E%3Cpath%20d%3D'M9%2021v-5h6v5'%2F%3E%3C%2Fsvg%3E"); }
.ph-fac-quran { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M4%205a2%202%200%200%201%202-2h13v16H6a2%202%200%200%200-2%202z'%2F%3E%3Cpath%20d%3D'M4%2021V5M9%207h6M9%2011h6'%2F%3E%3C%2Fsvg%3E"); }
.ph-fac-people { --ph-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'9'%20cy%3D'7'%20r%3D'3'%2F%3E%3Cpath%20d%3D'M3%2021c0-3.5%202.7-6%206-6s6%202.5%206%206'%2F%3E%3Cpath%20d%3D'M16%204a3%203%200%200%201%200%206M18%2015c2%20.6%203%202.7%203%206'%2F%3E%3C%2Fsvg%3E"); }

/* the top card: room for a photo later; for now a calm navy card with a drawn mosque */
.ph-mo-hero { position: relative; display: flex; align-items: flex-end; min-height: 11rem; margin-top: .4rem; padding: 1.2rem 1.1rem; overflow: hidden;
              border-radius: 20px; background: linear-gradient(160deg, var(--ph-primary-700), var(--ph-primary)); color: #fff;
              box-shadow: 0 8px 24px rgba(30, 71, 93, .18); }
.ph-mo-art { position: absolute; inset-block-start: .9rem; inset-inline-end: .9rem; width: 6.5rem; height: 6.5rem; opacity: .16; }
.ph-mo-art svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.ph-mo-hero-text { position: relative; min-width: 0; }
.ph-mo-hero .ph-mosque-name { margin: 0; color: #fff; font-size: 1.75rem; line-height: 1.3; }
.ph-mo-hero .ph-mosque-famous { margin: .2rem 0 0; color: rgba(255, 255, 255, .82); font-size: .9rem; }
.ph-mo-hero .ph-mosque-place { display: flex; align-items: center; gap: .3rem; margin: .35rem 0 0; color: rgba(255, 255, 255, .9); font-size: .95rem; }
.ph-mo-hero .ph-m-tags { margin-top: .7rem; }
.ph-mo-hero .ph-tag { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); color: #fff; }
.ph-closed { margin: .8rem 0 0; }

/* the actions: «الاتجاهات» wide; «مسجدي» and «مشاركة» under it on a phone, beside it on a computer */
.ph-mo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: .9rem; }
.ph-mo-actions .ph-mo-go { grid-column: 1 / -1; min-height: 3.2rem; border-radius: 14px; font-size: 1rem; }
.ph-mo-actions .ph-btn { border-radius: 12px; }
.ph-mo-actions .ph-btn[hidden] { display: none; }
.ph-mo-actions .ph-muted-note { display: block; padding: .7rem; border-radius: 12px; background: var(--ph-canvas); text-align: center; }

/* today's times: one row per prayer (icon, name, iqama, adhan time); the next one dark */
.ph-mo-times { display: block; margin: 0; padding: 0; list-style: none; }
.ph-mo-times > li.ph-time { display: grid; grid-template-columns: 1.4rem 1fr auto; grid-template-areas: "icon name val" "icon iq val";
                            column-gap: .8rem; align-items: center; padding: .75rem .9rem; border: 0; border-radius: 14px; background: transparent; text-align: start; }
.ph-mo-times > li.ph-time + li.ph-time { margin-top: .2rem; }
.ph-mo-times > li::before { grid-area: icon; color: var(--ph-primary); opacity: .85; }
.ph-mo-times .ph-time-name { grid-area: name; color: var(--ph-text); font-size: 1rem; font-weight: 700; }
.ph-mo-times .ph-time-val { grid-area: val; font-size: 1.15rem; }
.ph-mo-times .ph-time-iqama { grid-area: iq; margin-top: .1rem; font-size: .82rem; }
.ph-mo-times .ph-time-gap { font-weight: 600; color: var(--ph-muted); }
.ph-mo-times > li.is-past { background: transparent; }
.ph-mo-times > li.is-past .ph-time-name, .ph-mo-times > li.is-past .ph-time-val, .ph-mo-times > li.is-past::before { color: var(--ph-muted); }
.ph-mo-times > li.is-sunrise .ph-time-name, .ph-mo-times > li.is-sunrise .ph-time-val { font-weight: 600; color: var(--ph-muted); }
.ph-mo-times > li.is-next { background: var(--ph-primary); border: 0; box-shadow: 0 4px 14px rgba(30, 71, 93, .25); }
.ph-mo-times > li.is-next::before, .ph-mo-times > li.is-next .ph-time-name, .ph-mo-times > li.is-next .ph-time-val,
.ph-mo-times > li.is-next .ph-ap, .ph-mo-times > li.is-next .ph-time-iqama, .ph-mo-times > li.is-next .ph-time-gap { color: #fff; opacity: 1; }

/* the facilities: small tiles, two in a row (three on a computer) */
.ph-fac { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: 0; padding: 0; list-style: none; }
.ph-fac-item { display: flex; align-items: center; gap: .65rem; min-height: 3.6rem; padding: .65rem .75rem; border-radius: 14px; background: var(--ph-canvas); }
.ph-fac-ico { flex: none; width: 1.3rem; height: 1.3rem; padding: .5rem; box-sizing: content-box; border-radius: 10px; color: var(--ph-primary);
              -webkit-mask-origin: content-box; mask-origin: content-box; -webkit-mask-clip: content-box; mask-clip: content-box; }
.ph-fac-text { min-width: 0; font-size: .9rem; font-weight: 700; line-height: 1.4; }
.ph-fac-sub { display: block; font-size: .78rem; font-weight: 600; color: var(--ph-muted); }
.ph-fac-item.is-off .ph-fac-sub { color: #9a5b00; }
.ph-women-note { margin: .7rem 0 0; }
@media (min-width: 768px) {
    .ph-mo-hero { min-height: 13rem; padding: 1.6rem; }
    .ph-mo-hero .ph-mosque-name { font-size: 2.2rem; }
    .ph-mo-art { width: 9rem; height: 9rem; }
    .ph-mo-actions { grid-template-columns: 2fr 1fr 1fr; }
    .ph-mo-actions .ph-mo-go { grid-column: auto; }
    .ph-fac { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ph-mo-actions .ph-btn { white-space: nowrap; }
.ph-fac-item { gap: .55rem; padding: .6rem .65rem; }
.ph-fac-ico { padding: .45rem; }
.ph-fac-text { font-size: .86rem; }

/* the mosques list: a small picture tile (a drawn mosque until photos come), name, place, tiny facility icons */
.ph-m { padding: .35rem .35rem .35rem .75rem; border-radius: 16px; }
.ph-m-main { display: grid; grid-template-columns: 3.6rem 1fr; column-gap: .8rem; row-gap: .1rem; align-content: center; }
.ph-m-main > :not(.ph-m-thumb) { grid-column: 2; }
.ph-m-thumb { grid-column: 1; grid-row: 1 / span 6; align-self: center; width: 3.6rem; height: 3.6rem; border-radius: 12px; background: var(--ph-primary-50); position: relative; }
.ph-m-thumb::after { content: ''; position: absolute; inset: .55rem; background: var(--ph-primary); opacity: .55;
                     -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2064%2064'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'3'%20stroke-linejoin%3D'round'%20stroke-linecap%3D'round'%3E%3Cpath%20d%3D'M32%208c-2%204-6%206-6%2010h12c0-4-4-6-6-10z'%2F%3E%3Cpath%20d%3D'M15%2031c0-8%208-13%2017-13s17%205%2017%2013z'%2F%3E%3Cpath%20d%3D'M13%2031h38v24H13z'%2F%3E%3Cpath%20d%3D'M28%2055V45a4%204%200%200%201%208%200v10'%2F%3E%3Cpath%20d%3D'M7%2055V28l3-4%203%204v27M51%2055V28l3-4%203%204v27'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2064%2064'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'3'%20stroke-linejoin%3D'round'%20stroke-linecap%3D'round'%3E%3Cpath%20d%3D'M32%208c-2%204-6%206-6%2010h12c0-4-4-6-6-10z'%2F%3E%3Cpath%20d%3D'M15%2031c0-8%208-13%2017-13s17%205%2017%2013z'%2F%3E%3Cpath%20d%3D'M13%2031h38v24H13z'%2F%3E%3Cpath%20d%3D'M28%2055V45a4%204%200%200%201%208%200v10'%2F%3E%3Cpath%20d%3D'M7%2055V28l3-4%203%204v27M51%2055V28l3-4%203%204v27'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; }
.ph-m-icons { display: flex; gap: .45rem; margin-top: .25rem; color: var(--ph-muted); }
.ph-m-ic { display: block; width: 1rem; height: 1rem; background: currentColor; -webkit-mask: var(--ph-icon) center / contain no-repeat; mask: var(--ph-icon) center / contain no-repeat; }
@media (max-width: 359px) { .ph-m-main { grid-template-columns: 3rem 1fr; } .ph-m-thumb { width: 3rem; height: 3rem; } }

/* phones: «الاتجاهات» in the list is a small round arrow button (the word stays for screen readers), so names keep their room */
@media (max-width: 560px) {
    .ph-m-side { justify-content: center; }
    .ph-m-dir { position: relative; width: 2.75rem; height: 2.75rem; min-height: 0; padding: 0; border-radius: 999px; font-size: 0; color: transparent; overflow: hidden; }
    .ph-m-dir::before { content: ''; position: absolute; inset: .75rem; background: var(--ph-primary);
                        -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%2011l18-8-8%2018-2-8z'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%2011l18-8-8%2018-2-8z'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; }
}
.ph-m-tags { align-items: center; }
.ph-m-tags .ph-m-icons { margin: 0 .2rem; }
.ph-mo-hero .ph-mosque-place::before { content: ""; flex: none; width: 1.05rem; height: 1.05rem; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%2022s7-6.2%207-12a7%207%200%201%200-14%200c0%205.8%207%2012%207%2012z'%2F%3E%3Ccircle%20cx%3D'12'%20cy%3D'10'%20r%3D'2.5'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23000'%20stroke-width%3D'2'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%2022s7-6.2%207-12a7%207%200%201%200-14%200c0%205.8%207%2012%207%2012z'%2F%3E%3Ccircle%20cx%3D'12'%20cy%3D'10'%20r%3D'2.5'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat; }

/* ================= mosque photos (added by the mosques department) ================= */
/* the top card: the photo fills it, darker at the bottom so the name stays easy to read; 2-3 photos swipe sideways */
.ph-mo-hero.has-photo { min-height: 15rem; padding: 0; background: var(--ph-primary-800); }
.ph-mo-photos { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.ph-mo-photos::-webkit-scrollbar { display: none; }
.ph-mo-photo { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.ph-mo-hero.has-photo::after { content: ""; position: absolute; inset: 0; pointer-events: none;
                               background: linear-gradient(to top, rgba(10, 25, 35, .88) 0%, rgba(10, 25, 35, .45) 45%, rgba(10, 25, 35, 0) 75%); }
.ph-mo-hero.has-photo .ph-mo-hero-text { z-index: 1; padding: 1.2rem 1.1rem; pointer-events: none; }
.ph-mo-dots { position: absolute; z-index: 2; inset-block-start: .7rem; inset-inline: 0; display: flex; justify-content: center; gap: .35rem; margin: 0; pointer-events: none; }
.ph-mo-dots span { width: .45rem; height: .45rem; border-radius: 999px; background: rgba(255, 255, 255, .55); }
.ph-mo-dots span.is-on { width: 1.1rem; background: #fff; }
@media (min-width: 768px) { .ph-mo-hero.has-photo { min-height: 20rem; } }
/* the list tile and the map box */
.ph-m-thumb.has-photo { overflow: hidden; }
.ph-m-thumb.has-photo::after { display: none; }
.ph-m-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph-pop-photo { display: block; width: 100%; height: 7.5rem; margin: 0 0 .45rem; object-fit: cover; border-radius: 8px; }
