/* Beginner Arabic explain mode — overlay cards + term glosses. Does not restyle EN chrome. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap");

html[lang="ar"] body,
html[dir="rtl"] body {
  font-family: "Noto Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;
}

[data-explain-ar] .ar-explain,
[data-explain-ar] .ar-banner,
[data-explain-ar] .ar-glossary,
[data-explain-ar] .nav11-text,
[data-explain-ar] .nav11-hint {
  direction: rtl;
  text-align: right;
  unicode-bidi: isolate;
}
[data-explain-ar] .blurb-line strong {
  direction: rtl;
  unicode-bidi: isolate;
  display: inline-block;
  min-width: 4.5rem;
}

.ar-banner {
  display: none;
  margin: 0 0 1rem;
  padding: 0.9rem 1.05rem;
  border-radius: 14px;
  border: 1px solid #2a8a80;
  background: linear-gradient(135deg, rgba(14, 50, 48, 0.98), rgba(16, 36, 64, 0.98));
  color: #d6e4f7;
  line-height: 1.75;
}
html[lang="ar"] .ar-banner { display: block; }
.ar-banner strong { color: #7aecff; }
.ar-banner .ar-banner-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #2ee6d6;
  margin-bottom: 0.25rem;
}

.ar-explain {
  margin: 0.65rem 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid #3f638f;
  border-right: 4px solid #2ee6d6;
  background: #0c1a2e;
  color: #d6e4f7;
  line-height: 1.8;
  font-size: 0.95rem;
}
.ar-explain h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  color: #8eecff;
}
.ar-explain p { margin: 0.35rem 0; color: #d6e4f7; }
.ar-explain .lbl {
  color: #2ee6d6;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.ar-term {
  border-bottom: 1px dotted #2ee6d6;
  cursor: help;
  white-space: nowrap;
}
.ar-term-ar {
  color: #9ef0d2;
  font-weight: 600;
  font-size: 0.86em;
}
.ar-term:hover,
.ar-term:focus-visible {
  background: rgba(46, 230, 214, 0.12);
  outline: none;
}

.ar-glossary {
  position: fixed;
  z-index: 2147483645;
  bottom: 16px;
  left: 16px;
  width: min(380px, calc(100vw - 32px));
  max-height: min(62vh, 560px);
  display: none;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid #3f638f;
  background: rgba(8, 16, 30, 0.97);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
html[lang="ar"] .ar-glossary { display: flex; }
.ar-glossary.collapsed {
  width: auto;
  max-height: none;
}
.ar-glossary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  background: #12253d;
  color: #8eecff;
  font-weight: 800;
  cursor: pointer;
  border: 0;
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  text-align: inherit;
}
.ar-glossary-body {
  overflow: auto;
  padding: 0.55rem 0.85rem 0.9rem;
  color: #d6e4f7;
  font-size: 0.88rem;
  line-height: 1.7;
}
.ar-glossary.collapsed .ar-glossary-body { display: none; }
.ar-glossary dt {
  color: #2ee6d6;
  font-weight: 800;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  margin-top: 0.65rem;
}
.ar-glossary dd { margin: 0.15rem 0 0.35rem; color: #d6e4f7; }

html[lang="ar"] #btn-ar { background: rgba(46, 230, 214, 0.18); }
html[lang="en"] #btn-en { display: none !important; }

@media (max-width: 720px) {
  .ar-glossary {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: 56px;
  }
}
