  :root {
    --primary: #dc3f3c;
    --primary-dark: #b32023;
    --primary-light: #f0615a;
    --primary-muted: rgba(220,63,60,0.08);
    --primary-muted2: rgba(220,63,60,0.15);
    --surface: #fcf9f7;
    --surface-card: #ffffff;
    --surface-low: #f6f3f1;
    --surface-container: #f0edeb;
    --on-surface: #1b1c1b;
    --on-surface-variant: #5a403e;
    --outline: #8e706d;
    --outline-variant: #e3beba;
    --gold: #c9a84c;
    --gold-light: #f5e6b8;
    --shadow-sm: 0 1px 3px rgba(27,28,27,0.08);
    --shadow-md: 0 4px 16px rgba(27,28,27,0.10);
    --shadow-lg: 0 8px 32px rgba(27,28,27,0.12);
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-full: 999px;
    --font-headline: 'Urbanist', sans-serif;
    --font-body: 'Urbanist', sans-serif;
    --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  }



  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--on-surface);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-style: normal;
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
    user-select: none;
  }
  .fill-1 { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

  /* ── HEADER ── */
  header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--outline-variant);
    padding: 0 20px;
    height: 60px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .header-brand { display: flex; align-items: center; gap: 10px; }
  .header-brand h1 { font-family: var(--font-headline); font-size: 22px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
  .header-brand span { font-size: 11px; color: var(--on-surface-variant); font-weight: 500; letter-spacing: 0.05em; border-left: 1px solid var(--outline-variant); padding-left: 10px; }
  .header-actions { display: flex; align-items: center; gap: 8px; }
  .header-actions button { background: none; border: none; cursor: pointer; color: var(--on-surface-variant); padding: 6px; border-radius: var(--r-sm); transition: background var(--transition); /*display: flex;*/ height:30px; align-items: center; }
  .header-actions button:hover { background: var(--surface-container); }

  /* ── NAV TABS ── */
  .nav-tabs {
    display: flex; gap: 4px; overflow-x: auto;
    padding: 12px 20px; background: var(--surface-card);
    border-bottom: 1px solid var(--outline-variant);
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tab {
    flex-shrink: 0; display: flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: var(--r-full);
    font-size: 13px; font-weight: 600; cursor: pointer;
    border: 1.5px solid transparent;
    transition: all var(--transition); white-space: nowrap;
    background: var(--surface-low); color: var(--on-surface-variant);
    font-family: var(--font-body);
  }
  .nav-tab:hover { background: var(--primary-muted); color: var(--primary); border-color: var(--primary-muted2); }
  .nav-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
  .nav-tab .material-symbols-outlined { font-size: 16px; }

  /* ── MAIN LAYOUT ── */
  main { flex: 1; display: flex; overflow: hidden; }

  /* ── SIDEBAR ── */
  .sidebar {
    width: 280px; flex-shrink: 0;
    background: var(--surface-card);
    border-right: 1px solid var(--outline-variant);
    overflow-y: auto; display: flex; flex-direction: column;
    height: calc(100vh - 109px);
    position: sticky; top: 109px;
  }
  .sidebar-section { padding: 16px 12px 8px; }
  .sidebar-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--outline); padding: 0 8px 8px; }
  .sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--r-md);
    cursor: pointer; transition: all var(--transition);
    font-size: 13.5px; font-weight: 500; color: var(--on-surface-variant);
    border: 1px solid transparent;
  }
  .sidebar-item:hover { background: var(--surface-low); color: var(--on-surface); }
  .sidebar-item.active { background: var(--primary-muted); color: var(--primary); border-color: var(--primary-muted2); }
  .sidebar-item .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }
  .sidebar-item .step-badge {
    margin-left: auto; font-size: 10px; font-weight: 700;
    background: var(--primary-muted2); color: var(--primary);
    padding: 2px 7px; border-radius: var(--r-full);
  }
  .sidebar-item.done .step-badge { background: #e8f5e9; color: #2e7d32; }
  .sidebar-divider { margin: 4px 12px; border: none; border-top: 1px solid var(--outline-variant); }

  /* ── CONTENT AREA ── */
  .content-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px 28px 60px;
    height: calc(100vh - 109px);
    display: flex;
    justify-content: center;
  }

  .content-inner {
    width: 100%;
    max-width: 840px; 
  }

  /* ── RIGHT PANEL ── */
  .right-panel {
    width: 260px; flex-shrink: 0;
    background: var(--surface-card);
    border-left: 1px solid var(--outline-variant);
    overflow-y: auto;
    padding: 20px 16px;
    height: calc(100vh - 109px);
    position: sticky; top: 109px;
  }

  /* ── HERO BANNER ── */
  .hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    border-radius: var(--r-xl); padding: 28px 28px 24px;
    color: white; margin-bottom: 28px; position: relative; overflow: hidden;
  }
  .hero::before {
    content: ''; position: absolute; top: -30px; right: -30px;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(255,255,255,0.06);
  }
  .hero-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.8; margin-bottom: 6px; }
  .hero h2 { font-family: var(--font-headline); font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
  .hero p { font-size: 13.5px; opacity: 0.85; line-height: 1.6; margin-bottom: 18px; }
  .hero-progress { background: rgba(255,255,255,0.2); border-radius: var(--r-full); height: 5px; margin-bottom: 8px; }
  .hero-progress-bar { height: 100%; border-radius: var(--r-full); background: white; transition: width 0.6s ease; }
  .hero-meta { display: flex; justify-content: space-between; align-items: center; }
  .hero-meta span { font-size: 12px; opacity: 0.8; }
  .hero-meta strong { font-size: 12px; font-weight: 700; }

  /* ── SECTION TITLE ── */
  .section-title {
    font-family: var(--font-headline); font-size: 22px; font-weight: 800;
    color: var(--on-surface); margin-bottom: 4px; letter-spacing: -0.3px;
  }
  .section-subtitle { font-size: 14px; color: var(--on-surface-variant); margin-bottom: 24px; line-height: 1.5; }

  /* ── CARDS ── */
  .card {
    background: var(--surface-card); border-radius: var(--r-lg);
    border: 1px solid var(--outline-variant); padding: 20px;
    margin-bottom: 16px; transition: box-shadow var(--transition);
  }
  .card:hover { box-shadow: var(--shadow-sm); }

  .card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
  .card-icon { width: 40px; height: 40px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .card-icon.red { background: var(--primary-muted); color: var(--primary); }
  .card-icon.gold { background: var(--gold-light); color: var(--gold); }
  .card-icon.green { background: #e8f5e9; color: #2e7d32; }
  .card-icon.blue { background: #e3f2fd; color: #1565c0; }
  .card-title { font-family: var(--font-headline); font-size: 17px; font-weight: 700; color: var(--on-surface); margin-bottom: 4px; }
  .card-body { font-size: 14px; color: var(--on-surface-variant); line-height: 1.7; }

  /* ── QURAN / HADITH BLOCKS ── */
  .quran-block {
    background: linear-gradient(135deg, #fff8f0, #fff3e0);
    border: 1px solid #f9c06a;
    border-left: 4px solid var(--gold);
    border-radius: var(--r-md); padding: 14px 16px; margin: 14px 0;
  }
  .quran-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
  .quran-text { font-size: 13.5px; color: #5d4037; line-height: 1.7; font-style: italic; }
  .quran-ref { font-size: 11.5px; color: #8d6e63; margin-top: 5px; font-weight: 600; }

  .hadith-block {
    background: var(--primary-muted);
    border: 1px solid var(--primary-muted2);
    border-left: 4px solid var(--primary);
    border-radius: var(--r-md); padding: 14px 16px; margin: 14px 0;
  }
  .hadith-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
  .hadith-text { font-size: 13.5px; color: var(--primary-dark); line-height: 1.7; font-style: italic; }
  .hadith-ref { font-size: 11.5px; color: var(--primary); margin-top: 5px; font-weight: 600; }

  /* ── DUA BLOCKS ── */
  .dua-card {
    background: linear-gradient(135deg, #f3e5f5, #ede7f6);
    border: 1px solid #ce93d8; border-radius: var(--r-lg);
    padding: 18px; margin: 16px 0;
  }
  .dua-arabic { font-size: 22px; text-align: right; direction: rtl; color: #4a148c; font-weight: 600; line-height: 1.8; margin-bottom: 10px; }
  .dua-transliteration { font-size: 13px; color: #6a1b9a; font-style: italic; margin-bottom: 6px; line-height: 1.6; }
  .dua-translation { font-size: 13px; color: #7b1fa2; line-height: 1.6; }
  .dua-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #7b1fa2; margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }

  /* ── STEP TIMELINE ── */
  .timeline { position: relative; padding-left: 36px; margin: 20px 0; }
  .timeline::before { content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--outline-variant); border-radius: 1px; }
  .timeline-item { position: relative; margin-bottom: 20px; }
  .timeline-dot {
    position: absolute; left: -36px; top: 2px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--surface-card); border: 2px solid var(--outline-variant);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: var(--outline);
  }
  .timeline-dot.active { background: var(--primary); border-color: var(--primary); color: white; }
  .timeline-dot.done { background: #2e7d32; border-color: #2e7d32; color: white; font-size: 11px; }
  .timeline-title { font-size: 15px; font-weight: 700; color: var(--on-surface); margin-bottom: 4px; }
  .timeline-body { font-size: 13.5px; color: var(--on-surface-variant); line-height: 1.65; }

  /* ── CHECKLIST ── */
  .checklist { list-style: none; margin: 12px 0; }
  .checklist li {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 0; font-size: 14px; color: var(--on-surface-variant);
    line-height: 1.6; border-bottom: 1px solid var(--outline-variant);
  }
  .checklist li:last-child { border-bottom: none; }
  .check-box {
    width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
    border: 2px solid var(--outline-variant); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-card); transition: all var(--transition); margin-top: 1px;
  }
  .check-box.checked { background: var(--primary); border-color: var(--primary); }
  .check-box .material-symbols-outlined { font-size: 13px; color: white; display: none; }
  .check-box.checked .material-symbols-outlined { display: flex; }
  .checklist li.done span.item-text { text-decoration: line-through; opacity: 0.55; }

  /* ── LARANGAN GRID ── */
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
  .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin: 16px 0; }
  .mini-card {
    background: var(--surface-low); border-radius: var(--r-md);
    border: 1px solid var(--outline-variant); padding: 14px;
  }
  .mini-card-icon { font-size: 22px; margin-bottom: 6px; }
  .mini-card-title { font-size: 12.5px; font-weight: 700; color: var(--on-surface); margin-bottom: 3px; }
  .mini-card-body { font-size: 12px; color: var(--on-surface-variant); line-height: 1.5; }

  /* ── BADGE ── */
  .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-full); font-size: 11px; font-weight: 700; }
  .badge-red { background: var(--primary-muted); color: var(--primary); }
  .badge-green { background: #e8f5e9; color: #2e7d32; }
  .badge-gold { background: var(--gold-light); color: #8a6400; }
  .badge-blue { background: #e3f2fd; color: #1565c0; }

  /* ── PROGRESS TRACKER ── */
  .progress-tracker { background: var(--surface-card); border-radius: var(--r-lg); border: 1px solid var(--outline-variant); padding: 16px; margin-bottom: 20px; }
  .progress-tracker-title { font-size: 13px; font-weight: 700; color: var(--on-surface); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
  .rukun-steps { display: flex; flex-direction: column; gap: 8px; }
  .rukun-step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); cursor: pointer; transition: all var(--transition); border: 1px solid transparent; }
  .rukun-step:hover { background: var(--surface-low); }
  .rukun-step.active { background: var(--primary-muted); border-color: var(--primary-muted2); }
  .rukun-step.done { background: #f1f8e9; border-color: #c5e1a5; }
  .step-num { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface-container); color: var(--outline); }
  .rukun-step.active .step-num { background: var(--primary); color: white; }
  .rukun-step.done .step-num { background: #2e7d32; color: white; }
  .step-info { flex: 1; }
  .step-name { font-size: 13px; font-weight: 700; color: var(--on-surface); }
  .step-desc { font-size: 11.5px; color: var(--on-surface-variant); margin-top: 1px; }
  .rukun-step.done .step-name { color: #2e7d32; }

  /* ── QUICK STATS ── */
  .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
  .stat-card { background: var(--surface-low); border-radius: var(--r-md); border: 1px solid var(--outline-variant); padding: 12px 14px; }
  .stat-label { font-size: 11px; color: var(--on-surface-variant); margin-bottom: 4px; font-weight: 500; }
  .stat-value { font-family: var(--font-headline); font-size: 20px; font-weight: 800; color: var(--on-surface); }
  .stat-value.red { color: var(--primary); }

  /* ── PAGE SECTIONS (shown/hidden) ── */
  .page-section { display: none; }
  .page-section.active { display: block; }

  /* ── ZIARAH LOCATION CARDS ── */
  .location-card {
    background: var(--surface-card); border-radius: var(--r-lg);
    border: 1px solid var(--outline-variant); overflow: hidden; margin-bottom: 16px;
  }
  .location-header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); padding: 16px 18px; color: white; }
  .location-header h3 { font-family: var(--font-headline); font-size: 17px; font-weight: 700; margin-bottom: 3px; }
  .location-header span { font-size: 12px; opacity: 0.8; }
  .location-body { padding: 16px 18px; }

  /* ── TIPS CARDS ── */
  .tip-card { display: flex; gap: 14px; padding: 14px; background: var(--surface-low); border-radius: var(--r-md); border: 1px solid var(--outline-variant); margin-bottom: 10px; }
  .tip-icon { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--primary-muted); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .tip-title { font-size: 13.5px; font-weight: 700; color: var(--on-surface); margin-bottom: 3px; }
  .tip-body { font-size: 13px; color: var(--on-surface-variant); line-height: 1.6; }

  /* ── RESPONSIVE ── */
  @media (max-width: 1024px) {
    .right-panel { display: none; }
  }
  @media (max-width: 768px) {
    .sidebar { display: none; }
    .content-area { padding: 20px 16px 60px; height: auto; }
  }

  /* ── SEARCH ── */
  .search-bar {
    padding: 12px 16px; border-bottom: 1px solid var(--outline-variant);
    background: var(--surface-card);
  }
  .search-input {
    width: 100%; padding: 9px 12px 9px 36px; border-radius: var(--r-md);
    border: 1px solid var(--outline-variant); background: var(--surface-low);
    font-family: var(--font-body); font-size: 13.5px; color: var(--on-surface);
    outline: none; transition: border-color var(--transition);
  }
  .search-input:focus { border-color: var(--primary); }
  .search-wrapper { position: relative; }
  .search-wrapper .material-symbols-outlined { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--outline); pointer-events: none; }

  /* ── SCROLL SMOOTH ── */
  html { scroll-behavior: smooth; }

  /* ── PAGE TRANSITIONS ── */
  .page-section { animation: fadeIn 0.25s ease; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

  /* ── MOBILE BOTTOM NAV ── */
  .mobile-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px);
    border-top: 1px solid var(--outline-variant); padding: 8px 0 12px;
    z-index: 100;
  }
  .mobile-nav-inner { display: flex; justify-content: space-around; }
  .mobile-nav-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; padding: 6px 12px; border-radius: var(--r-md); transition: all var(--transition); background: none; border: none; color: var(--outline); }
  .mobile-nav-btn.active { color: var(--primary); }
  .mobile-nav-btn span:first-child { font-size: 22px; }
  .mobile-nav-btn span:last-child { font-size: 10px; font-weight: 600; font-family: var(--font-body); }
  @media (max-width: 768px) { .mobile-nav { display: block; } }

  h3.subsection { font-family: var(--font-headline); font-size: 16px; font-weight: 700; color: var(--on-surface); margin: 20px 0 10px; }
  p.body-text { font-size: 14px; color: var(--on-surface-variant); line-height: 1.75; margin-bottom: 12px; }
  .highlight-box { background: var(--primary-muted); border-radius: var(--r-md); padding: 14px 16px; margin: 14px 0; border: 1px solid var(--primary-muted2); }
  .highlight-box p { font-size: 13.5px; color: var(--primary-dark); line-height: 1.7; }

  /* ─── Tracker styles ─── */
.tracker-card { background: #fff; border-radius: 16px; border: 1px solid #eadfd8; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.tracker-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.tracker-title-block { flex: 1; }
.tracker-title { font-size: 18px; font-weight: 800; color: #2a2a2a; display: flex; align-items: center; gap: 8px; }
.tracker-subtitle { font-size: 12.5px; color: #888; margin-top: 2px; }
.tracker-icon { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #dc3f3c, #b32023); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.tracker-icon .material-symbols-outlined { font-size: 24px; }
.counter-display { text-align: center; background: linear-gradient(135deg, #fff8f7, #fff3f2); border-radius: 14px; padding: 24px 16px; margin-bottom: 16px; border: 1px solid #fadbd8; }
.counter-number { font-size: 64px; font-weight: 900; line-height: 1; color: #dc3f3c; font-family: 'Urbanist', sans-serif; }
.counter-label { font-size: 13px; color: #888; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.counter-of { font-size: 20px; color: #b32023; font-weight: 600; }
.dot-row { display: flex; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.dot { width: 26px; height: 26px; border-radius: 50%; background: #f3e6e4; border: 2px solid #fadbd8; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #c9a4a1; transition: all 0.3s; }
.dot.done { background: linear-gradient(135deg, #dc3f3c, #b32023); border-color: #b32023; color: #fff; transform: scale(1.05); box-shadow: 0 2px 6px rgba(220,63,60,0.3); }
.timer-display { text-align: center; font-family: 'Urbanist', monospace; font-size: 32px; font-weight: 700; color: #2a2a2a; background: #f9f5f2; border-radius: 12px; padding: 12px; margin-bottom: 14px; letter-spacing: 0.05em; border: 1px solid #eadfd8; }
.timer-display.running { color: #dc3f3c; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.btn-row.three { grid-template-columns: 1fr 1fr 1fr; }
.tracker-btn { padding: 12px 14px; border-radius: 10px; border: none; font-family: 'Urbanist', sans-serif; font-weight: 700; font-size: 13px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tracker-btn .material-symbols-outlined { font-size: 17px; }
.tracker-btn.primary { background: #dc3f3c; color: #fff; }
.tracker-btn.primary:hover { background: #b32023; }
.tracker-btn.secondary { background: #fff; color: #dc3f3c; border: 1.5px solid #fadbd8; }
.tracker-btn.secondary:hover { background: #fff5f4; }
.tracker-btn.ghost { background: #f3f3f3; color: #666; border: 1px solid #e5e5e5; }
.tracker-btn.ghost:hover { background: #e9e9e9; }
.tracker-btn.big { padding: 14px; font-size: 14px; }
.tracker-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.complete-banner { background: linear-gradient(135deg, #d4edda, #c3e6cb); border: 1px solid #28a745; border-radius: 12px; padding: 14px; text-align: center; color: #155724; font-weight: 700; font-size: 14px; margin-bottom: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tracker-info { background: #fff8e1; border-left: 3px solid #c9a84c; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #6b5410; margin-top: 12px; }

/* ─── Language toggle ─── */
.lang-toggle {
      display: inline-flex; background: #f3f3f3; border-radius: 10px;
      padding: 3px; gap: 2px; border: 1px solid #e5e5e5;
    }
    .lang-btn {
      padding: 5px 12px; border-radius: 999px; border: none;
      background-color: transparent; cursor: pointer;
      font-family: 'Urbanist', sans-serif; font-weight: 700; font-size: 12px;
      color: #666;
      transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
      -webkit-tap-highlight-color: transparent;
      -webkit-appearance: none;
      appearance: none;
      outline: none;
    }
    .lang-btn:focus { outline: none; }
    .lang-btn.active {
      background-color: #dc3f3c !important;
      color: #fff !important;
      box-shadow: 0 2px 4px rgba(220,63,60,0.2);
    }

/* ─── Prayer times widget ─── */
.prayer-widget {
    background: linear-gradient(135deg, #4a4f50 0%, #6c7583 100%);
    color: #fff;
    border-radius: 16px;
    padding: 18px;
    margin-top: 16px;
    box-shadow: 0 4px 14px rgba(26, 58, 92, 0.2);
}
.pw-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 10px;
}
.pw-location {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; opacity: 0.9; font-weight: 600;
}
.pw-location .material-symbols-outlined { font-size: 16px; }
.pw-loc-toggle {
  display: inline-flex; background: rgba(255,255,255,0.12);
  border-radius: 999px; padding: 2px; gap: 2px;
}
.pw-loc-btn {
  padding: 4px 10px; border-radius: 999px; border: none; background: transparent;
  color: #fff; font-family: 'Urbanist', sans-serif; font-weight: 700;
  font-size: 11px; cursor: pointer; opacity: 0.7; transition: all 0.2s;
}
.pw-loc-btn.active { background: rgba(255,255,255,0.25); opacity: 1; }
.pw-dates {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 12px; font-size: 12px;
} 
.pw-date-block { flex: 1; }
.pw-date-label { font-size: 10px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.06em; }
.pw-date-value { font-size: 13px; font-weight: 700; margin-top: 2px; }
.pw-next {
  background: rgba(255,255,255,0.12); border-radius: 12px; padding: 12px;
  text-align: center; margin-bottom: 12px;
}
.pw-next-label { font-size: 10.5px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.pw-next-name { font-size: 18px; font-weight: 800; margin: 4px 0; }
.pw-next-time { font-size: 30px; opacity: 0.98; font-weight: 800; color: #ffc802f0; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.pw-next-note { font-size: 11px; opacity: 0.72; margin-top: 6px; }
.pw-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  font-size: 11px;
}
.pw-cell { text-align: center; padding: 8px 4px; border-radius: 8px; background: rgba(255,255,255,0.06); }
.pw-cell.now { background: rgba(255,255,255,0.22); }
.pw-cell-name { font-weight: 700; opacity: 0.85; font-size: 10.5px; }
.pw-cell-time { font-size: 12.5px; font-weight: 800; margin-top: 3px; }
.pw-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px;
}
.pw-btn {
  background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px; padding: 10px; font-family: 'Urbanist', sans-serif;
  font-weight: 700; font-size: 12px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 6px;
}
.pw-btn:hover { background: rgba(255,255,255,0.22); }
.pw-btn .material-symbols-outlined { font-size: 16px; }
.pw-error {
  background: rgba(255,255,255,0.1); padding: 12px; border-radius: 10px;
  font-size: 12px; text-align: center; opacity: 0.9;
}

/* ─── Qibla compass modal ─── */
.qibla-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 10000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.qibla-modal.open { display: flex; }
.qibla-card {
  background: #fff; border-radius: 20px; padding: 28px 24px; max-width: 360px;
  width: 100%; text-align: center;
}
.qibla-card h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; color: #2a2a2a; }
.qibla-card .sub { font-size: 12px; color: #888; margin-bottom: 20px; }
.qibla-compass {
  width: 220px; height: 220px; margin: 0 auto 18px; position: relative;
  border-radius: 50%; background: radial-gradient(circle, #fff8f7 0%, #fadbd8 100%);
  border: 3px solid #dc3f3c; display: flex; align-items: center; justify-content: center;
}
.qibla-needle {
  position: absolute; width: 4px; height: 90px; background: linear-gradient(180deg, #dc3f3c 0%, #dc3f3c 50%, #ccc 50%, #ccc 100%);
  top: 20px; left: 50%; transform-origin: bottom center; margin-left: -2px;
  transition: transform 0.2s ease-out; border-radius: 4px;
}
.qibla-kaaba {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  font-size: 22px;
}
.qibla-degree { font-size: 28px; font-weight: 900; color: #dc3f3c; margin-bottom: 4px; }
.qibla-status { font-size: 12px; color: #666; margin-bottom: 18px; min-height: 16px; }
.qibla-close {
  background: #dc3f3c; color: #fff; border: none; border-radius: 12px;
  padding: 12px 24px; font-family: 'Urbanist', sans-serif; font-weight: 700;
  font-size: 14px; cursor: pointer; width: 100%;
}


/* ─── Rukun diagram image ─── */
.rukun-diagram {
  margin: 0 0 16px;
  border-radius: 14px;
  overflow: hidden;
  background: #faf6f2;
  border: 1px solid #eadfd8;
  cursor: zoom-in;
  position: relative;
  transition: transform 0.15s;
}
.rukun-diagram:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.rukun-diagram img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.rukun-diagram-hint {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 10.5px; font-weight: 600;
  padding: 4px 9px; border-radius: 999px;
  display: flex; align-items: center; gap: 4px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.rukun-diagram-hint .material-symbols-outlined { font-size: 13px; }

/* ─── Image zoom modal ─── */
.img-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 10001;
  display: none; align-items: center; justify-content: center;
  padding: 0; overflow: auto;
}
.img-modal.open { display: flex; }
.img-modal-content {
  max-width: 100%; max-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.img-modal img {
  max-width: 100%; max-height: 100vh;
  object-fit: contain;
  /* Allow pinch-zoom on mobile */
  touch-action: pinch-zoom;
  transform-origin: center;
}
.img-modal-close {
  position: fixed; top: 16px; right: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(8px);
  z-index: 10002;
}
.img-modal-close:hover { background: rgba(255,255,255,0.25); }
.img-modal-close .material-symbols-outlined { font-size: 24px; }
.img-modal-caption {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.6); color: #fff; padding: 8px 16px;
  border-radius: 999px; font-size: 12px; backdrop-filter: blur(6px);
  max-width: 90vw; text-align: center;
}

/* ─── Navigation UX fixes ─── */

/* Arrival highlight flash — soft red pulse on the target section */
@keyframes arrive-flash {
  0%   { background-color: rgba(220, 63, 60, 0.00); box-shadow: 0 0 0 0 rgba(220,63,60,0.0); }
  15%  { background-color: rgba(220, 63, 60, 0.10); box-shadow: 0 0 0 4px rgba(220,63,60,0.15); }
  100% { background-color: rgba(220, 63, 60, 0.00); box-shadow: 0 0 0 0 rgba(220,63,60,0.0); }
}
.section-arriving {
  animation: arrive-flash 1.5s ease-out;
  border-radius: 12px;
}

/* Breadcrumb strip — shown after section-level navigation */
.breadcrumb {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  margin: 0 0 12px;
  background: linear-gradient(135deg, #fff8f7, #fff3f2);
  border: 1px solid #fadbd8;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #888;
  animation: breadcrumb-in 0.3s ease-out;
}
.breadcrumb.show { display: flex; }
.breadcrumb .crumb {
  color: #b32023;
  cursor: pointer;
  text-decoration: none;
}
.breadcrumb .crumb:hover { text-decoration: underline; }
.breadcrumb .crumb-current {
  color: #2a2a2a;
  font-weight: 700;
}
.breadcrumb .sep {
  color: #c9a4a1;
  font-size: 14px;
  line-height: 1;
}
.breadcrumb .material-symbols-outlined {
  font-size: 15px;
  color: #dc3f3c;
}
.breadcrumb .dismiss {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #c9a4a1;
  cursor: pointer;
  padding: 2px 4px;
  display: flex;
  align-items: center;
}
.breadcrumb .dismiss:hover { color: #666; }
.breadcrumb .dismiss .material-symbols-outlined { font-size: 16px; }

@keyframes breadcrumb-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ─── Floating help button ─── */
.help-fab {
  position: fixed;
  right: 18px;
  bottom: 90px;  /* clears mobile bottom nav */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc3f3c, #b32023);
  color: #fff;
  border: none;
  box-shadow: 0 6px 20px rgba(220, 63, 60, 0.45), 0 2px 6px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.help-fab:hover { transform: scale(1.05); box-shadow: 0 8px 24px rgba(220, 63, 60, 0.55); }
.help-fab:active { transform: scale(0.96); }
.help-fab .material-symbols-outlined { font-size: 28px; }
.help-fab.hidden { opacity: 0; pointer-events: none; transform: scale(0.8); }

/* Desktop: bottom nav isn't visible, bring FAB lower */
@media (min-width: 768px) {
  .help-fab { bottom: 24px; right: 24px; }
}

/* Gentle pulse on first-time users (stops after first tap) */
@keyframes help-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(220, 63, 60, 0.45), 0 0 0 0 rgba(220, 63, 60, 0.5); }
  50%      { box-shadow: 0 6px 20px rgba(220, 63, 60, 0.45), 0 0 0 12px rgba(220, 63, 60, 0); }
}
.help-fab.pulsing { animation: help-pulse 2s ease-out infinite; }

/* ─── Bottom sheet (shared) ─── */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10010;
  display: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.sheet-backdrop.open { display: block; opacity: 1; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: 24px 24px 0 0;
  z-index: 10011;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
}
.sheet.open { transform: translateY(0); }

@media (min-width: 768px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: 24px;
    transform: translate(-50%, 120%);
    max-width: 460px;
    width: calc(100% - 48px);
    border-radius: 20px;
  }
  .sheet.open { transform: translate(-50%, 0); }
}

.sheet-handle {
  width: 40px; height: 4px;
  background: #e0dcd8;
  border-radius: 999px;
  margin: 10px auto 0;
}
.sheet-header {
  padding: 14px 22px 10px;
  text-align: center;
}
.sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: #2a2a2a;
  margin: 0;
}
.sheet-subtitle {
  font-size: 12.5px;
  color: #888;
  margin-top: 4px;
}
.sheet-body { padding: 6px 18px 24px; }

.sheet-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #f3f3f3;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
}
.sheet-close:hover { background: #e9e9e9; }
.sheet-close .material-symbols-outlined { font-size: 20px; }

/* ─── Action row (used inside sheets) ─── */
.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #faf6f2;
  border: 1px solid #eadfd8;
  border-radius: 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.action-row:hover { background: #fff8f7; border-color: #fadbd8; }
.action-row:active { transform: scale(0.985); }
.action-row.primary {
  background: linear-gradient(135deg, #dc3f3c, #b32023);
  border-color: transparent;
  color: #fff;
}
.action-row.primary:hover { background: linear-gradient(135deg, #e14a47, #c02428); }
.action-row-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(220, 63, 60, 0.1);
  color: #dc3f3c;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.action-row.primary .action-row-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.action-row-icon .material-symbols-outlined { font-size: 24px; }
.action-row-text { flex: 1; min-width: 0; }
.action-row-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.action-row-sub {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.action-row.primary .action-row-sub { color: rgba(255, 255, 255, 0.85); }
.action-row-chevron {
  color: #c9a4a1;
  flex-shrink: 0;
}
.action-row.primary .action-row-chevron { color: rgba(255, 255, 255, 0.7); }

/* ─── Mutawif setup & contact card ─── */
.mutawif-card {
  background: #faf6f2;
  border: 1px solid #eadfd8;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  text-align: center;
}
.mutawif-card-name {
  font-size: 16px;
  font-weight: 800;
  color: #2a2a2a;
}
.mutawif-card-phone {
  font-size: 13px;
  color: #888;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.mutawif-edit-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: #dc3f3c;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

/* ─── Destination list item with delete ─── */
.dest-item {
  position: relative;
}
.dest-delete {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #c9a4a1;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: none;
  z-index: 2;
}
.dest-item.custom:hover .dest-delete { display: block; }
.dest-delete:hover { color: #dc3f3c; background: #fff; }
.dest-delete .material-symbols-outlined { font-size: 18px; }

/* ─── Input field (shared) ─── */
.sheet-input-group {
  margin-bottom: 14px;
}
.sheet-input-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sheet-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #eadfd8;
  border-radius: 10px;
  font-family: 'Urbanist', sans-serif;
  font-size: 14px;
  color: #2a2a2a;
  background: #fff;
  box-sizing: border-box;
}
.sheet-input:focus {
  outline: none;
  border-color: #dc3f3c;
  box-shadow: 0 0 0 3px rgba(220, 63, 60, 0.1);
}
.sheet-input-hint {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}
.sheet-btn-primary {
  width: 100%;
  padding: 14px;
  background: #dc3f3c;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Urbanist', sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 6px;
}
.sheet-btn-primary:hover { background: #b32023; }
.sheet-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.sheet-btn-ghost {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: #888;
  border: none;
  font-family: 'Urbanist', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-top: 4px;
}

@media (max-width: 767px) {
  #searchBar {
    position: fixed;
    top: 64px; /* adjust if your header height differs */
    left: 0;
    right: 0;
    z-index: 9997;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #eadfd8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  }
}
@media (min-width: 768px) {
  #searchBar { padding: 0 16px 12px; }

}
@media (max-width: 767px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Prevent iOS auto-zoom on search input focus */
.search-input {
  font-size: 16px;
}


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

* {
  touch-action: manipulation;
}

.search-wrapper {
  position: relative;
}



.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--outline);
}


.search-btn:hover {
  background: var(--primary-dark);
}

.search-btn .material-symbols-outlined {
  font-size: 18px;
}
.search-input {
  width: 100%;
  padding: 9px 48px 9px 36px;
  
  z-index: 1;
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  
  z-index: 2;
  pointer-events: auto;
  height:30px;
  width:30px;
  
  color: white;
  border: none;
  border-radius: var(--r-sm);
  padding: 4px 8px;
  cursor: pointer;
  text-align:center;
}

  .wrap { max-width: 720px; margin: 0 auto; }
  h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; color: #b32023; }
  .sub { font-size: 13px; color: #888; margin-bottom: 16px; }

  .tawaf-3d-card {
    background: linear-gradient(135deg, #fdfaf5 0%, #f5ece0 100%);
    border: 1px solid #eadfd8;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    position: relative;
  }
  .tawaf-3d-header {
    padding: 14px 18px;
    background: rgba(255,255,255,0.5);
    border-bottom: 1px solid #eadfd8;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .tawaf-3d-title {
    font-size: 14px;
    font-weight: 800;
    color: #2a2a2a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .tawaf-3d-round {
    font-size: 13px;
    font-weight: 700;
    color: #dc3f3c;
    background: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid #fadbd8;
  }
  .tawaf-3d-canvas {
    width: 100%;
    height: 400px;
    display: block;
    cursor: grab;
    touch-action: none;
  }
  .tawaf-3d-canvas:active { cursor: grabbing; }

  .tawaf-3d-controls {
    padding: 12px 18px 16px;
    background: rgba(255,255,255,0.5);
    border-top: 1px solid #eadfd8;
  }
  .tawaf-3d-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }
  .t3d-btn {
    padding: 10px 8px;
    border-radius: 10px;
    border: 1.5px solid #fadbd8;
    background: #fff;
    color: #dc3f3c;
    font-family: 'Urbanist', sans-serif;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s;
  }
  .t3d-btn:hover { background: #fff5f4; }
  .t3d-btn.primary {
    background: linear-gradient(135deg, #dc3f3c, #b32023);
    color: #fff;
    border-color: transparent;
  }
  .t3d-btn.primary:hover { background: linear-gradient(135deg, #e14a47, #c02428); }

  .speed-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #666;
    font-weight: 600;
  }
  .speed-row input[type=range] {
    flex: 1;
    accent-color: #dc3f3c;
  }
  .legend {
    padding: 10px 18px;
    font-size: 11px;
    color: #888;
    text-align: center;
    border-top: 1px solid #eadfd8;
    background: rgba(255,255,255,0.3);
  }



  .sai-3d-card {
    background: linear-gradient(135deg, #fdfaf5 0%, #f5ece0 100%);
    border: 1px solid #eadfd8;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    position: relative;
  }
  .sai-3d-header {
    padding: 14px 18px;
    background: rgba(255,255,255,0.5);
    border-bottom: 1px solid #eadfd8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .sai-3d-title {
    font-size: 14px;
    font-weight: 800;
    color: #2a2a2a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .sai-3d-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .sai-3d-round {
    font-size: 13px;
    font-weight: 700;
    color: #dc3f3c;
    background: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid #fadbd8;
  }
  .sai-3d-direction {
    font-size: 11px;
    font-weight: 700;
    color: #666;
    background: rgba(255,255,255,0.8);
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #eadfd8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .sai-3d-canvas {
    width: 100%;
    height: 420px;
    display: block;
    cursor: grab;
    touch-action: none;
  }
  .sai-3d-canvas:active { cursor: grabbing; }

  .sai-3d-controls {
    padding: 12px 18px 16px;
    background: rgba(255,255,255,0.5);
    border-top: 1px solid #eadfd8;
  }
  .sai-3d-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }
  .s3d-btn {
    padding: 10px 8px;
    border-radius: 10px;
    border: 1.5px solid #fadbd8;
    background: #fff;
    color: #dc3f3c;
    font-family: 'Urbanist', sans-serif;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.15s;
  }
  .s3d-btn:hover { background: #fff5f4; }
  .s3d-btn.primary {
    background: linear-gradient(135deg, #dc3f3c, #b32023);
    color: #fff;
    border-color: transparent;
  }
  .s3d-btn.primary:hover { background: linear-gradient(135deg, #e14a47, #c02428); }

  .speed-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #666;
    font-weight: 600;
  }
  .speed-row input[type=range] {
    flex: 1;
    accent-color: #dc3f3c;
  }
  .legend {
    padding: 10px 18px;
    font-size: 11px;
    color: #888;
    text-align: center;
    border-top: 1px solid #eadfd8;
    background: rgba(255,255,255,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  .legend-item { display: inline-flex; align-items: center; gap: 4px; }
  .legend-dot {
    width: 10px; height: 10px; border-radius: 50%;
    display: inline-block;
  }
  .legend-dot.green { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
  .legend-dot.red { background: #dc3f3c; }
  .legend-dot.blue { background: #3b82f6; }

   .preview-sub {
    font-size: 13px; color: #888;
    margin: 0 0 20px;
  }
  .lang-switch {
    display: inline-flex;
    background: #f3f3f3;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 18px;
    border: 1px solid #e5e5e5;
  }
  .lang-switch button {
    padding: 6px 14px;
    border: none;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 12px;
    color: #666;
  }
  .lang-switch button.active {
    background: #dc3f3c; color: #fff;
  }


  /* ─── Tahallul card ─── */
  .tahallul-card {
    background: linear-gradient(135deg, #fdfaf5 0%, #f5ece0 100%);
    border: 1px solid #eadfd8;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  }
  .tahallul-header {
    padding: 14px 18px;
    background: rgba(255,255,255,0.5);
    border-bottom: 1px solid #eadfd8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .tahallul-title {
    font-size: 14px;
    font-weight: 800;
    color: #2a2a2a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .tahallul-state {
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.6s ease;
    background: #fff;
    color: #888;
    border: 1px solid #eadfd8;
  }
  .tahallul-state.complete {
    background: linear-gradient(135deg, #f4d35e, #c9a84c);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(201, 168, 76, 0.4);
  }

  /* ─── Stage (the SVG scene) ─── */
  .tahallul-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: radial-gradient(ellipse at center top, #fff 0%, #fdfaf5 60%, #f5ece0 100%);
    overflow: hidden;
  }
  .tahallul-stage svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  /* Aura behind figures — transitions white → gold */
  .aura {
    transform-origin: center;
    animation: pulse-aura 4s ease-in-out infinite;
  }
  @keyframes pulse-aura {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50%      { opacity: 0.85; transform: scale(1.08); }
  }
  .stage-complete .aura-fill { fill: #f4d35e !important; }
  .stage-complete .aura-glow { opacity: 1 !important; }

  /* Scissors animation */
  .scissors {
    transform-origin: 130px 90px;
    animation: scissor-bob 2.4s ease-in-out infinite;
  }
  @keyframes scissor-bob {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50%      { transform: translateY(-6px) rotate(8deg); }
  }
  .scissors-blade-top { transform-origin: 132px 95px; animation: snip-top 1.2s ease-in-out infinite; }
  .scissors-blade-bot { transform-origin: 132px 95px; animation: snip-bot 1.2s ease-in-out infinite; }
  @keyframes snip-top {
    0%, 100% { transform: rotate(-15deg); }
    50%      { transform: rotate(0deg); }
  }
  @keyframes snip-bot {
    0%, 100% { transform: rotate(15deg); }
    50%      { transform: rotate(0deg); }
  }

  /* Falling hair strands */
  .strand {
    animation: fall linear infinite;
    transform-origin: top;
    opacity: 0;
  }
  .strand-1 { animation-duration: 3.4s; animation-delay: 0s; }
  .strand-2 { animation-duration: 4.2s; animation-delay: 0.6s; }
  .strand-3 { animation-duration: 3.8s; animation-delay: 1.4s; }
  .strand-4 { animation-duration: 4.6s; animation-delay: 2.0s; }
  .strand-5 { animation-duration: 3.2s; animation-delay: 2.8s; }
  .strand-6 { animation-duration: 4.0s; animation-delay: 0.3s; }

  @keyframes fall {
    0%   { opacity: 0; transform: translateY(0) rotate(var(--r, 0deg)); }
    15%  { opacity: 0.9; }
    85%  { opacity: 0.7; }
    100% { opacity: 0; transform: translateY(220px) rotate(calc(var(--r, 0deg) + 180deg)); }
  }

  /* Floating sparkles when complete */
  .sparkle {
    opacity: 0;
    transform-origin: center;
  }
  .stage-complete .sparkle {
    animation: sparkle-rise 3s ease-out infinite;
  }
  .stage-complete .sparkle-1 { animation-delay: 0s; }
  .stage-complete .sparkle-2 { animation-delay: 0.7s; }
  .stage-complete .sparkle-3 { animation-delay: 1.4s; }
  .stage-complete .sparkle-4 { animation-delay: 2.1s; }
  @keyframes sparkle-rise {
    0%   { opacity: 0; transform: translateY(0) scale(0.3); }
    20%  { opacity: 1; transform: translateY(-20px) scale(1); }
    100% { opacity: 0; transform: translateY(-100px) scale(0.5); }
  }

  /* Subtle figure breathing */
  .figure-male, .figure-female {
    transform-origin: center bottom;
    animation: breathe 4s ease-in-out infinite;
  }
  .figure-female { animation-delay: 0.5s; }
  @keyframes breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.012); }
  }

  /* ─── Controls + info ─── */
  .tahallul-controls {
    padding: 14px 18px;
    background: rgba(255,255,255,0.5);
    border-top: 1px solid #eadfd8;
    display: flex;
    gap: 8px;
    justify-content: center;
  }
  .tah-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1.5px solid #fadbd8;
    background: #fff;
    color: #dc3f3c;
    font-family: 'Urbanist', sans-serif;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
  }
  .tah-btn:hover { background: #fff5f4; }
  .tah-btn.primary {
    background: linear-gradient(135deg, #dc3f3c, #b32023);
    color: #fff;
    border-color: transparent;
  }
  .tah-btn.primary:hover { background: linear-gradient(135deg, #e14a47, #c02428); }
  .tah-btn .material-symbols-outlined { font-size: 17px; }

  .tahallul-rules {
    padding: 16px 18px 18px;
    background: rgba(255,255,255,0.4);
    border-top: 1px solid #eadfd8;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .rule-card {
    background: #fff;
    border: 1px solid #eadfd8;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
  }
  .rule-icon {
    font-size: 24px;
    margin-bottom: 4px;
  }
  .rule-title {
    font-size: 13px;
    font-weight: 800;
    color: #2a2a2a;
    margin-bottom: 4px;
  }
  .rule-body {
    font-size: 11.5px;
    color: #666;
    line-height: 1.4;
  }

  .legend {
    padding: 10px 18px;
    font-size: 11px;
    color: #888;
    text-align: center;
    background: rgba(255,255,255,0.3);
    border-top: 1px solid #eadfd8;
    font-style: italic;
  }