html,
body.act-page {
  height: 100%;
  overflow: hidden;
}

.act-page {
  min-height: 100vh;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.act-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--er-t-border);
  background: rgba(8, 18, 13, 0.96);
  flex-shrink: 0;
}

.act-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--er-t-gold);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
}

.act-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.act-analytics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0.45rem;
  padding: 0.55rem 1rem 0.65rem;
  border-bottom: 1px solid var(--er-t-border);
  background: rgba(14, 26, 20, 0.72);
  flex-shrink: 0;
}

.act-kpi {
  background: rgba(8, 18, 13, 0.7);
  border: 1px solid var(--er-t-border);
  border-radius: 10px;
  padding: 0.45rem 0.6rem 0.5rem;
}

.act-kpi .k {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--er-t-muted);
}

.act-kpi .v {
  display: block;
  margin-top: 0.12rem;
  font-family: var(--er-t-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--er-t-gold);
}

.act-kpi .s {
  display: block;
  font-size: 0.68rem;
  color: var(--er-t-muted);
}

.act-kpi.is-on {
  border-color: rgba(196, 163, 90, 0.55);
}

.act-body {
  flex: 1;
  min-height: 0;
  display: flex;
}

.act-nav {
  width: 268px;
  flex-shrink: 0;
  border-right: 1px solid var(--er-t-border);
  background: rgba(8, 18, 13, 0.88);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.act-nav-head {
  padding: 0.55rem 0.65rem 0.4rem;
  border-bottom: 1px solid var(--er-t-border);
}

.act-search-label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--er-t-muted);
  margin-bottom: 0.25rem;
}

.act-nav-list {
  overflow: auto;
  padding: 0.35rem 0.4rem 0.8rem;
}

.act-name-btn {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.35rem;
  align-items: center;
  width: 100%;
  margin: 0 0 0.22rem;
  padding: 0.38rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.act-name-btn:hover,
.act-name-btn.is-on {
  background: rgba(196, 163, 90, 0.1);
  border-color: rgba(196, 163, 90, 0.35);
}

.act-name-btn .n {
  font-family: var(--er-t-mono);
  font-size: 0.72rem;
  color: var(--er-t-gold);
}

.act-name-btn .nm {
  font-size: 0.8rem;
  line-height: 1.2;
}

.act-name-btn .en {
  display: block;
  font-size: 0.62rem;
  color: var(--er-t-muted);
}

.act-name-btn .ar {
  font-family: "Noto Naskh Arabic", serif;
  font-size: 1.05rem;
  color: #e8d5a3;
}

.act-name-btn.is-arabic-only {
  grid-template-columns: 2rem 1fr;
}

.act-name-btn.is-arabic-only .ar {
  font-size: 1.25rem;
  justify-self: end;
}

.act-workspace {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.act-frame-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem 0.4rem;
  border-bottom: 1px solid var(--er-t-border);
}

.act-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--er-t-muted);
}

.act-frame-head h2 {
  margin: 0.1rem 0 0;
  font-size: 1.15rem;
}

.act-frame-head h2[lang="ar"] {
  font-family: "Noto Naskh Arabic", serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: #e8d5a3;
}

.act-frame-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.act-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem;
  border: 1px solid var(--er-t-border);
  border-radius: 8px;
  background: rgba(8, 18, 13, 0.45);
}

.act-mode-toggle .er-tbtn {
  font-size: 0.72rem;
}

.act-focus-note-block {
  margin: 0 0 0.55rem;
}

.act-verse-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.25rem 0 0.65rem;
}

.act-verse-link {
  text-decoration: none;
  font-size: 0.78rem;
}

.act-zoom {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem;
  border: 1px solid var(--er-t-border);
  border-radius: 8px;
  background: rgba(8, 18, 13, 0.45);
}

.act-zoom .er-tbtn {
  min-width: 2rem;
  justify-content: center;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.act-zoom-label {
  min-width: 2.8rem;
  text-align: center;
  font-size: 0.72rem;
  font-family: var(--er-t-mono);
  color: #e8d5a3;
}

.act-stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.act-map-row {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  position: relative;
}

.act-map-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  position: relative;
  background:
    radial-gradient(ellipse 42% 48% at 50% 50%, rgba(196, 163, 90, 0.1), transparent 70%);
}

.act-map-pane {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
}

.act-map-tools {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.28rem;
  border: 1px solid var(--er-t-border);
  border-radius: 10px;
  background: rgba(8, 18, 13, 0.92);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.act-map-zoom-btn {
  min-width: 2.1rem;
  justify-content: center;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.act-hover-tip {
  position: fixed;
  z-index: 20;
  max-width: 22rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(196, 163, 90, 0.45);
  border-radius: 10px;
  background: rgba(10, 22, 16, 0.96);
  color: #e8efe9;
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.act-map-zoom {
  display: inline-block;
  min-width: 100%;
  min-height: 100%;
}

.act-svg {
  display: block;
  height: auto;
}

.act-edge {
  fill: none;
  stroke: rgba(196, 163, 90, 0.42);
  stroke-width: 1.2;
}

.act-hub {
  cursor: pointer;
}

.act-hub-hit {
  fill: transparent;
}

.act-hub circle:not(.act-hub-hit) {
  fill: #c4a35a;
  stroke: rgba(243, 239, 230, 0.4);
  stroke-width: 1.4;
}

.act-hub.is-on circle:not(.act-hub-hit),
.act-hub:hover circle:not(.act-hub-hit) {
  fill: #d4b56a;
  stroke: #f3efe6;
  stroke-width: 2;
}

.act-hub .num {
  fill: #0e1a14;
  font-family: var(--er-t-mono);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

.act-hub .ar {
  fill: #0e1a14;
  font-family: "Noto Naskh Arabic", serif;
  font-size: 15px;
  font-weight: 700;
  pointer-events: none;
}

.act-caption {
  fill: #f3efe6;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: #08120e;
  stroke-width: 3.5px;
  stroke-linejoin: round;
}

.act-caption.is-leaf {
  font-size: 8.5px;
  font-weight: 500;
  fill: #e8d5a3;
  pointer-events: none;
}

.act-card {
  cursor: pointer;
}

.act-card rect {
  fill: #12261d;
  stroke: #6b9e86;
  stroke-width: 1.35;
}

.act-card.is-on rect,
.act-card:hover rect {
  fill: #1d3d2e;
  stroke: #c4a35a;
}

.act-card-kicker {
  fill: #c4a35a;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.act-card-body {
  fill: #dce8e1;
  font-size: 9.5px;
  font-weight: 500;
  pointer-events: none;
}

.act-dot {
  cursor: pointer;
}

.act-dot circle {
  fill: #0e1a14;
  stroke: rgba(196, 163, 90, 0.8);
  stroke-width: 1.25;
}

.act-dot.is-on circle,
.act-dot:hover circle {
  fill: #c4a35a;
  stroke: #f3efe6;
  stroke-width: 2.25;
}

.act-focus {
  width: 28rem;
  min-width: 22rem;
  flex-shrink: 0;
  border-left: 1px solid var(--er-t-border);
  padding: 0.75rem 1rem 1.1rem;
  overflow: auto;
  background: rgba(8, 18, 13, 0.55);
}

.act-focus h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: normal;
}

.act-focus-ar {
  margin: 0 0 0.55rem;
  font-family: "Noto Naskh Arabic", serif;
  font-size: 1.45rem;
  color: #e8d5a3;
}

.act-focus-empty {
  margin: 0;
  color: var(--er-t-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.act-summary-list {
  margin: 0 0 0.75rem;
  padding: 0 0 0 1.1rem;
  color: #d7e2db;
  font-size: 0.88rem;
  line-height: 1.5;
}

.act-summary-list li {
  margin: 0 0 0.28rem;
}

.act-focus .act-focus-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--er-t-gold);
}

.act-focus .act-focus-body,
.act-focus-note {
  display: block;
  width: 100%;
  margin: 0 0 0.55rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d7e2db;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
}

.act-focus-note {
  cursor: pointer;
  padding: 0.5rem 0.45rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.act-focus-note:hover,
.act-focus-note.is-on {
  background: rgba(196, 163, 90, 0.08);
  border-color: rgba(196, 163, 90, 0.22);
}

.act-dot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin: 0.15rem 0 0.7rem;
}

.act-mini-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  border: 1px solid rgba(196, 163, 90, 0.75);
  background: #0e1a14;
  padding: 0;
  cursor: pointer;
}

.act-mini-dot.is-on,
.act-mini-dot:hover {
  background: #c4a35a;
}

.act-name-btn {
  position: relative;
}

.act-pr-dot {
  position: absolute;
  top: 0.45rem;
  right: 0.4rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}

.act-pr-dot.ok { background: #6ecf9a; }
.act-pr-dot.mid { background: #c4a35a; }
.act-pr-dot.no { background: #c97878; }

body.is-practice .act-map-row { display: none; }

.act-practice {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.15rem 1.4rem;
  max-width: 52rem;
}

.act-pr-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.act-pr-lead {
  margin: 0.35rem 0 0;
  color: var(--er-t-muted);
  font-size: 0.92rem;
  max-width: 40rem;
  line-height: 1.45;
}

.act-pr-stats {
  font-family: var(--er-t-mono);
  font-size: 0.82rem;
  color: var(--er-t-gold);
  white-space: nowrap;
}

.act-pr-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.act-pr-pick label {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--er-t-muted);
}

.act-pr-pick select {
  flex: 1;
  min-width: 16rem;
  background: #0e1a14;
  color: var(--er-t-cream, #f5ecd6);
  border: 1px solid var(--er-t-border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}

.act-pr-namecard {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.1rem 1rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  border: 1px solid var(--er-t-border);
  border-radius: 12px;
  background: rgba(8, 18, 13, 0.7);
}

.act-pr-namecard .ar {
  grid-row: 1 / span 2;
  font-size: 2.1rem;
  color: var(--er-t-gold);
  align-self: center;
}

.act-pr-namecard .nm {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.act-pr-namecard .en {
  margin: 0;
  color: var(--er-t-muted);
}

.act-pr-answer-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--er-t-muted);
  margin-bottom: 0.3rem;
}

#actPrText {
  width: 100%;
  background: #0e1a14;
  color: #f5ecd6;
  border: 1px solid var(--er-t-border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  resize: vertical;
  min-height: 7.5rem;
}

.act-pr-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.65rem 0 0.35rem;
}

.act-pr-status {
  margin: 0.2rem 0 0.6rem;
  font-size: 0.85rem;
  color: var(--er-t-muted);
}

.act-pr-status.is-err { color: #e8a0a0; }

#actPrAudio {
  width: 100%;
  margin: 0.3rem 0 0.6rem;
}

.act-pr-result {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--er-t-border);
  background: rgba(8, 18, 13, 0.85);
}

.act-pr-result .verdict {
  margin: 0 0 0.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--er-t-gold);
}

.act-pr-result.is-correct { border-color: rgba(110, 207, 154, 0.55); }
.act-pr-result.is-correct .verdict { color: #6ecf9a; }
.act-pr-result.is-partial { border-color: rgba(196, 163, 90, 0.55); }
.act-pr-result.is-incorrect { border-color: rgba(201, 120, 120, 0.55); }
.act-pr-result.is-incorrect .verdict { color: #e8a0a0; }

.act-pr-result ul {
  margin: 0.35rem 0;
  padding-left: 1.1rem;
}

.act-pr-result .hint,
.act-pr-result .fix {
  color: var(--er-t-cream, #f5ecd6);
}

.act-pr-result .engine {
  font-size: 0.72rem;
  color: var(--er-t-muted);
  margin: 0.5rem 0 0;
}

.act-pr-namecard .saved {
  grid-column: 1 / -1;
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  color: #6ecf9a;
}

.act-pr-decide {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px dashed rgba(196, 163, 90, 0.45);
  border-radius: 12px;
  background: rgba(8, 18, 13, 0.55);
}

.act-pr-decide p {
  margin: 0 0 0.45rem;
  color: var(--er-t-muted);
  font-size: 0.88rem;
}

.act-pr-result.is-saved {
  border-style: solid;
}
  font-size: 0.72rem;
  color: var(--er-t-muted);
  margin: 0.5rem 0 0;
}

@media (max-width: 900px) {
  .act-body { flex-direction: column; }
  .act-nav { width: 100%; max-height: 12rem; border-right: 0; border-bottom: 1px solid var(--er-t-border); }
  .act-map-row { flex-direction: column; min-height: 28rem; }
  .act-focus { width: 100%; border-left: 0; border-top: 1px solid var(--er-t-border); max-height: 16rem; }
}
