/* NurOS / Clarity upgrade — last-wins layout, name sheet, live theater, still deck */
:root {
  --nx-z-banner: 40;
  --nx-z-dock: 70;
  --nx-z-tabs: 180;
  --nx-z-rail: 150;
  --nx-z-sheet: 40000;
  --nx-z-live: 40100;
}

/* ---- Kill ghost positioning that stacked name card over tabs ---- */
#clarity-today-surface,
#today-journey-plaque,
#clarity-learn-os,
#path-board {
  position: static !important;
  left: auto !important;
  width: auto !important;
  max-width: 100% !important;
}

#clarity-today-surface:not(.nx-mounted),
#today-journey-plaque:not(.nx-mounted),
#clarity-learn-os:not(.nx-mounted),
#path-board:not(.nx-mounted) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  left: -9999px !important;
}

.card-journey-moved,
#tab-journey > .card-journey {
  display: none !important;
}

html.door-rail-on .nav-tabs,
.nav-tabs {
  display: flex !important;
  visibility: visible !important;
  position: sticky !important;
  top: 0 !important;
  z-index: var(--nx-z-tabs) !important;
  isolation: isolate;
}
#clarity-global-nav:not(.hidden) {
  z-index: 190 !important;
  position: sticky !important;
  top: 0 !important;
}
#clarity-door-rail {
  z-index: var(--nx-z-rail) !important;
}

@media (max-width: 900px) {
  html.door-rail-on .nav-tabs,
  .nav-tabs {
    display: none !important;
  }
  html.door-rail-on .mobile-bottom-nav,
  .mobile-bottom-nav {
    display: flex !important;
    z-index: 220 !important;
  }
  #clarity-door-rail {
    display: none !important;
  }
  html.door-rail-on #main-application-workspace,
  html.door-rail-on body.section-open .page-wrapper {
    padding-left: 0.55rem !important;
    padding-bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (min-width: 901px) {
  html.door-rail-on #main-application-workspace,
  html.door-rail-on body.section-open .page-wrapper {
    padding-left: 8.4rem !important;
  }
}

.tab-panel {
  position: relative !important;
  z-index: 1 !important;
  isolation: isolate;
}
.tab-panel.active {
  display: block !important;
}

#nuros-daily-dock {
  display: none !important;
}
.domain-promise + .domain-promise,
.clarity-tab-disclaimer + .domain-promise {
  display: none !important;
}
.domain-promise {
  position: relative !important;
  z-index: 1;
  margin: 0.15rem 0.75rem 0.35rem !important;
  font-size: 0.78rem !important;
  line-height: 1.4 !important;
  clear: both;
}

body.nx-name-open .nav-tabs,
body.nx-live-open .nav-tabs,
body.nx-name-open #clarity-door-rail,
body.nx-live-open #clarity-door-rail {
  pointer-events: none;
}

body.nx-name-open #clarity-welcome,
body.nx-live-open #clarity-welcome {
  display: none !important;
  visibility: hidden !important;
}
#clarity-welcome.show {
  z-index: 35000;
}

#nx-name-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.9rem;
  background: linear-gradient(90deg, rgba(13, 79, 60, 0.97), rgba(10, 40, 32, 0.94));
  color: #f7f3eb;
  border-bottom: 1px solid rgba(212, 180, 90, 0.35);
  position: relative;
  z-index: 90;
}
html[data-theme="light"] #nx-name-chip {
  background: linear-gradient(90deg, #0d4f3c, #1a6b52);
  color: #f7f3eb;
}
#nx-name-chip .nx-chip-salam {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 1.02rem;
}
#nx-name-chip .nx-chip-meta {
  font-size: 0.75rem;
  opacity: 0.9;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
#nx-name-chip .nx-chip-meta span {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
}
#nx-name-chip button {
  margin: 0 !important;
  padding: 0.4rem 0.85rem !important;
  min-height: 2.4rem;
  border-radius: 999px !important;
  font-size: 0.78rem !important;
  background: rgba(212, 180, 90, 0.22) !important;
  color: #f6e7c1 !important;
  border: 1px solid rgba(212, 180, 90, 0.55) !important;
}

#nx-name-sheet {
  position: fixed;
  inset: 0;
  z-index: var(--nx-z-sheet);
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(6, 18, 14, 0.58);
  backdrop-filter: blur(8px);
  padding: 0;
}
#nx-name-sheet.open {
  display: flex;
}
#nx-name-sheet .nx-sheet-panel {
  width: min(560px, 100%);
  max-height: min(88vh, 740px);
  overflow: auto;
  background: var(--card-bg, #fffdf8);
  color: var(--text, #1c2a22);
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--border, #e0d5c4);
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.28);
  padding: 1rem 1.1rem 1.5rem;
}
@media (min-width: 720px) {
  #nx-name-sheet {
    align-items: center;
    padding: 1.25rem;
  }
  #nx-name-sheet .nx-sheet-panel {
    border-radius: 20px;
  }
}
#nx-name-sheet h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--accent, #0d4f3c);
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}
#nx-name-sheet .nx-sheet-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
#nx-name-sheet .nx-close,
#nx-live-theater .nx-close {
  margin: 0 !important;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  border-radius: 999px !important;
  background: var(--accent-soft, #e6f2ec) !important;
  color: var(--accent, #0d4f3c) !important;
  border: 1px solid var(--border) !important;
  font-size: 1.15rem;
}
#nx-name-host .today-journey-plaque,
#nx-name-host #clarity-today-surface,
#nx-name-host #today-journey-plaque,
#nx-name-host #clarity-learn-os,
#nx-name-host #path-board {
  display: block !important;
  visibility: visible !important;
  position: relative !important;
  left: auto !important;
  height: auto !important;
  max-height: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  overflow: visible !important;
  margin: 0 0 0.65rem !important;
  padding: 0 !important;
  width: 100% !important;
}
body.nx-name-open,
body.nx-live-open {
  overflow: hidden;
}

.banner {
  min-height: 168px !important;
  overflow: hidden;
}
.banner-media {
  z-index: 0 !important;
  pointer-events: none !important;
}
#banner-still-fallback {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  opacity: 1 !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  transition: background-image 0.6s ease, opacity 0.4s ease;
}
#banner-img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 2 !important;
  opacity: 0.92 !important;
}
#banner-live {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.banner-overlay {
  z-index: 5 !important;
}
.nx-deck-dots {
  display: inline-flex;
  gap: 0.28rem;
  align-items: center;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.nx-deck-dots button {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0.55rem;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  background: rgba(255, 255, 255, 0.28) !important;
}
.nx-deck-dots button.on {
  background: #d4b45a !important;
  border-color: #d4b45a !important;
}

#nx-live-theater {
  position: fixed;
  inset: 0;
  z-index: var(--nx-z-live);
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 12, 10, 0.82);
  padding: 0.75rem;
}
#nx-live-theater.open {
  display: flex;
}
#nx-live-theater .nx-live-box {
  width: min(960px, 100%);
  background: #07140f;
  border: 1px solid rgba(212, 180, 90, 0.4);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
#nx-live-theater .nx-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  color: #f7f3eb;
}
#nx-live-theater .nx-live-head h3 {
  margin: 0;
  font-size: 0.98rem;
  font-family: "Cormorant Garamond", Georgia, serif;
}
#nx-live-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
#nx-live-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.nx-live-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem 0.95rem;
}
.nx-live-actions a,
.nx-live-actions button {
  margin: 0 !important;
  padding: 0.45rem 0.8rem !important;
  min-height: 2.4rem;
  border-radius: 999px !important;
  font-size: 0.78rem !important;
}
.nx-live-actions a {
  background: #1fa67a !important;
  color: #04140f !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.nx-live-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.65rem;
  color: #f7f3eb;
  text-align: center;
  padding: 1rem;
  background-size: cover;
  background-position: center;
}
.nx-live-fallback.show {
  display: flex;
}
.nx-live-fallback .nx-veil {
  background: rgba(4, 12, 10, 0.62);
  padding: 1rem 1.1rem;
  border-radius: 14px;
  max-width: 26rem;
}

#nx-qibla-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.25rem;
}
#nx-qibla-chip .nx-qibla-needle {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  position: relative;
}

#nx-compare-card {
  margin: 0.75rem 0 1rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(212, 180, 90, 0.35);
  background: linear-gradient(160deg, rgba(13, 79, 60, 0.08), rgba(255, 253, 248, 0.95));
}
html[data-theme="dark"] #nx-compare-card {
  background: linear-gradient(160deg, rgba(13, 79, 60, 0.35), rgba(8, 24, 20, 0.95));
}
#nx-compare-card h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--accent, #0d4f3c);
  margin: 0 0 0.35rem;
}
#nx-compare-card p {
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 0 0 0.65rem;
}
#nx-compare-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
#nx-compare-card th,
#nx-compare-card td {
  text-align: left;
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--border, #e0d5c4);
}
#nx-compare-card th:not(:first-child),
#nx-compare-card td:not(:first-child) {
  text-align: center;
}
#nx-compare-card .nx-win {
  color: var(--accent, #0d4f3c);
  font-weight: 700;
}

/* Hide leftover live-chip duplicates — live theater owns Haramain */
#banner-live-chip,
.banner-tools #banner-live-chip {
  display: none !important;
}
.banner-tools {
  position: absolute !important;
  top: 0.45rem !important;
  right: 0.5rem !important;
  left: auto !important;
  inset: auto 0.5rem auto auto !important;
  width: auto !important;
  height: auto !important;
  pointer-events: none !important;
  z-index: 14 !important;
  background: transparent !important;
}
.banner-tools .theme-toggle,
.banner-tools .a11y-bar,
.banner-tools button {
  pointer-events: auto !important;
}

/* Daily cards: one quiet accounting, not stacked streaks */
#welcome-area .stats-row {
  display: none !important;
}
#progress-strip {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.4rem !important;
  margin: 0.35rem 0 0.55rem !important;
}
#weekly-review-card {
  margin-top: 0.25rem !important;
  border-top: 2px solid rgba(184, 146, 42, 0.35) !important;
}

/* Tajweed Deep Studio — last-wins polish */
#tj-deep-studio {
  margin-top: 0.85rem;
}
.tj-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
  gap: 0.55rem;
}
.tj-flash-card {
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(13, 79, 60, 0.1), rgba(184, 146, 42, 0.1));
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--accent, #0d4f3c);
  margin-bottom: 0.5rem;
}
.tj-flash-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.tj-media-frame audio {
  width: 100%;
  margin-top: 0.35rem;
}

@media (prefers-reduced-motion: reduce) {
  #banner-still-fallback,
  #banner-img {
    transition: none !important;
  }
}


/* ===== Tajweed Deep Studio — last-wins visibility (v tajweed4) ===== */
#tab-tajweed.active #tj-deep-studio,
#tab-tajweed.is-active #tj-deep-studio,
#tj-deep-studio {
  display: block !important;
  visibility: visible !important;
  position: relative !important;
  z-index: 2 !important;
  margin: 0 0 0.9rem !important;
  max-height: none !important;
  overflow: visible !important;
  opacity: 1 !important;
}
#tab-tajweed.active,
#tab-tajweed.is-active {
  display: block !important;
}
.nx-tj-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold, #b8922a);
  margin: 0 0 0.25rem;
}
#tj-rule-grid:empty::before {
  content: "Loading rule tiles…";
  display: block;
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
}
body[data-active-tab="tajweed"] #nx-name-sheet,
body[data-active-tab="tajweed"] #clarity-welcome.clarity-welcome-overlay,
html[data-active-tab="tajweed"] #nx-name-sheet {
  display: none !important;
  pointer-events: none !important;
}
body[data-active-tab="tajweed"] {
  overflow: auto !important;
}
.nx-tj-hero {
  border-top: 3px solid var(--gold, #b8922a) !important;
}
.nx-tj-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}


/* ===== Tajweed Deep Studio ===== */
.tj-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
  gap: 0.55rem;
  margin: 0.35rem 0 1rem;
}
.tj-rule-tile {
  border: 1px solid var(--border, #e0d5c4);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255,253,248,0.98), rgba(232,245,236,0.9));
  padding: 0.55rem 0.4rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
  box-shadow: 0 2px 8px rgba(13,50,40,0.06);
  min-height: 5.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.2rem;
}
html[data-theme="dark"] .tj-rule-tile {
  background: linear-gradient(160deg, rgba(12,36,30,0.95), rgba(18,48,40,0.9));
  border-color: rgba(212,180,90,0.28);
}
.tj-rule-tile:hover, .tj-rule-tile:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13,50,40,0.12);
  border-color: var(--gold, #b8922a);
  outline: none;
}
.tj-rule-tile.open {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(13,79,60,0.2);
}
.tj-rule-pic {
  width: 2.6rem; height: 2.6rem;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 0.15rem;
  background: rgba(13,79,60,0.1);
}
.tj-rule-tile[data-rule="izhar"] .tj-rule-pic { background: #e8f5ec; }
.tj-rule-tile[data-rule="ikhfa"] .tj-rule-pic { background: #eef6fa; }
.tj-rule-tile[data-rule="idgham"] .tj-rule-pic { background: #f5edd6; }
.tj-rule-tile[data-rule="iqlab"] .tj-rule-pic { background: #f0e8f5; }
.tj-rule-tile[data-rule="qalqalah"] .tj-rule-pic { background: #fce8e8; }
.tj-rule-tile[data-rule="ghunnah"] .tj-rule-pic { background: #e8f0f8; }
.tj-rule-tile[data-rule="madd"] .tj-rule-pic { background: #e8f8f0; }
.tj-rule-tile[data-rule="waqf"] .tj-rule-pic { background: #f8f0e8; }
.tj-rule-tile[data-rule="makharij"] .tj-rule-pic { background: #eef5e8; }
.tj-rule-name {
  font-size: 0.78rem; font-weight: 700; color: var(--accent);
  line-height: 1.2;
}
.tj-rule-ar {
  font-family: 'Scheherazade New', Amiri, serif;
  direction: rtl;
  font-size: 0.95rem;
  color: var(--text);
  opacity: 0.92;
}
.tj-rule-detail {
  display: none;
  grid-column: 1 / -1;
  background: rgba(13,79,60,0.06);
  border: 1px solid rgba(13,79,60,0.15);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0.15rem 0 0.35rem;
}
.tj-rule-detail.show { display: block; }
.tj-rule-detail strong { color: var(--accent); }
.tj-rule-detail .tj-ex {
  margin-top: 0.4rem;
  padding: 0.4rem 0.55rem;
  background: rgba(255,255,255,0.55);
  border-radius: 8px;
  font-size: 0.86rem;
}
html[data-theme="dark"] .tj-rule-detail .tj-ex { background: rgba(0,0,0,0.25); }

.tj-tool-panel {
  margin: 0.45rem 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,253,248,0.7);
  overflow: hidden;
}
html[data-theme="dark"] .tj-tool-panel { background: rgba(10,30,24,0.6); }
.tj-tool-panel > summary {
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--accent);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.tj-tool-panel > summary::-webkit-details-marker { display: none; }
.tj-tool-panel > summary::before {
  content: "▸";
  font-size: 0.75rem;
  opacity: 0.7;
}
.tj-tool-panel[open] > summary::before { content: "▾"; }
.tj-tool-panel > *:not(summary) {
  padding: 0 0.75rem 0.75rem;
}
.tj-makharij-svg {
  width: 100%;
  max-width: 380px;
  height: auto;
  display: block;
  margin: 0.25rem auto;
}
.tj-tool-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}
.tj-steps {
  margin: 0.25rem 0 0.55rem 1.1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.tj-steps li { margin-bottom: 0.3rem; }
.tj-quick-links {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.tj-quick-links a {
  text-decoration: none;
  margin: 0 !important;
  padding: 0.32rem 0.7rem !important;
  font-size: 0.8rem !important;
}
.tj-flash-card {
  min-height: 3.2rem;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(13,79,60,0.1), rgba(184,146,42,0.1));
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.tj-flash-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tj-flash-tip {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(13,79,60,0.06);
}
.tj-challenge ul {
  margin: 0.35rem 0 0.5rem 1.15rem;
  font-size: 0.9rem;
}
.tj-challenge li { margin-bottom: 0.25rem; }

/* Collapsible levels */
.tj-level-collapse {
  margin: 0.55rem 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg, #fffdf8);
  overflow: hidden;
}
.tj-level-summary {
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  list-style: none;
  font-weight: 650;
}
.tj-level-summary::-webkit-details-marker { display: none; }
.tj-level-summary::before {
  content: "▸";
  margin-right: 0.35rem;
  opacity: 0.65;
  font-size: 0.8rem;
}
.tj-level-collapse[open] > .tj-level-summary::before { content: "▾"; }
.tj-level-sum-main { flex: 1 1 auto; min-width: 12rem; }
.tj-level-sum-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tj-level-body { padding: 0 0.85rem 0.85rem; }
.tj-level-collapse .level-goal { font-size: 0.88rem; margin-bottom: 0.5rem; }
.tj-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(13,79,60,0.1);
  color: var(--accent);
}
.tj-badge.complete {
  background: rgba(31,166,122,0.2);
  color: #0d6b4c;
}
html[data-theme="dark"] .tj-badge.complete { color: #7dff9a; }

@media (max-width: 520px) {
  .tj-rule-grid { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
  .tj-rule-tile { min-height: 5rem; padding: 0.4rem 0.25rem; }
  .tj-rule-pic { width: 2.2rem; height: 2.2rem; font-size: 1.15rem; }
  .tj-rule-name { font-size: 0.7rem; }
}

.tj-media-row {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  margin-top: 0.55rem;
}
.tj-media-row .btn-soft {
  margin: 0 !important;
  padding: 0.35rem 0.7rem !important;
  font-size: 0.8rem !important;
}
.tj-media-frame {
  margin-top: 0.55rem;
  border-radius: 12px;
  overflow: hidden;
  background: #0a1812;
}
.tj-embed-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}
.tj-embed-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}

.tj-lmr-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: flex-end;
  margin-bottom: 0.55rem;
}
.tj-lmr-label {
  display: flex; flex-direction: column; gap: 0.15rem;
  font-size: 0.72rem; font-weight: 650; color: var(--accent);
}
.tj-lmr-label select,
.tj-lmr-label input {
  margin: 0; min-width: 7rem; padding: 0.35rem 0.5rem;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--card-bg, #fff); color: var(--text);
  font-size: 0.88rem;
}
.tj-lmr-label input { width: 4.5rem; }
.tj-lmr-steps {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  margin-bottom: 0.55rem;
}
.tj-lmr-step {
  margin: 0 !important;
  padding: 0.32rem 0.65rem !important;
  font-size: 0.78rem !important;
  border-radius: 999px !important;
  background: rgba(13,79,60,0.08) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(13,79,60,0.18) !important;
}
.tj-lmr-step.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
.tj-lmr-ayah-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: rgba(13,79,60,0.05);
}
.tj-lmr-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.tj-lmr-ar {
  font-size: 1.45rem; line-height: 2.1; margin: 0.35rem 0;
  text-align: center;
}
.tj-lmr-ar-sm { font-size: 1.25rem; }
.tj-lmr-en { font-size: 0.9rem; color: var(--text-muted); text-align: center; margin-bottom: 0.5rem; }
.tj-lmr-audio-row, .tj-lmr-rec-row {
  display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center;
}
.tj-lmr-audio-row .btn-soft,
.tj-lmr-rec-row .btn-soft,
.tj-lmr-rec-row .btn-secondary {
  margin: 0 !important; padding: 0.35rem 0.75rem !important; font-size: 0.82rem !important;
}
.tj-lmr-ext { font-size: 0.8rem; color: var(--accent); margin-left: auto; }
.tj-lmr-check { font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.tj-lmr-rec-status {
  margin-top: 0.4rem; font-size: 0.82rem; color: var(--text-muted);
}
.tj-lmr-rec-status.rec {
  color: #c0392b; font-weight: 650;
}
.tj-lmr-focus-row {
  display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0 0.55rem;
}
.tj-lmr-focus-row button {
  margin: 0 !important; padding: 0.3rem 0.65rem !important; font-size: 0.78rem !important;
  border-radius: 999px !important;
}
.tj-lmr-focus-row button.on {
  background: var(--accent) !important; color: #fff !important;
}
.tj-lmr-loop-stat { font-size: 0.8rem; margin-left: 0.5rem; color: var(--text-muted); }
html[data-theme="dark"] .tj-lmr-ayah-card { background: rgba(0,0,0,0.22); }
html[data-theme="dark"] .tj-lmr-step { background: rgba(255,255,255,0.06) !important; }
