/* Sakina 安宁 — Islamic ornamental UI */

@font-face {
  font-family: 'Amiri';
  src: url('../fonts/Amiri-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+0000-00FF;
}
@font-face {
  font-family: 'Amiri';
  src: url('../fonts/Amiri-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Naskh Arabic';
  src: url('../fonts/NotoNaskhArabic-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --navy: #0c1e3d;
  --navy-2: #12284d;
  --cobalt: #1a3560;
  --teal: #1a7a6d;
  --turquoise: #2a9d8f;
  --mint: #5eead4;
  --gold: #c9a84c;
  --gold-2: #e8d48b;
  --gold-dim: #8a7030;
  --sand: #e8d5b0;
  --cream: #f7f0e1;
  --ink: #1a1714;
  --burgundy: #6b2d3c;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font-ui: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-ar: "Amiri", "Noto Naskh Arabic", serif;
  --shadow: 0 10px 40px rgba(8, 16, 36, 0.4);
  --pattern: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><g fill='none' stroke='%23c9a84c' stroke-width='0.6' opacity='0.35'><path d='M40 4 L48 24 L40 32 L32 24 Z M40 76 L48 56 L40 48 L32 56 Z M4 40 L24 48 L32 40 L24 32 Z M76 40 L56 48 L48 40 L56 32 Z'/><path d='M40 28 L52 40 L40 52 L28 40 Z'/></g></svg>");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--navy); color: var(--cream); font-family: var(--font-ui); }
button, input { font-family: inherit; }
button { cursor: pointer; border: 0; background: none; color: inherit; }
kbd {
  display: inline-block; min-width: 1.3em; padding: 0.05em 0.35em;
  border: 1px solid var(--gold-dim); border-bottom-width: 2px; border-radius: 4px;
  font-size: 0.75em; color: var(--gold-2); background: rgba(12,30,61,0.5);
}
#app, #scene-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#scene-canvas { touch-action: none; }

/* ---------- Arabic ---------- */
.arabic-word {
  font-family: var(--font-ar); font-size: 2.4rem; color: var(--gold-2);
  direction: rtl; letter-spacing: 0; line-height: 1.6; font-weight: 700;
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.arabic-word.small { font-size: 1.45rem; font-weight: 400; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  padding: 0.65em 1.35em; border-radius: 2px; font-size: 0.95rem;
  border: 1px solid var(--gold);
  transition: background 0.15s, transform 0.15s, color 0.15s;
}
.btn.gold { background: linear-gradient(180deg, #e8d48b, #c9a84c 55%, #a88830); color: var(--navy); font-weight: 600; }
.btn.gold:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--gold-2); }
.btn.ghost:hover { background: rgba(201,168,76,0.12); }
.btn.wide { width: 100%; margin-top: 0.6rem; padding: 0.9em 1em; font-size: 1.05rem; }
.btn.small { font-size: 0.8rem; padding: 0.4em 0.8em; margin-top: 0.5rem; }

/* ---------- Loading ---------- */
#loading {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, #1a3560 0%, #0c1e3d 55%, #070f1f 100%);
  overflow: hidden;
}
#loading::before {
  content: ""; position: absolute; inset: -20%;
  background-image: var(--pattern); background-size: 90px 90px;
  opacity: 0.45; animation: drift 48s linear infinite;
}
@keyframes drift { to { transform: rotate(360deg); } }
.load-inner { position: relative; text-align: center; padding: 2rem; max-width: 28rem; }
.load-inner h1 {
  font-weight: 600; font-size: 2.2rem; letter-spacing: 0.08em;
  color: var(--cream); margin: 0.2rem 0;
}
.load-inner h1 span { color: var(--gold-2); }
.load-sub { color: var(--sand); letter-spacing: 0.22em; font-size: 0.75rem; text-transform: uppercase; margin-bottom: 1.8rem; }
.load-msg { color: var(--gold-2); font-size: 1.05rem; margin-bottom: 0.8rem; }
.load-bar {
  width: 16rem; max-width: 70vw; height: 5px; margin: 0 auto;
  background: rgba(201,168,76,0.2); border: 1px solid rgba(201,168,76,0.45);
  border-radius: 2px; overflow: hidden;
}
.load-bar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #8a7030, #e8d48b, #c9a84c);
  transition: width 0.25s ease;
}
.load-pct { margin-top: 0.45rem; font-size: 0.75rem; color: var(--sand); letter-spacing: 0.12em; }
.star8 {
  width: 56px; height: 56px; margin: 0 auto 1rem;
  background: var(--gold);
  clip-path: polygon(50% 0%, 62% 25%, 90% 10%, 75% 38%, 100% 50%, 75% 62%, 90% 90%, 62% 75%, 50% 100%, 38% 75%, 10% 90%, 25% 62%, 0% 50%, 25% 38%, 10% 10%, 38% 25%);
  filter: drop-shadow(0 0 10px rgba(201,168,76,0.55));
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(0.92) rotate(8deg); opacity: 0.85; } }
#loading.fade { animation: fadeout 0.7s ease forwards; pointer-events: none; }
@keyframes fadeout { to { opacity: 0; visibility: hidden; } }

/* ---------- Onboarding & frames ---------- */
#onboarding, #nowebgl {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7, 14, 30, 0.72);
  backdrop-filter: blur(8px);
  padding: 1.25rem;
}
.ob-frame, .panel-frame, .pp-frame {
  position: relative;
  background:
    var(--pattern),
    linear-gradient(180deg, #152a4e 0%, #0c1e3d 100%);
  background-blend-mode: overlay;
  border: 1px solid var(--gold);
  box-shadow: var(--shadow), inset 0 0 0 4px rgba(12,30,61,0.9), inset 0 0 0 5px var(--gold-dim);
  max-width: 36rem; width: 100%;
  padding: 2rem 1.8rem 1.5rem;
  color: var(--cream);
}
.ob-frame::before, .panel-frame::before {
  content: ""; position: absolute; inset: 8px;
  border: 1px solid rgba(201,168,76,0.35); pointer-events: none;
}
.ob-screen h2, .panel-frame h2, #nowebgl h2 {
  font-weight: 600; font-size: 1.55rem; margin-bottom: 1rem;
  color: var(--gold-2);
}
.ob-screen h2 small, .panel-frame h2 small {
  display: block; font-weight: 400; font-size: 0.85rem;
  color: var(--sand); letter-spacing: 0.06em; margin-top: 0.2rem;
}
.ob-kicker, .panel-kicker {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--turquoise); margin-bottom: 0.4rem;
}
.ob-list, .ob-actions { list-style: none; display: grid; gap: 0.7rem; }
.ob-list li, .ob-notice p { line-height: 1.65; font-size: 0.98rem; }
.ob-en, .ob-muted, .panel-note, .panel-intro {
  margin-top: 0.9rem; font-size: 0.82rem; color: var(--sand); line-height: 1.6;
}
.ob-actions li {
  display: grid; grid-template-columns: 2rem 1fr; gap: 0.7rem; align-items: baseline;
  line-height: 1.5;
}
.ob-actions li span {
  width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold); color: var(--gold-2); font-family: var(--font-ar);
  font-size: 1.05rem;
}
.ob-actions li b { margin-inline-end: 0.4rem; color: var(--gold-2); }
.ob-notice {
  border-top: 1px solid rgba(201,168,76,0.3);
  border-bottom: 1px solid rgba(201,168,76,0.3);
  padding: 1rem 0;
}
.ob-notice strong { color: var(--gold-2); }
.ob-notice .arabic-word { text-align: center; margin-bottom: 0.7rem; display: block; }
.ob-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1.5rem; gap: 0.6rem;
}
.ob-dots { display: flex; gap: 0.4rem; }
.ob-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(201,168,76,0.3); border: 1px solid var(--gold-dim);
}
.ob-dots i.on { background: var(--gold); }

/* ---------- HUD / topbar ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
.topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 0.45rem;
  padding: calc(0.55rem + var(--safe-t)) 0.7rem 0.5rem;
  background: linear-gradient(180deg, rgba(7,14,30,0.78), rgba(7,14,30,0.25) 70%, transparent);
  flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 0.5rem; margin-inline-end: 0.4rem;
  background: none;
}
.brand-mark {
  width: 28px; height: 28px; display: block;
  background: var(--gold);
  clip-path: polygon(50% 0%, 62% 25%, 90% 10%, 75% 38%, 100% 50%, 75% 62%, 90% 90%, 62% 75%, 50% 100%, 38% 75%, 10% 90%, 25% 62%, 0% 50%, 25% 38%, 10% 10%, 38% 25%);
}
.brand strong { display: block; font-size: 0.95rem; letter-spacing: 0.04em; line-height: 1.1; }
.brand em { display: block; font-family: var(--font-ar); font-style: normal; font-size: 0.85rem; color: var(--gold-2); line-height: 1.2; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.32rem 0.65rem;
  background: rgba(12,30,61,0.72);
  border: 1px solid rgba(201,168,76,0.45);
  color: var(--cream); font-size: 0.8rem;
  backdrop-filter: blur(6px);
}
.chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 6px #4ade80;
}
.chip small { color: var(--sand); }
.chip.prayer-chip { margin-inline-start: auto; gap: 0.5rem; }
.chip-label { color: var(--turquoise); font-size: 0.7rem; letter-spacing: 0.08em; }
.prayer-chip strong { color: var(--gold-2); font-weight: 600; }
.prayer-chip #next-prayer-count { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.icon-btn {
  width: 34px; height: 34px;
  border: 1px solid rgba(201,168,76,0.5);
  background: rgba(12,30,61,0.72);
  color: var(--gold-2); font-size: 1rem;
}
.icon-btn[aria-pressed="true"] { color: #888; }
.icon-btn:hover { background: rgba(201,168,76,0.15); }

/* ---------- Prayer prompt ---------- */
#prayer-prompt {
  position: absolute; left: 50%; top: 18%;
  transform: translateX(-50%);
  width: min(28rem, calc(100% - 2rem));
  z-index: 20;
}
.pp-frame { text-align: center; padding: 1.4rem 1.4rem 1.2rem; }
.pp-zh { font-size: 1.2rem; color: var(--gold-2); margin: 0.5rem 0 0.35rem; font-weight: 600; }
.pp-en { font-size: 0.88rem; color: var(--sand); margin-bottom: 1rem; line-height: 1.5; }

/* ---------- Door / toasts / rest ---------- */
.door-btn {
  position: absolute; left: 50%; bottom: 7.6rem;
  transform: translateX(-50%);
  padding: 0.75rem 1.4rem;
  background: linear-gradient(180deg, #e8d48b, #c9a84c);
  color: var(--navy); font-weight: 700; font-size: 1.05rem;
  border: 1px solid #8a7030;
  box-shadow: var(--shadow);
  letter-spacing: 0.04em;
}
.door-btn small { display: block; font-weight: 400; font-size: 0.72rem; letter-spacing: 0.06em; }
#toast-wrap {
  position: absolute; left: 50%; top: 5.5rem;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 0.4rem;
  width: min(26rem, calc(100% - 2rem));
  pointer-events: none;
}
.toast {
  text-align: center; padding: 0.7rem 1rem;
  background: rgba(12,30,61,0.88);
  border: 1px solid var(--gold);
  color: var(--gold-2);
  box-shadow: var(--shadow);
  animation: toastin 0.3s ease;
}
.toast b { display: block; font-size: 1.05rem; }
.toast small { color: var(--sand); }
@keyframes toastin { from { opacity: 0; transform: translateY(-8px); } }
#rest-banner {
  position: absolute; left: 50%; top: 30%;
  transform: translateX(-50%);
  width: min(26rem, calc(100% - 2rem));
  padding: 1.2rem 1.3rem;
  background: rgba(12,30,61,0.9);
  border: 1px solid var(--gold);
  text-align: center;
}
#rest-banner p { margin-bottom: 0.9rem; font-size: 1.1rem; color: var(--gold-2); }
#rest-banner small { display: block; color: var(--sand); font-size: 0.8rem; }
#rest-banner div { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.action-hint {
  position: absolute; left: 50%; bottom: 7.4rem;
  transform: translateX(-50%);
  background: rgba(12,30,61,0.75);
  border: 1px solid rgba(201,168,76,0.4);
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem; color: var(--sand);
  pointer-events: none; white-space: nowrap;
}

/* ---------- Action bar ---------- */
.actions {
  position: absolute; left: 50%; bottom: calc(0.7rem + var(--safe-b));
  transform: translateX(-50%);
  display: flex; gap: 0.4rem;
  padding: 0.4rem;
  background: rgba(12,30,61,0.78);
  border: 1px solid rgba(201,168,76,0.45);
  backdrop-filter: blur(8px);
}
.actions button {
  min-width: 4.2rem; padding: 0.4rem 0.45rem 0.45rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  border: 1px solid transparent; color: var(--cream);
}
.actions button:hover, .actions button.on {
  border-color: var(--gold); background: rgba(201,168,76,0.12); color: var(--gold-2);
}
.actions kbd { margin-bottom: 0.1rem; }
.actions span { font-size: 0.85rem; font-weight: 600; }
.actions small { font-size: 0.65rem; color: var(--sand); letter-spacing: 0.04em; }

/* ---------- Joystick ---------- */
.joystick {
  position: absolute;
  inset-inline-start: 1rem; bottom: calc(6.5rem + var(--safe-b));
  width: 128px; height: 128px;
  touch-action: none;
}
.joy-base {
  width: 100%; height: 100%; border-radius: 50%;
  background: rgba(12,30,61,0.45);
  border: 1px solid rgba(201,168,76,0.45);
  position: relative;
}
.joy-knob {
  position: absolute; left: 50%; top: 50%;
  width: 54px; height: 54px; margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(201,168,76,0.75);
  border: 2px solid var(--gold-2);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  pointer-events: none;
}
.look-hint {
  position: absolute; inset-inline-end: 1rem; bottom: calc(6.5rem + var(--safe-b));
  font-size: 0.72rem; color: rgba(247,240,225,0.55);
  pointer-events: none;
}

/* ---------- Panels ---------- */
.panel {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7,14,30,0.62);
  backdrop-filter: blur(6px);
  padding: 1rem;
}
[hidden] { display: none !important; }

.panel-frame { max-height: min(90vh, 44rem); overflow: auto; width: min(38rem, 100%); }
.panel-close {
  position: absolute; top: 0.6rem; inset-inline-end: 0.8rem;
  width: 2rem; height: 2rem; font-size: 1.5rem; color: var(--gold-2); line-height: 1;
  z-index: 2;
}
.panel-close:hover { color: #fff; }

.ayah-list { list-style: none; display: grid; gap: 1rem; }
.ayah {
  padding: 0.7rem 0.4rem;
  border-bottom: 1px solid rgba(201,168,76,0.2);
}
.ayah .ar {
  font-family: var(--font-ar); direction: rtl; text-align: start;
  font-size: 1.65rem; line-height: 2; color: var(--gold-2);
}
.ayah .tr { font-size: 0.88rem; color: var(--sand); font-style: italic; margin: 0.2rem 0; }
.ayah .zh { font-size: 0.95rem; color: var(--cream); }
.ayah .n {
  float: inline-start; width: 1.4rem; height: 1.4rem;
  border: 1px solid var(--gold-dim); color: var(--gold);
  font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
  margin: 0.3rem 0.5rem 0 0;
}

/* Dhikr */
.dhikr-modes { display: flex; gap: 0.3rem; margin: 0.8rem 0 1rem; }
.seg {
  flex: 1; padding: 0.45rem 0.4rem;
  border: 1px solid rgba(201,168,76,0.4); font-size: 0.85rem; color: var(--sand);
}
.seg.on { background: rgba(201,168,76,0.18); color: var(--gold-2); border-color: var(--gold); }
.dhikr-phrase { text-align: center; min-height: 6.2rem; }
.dhikr-phrase .ar {
  font-family: var(--font-ar); font-size: 2.3rem; color: var(--gold-2);
  direction: rtl; display: block; line-height: 1.6;
}
.dhikr-phrase .tr { display: block; color: var(--sand); font-style: italic; margin: 0.15rem 0; }
.dhikr-phrase .zh { display: block; color: var(--cream); }
.dhikr-phrase .step { font-size: 0.75rem; color: var(--turquoise); letter-spacing: 0.12em; margin-bottom: 0.3rem; }
.beads {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 5px;
  margin: 0.6rem auto; max-width: 22rem;
}
.beads i {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(201,168,76,0.2);
  border: 1px solid var(--gold-dim);
}
.beads i.on {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(201,168,76,0.7);
}
.dhikr-progress {
  text-align: center; font-size: 1.3rem; color: var(--gold-2);
  font-variant-numeric: tabular-nums; margin: 0.3rem 0;
}
.dhikr-progress.big { font-size: 3.2rem; font-weight: 600; }
.dhikr-total { text-align: center; color: var(--sand); font-size: 0.85rem; margin-top: 0.6rem; }

/* Times & cities */
.times-list, .city-list { list-style: none; display: grid; gap: 0.35rem; margin: 0.8rem 0; }
.times-list li, .city-list button {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(201,168,76,0.25);
  background: rgba(0,0,0,0.15);
  width: 100%; text-align: left; color: inherit; font-size: 0.95rem;
}
.times-list li.next, .city-list button.on {
  border-color: var(--gold); background: rgba(201,168,76,0.12);
}
.times-list .nm { color: var(--gold-2); }
.times-list .tm { font-variant-numeric: tabular-nums; letter-spacing: 0.05em; }
.times-city { color: var(--sand); font-size: 0.88rem; }
.city-list button:hover { border-color: var(--gold); }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .topbar { gap: 0.3rem; }
  .brand em { display: none; }
  .chip { font-size: 0.72rem; padding: 0.28rem 0.45rem; }
  .chip.prayer-chip { margin-inline-start: 0; order: 5; flex: 1 1 100%; justify-content: center; }
  .actions { width: calc(100% - 1rem); justify-content: space-around; }
  .actions button { min-width: 0; flex: 1; padding: 0.35rem 0.15rem; }
  .actions kbd { display: none; }
  .look-hint { display: none; }
  .door-btn { bottom: 6.8rem; }
  .arabic-word { font-size: 2rem; }
  .ayah .ar { font-size: 1.4rem; }
  .ob-frame, .panel-frame { padding: 1.5rem 1.1rem 1.1rem; }
}
@media (pointer: fine) {
  .joystick { display: none !important; }
}
@media (pointer: coarse) {
  .joystick { display: block; }
  .actions kbd { display: none; }
}

#hud.panel-open .actions,
#hud.panel-open .joystick,
#hud.panel-open .door-btn { visibility: hidden; }

/* mobile fix: keep onboarding/panels scrollable so buttons stay reachable */
#onboarding, #nowebgl { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ob-frame { margin: auto; max-height: none; }
.ob-actions li > div { min-width: 0; }
@media (max-height: 760px), (max-width: 720px) {
  #onboarding { align-items: flex-start; padding: 0.75rem; }
  .ob-list li, .ob-notice p { font-size: 0.92rem; line-height: 1.55; }
  .ob-nav { position: sticky; bottom: 0; background: #0c1e3d; padding: 0.7rem 0; z-index: 2; }
}


/* ---- Language & RTL ---- */
html[lang="ar"] body {
  font-family: "Noto Naskh Arabic", "Amiri", "Noto Sans SC", "Segoe UI", sans-serif;
}
html:not([lang="ar"]) .brand-ar { display: none !important; }
html[lang="ar"] .brand-ar { display: block; font-style: normal; }
html[lang="ar"] .brand em.brand-ar { display: none; } /* brand strong already says سكينة */
html[lang="ar"] #loading .brand-ar { display: block; }

.lang-wrap { position: relative; }
#lang-menu {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-end: 0;
  min-width: 11rem;
  background: rgba(12,30,61,0.96);
  border: 1px solid var(--gold);
  box-shadow: var(--shadow);
  list-style: none;
  z-index: 40;
  padding: 0.25rem;
}
#lang-menu button {
  display: block; width: 100%; text-align: start;
  padding: 0.5rem 0.7rem; color: var(--cream); font-size: 0.9rem;
}
#lang-menu button:hover, #lang-menu button[aria-current="true"] {
  background: rgba(201,168,76,0.18); color: var(--gold-2);
}
#btn-lang { font-size: 0.85rem; letter-spacing: 0; }

/* Sacred Arabic stays RTL even in LTR UIs */
.sacred, .ayah .ar, .dhikr-phrase .ar, .arabic-word {
  direction: rtl;
  unicode-bidi: isolate;
  font-family: var(--font-ar);
}
.ayah .tr { font-style: italic; }
html[lang="ar"] .ayah .tr { display: none; }
html[lang="ar"] .dhikr-phrase .tr { display: none; }

/* RTL polish */
html[dir="rtl"] .ayah .n { float: right; margin: 0.3rem 0 0 0.5rem; }
html[dir="rtl"] .ob-actions li { direction: rtl; }
html[dir="rtl"] kbd { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .prayer-chip #next-prayer-count { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .dhikr-progress, html[dir="rtl"] #load-pct { direction: ltr; unicode-bidi: isolate; }

.pp-title { font-size: 1.15rem; color: var(--gold-2); margin: 0.5rem 0 1rem; font-weight: 600; line-height: 1.5; }

/* action buttons no longer have a secondary English line */
.actions button span { font-size: 0.85rem; font-weight: 600; }
.actions button small { display: none; }

@media (max-width: 720px) {
  .chip.prayer-chip { margin-inline-start: 0; }
  #lang-menu { inset-inline-end: 0; max-width: calc(100vw - 2rem); }
}

.ayah .meaning, .dhikr-phrase .meaning { font-size: 0.95rem; color: var(--cream); }
.dhikr-phrase .meaning { display: block; color: var(--cream); }
html[lang="ar"] .ayah .meaning,
html[lang="ar"] .dhikr-phrase .meaning { display: none; }

#city-name {
  max-width: 11em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}
#btn-presence, #btn-presence small, #next-prayer-count, #online-count {
  direction: ltr;
  unicode-bidi: isolate;
}
@media (max-width: 720px) {
  #btn-city { min-width: 0; flex: 1 1 auto; }
  #city-name { max-width: 11em; }
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  margin-inline-start: auto;
}
@media (max-width: 720px) {
  .top-tools { margin-inline-start: 0; }
  .icon-btn { width: 1.85rem; height: 1.85rem; padding: 0; }
}
