.result-top{align-items:flex-start}
#profile .profile-schedule{display:grid;grid-template-columns:minmax(145px,.38fr) minmax(0,1fr);gap:20px;align-items:start}
#profile .profile-schedule .section-head{display:block;margin:2px 0 0}
#profile .profile-schedule .profile-day-switch{width:max-content;margin-top:13px}
#profile .profile-prayer-content{min-width:0}
#profile .prayer-table{margin-top:0;font-variant-numeric:tabular-nums}
#profile .prayer-row{grid-template-columns:minmax(0,1fr) 86px 86px;gap:12px;padding:10px 2px;font-size:12px}
#profile .prayer-row>:not(:first-child){text-align:right}
#profile .prayer-row>strong{font-weight:600}
#profile .prayer-row>span:nth-child(2){color:var(--muted)}
#profile .prayer-row .jamaah{font-weight:500}
#profile .prayer-row.head{padding-top:0;font-size:9px}
#profile .profile-prayer-status{margin:4px 0 0}
#profile .profile-schedule .jumuah-highlight{grid-column:1/-1;margin:0}
.site-footer{margin-top:42px;padding:22px 0 0;background:var(--bg);border-top:0;color:var(--muted);font-size:10px;line-height:1.5}
.site-footer p{margin:0 0 4px}
.site-footer nav{display:flex;flex-wrap:wrap;gap:14px;margin-top:10px}
.site-footer a{color:inherit;text-decoration:none}
.site-footer a:hover{text-decoration:underline}
.community-toolbar{grid-template-columns:1fr}
.community-results .community-card{min-height:0}
.community-card h3{margin:9px 0 0}
.community-card .link-btn{margin-top:10px}
.rail-foot .login + .login{margin-top:5px}
#home .promo{background-image:linear-gradient(90deg,rgba(20,21,20,.84),rgba(20,21,20,.48)),var(--banner-image,none);background-size:cover;background-position:center}
.light #home .promo{background:linear-gradient(120deg,#f6ead4,#fbf7f0);border-color:var(--line)}
.light #home .promo .promo-title,.light #home .promo .promo-action{color:var(--text)}
.light #home .promo .promo-copy{color:var(--muted)}
.light #home .promo .promo-kicker{color:#966d2e}
.light #home .promo .promo-action{background:#fffdf9;border-color:rgba(182,138,63,.28)}
.result-top h3,.home-list-link > span:first-child{min-width:0;overflow-wrap:anywhere}
.result-top .pill,.home-list-link > .pill{flex:0 0 auto;max-width:none;white-space:nowrap;text-align:center;line-height:1.3}
.home-list-link{align-items:center;width:100%;min-width:0}
.home-mosque-link{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"name location" "time .";align-items:start;row-gap:7px}
.home-mosque-link .list-title{grid-area:name;align-self:center}
.home-mosque-link .home-location{grid-area:location;align-self:start}
.home-mosque-link .home-prayer-time{grid-area:time;justify-self:start;align-self:start;margin:0}
.list-title{display:block;line-height:1.35}
.list-meta{line-height:1.35}
.result .times{min-width:0}
.result .time-pill{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.jumuah-table tr[data-jumuah-profile]{cursor:pointer}
.jumuah-table tr[data-jumuah-profile]:hover,.jumuah-table tr[data-jumuah-profile]:focus-visible{background:rgba(211,196,147,.09);outline:0}
.kahf-reciter{display:block;max-width:100%;min-width:0;width:100%;border:0;background:transparent;color:var(--text);font-size:11px;appearance:auto}
.audio-player > div{min-width:0}
.kahf-status{color:var(--muted);font-size:10px;min-height:14px;margin:5px 2px 9px}
.ayah.current{border-color:var(--accent)}
.calendar-controls{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:16px}
.calendar-controls button{border:1px solid var(--line);border-radius:9px;background:var(--panel2);padding:6px 11px;cursor:pointer}
.calendar-controls span{font-size:11px;color:var(--muted)}
.calendar-grid .day.outside{opacity:.3}
.calendar-grid .day:not(.outside){display:flex;flex-direction:column;justify-content:center;gap:1px}
.calendar-grid .day small{font-size:8px;color:var(--accent)}
.calendar-grid .day.today small{color:#1a1b19}
.calendar-grid .day.weekday{aspect-ratio:auto;color:var(--muted);font-size:10px}
.calendar-grid button.day{border:1px solid transparent;background:transparent;color:var(--text);cursor:pointer;font:inherit}
.calendar-grid button.day.today{border-color:var(--accent)}
.calendar-grid button.day.selected{background:var(--accent);color:#1a1b19}
.calendar-grid button.day.selected small{color:#1a1b19}
.calendar-grid button.day.has-event{position:relative}
.calendar-grid button.day.has-event::after{content:'';position:absolute;right:4px;top:4px;width:4px;height:4px;border-radius:50%;background:var(--accent)}
.calendar-grid button.day.selected.has-event::after{background:#1a1b19}
.calendar-grid button.day:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.calendar-detail{display:grid;gap:4px;margin-top:16px;padding-top:14px;border-top:1px solid var(--line);font-size:11px}
.calendar-detail strong{font-size:13px;font-weight:500}
.calendar-detail span,.calendar-detail p{color:var(--muted)}
.calendar-detail b{margin-top:7px;color:var(--accent);font-weight:500}
.calendar-detail p{margin:0;line-height:1.5}
#calendar .modal-card{max-height:min(680px,calc(100dvh - 40px));overflow:auto}
.theme-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nearby-status{margin:-5px 0 12px;color:var(--muted);font-size:11px}
.nearby-status:empty{display:none}
@media(max-width:720px){.profile-hero h1{overflow-wrap:anywhere}}
@media(max-width:720px){
  #profile .profile-schedule{grid-template-columns:minmax(0,1fr);gap:12px}
  #profile .profile-schedule .section-head{display:flex;align-items:end;justify-content:space-between;margin:0}
  #profile .profile-schedule .profile-day-switch{margin:0}
  #profile .prayer-row{grid-template-columns:minmax(0,1fr) 74px 74px;gap:7px}
  #profile .profile-schedule .jumuah-highlight{grid-column:1;margin-top:2px}
  #home .prayer-row,#profile .prayer-row{font-size:14px;line-height:1.3;padding:12px 2px}
  #home .prayer-row.head,#profile .prayer-row.head{font-size:10px;padding-top:2px;padding-bottom:8px}
  #home .prayer-row strong,#profile .prayer-row strong{font-weight:600}
  #home .prayer-row [data-time],#profile .prayer-row span{font-size:15px}
  #home .prayer-row.head span,#profile .prayer-row.head span{font-size:10px}
  #home .prayer-row:not(.head) strong{font-size:13px;font-weight:500}
  #home .prayer-row:not(.head) [data-time]{font-size:14px}
}

@media(min-width:721px){
  #home .topline > div:first-child,
  #home .topline .calendar-open,
  #home .quick{display:none}
  #home .topline{justify-content:flex-end;margin-bottom:8px}
}
@media(max-width:720px){
  .mobile-nav{transition:transform .22s ease}
  .mobile-nav.is-hidden{transform:translateY(calc(100% + 8px));pointer-events:none}
}
@media(prefers-reduced-motion:reduce){.mobile-nav{transition:none}}

/* Keep the launch banner ready for a later release. */
#home .promo{display:none}
.site-footer .manage-mosque-link{color:var(--text);font-weight:600}

#profile .profile-hero h1{font-size:22px;line-height:1.2;letter-spacing:-.035em;overflow-wrap:anywhere}
@media(max-width:720px){#profile .profile-hero h1{font-size:19px}}

#space-profile .profile-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
#space-profile .profile-heading h1{min-width:0}
#space-profile .profile-actions{display:flex;flex:none;margin:0}
#space-profile .profile-actions a{width:36px;height:36px;padding:0;display:grid;place-items:center;border:1px solid var(--line);border-radius:10px;background:var(--panel2)}
#space-profile .profile-actions a svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

/* Essentials can be restored when ready. */
#home .essentials{display:none}

/* Desktop review: keep the next jama'ah and full prayer table in one glance. */
@media(min-width:1100px){
  body:has(#home.active) .main{max-width:none}
  #home{max-width:1280px;margin-inline:auto}
  body:has(#home.active) .site-footer{max-width:1280px;margin-inline:auto}
  #home .hero{display:grid;grid-template-columns:minmax(0,42%) minmax(0,58%)}
  #home .hero-main{display:block!important;min-width:0;border-right:1px solid var(--line2)}
  #home .next-panel{height:100%;padding:22px 24px;display:flex;flex-direction:column}
  #home .next-panel .progress{margin-top:auto}
  #home .schedule{min-width:0;display:block;padding:22px 24px;border-top:0}
  #home .schedule .section-head{display:flex;align-items:center;justify-content:space-between;margin:0 0 15px}
  #home .schedule .profile-day-switch{margin:0}
  #home .prayer-row{padding:9px 2px;font-size:13px}
  #home .prayer-row.head{padding:0 2px 8px}
}

/* Give prayer times and prayer-space detail pills a restrained gold accent. */
#home .home-prayer-time,
#mosques .result .time-pill,
#spaces .result .time-pill{color:var(--accent)}
.light #home .home-prayer-time,
.light #mosques .result .time-pill,
.light #spaces .result .time-pill{color:#8a6427}

.brand-prayer{color:var(--accent)}
.view{scroll-margin-top:100px}
.light .brand-prayer{color:#8a6427}

/* Keep the desktop theme control in the sidebar and reclaim the top strip. */
.rail-theme-toggle{margin:0 0 4px 12px}
@media(min-width:721px){
  .main{padding-top:16px}
  .main .topline,.main .page-appearance{display:none}
}

.rail-manage-link{display:inline-block;margin:12px 12px 0;color:var(--accent);font-size:12px;font-weight:500;text-decoration:none}
.rail-manage-link:hover{text-decoration:underline}
.rail-manage-link:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:2px}
.light .rail-manage-link{color:#8a6427}
.rail-ownership{margin:14px 12px 0;padding-top:13px;border-top:1px solid var(--line2);color:var(--muted);font-size:10px;line-height:1.5}
.rail-ownership p{margin:0 0 7px}
.rail-ownership a{color:inherit;text-decoration:underline;text-underline-offset:2px}
@media(min-width:721px){.site-footer>p,.site-footer .manage-mosque-link{display:none}}
.rail-site-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 10px;margin:10px 12px 0;padding-top:12px;border-top:1px solid var(--line2)}
.rail-site-links a{color:var(--muted);font-size:11px;text-decoration:none}
.rail-site-links a:hover{color:var(--text);text-decoration:underline}
.rail-site-links a:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:2px}
@media(min-width:721px){.site-footer nav{display:none}}
@media(min-width:721px){#desktop-nav .nav-btn[data-page="home"],#home.view{display:none!important}}

/* Mosque directory follows the Jumu'ah area tables on desktop. */
#mosques-results{display:block}
.mosque-desktop-list{display:grid;gap:12px}
.mosque-mobile-list{display:none}
.mosque-table th:first-child{width:42.5%}
.mosque-table th:not(:first-child),.mosque-table td:not(:first-child){width:11.5%}
.mosque-table td:not(:first-child){color:var(--text);font-variant-numeric:tabular-nums}
.mosque-table td.next-jamaah{color:var(--accent)}
.mosque-table td.no-time{color:var(--muted)}
.mosque-table tr[data-profile]{cursor:pointer}
.mosque-table tr[data-profile]:hover,.mosque-table tr[data-profile]:focus-visible{background:rgba(211,196,147,.09);outline:0}
.brand,.mobile-brand,.mosque-name-link,.mosque-profile-link,.home-mosque-link{text-decoration:none;color:inherit}
.brand:focus-visible,.mobile-brand:focus-visible,.mosque-name-link:focus-visible,.mosque-profile-link:focus-visible,.home-mosque-link:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.mosque-name-link:hover{color:var(--accent)}

/* Prayer spaces use the same area bands and row rhythm as the mosque directories. */
#spaces-results{grid-template-columns:minmax(0,1fr);gap:12px}
.space-group-heading{margin:0;padding:14px 16px;background:#292923;color:var(--accent);font-size:12px;font-weight:500}
.space-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,40%);align-items:start;gap:24px;padding:16px;border-top:1px solid var(--line2);cursor:pointer}
.space-row:hover,.space-row:focus-visible{background:rgba(211,196,147,.09);outline:0}
.space-row-name{color:var(--text);font-size:14px;font-weight:500;line-height:1.4;overflow-wrap:anywhere}
.space-row-detail{color:var(--accent);font-size:13px;line-height:1.45;text-align:right;overflow-wrap:anywhere}
.light .space-group-heading{background:rgba(182,138,63,.12);color:#966d2e}

/* Friday-only venues share the Jumu'ah timetable without entering the mosque directory. */
#jumuah .halls-directory{margin:28px 0 20px;padding-top:20px;border-top:1px solid var(--line2)}
#jumuah .halls-directory-results{display:grid;gap:12px}
#jumuah .halls-table th:not(:first-child),#jumuah .halls-table td:not(:first-child){width:72px;text-align:right}
#jumuah .halls-table th:last-child,#jumuah .halls-table td:last-child{padding-right:16px}
#jumuah .hall-name-link{color:var(--text);text-decoration:none}
#jumuah .hall-name-link:hover,#jumuah .hall-name-link:focus-visible{color:var(--accent);text-decoration:underline}
#jumuah .hall-distance{display:block;margin-top:3px;color:var(--muted);font-size:11px;font-weight:400}
@media(max-width:720px){
  .space-group-heading{padding:14px 15px}
  .space-row{grid-template-columns:minmax(0,1fr);gap:4px;padding:14px 15px}
  .space-row-name{font-size:13px}
  .space-row-detail{font-size:12px;text-align:left}
  #jumuah .halls-directory{margin:20px 0 24px;padding-top:16px}
  #jumuah .halls-table th:not(:first-child),#jumuah .halls-table td:not(:first-child){width:60px}
}
@media(max-width:999px){
  .mosque-desktop-list{display:none}
  .mosque-mobile-list{display:grid;gap:12px}
  .mosque-next-table th:not(:first-child),.mosque-next-table td:not(:first-child){width:84px;text-align:right;padding-right:10px;font-variant-numeric:tabular-nums}
  .mosque-next-table th:last-child,.mosque-next-table td:last-child{padding-right:16px}
  .mosque-next-table td:first-child{font-size:13px;font-weight:500;line-height:1.4}
  .mosque-next-table td:nth-child(2){color:var(--muted)}
  .mosque-next-table td.next-jamaah{color:var(--accent)}
  .mosque-next-table td.next-jamaah{font-weight:600}
  .mosque-next-table .next-prayer-label{display:block;margin-top:3px;color:var(--muted);font-size:12px;line-height:1.3}
  .mosque-next-table .mosque-begins-heading{display:flex;align-items:center;justify-content:flex-end;gap:5px;white-space:nowrap}
}
@media(max-width:720px){
  .mosque-next-table th:first-child,.mosque-next-table td:first-child{padding-left:15px}
  .mosque-next-table th:not(:first-child),.mosque-next-table td:not(:first-child){width:71px;padding-right:8px}
  .mosque-next-table th:last-child,.mosque-next-table td:last-child{padding-right:13px}
}

/* Show key card details as readable text instead of bordered pills. */
#home .home-prayer-time,
#mosques .result .time-pill,
#spaces .result .time-pill{
  display:block;
  width:auto;
  padding:0;
  border:0;
  border-radius:0;
  background:none;
  font-size:13px;
  line-height:1.45;
  font-weight:500;
}
#mosques .result .times,
#spaces .result .times{margin-top:9px}
#home .below .card:last-child .list-meta{font-size:12px;line-height:1.45}

#home .below .list-title{font-size:14px;font-weight:600}
#mosques .result h3,#spaces .result h3{font-size:15px;font-weight:600}

/* On mobile, show the footer only after Home and keep it above the bottom navigation. */
@media(max-width:720px){
  body{background:var(--bg)}
  .mobile-head,.mobile-nav,.light .mobile-head,.light .mobile-nav{background:var(--bg);backdrop-filter:none}
  .mobile-head{border-bottom:0}
  .mobile-nav{border-top:0}
  .site-footer{display:none}
  .main:has(#home.active){min-height:calc(100dvh - 80px);display:flex;flex-direction:column}
  .main:has(#home.active) > #home{flex:1 0 auto}
  .main:has(#home.active) > .site-footer{display:block}
  .app:has(#home.active){min-height:calc(100dvh - 80px)}
}

#space-profile .profile-hero h1{font-size:22px;line-height:1.2;letter-spacing:-.035em;overflow-wrap:anywhere}
@media(max-width:720px){#space-profile .profile-hero h1{font-size:19px}}

/* Desktop home: keep the next prayer and timetable balanced in one compact card. */
@media(min-width:1100px){
  body:has(#home.active) .main{min-height:100vh;display:flex;flex-direction:column}
  #home{width:100%}
  body:has(#home.active) .site-footer{width:100%;margin-top:auto}
  #home .below{display:none}
  #home .hero{grid-template-columns:minmax(0,39%) minmax(0,61%);min-height:clamp(440px,58vh,540px)}
  #home .next-panel{padding:22px 28px 20px}
  #home .mosque-picker{order:1;margin-bottom:10px;padding-bottom:12px}
  #home .next-head{display:contents}
  #home .next-head>div:first-child{order:2;margin-top:auto}
  #home .next-name{font-size:32px;margin:8px 0 0}
  #home .next-time{order:3;font-size:50px;line-height:1.08;margin:0}
  #home .countdown{order:4;display:flex;align-items:baseline;gap:12px;text-align:left;margin:16px 0 auto;color:var(--text)}
  #home .countdown #countdown{font-size:20px;font-weight:500}
  #home .next-panel .progress{order:5;margin:0 0 8px}
  #home .next-panel .helper{order:6}
  #home .schedule{padding:24px 27px 20px;display:flex;flex-direction:column;align-items:stretch}
  #home .schedule .section-head{margin-bottom:10px}
  #home .prayer-grid,#home .prayer-table{display:flex;flex-direction:column;flex:1}
  #home .prayer-row{padding:10px 2px;line-height:1.3}
  #home .prayer-row:not(.head){flex:1;min-height:48px}
  #home .prayer-row.head{padding:0 2px 7px}
  #home .schedule-day-status{margin-top:7px}
  #home .hero:has(#home-source option[value="london"]:checked) .prayer-row{grid-template-columns:minmax(0,1fr) 100px}
  #home .hero:has(#home-source option[value="london"]:checked) .prayer-row > :last-child{display:none}
}

/* Keep the Friday time columns aligned with the other directory tables. */
@media(min-width:1000px){
  #jumuah .jumuah-table th:not(:first-child),
  #jumuah .jumuah-table td:not(:first-child){width:72px}
  #jumuah .jumuah-table.halls-table th:not(:first-child),
  #jumuah .jumuah-table.halls-table td:not(:first-child){width:72px;text-align:center;padding-left:8px;padding-right:8px}
}
