/* Islamic Corner (portal). Colours come from the brand variables. */
.ih-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 0 12px; scrollbar-width: none; }
.ih-tabs::-webkit-scrollbar { display: none; }
.ih-tabs button {
  flex: 0 0 auto; border: 1px solid var(--border, #e2e8f0); background: #fff; color: var(--text-mid, #334155);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.ih-tabs button[aria-selected="true"] { background: var(--primary-dark, var(--p-700, #0f766e)); border-color: transparent; color: #fff; }
.ih-panel { margin-bottom: 1rem; }
.ih-muted { color: var(--text-light, #64748b); font-size: 13px; }
.ih-note { color: var(--text-light, #64748b); font-size: 12px; margin-top: 14px; }
.ih-status { font-size: 14px; color: var(--text-mid, #334155); }
.ih-center { text-align: center; }
.ih-dates { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ih-options { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ih-options-center { justify-content: center; }
.ih-options label { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-light, #64748b); }
.ih-options select { width: 100%; text-overflow: ellipsis; padding: 8px 10px; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; background: #fff; font-size: 14px; max-width: 100%; }
.ih-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* Prayer list */
.ih-prayers { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; overflow: hidden; }
.ih-prayers li { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border, #e2e8f0); font-size: 15px; }
.ih-prayers li:last-child { border-bottom: 0; }
.ih-prayers li span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.ih-prayers li.ih-is-next { background: var(--primary-light, var(--p-50, #f0fdfa)); color: var(--primary-dark, var(--p-700, #0f766e)); }
.ih-prayers li.ih-minor { color: var(--text-light, #64748b); font-size: 14px; }
.ih-next { margin-top: 10px; font-weight: 600; color: var(--primary-dark, var(--p-700, #0f766e)); }

/* Qibla compass */
.ih-compass { display: flex; justify-content: center; margin: 6px 0 14px; }
.ih-dial {
  position: relative; width: min(72vw, 260px); aspect-ratio: 1; border-radius: 50%;
  border: 6px solid var(--primary-dark, var(--p-700, #0f766e)); background: radial-gradient(circle, #fff 60%, var(--primary-light, #f0fdfa));
  transition: transform .2s ease-out;
}
.ih-dial span { position: absolute; font-weight: 800; font-size: 14px; color: var(--text-mid, #334155); }
.ih-n { top: 6px; left: 50%; transform: translateX(-50%); color: #dc2626 !important; }
.ih-s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.ih-e { right: 10px; top: 50%; transform: translateY(-50%); }
.ih-w { left: 10px; top: 50%; transform: translateY(-50%); }
.ih-needle {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 34%; margin-left: -3px;
  transform-origin: 50% 0; transform: rotate(180deg); background: var(--primary-dark, var(--p-700, #0f766e)); border-radius: 3px;
}
.ih-needle i { position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%); font-size: 26px; color: #111827; }
.ih-big { font-size: 1.6rem; font-weight: 800; margin: 0; color: var(--text-dark, #0f172a); }
.ih-facing .ih-dial { border-color: #16a34a; box-shadow: 0 0 0 6px rgba(22, 163, 74, .18); }

/* Hijri calendar */
.ih-cal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.ih-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ih-cal .ih-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-light, #64748b); padding: 4px 0; }
.ih-cal .ih-day { border: 1px solid var(--border, #e2e8f0); border-radius: 8px; padding: 6px 4px; min-height: 54px; text-align: center; background: #fff; }
.ih-cal .ih-day b { display: block; font-size: 16px; color: var(--text-dark, #0f172a); }
.ih-cal .ih-day small { display: block; font-size: 10px; color: var(--text-light, #64748b); }
.ih-cal .ih-today { border: 2px solid var(--primary-dark, var(--p-700, #0f766e)); background: var(--primary-light, #f0fdfa); }
.ih-cal .ih-event { background: #fef3c7; border-color: #f59e0b; }
.ih-cal .ih-friday b { color: var(--primary-dark, var(--p-700, #0f766e)); }
.ih-events { list-style: none; padding: 0; margin: 12px 0 0; }
.ih-events li { padding: 8px 10px; border-left: 3px solid #f59e0b; background: #fffbeb; border-radius: 6px; margin-bottom: 6px; font-size: 14px; }

/* Duas and names */
.ih-search { width: 100%; padding: 10px 12px; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; font-size: 16px; margin-bottom: 12px; }
.ih-group { font-size: 1rem; margin: 18px 0 8px; color: var(--text-dark, #0f172a); }
.ih-item { margin-bottom: 10px; }
.ih-item-title { font-size: 15px; margin: 0 0 6px; }
.ih-arabic { font-family: 'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', 'Traditional Arabic', serif; font-size: 1.6rem; line-height: 2.1; color: var(--text-dark, #0f172a); margin: 4px 0 8px; }
.ih-translit { font-style: italic; color: var(--text-mid, #334155); }
.ih-ref { font-size: 12px; color: var(--text-light, #64748b); margin: 0; }
.ih-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ih-name { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 10px; gap: 2px; }
.ih-name .ih-arabic { font-size: 1.7rem; margin: 0; line-height: 1.6; }
.ih-num { position: absolute; top: 6px; left: 8px; font-size: 11px; color: var(--text-light, #64748b); }
.ih-empty { text-align: center; color: var(--text-light, #64748b); }
.ih-empty i { font-size: 2rem; margin-bottom: 8px; }

/* Tasbeeh */
.ih-dhikr-text { font-size: 2rem; margin: 10px 0; }
.ih-counter {
  width: min(64vw, 220px); aspect-ratio: 1; border-radius: 50%; border: 0; margin: 8px auto 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  background: var(--grad-primary, var(--primary-dark, #0f766e)); box-shadow: 0 10px 24px rgba(15, 23, 42, .22); touch-action: manipulation;
}
.ih-counter:active { transform: scale(.97); }
.ih-counter span { font-size: 3.4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ih-counter small { font-size: 14px; opacity: .85; margin-top: 6px; }
.ih-counter.ih-done { background: #16a34a; }

/* Phones: section icons in a bottom bar (replaces the portal tab bar on this page). */
.ih-bottom, .ih-sheet, .ih-sheet-backdrop { display: none; }
@media (max-width: 640px) {
  .ih-tabs { display: none; }
  body:has(.ih-bottom) .pt-tabbar { display: none !important; }
  body:has(.ih-bottom) { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  body:has(.ih-bottom) #pwa-install { bottom: calc(62px + env(safe-area-inset-bottom)); }
  .ih-bottom {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; display: flex;
    background: var(--bg-white, #fff); border-top: 1px solid var(--border, #e2e8f0);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .08); padding-bottom: env(safe-area-inset-bottom);
  }
  .ih-bottom button {
    position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 58px; border: 0; background: none; font: inherit; font-size: 11px; font-weight: 600;
    color: var(--text-light, #64748b); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .ih-bottom i { font-size: 19px; }
  .ih-bottom [aria-selected="true"] { color: var(--primary-dark, var(--p-700, #0f766e)); }
  .ih-bottom [aria-selected="true"]::before {
    content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px;
    background: var(--primary-dark, var(--p-700, #0f766e));
  }
  .ih-sheet-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 1041; background: rgba(15, 23, 42, .4); }
  .ih-sheet:not([hidden]) {
    display: flex; flex-direction: column; position: fixed; left: 8px; right: 8px; z-index: 1042;
    bottom: calc(66px + env(safe-area-inset-bottom)); padding: 6px; border-radius: 14px;
    background: var(--bg-white, #fff); box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
  }
  .ih-sheet button, .ih-sheet a {
    display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 0; border-radius: 10px; background: none;
    font: inherit; font-size: 15px; font-weight: 600; color: var(--text-dark, #0f172a); text-decoration: none; text-align: left; cursor: pointer;
  }
  .ih-sheet i { width: 20px; text-align: center; color: var(--primary-dark, var(--p-700, #0f766e)); }
  .ih-sheet [aria-selected="true"] { background: var(--primary-light, var(--p-50, #f0fdfa)); }
  .ih-sheet a + a, .ih-sheet button + a { border-top: 1px solid var(--border, #e2e8f0); border-radius: 0; }
}
