:root {
  color-scheme: dark;
  --font-ui: Lato, "Aptos", "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-ar: Tahoma, "Droid Sans Fallback", "DejaVu Sans", Arial, sans-serif;
  --bg: #05070b;
  --bg-2: #08111f;
  --bg-3: #0b1b2e;
  --glass: rgba(9, 16, 28, 0.72);
  --glass-strong: rgba(10, 18, 32, 0.88);
  --line: rgba(86, 196, 255, 0.22);
  --line-hot: rgba(53, 245, 255, 0.75);
  --text: #f5fbff;
  --muted: #91a4bb;
  --cyan: #35f5ff;
  --teal: #19d8b5;
  --violet: #8b5cf6;
  --magenta: #ff4da6;
  --amber: #f6b73c;
  --gold: #ffd166;
  --danger: #ff5c7a;
  --radius: 10px;
  --panel-blur: blur(20px);
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 18%, rgba(53, 245, 255, 0.12), transparent 28%),
    radial-gradient(circle at 28% 70%, rgba(139, 92, 246, 0.12), transparent 30%),
    linear-gradient(135deg, var(--bg), var(--bg-2) 52%, #04050a);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.5;
}

[lang="ar"] {
  font-family: var(--font-ar);
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.screen::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.35) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(53, 245, 255, 0.28) 0 1px, transparent 1px);
  background-position: 0 0, 38px 54px;
  background-size: 120px 120px, 180px 180px;
  opacity: 0.18;
  animation: star-drift 24s linear infinite;
}

.screen::after {
  position: absolute;
  inset: -20%;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(ellipse at 52% 46%, rgba(25, 216, 181, 0.08), transparent 34%),
    radial-gradient(ellipse at 72% 62%, rgba(255, 77, 166, 0.06), transparent 28%);
  filter: blur(34px);
  opacity: 0.8;
  animation: haze 18s ease-in-out infinite alternate;
}

.role-screen {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-height: 100vh;
  padding: 24px 28px;
}

.role-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(520px, 1.08fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  width: min(1460px, 100%);
  margin: 0 auto;
}

[dir="rtl"] .role-shell {
  grid-template-columns: minmax(520px, 1.08fr) minmax(360px, 0.92fr);
}

[dir="rtl"] .role-copyblock {
  grid-column: 2;
  text-align: right;
}

[dir="rtl"] .role-preview {
  grid-column: 1;
  grid-row: 1;
}

.role-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1460px, 100%);
  min-height: 58px;
  margin: 0 auto;
  padding: 10px 14px;
  border: 1px solid rgba(46, 105, 170, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 46px rgba(59, 88, 121, 0.12);
  backdrop-filter: var(--panel-blur);
}

.role-nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.role-nav-actions button {
  min-height: 38px;
  border: 0;
  color: var(--text);
  background: transparent;
  padding: 0 8px;
}

.role-nav-actions .nav-lang {
  min-width: 78px;
  border: 1px solid rgba(46, 105, 170, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(53, 245, 255, 0.42);
  border-radius: 50%;
  color: var(--cyan);
  box-shadow: 0 0 28px rgba(53, 245, 255, 0.28);
}

.role-kicker {
  margin: 18px 0 10px;
  color: var(--cyan);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.role-title {
  max-width: 620px;
  margin: 0;
  font-size: clamp(4.1rem, 5.2vw, 6.2rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.role-copy {
  max-width: 640px;
  margin: 44px 0 0;
  color: #b8c9da;
  font-size: 1.18rem;
  line-height: 1.65;
}

.role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.role-actions .primary-btn,
.role-actions .ghost-btn {
  min-width: 172px;
  min-height: 58px;
  font-weight: 700;
}

.role-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 680px;
  margin-top: 34px;
}

.role-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon title"
    "icon desc";
  column-gap: 14px;
  row-gap: 4px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(46, 105, 170, 0.16);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
  box-shadow: 0 18px 42px rgba(59, 88, 121, 0.12);
}

[dir="rtl"] .role-choice {
  text-align: right;
}

.role-choice strong {
  grid-area: title;
  align-self: end;
  font-size: 1.22rem;
}

.role-choice small {
  grid-area: desc;
  color: var(--muted);
  line-height: 1.35;
  font-weight: 650;
}

.choice-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: #132033;
  font-weight: 820;
}

.teacher-choice {
  border-color: rgba(245, 184, 75, 0.38);
  background: linear-gradient(135deg, rgba(255, 224, 130, 0.82), rgba(112, 224, 203, 0.76));
}

.teacher-choice .choice-icon {
  background: rgba(255, 255, 255, 0.62);
}

.student-choice {
  border-color: rgba(248, 94, 143, 0.22);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(217, 242, 255, 0.86));
}

.student-choice .choice-icon {
  background: rgba(255, 142, 178, 0.18);
  color: #b43765;
}

.role-choice:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 184, 216, 0.42);
  box-shadow: 0 24px 48px rgba(59, 88, 121, 0.17);
}

.proof-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 46px;
}

.proof-pills span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(46, 105, 170, 0.14);
  border-radius: 999px;
  color: #3d506c;
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.92rem;
  font-weight: 660;
}

.proof-pills i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--teal);
}

.role-footnote {
  max-width: 660px;
  margin: 52px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.role-preview {
  position: relative;
  min-height: min(76vh, 720px);
  overflow: hidden;
  border: 1px solid rgba(46, 105, 170, 0.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 34% 56%, rgba(32, 191, 169, 0.16), transparent 28%),
    radial-gradient(circle at 92% 62%, rgba(248, 94, 143, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(211, 248, 255, 0.82), rgba(255, 250, 239, 0.78));
  box-shadow: 0 30px 80px rgba(59, 88, 121, 0.18);
  backdrop-filter: blur(22px);
}

.preview-insight {
  position: absolute;
  z-index: 4;
  left: 34px;
  top: 88px;
  width: 220px;
  padding: 14px 16px;
  border: 1px solid rgba(248, 94, 143, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 38px rgba(248, 94, 143, 0.12);
}

[dir="rtl"] .preview-insight {
  right: 34px;
  left: auto;
  text-align: right;
}

.preview-insight span,
.preview-insight small {
  color: #b43765;
  font-size: 0.78rem;
  font-weight: 760;
}

.preview-insight strong {
  display: block;
  margin: 6px 0 3px;
  color: var(--text);
  font-size: 1.18rem;
}

.preview-top {
  position: absolute;
  z-index: 3;
  top: 26px;
  left: 32px;
  right: 32px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
}

[dir="rtl"] .preview-top {
  grid-template-columns: 1fr 140px;
}

.preview-top span,
.preview-top strong {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #30445f;
  font-size: 0.84rem;
  font-weight: 760;
}

.preview-top strong {
  font-weight: 560;
}

.preview-graph {
  position: absolute;
  inset: 132px 34px 34px;
}

.preview-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.preview-lines path {
  fill: none;
  stroke-linecap: round;
}

.preview-lines .thin {
  stroke: rgba(49, 105, 145, 0.36);
  stroke-width: 1.2;
}

.preview-lines .hot {
  stroke: rgba(245, 151, 48, 0.78);
  stroke-width: 4.5;
  filter: drop-shadow(0 10px 10px rgba(245, 151, 48, 0.18));
}

.preview-node {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: block;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
}

[dir="rtl"] .preview-node {
  transform: translate(50%, -50%);
}

.preview-node b {
  position: absolute;
  inset: 0;
  border: 3px solid currentColor;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 24px color-mix(in srgb, currentColor 36%, transparent);
}

.preview-node small {
  display: none;
}

.preview-node em {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
  min-width: max-content;
  padding: 6px 10px;
  border: 2px solid currentColor;
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 26px rgba(59, 88, 121, 0.12);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 760;
  white-space: nowrap;
}

[dir="rtl"] .preview-node em {
  right: calc(100% + 10px);
  left: auto;
}

.preview-node.label-left em {
  right: calc(100% + 10px);
  left: auto;
}

[dir="rtl"] .preview-node.label-left em {
  right: auto;
  left: calc(100% + 10px);
}

.preview-node.teal {
  color: var(--teal);
}

.preview-node.blue {
  color: #35a7ff;
}

.preview-node.amber {
  color: var(--amber);
}

.preview-node.orange {
  color: #ff8a4c;
}

.preview-node.pink {
  color: var(--magenta);
}

.preview-node.large b {
  box-shadow: 0 0 46px color-mix(in srgb, currentColor 44%, transparent);
}

.next-card {
  position: absolute;
  right: 18px;
  bottom: 6px;
  z-index: 4;
  width: min(310px, 48%);
  padding: 18px 20px;
  border: 1px solid rgba(46, 105, 170, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 38px rgba(59, 88, 121, 0.14);
}

[dir="rtl"] .next-card {
  right: auto;
  left: 18px;
  text-align: right;
}

.next-card span {
  color: #008aa0;
  font-size: 0.74rem;
  font-weight: 780;
}

.next-card strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--text);
  font-size: 1.12rem;
}

.next-card small {
  color: var(--muted);
}

.blocked-card {
  position: absolute;
  left: 48%;
  top: 57%;
  z-index: 4;
  width: 176px;
  padding: 14px 16px;
  border: 1px solid rgba(248, 94, 143, 0.26);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 38px rgba(248, 94, 143, 0.14);
}

[dir="rtl"] .blocked-card {
  text-align: right;
}

.blocked-card span,
.blocked-card small {
  color: #b43765;
  font-size: 0.78rem;
  font-weight: 760;
}

.blocked-card strong {
  display: block;
  margin: 6px 0 3px;
  color: var(--text);
  font-size: 1.08rem;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.chip-btn,
.answer-btn {
  min-height: 40px;
  border: 1px solid rgba(140, 211, 255, 0.2);
  border-radius: 8px;
  color: var(--text);
  background: rgba(9, 18, 33, 0.74);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.primary-btn {
  padding: 0 18px;
  border-color: rgba(53, 245, 255, 0.52);
  background: linear-gradient(135deg, rgba(25, 216, 181, 0.3), rgba(139, 92, 246, 0.22));
  box-shadow: 0 0 28px rgba(53, 245, 255, 0.18);
}

.ghost-btn {
  padding: 0 15px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
}

.chip-btn {
  min-height: 31px;
  padding: 0 10px;
  color: #ccefff;
  font-size: 0.74rem;
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover,
.chip-btn:hover,
.answer-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(53, 245, 255, 0.68);
  box-shadow: 0 0 24px rgba(53, 245, 255, 0.16);
}

.app-shell {
  display: none;
  position: relative;
  z-index: 1;
  height: 100vh;
  padding: 18px;
}

.dashboard-active .app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
}

.dashboard-active .role-screen {
  display: none;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 12, 22, 0.72);
  backdrop-filter: var(--panel-blur);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.product {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.product-name {
  font-weight: 720;
  white-space: nowrap;
}

.brand-short {
  display: none;
}

.product-sub {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.segmented,
.select-shell,
.metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px;
  border: 1px solid rgba(140, 211, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.segmented button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  padding: 0 10px;
}

.segmented button.active {
  color: var(--bg);
  background: linear-gradient(135deg, var(--cyan), var(--teal));
}

.select-shell {
  padding: 0 8px;
  color: var(--muted);
}

.select-shell select {
  max-width: 160px;
  border: 0;
  color: var(--text);
  background: transparent;
  outline: 0;
}

.metrics {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.metric {
  padding: 0 10px;
  font-size: 0.8rem;
}

.metric strong {
  color: var(--cyan);
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

[dir="rtl"] .main-layout {
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
}

[dir="rtl"] .insight-panel {
  grid-column: 1;
  text-align: right;
}

[dir="rtl"] .graph-stage {
  grid-column: 2;
  grid-row: 1;
}

.panel,
.insight-panel,
.detail-drawer,
.copilot-panel,
.quiz-panel,
.bottom-sheet {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: var(--panel-blur);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.insight-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-title {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.student-meta {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  color: #bfd0df;
  font-size: 0.8rem;
}

.student-meta span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 7px;
}

[dir="rtl"] .student-meta span {
  flex-direction: row-reverse;
}

.report-stream {
  min-height: 240px;
  overflow: auto;
  padding-inline-end: 4px;
  color: #e8f5ff;
  line-height: 1.68;
  white-space: pre-wrap;
}

.keyword {
  display: inline;
  border: 0;
  color: var(--cyan);
  background: transparent;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(53, 245, 255, 0.35);
  text-underline-offset: 3px;
}

.keyword.active {
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255, 209, 102, 0.55);
}

.action-row,
.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quest-box {
  display: none;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 209, 102, 0.24);
  border-radius: 8px;
  background: rgba(255, 209, 102, 0.07);
}

.student-mode .quest-box {
  display: block;
}

.quest-box p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.graph-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(86, 196, 255, 0.16);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 52%, rgba(53, 245, 255, 0.1), transparent 24%),
    radial-gradient(circle at 68% 30%, rgba(139, 92, 246, 0.1), transparent 24%),
    rgba(3, 8, 16, 0.52);
}

#graphCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.graph-hud {
  position: absolute;
  top: 16px;
  inset-inline-start: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(560px, calc(100% - 32px));
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #dcefff;
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.78rem;
}

.tooltip {
  position: fixed;
  z-index: 8;
  display: none;
  min-width: 154px;
  padding: 10px;
  border: 1px solid rgba(53, 245, 255, 0.3);
  border-radius: 8px;
  color: var(--text);
  background: rgba(5, 10, 19, 0.92);
  box-shadow: 0 0 32px rgba(53, 245, 255, 0.14);
  pointer-events: none;
}

.tooltip strong {
  display: block;
  margin-bottom: 4px;
}

.tooltip span {
  color: var(--muted);
  font-size: 0.74rem;
}

.detail-drawer {
  position: absolute;
  z-index: 5;
  top: 96px;
  bottom: 92px;
  inset-inline-end: 28px;
  width: min(390px, calc(100vw - 56px));
  padding: 16px;
  transform: translateX(18px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 260ms ease,
    opacity 260ms ease;
  overflow: auto;
}

.detail-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

[dir="rtl"] .detail-drawer {
  inset-inline-end: auto;
  inset-inline-start: 28px;
  transform: translateX(-18px);
  text-align: right;
}

[dir="rtl"] .detail-drawer.open {
  transform: translateX(0);
}

.drawer-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.mastery-ring {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(53, 245, 255, 0.35);
  border-radius: 50%;
  color: var(--cyan);
  background: radial-gradient(circle, rgba(53, 245, 255, 0.14), transparent 64%);
  box-shadow: 0 0 28px rgba(53, 245, 255, 0.15);
  font-weight: 760;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #09101c;
  background: var(--cyan);
  font-size: 0.75rem;
  font-weight: 720;
  text-transform: capitalize;
}

.detail-section {
  margin-top: 14px;
}

.detail-section h4 {
  margin: 0 0 8px;
  color: #eaf9ff;
  font-size: 0.84rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  padding: 6px 8px;
  border: 1px solid rgba(140, 211, 255, 0.16);
  border-radius: 999px;
  color: #d3e8f7;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.78rem;
}

.streamed-explanation {
  min-height: 96px;
  color: #dcecf8;
  line-height: 1.58;
}

.quiz-panel {
  position: absolute;
  z-index: 7;
  right: 28px;
  bottom: 28px;
  width: min(420px, calc(100vw - 56px));
  padding: 16px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 240ms ease,
    opacity 240ms ease;
}

.quiz-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

[dir="rtl"] .quiz-panel {
  right: auto;
  left: 28px;
  text-align: right;
}

.quiz-panel ol {
  margin: 12px 0 0;
  padding-inline-start: 20px;
  color: #d7e9f8;
  line-height: 1.55;
}

.challenge {
  display: grid;
  gap: 9px;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.answer-btn {
  min-height: 44px;
  padding: 8px 10px;
}

.answer-btn.correct {
  border-color: rgba(25, 216, 181, 0.86);
  background: rgba(25, 216, 181, 0.18);
}

.answer-btn.wrong {
  border-color: rgba(255, 92, 122, 0.8);
  background: rgba(255, 92, 122, 0.12);
  animation: shake 360ms ease;
}

.feedback {
  min-height: 22px;
  color: var(--gold);
  font-size: 0.8rem;
}

.coin-burst {
  position: fixed;
  z-index: 20;
  display: none;
  color: var(--gold);
  font-weight: 800;
  text-shadow: 0 0 18px rgba(255, 209, 102, 0.7);
  pointer-events: none;
}

.coin-burst.play {
  display: block;
  animation: coin-rise 850ms ease-out forwards;
}

.copilot-button {
  position: absolute;
  z-index: 9;
  right: 28px;
  bottom: 28px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(53, 245, 255, 0.6);
  border-radius: 50%;
  color: var(--cyan);
  background: rgba(7, 14, 25, 0.86);
  box-shadow: 0 0 34px rgba(53, 245, 255, 0.28);
}

[dir="rtl"] .copilot-button {
  right: auto;
  left: 28px;
}

.copilot-button.pulse {
  animation: copilot-pulse 2.4s ease-in-out 2;
}

.copilot-panel {
  position: absolute;
  z-index: 10;
  right: 28px;
  bottom: 94px;
  display: none;
  width: min(360px, calc(100vw - 56px));
  height: min(500px, calc(100vh - 132px));
  padding: 14px;
}

.copilot-panel.open {
  display: flex;
  flex-direction: column;
}

[dir="rtl"] .copilot-panel {
  right: auto;
  left: 28px;
  text-align: right;
}

.copilot-log {
  flex: 1;
  overflow: auto;
  margin: 12px 0;
  color: #dcecf8;
  line-height: 1.55;
}

.copilot-input {
  display: flex;
  gap: 8px;
}

.copilot-input input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(140, 211, 255, 0.18);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  padding: 0 10px;
  outline: 0;
}

.demo-step {
  display: none;
  position: absolute;
  z-index: 6;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(620px, calc(100vw - 56px));
  padding: 11px 14px;
  border: 1px solid rgba(255, 209, 102, 0.26);
  border-radius: 8px;
  color: #fff7dc;
  background: rgba(39, 28, 6, 0.78);
  backdrop-filter: var(--panel-blur);
  box-shadow: 0 0 40px rgba(255, 209, 102, 0.12);
  text-align: center;
}

.demo-step.show {
  display: block;
}

.bottom-sheet {
  display: none;
}

.hidden {
  display: none !important;
}

@keyframes star-drift {
  to {
    background-position: 120px 120px, 218px 174px;
  }
}

/* Dashboard polish: unified brand, wider report panel, assistant entry, no awkward wrapping */
.dashboard-active .topbar {
  grid-template-columns: minmax(210px, 0.65fr) minmax(360px, auto) auto;
  gap: 16px;
  min-height: 70px;
  padding: 10px 14px;
}

.dashboard-active .product {
  gap: 12px;
}

.dashboard-active .brand-symbol-small {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

.dashboard-active .product-name {
  color: #101936;
  font-size: 1.14rem;
  font-weight: 760;
  white-space: nowrap;
}

.dashboard-active .product-sub {
  color: #5f6b83;
  font-size: 0.74rem;
  white-space: nowrap;
}

.dashboard-active .controls,
.dashboard-active .metrics {
  flex-wrap: nowrap;
  min-width: 0;
}

.dashboard-active .select-shell,
.dashboard-active .metric,
.dashboard-active .chip-btn,
.dashboard-active .primary-btn,
.dashboard-active .ghost-btn,
.dashboard-active .answer-btn {
  white-space: nowrap;
}

.dashboard-active .select-shell {
  gap: 8px;
  padding: 0 10px;
}

.dashboard-active .select-shell select {
  max-width: 220px;
}

.dashboard-active .main-layout,
[dir="rtl"].dashboard-active .main-layout {
  grid-template-columns: minmax(480px, 540px) minmax(0, 1fr);
}

.dashboard-active .insight-panel {
  padding: 18px;
}

.dashboard-active .student-meta span {
  align-items: center;
}

.dashboard-active .student-meta strong {
  min-width: 0;
  text-align: end;
}

.dashboard-active .action-row {
  flex-wrap: nowrap;
  gap: 10px;
}

.dashboard-active .action-row .primary-btn,
.dashboard-active .action-row .ghost-btn {
  min-width: max-content;
  padding-inline: 18px;
}

.dashboard-active .copilot-button {
  position: absolute;
  z-index: 9;
  right: 28px;
  bottom: 28px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 56px;
  align-items: center;
  gap: 18px;
  width: 430px;
  max-width: calc(100vw - 56px);
  min-height: 86px;
  padding: 10px 12px 10px 18px;
  border: 1px solid rgba(103, 206, 247, 0.72);
  border-radius: 999px 999px 999px 12px;
  color: #111947;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76)),
    radial-gradient(circle at 20% 22%, rgba(156, 125, 255, 0.18), transparent 34%),
    radial-gradient(circle at 82% 46%, rgba(91, 210, 255, 0.22), transparent 34%);
  box-shadow:
    0 24px 58px rgba(55, 90, 138, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(22px);
  text-align: left;
}

[dir="rtl"].dashboard-active .copilot-button {
  right: auto;
  left: 28px;
  text-align: right;
  border-radius: 999px 999px 12px 999px;
}

.assistant-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(104, 121, 165, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 0 0 10px rgba(95, 114, 158, 0.045);
}

.assistant-orbit::before,
.assistant-orbit::after {
  position: absolute;
  inset: -9px;
  content: "";
  border: 1px solid rgba(104, 121, 165, 0.14);
  border-radius: 50%;
}

.assistant-orbit::after {
  inset: 8px;
}

.assistant-orbit i {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4388ff;
  box-shadow: 0 8px 18px rgba(67, 136, 255, 0.28);
}

.assistant-orbit i:nth-child(1) {
  left: 11px;
  bottom: 10px;
  background: #9c4cff;
}

.assistant-orbit i:nth-child(2) {
  right: 8px;
  top: 8px;
  background: #23c67a;
}

.assistant-orbit i:nth-child(3) {
  right: 8px;
  bottom: 12px;
  background: #ff725d;
}

.assistant-orbit b {
  width: 18px;
  height: 18px;
  border-radius: 46% 54% 48% 52%;
  background: linear-gradient(135deg, #8f70ff, #5dd7ff);
  transform: rotate(45deg);
  box-shadow: 0 8px 20px rgba(120, 106, 255, 0.24);
}

.assistant-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.assistant-copy strong,
.assistant-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-copy strong {
  color: #111947;
  font-size: 1.32rem;
  font-weight: 760;
}

.assistant-copy small {
  color: #66708f;
  font-size: 0.98rem;
  font-weight: 520;
}

.assistant-arrow {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #9a6cff, #55d6ff);
  box-shadow: 0 16px 34px rgba(69, 177, 241, 0.32);
  font-size: 2rem;
  line-height: 1;
}

.dashboard-active .copilot-panel {
  right: 28px;
  bottom: 126px;
  width: min(460px, calc(100vw - 56px));
  height: min(620px, calc(100vh - 162px));
  padding: 18px;
  border-color: rgba(115, 206, 244, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 253, 255, 0.86)),
    radial-gradient(circle at 12% 8%, rgba(151, 120, 255, 0.12), transparent 34%),
    radial-gradient(circle at 92% 18%, rgba(78, 207, 255, 0.16), transparent 34%);
  color: #101936;
  box-shadow: 0 26px 72px rgba(45, 76, 128, 0.22);
}

.dashboard-active .quiz-panel {
  bottom: 126px;
  max-height: calc(100vh - 220px);
  overflow: auto;
}

[dir="rtl"].dashboard-active .copilot-panel {
  right: auto;
  left: 28px;
}

.dashboard-active .copilot-panel .panel-title,
.dashboard-active .copilot-panel .copilot-log,
.dashboard-active .copilot-panel .detail-section h4 {
  color: #101936;
}

.dashboard-active .copilot-panel .chip-btn {
  color: #223055;
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-active .suggestion-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 3px;
}

.dashboard-active .copilot-log {
  margin: 14px 0;
  color: #1b2749;
  line-height: 1.55;
}

.dashboard-active .copilot-input {
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(115, 156, 205, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.dashboard-active .copilot-input input {
  border: 0;
  color: #101936;
  background: transparent;
}

.dashboard-active .copilot-input input::placeholder {
  color: #7b849d;
}

.chat-message {
  display: grid;
  gap: 6px;
  width: fit-content;
  max-width: 88%;
  margin-bottom: 12px;
}

.chat-message span {
  color: #6a7693;
  font-size: 0.74rem;
  font-weight: 760;
}

.chat-message p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  white-space: pre-wrap;
}

.user-message {
  margin-left: auto;
}

.user-message span {
  text-align: right;
}

.user-message p {
  color: #ffffff;
  background: linear-gradient(135deg, #5b76ff, #8d6bff);
}

.ai-message p {
  border: 1px solid rgba(94, 132, 190, 0.16);
  color: #17213d;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(75, 94, 136, 0.08);
}

[dir="rtl"].dashboard-active .user-message {
  margin-right: auto;
  margin-left: 0;
}

[dir="rtl"].dashboard-active .user-message span {
  text-align: left;
}

.copilot-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 100%;
  gap: 12px;
  padding: 20px;
  color: #152044;
  text-align: center;
}

.copilot-empty .assistant-orbit {
  width: 76px;
  height: 76px;
}

.copilot-empty strong {
  font-size: 1.2rem;
}

.copilot-empty p {
  max-width: 280px;
  margin: 0;
  color: #697490;
}

@media (max-width: 1180px) {
  .dashboard-active .topbar {
    grid-template-columns: 1fr auto;
  }

  .dashboard-active .controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

  [dir="rtl"].dashboard-active .controls {
    justify-content: flex-end;
  }

  .dashboard-active .main-layout,
  [dir="rtl"].dashboard-active .main-layout {
    grid-template-columns: minmax(430px, 500px) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .dashboard-active .main-layout,
  [dir="rtl"].dashboard-active .main-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-active .action-row {
    overflow-x: auto;
  }

  .dashboard-active .copilot-button {
    grid-template-columns: auto 50px;
    width: auto;
    min-height: 72px;
    padding: 8px 10px 8px 14px;
  }

  .dashboard-active .copilot-button .assistant-copy {
    display: none;
  }

  .dashboard-active .assistant-orbit {
    width: 50px;
    height: 50px;
  }

  .dashboard-active .assistant-arrow {
    width: 50px;
    height: 50px;
    font-size: 1.7rem;
  }

  .dashboard-active .copilot-panel {
    bottom: 112px;
  }
}

@keyframes haze {
  from {
    transform: translate3d(-1%, 0, 0) scale(1);
  }
  to {
    transform: translate3d(1%, -1%, 0) scale(1.03);
  }
}

@keyframes shake {
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(2px);
  }
}

@keyframes coin-rise {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.92);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-62px) scale(1.12);
  }
}

@keyframes copilot-pulse {
  50% {
    box-shadow: 0 0 48px rgba(53, 245, 255, 0.48);
  }
}

@media (max-width: 1040px) {
  .app-shell {
    padding: 12px;
  }

  .dashboard-active .app-shell {
    gap: 10px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .controls,
  .metrics {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .main-layout,
  [dir="rtl"] .main-layout {
    grid-template-columns: 1fr;
  }

  [dir="rtl"] .insight-panel,
  [dir="rtl"] .graph-stage {
    grid-column: auto;
    grid-row: auto;
  }

  .insight-panel {
    display: none;
  }

  .graph-stage {
    min-height: 0;
  }

  .bottom-sheet {
    position: absolute;
    z-index: 7;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: block;
    max-height: 46vh;
    padding: 14px;
    overflow: auto;
    transition: max-height 260ms ease;
  }

  .bottom-sheet.expanded {
    max-height: 76vh;
  }

  .detail-drawer {
    display: none;
  }

  .copilot-button {
    right: 22px;
    bottom: calc(46vh + 24px);
  }

  [dir="rtl"] .copilot-button {
    right: auto;
    left: 22px;
  }

  .copilot-panel {
    right: 12px;
    bottom: calc(46vh + 88px);
  }

  [dir="rtl"] .copilot-panel {
    right: auto;
    left: 12px;
  }
}

@media (max-width: 680px) {
  body {
    overflow: hidden;
  }

  .role-screen {
    padding: 22px;
  }

  .role-title {
    font-size: clamp(2.2rem, 13vw, 4.2rem);
  }

  .role-actions {
    flex-direction: column;
  }

  .role-actions button {
    width: 100%;
  }

  .topbar {
    min-height: 0;
    padding: 9px;
  }

  .product-sub,
  .select-shell span {
    display: none;
  }

  .segmented button,
  .chip-btn,
  .metric {
    font-size: 0.78rem;
  }

  .controls,
  .metrics {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .select-shell select {
    max-width: 136px;
  }

  .metric {
    min-height: 34px;
  }

  .main-layout {
    height: 100%;
  }

  .graph-hud {
    top: 10px;
    inset-inline-start: 10px;
  }

  .status-pill {
    font-size: 0.72rem;
  }

  .quiz-panel {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  [dir="rtl"] .quiz-panel {
    right: auto;
    left: 12px;
  }

  .answer-grid {
    grid-template-columns: 1fr;
  }
}

/* Final override layer: typography and compact AI assistant */
:root {
  --font-ui: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-number: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

html,
body,
button,
select,
input {
  font-family: var(--font-ui);
}

[dir="rtl"],
[lang="ar"],
[dir="rtl"] button,
[dir="rtl"] select,
[dir="rtl"] input {
  font-family: var(--font-ar);
  line-height: 1.58;
}

.metric,
.stat-pill,
.score-row,
.node-score,
.quiz-panel li {
  font-family: var(--font-number);
}

.assistant-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
}

.assistant-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.96) 0 36%, rgba(255, 255, 255, 0.66) 37% 100%);
  box-shadow:
    inset 0 0 0 9px rgba(82, 101, 155, 0.04),
    0 8px 20px rgba(54, 79, 126, 0.1);
}

.mark-ring {
  fill: none;
  stroke: rgba(92, 105, 155, 0.14);
  stroke-width: 1.25;
}

.ring-b {
  stroke: rgba(92, 105, 155, 0.1);
}

.mark-orbit {
  fill: none;
  stroke: rgba(122, 128, 180, 0.2);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.mark-dot {
  filter: drop-shadow(0 6px 10px rgba(43, 72, 132, 0.14));
}

.dot-blue {
  fill: #4f8dff;
}

.dot-green {
  fill: #27c17f;
}

.dot-red {
  fill: #ff735f;
}

.dot-purple {
  fill: #8950f5;
}

.mark-star {
  fill: #9b8cf8;
}

.dashboard-active .copilot-button {
  grid-template-columns: 54px minmax(0, 1fr) 44px;
  gap: 12px;
  right: 24px;
  bottom: 24px;
  width: min(348px, calc(100vw - 48px));
  min-height: 64px;
  padding: 8px 9px 8px 10px;
  border: 1px solid rgba(111, 183, 255, 0.52);
  border-radius: 999px 999px 999px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.9)),
    radial-gradient(circle at 13% 18%, rgba(139, 95, 255, 0.1), transparent 34%),
    radial-gradient(circle at 86% 50%, rgba(85, 211, 255, 0.16), transparent 32%);
  box-shadow:
    0 18px 42px rgba(42, 77, 124, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

[dir="rtl"].dashboard-active .copilot-button {
  right: auto;
  left: 24px;
  border-radius: 999px 999px 18px 999px;
}

.dashboard-active .copilot-button.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
}

.assistant-mark-launcher {
  width: 48px;
  height: 48px;
}

.assistant-copy {
  gap: 2px;
}

.assistant-copy strong,
.assistant-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-copy strong {
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.12;
}

.assistant-copy small {
  color: #68748d;
  font-size: 0.78rem;
  font-weight: 520;
  line-height: 1.2;
}

.assistant-arrow {
  width: 42px;
  height: 42px;
  font-size: 1.32rem;
}

.dashboard-active .copilot-panel {
  display: none;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  right: 24px;
  bottom: 98px;
  width: min(460px, calc(100vw - 48px));
  height: min(406px, calc(100vh - 122px));
  padding: 18px;
  border: 1px solid rgba(126, 159, 202, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.94)),
    radial-gradient(circle at 12% 10%, rgba(136, 95, 255, 0.1), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(93, 214, 255, 0.12), transparent 30%);
  box-shadow:
    0 24px 66px rgba(35, 63, 102, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.dashboard-active .copilot-panel.open {
  display: grid;
}

[dir="rtl"].dashboard-active .copilot-panel {
  right: auto;
  left: 24px;
}

.copilot-panel-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

[dir="rtl"].dashboard-active .copilot-panel-header {
  grid-template-columns: 38px minmax(0, 1fr) 44px;
}

[dir="rtl"].dashboard-active .copilot-panel-header .assistant-mark-small {
  grid-column: 3;
}

[dir="rtl"].dashboard-active .copilot-panel-header .panel-title {
  grid-column: 2;
}

[dir="rtl"].dashboard-active .copilot-panel-header .copilot-close {
  grid-column: 1;
  grid-row: 1;
}

.assistant-mark-small {
  width: 40px;
  height: 40px;
}

.dashboard-active .copilot-panel .panel-title {
  overflow: hidden;
  color: #0b123c;
  font-size: 1.12rem;
  font-weight: 780;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-active .copilot-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(119, 144, 185, 0.28);
  border-radius: 10px;
  color: #22283f;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 18px rgba(43, 70, 114, 0.08);
  font-size: 0.9rem;
  font-weight: 760;
}

.dashboard-active .copilot-panel .suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding: 0;
  overflow: visible;
}

.dashboard-active .copilot-panel .suggestion-row .chip-btn {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid rgba(118, 149, 194, 0.26);
  border-radius: 10px;
  color: #111735;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
  font-size: 0.74rem;
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
}

.dashboard-active .copilot-log {
  min-height: 0;
  margin: 12px 0;
  overflow-y: auto;
}

.copilot-empty {
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 8px 18px 2px;
}

.assistant-mark-empty {
  width: 52px;
  height: 52px;
  margin: 4px 0 8px;
}

.copilot-empty strong {
  color: #0b123c;
  font-size: 1.04rem;
  font-weight: 780;
  line-height: 1.16;
}

.copilot-empty p {
  max-width: 280px;
  color: #69728b;
  font-size: 0.8rem;
  line-height: 1.38;
}

.dashboard-active .copilot-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 6px;
  border: 1px solid rgba(115, 151, 198, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(46, 71, 109, 0.06);
}

.dashboard-active .copilot-input input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  color: #111735;
  background: transparent;
  border: 0;
  font-size: 0.8rem;
}

.dashboard-active .copilot-input input::placeholder {
  color: #7b8298;
}

.dashboard-active .copilot-input .primary-btn {
  min-width: 82px;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, #9a66f4, #ff8a76);
  box-shadow: 0 12px 24px rgba(161, 105, 223, 0.2);
  font-size: 0.8rem;
  font-weight: 760;
  white-space: nowrap;
}

.chat-message {
  gap: 5px;
  max-width: 86%;
  margin-bottom: 10px;
}

.chat-message p {
  padding: 10px 12px;
  border-radius: 13px;
  font-size: 0.84rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .dashboard-active .copilot-button {
    grid-template-columns: 46px minmax(0, 1fr) 38px;
    right: 14px;
    bottom: 14px;
    width: min(320px, calc(100vw - 28px));
    min-height: 58px;
    gap: 9px;
    padding: 7px 8px;
  }

  [dir="rtl"].dashboard-active .copilot-button {
    right: auto;
    left: 14px;
  }

  .assistant-mark-launcher {
    width: 42px;
    height: 42px;
  }

  .assistant-copy strong {
    font-size: 0.92rem;
  }

  .assistant-copy small {
    font-size: 0.72rem;
  }

  .assistant-arrow {
    width: 36px;
    height: 36px;
    font-size: 1.12rem;
  }

  .dashboard-active .copilot-panel {
    right: 14px;
    bottom: 82px;
    width: calc(100vw - 28px);
    height: min(390px, calc(100vh - 98px));
    padding: 16px;
  }

  [dir="rtl"].dashboard-active .copilot-panel {
    right: auto;
    left: 14px;
  }
}

@media (max-width: 520px) {
  .dashboard-active .copilot-panel {
    right: 10px;
    bottom: 74px;
    width: calc(100vw - 20px);
    height: min(370px, calc(100vh - 86px));
    padding: 14px;
  }

  [dir="rtl"].dashboard-active .copilot-panel {
    right: auto;
    left: 10px;
  }

  .dashboard-active .copilot-panel .suggestion-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .dashboard-active .copilot-input {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dashboard-active .copilot-input .primary-btn {
    width: auto;
    min-width: 76px;
  }
}

/* Final page interaction polish */
.brand-symbol {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.brand-symbol svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.brand-symbol .brand-ribbon {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 6.2;
  filter: drop-shadow(0 7px 9px rgba(82, 96, 180, 0.16));
}

.brand-symbol .brand-ribbon-blue {
  stroke: #6aa6ff;
}

.brand-symbol .brand-ribbon-cyan {
  stroke: #65d7ff;
}

.brand-symbol .brand-ribbon-violet {
  stroke: #8c63f6;
}

.brand-symbol .brand-core {
  fill: rgba(139, 99, 246, 0.16);
  stroke: #7864ef;
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.brand-symbol-small {
  width: 38px;
  height: 38px;
}

.product-button {
  appearance: none;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: inherit;
}

.product-button:hover .product-name {
  color: #006f9f;
}

.product-button:focus-visible {
  outline: 3px solid rgba(53, 167, 255, 0.34);
  outline-offset: 6px;
  border-radius: 12px;
}

.dashboard-active .insight-panel {
  display: flex;
  flex-direction: column;
}

.dashboard-active .insight-panel .report-stream {
  flex: 1 1 auto;
  min-height: 0;
}

.dashboard-active .insight-panel .action-row {
  margin-top: auto;
  padding-top: 22px;
}

.dashboard-active .copilot-button {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.dashboard-active .copilot-button.is-hidden,
.dashboard-active .copilot-button.is-docked {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.dashboard-active .copilot-panel.open + .copilot-button {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.dashboard-active .copilot-panel {
  bottom: 98px;
  width: min(460px, calc(100vw - 48px));
  height: min(406px, calc(100vh - 122px));
  padding: 15px;
  border-radius: 18px;
}

.copilot-panel-header {
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  gap: 10px;
}

[dir="rtl"].dashboard-active .copilot-panel-header {
  grid-template-columns: 34px minmax(0, 1fr) 38px;
}

.assistant-mark-small {
  width: 34px;
  height: 34px;
}

.dashboard-active .copilot-panel .panel-title {
  font-size: 1rem;
}

.dashboard-active .copilot-close {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 0.74rem;
}

.dashboard-active .copilot-panel .suggestion-row {
  gap: 7px;
  margin-top: 14px;
}

.dashboard-active .copilot-panel .suggestion-row .chip-btn {
  min-height: 31px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 0.74rem;
}

.dashboard-active .copilot-log {
  margin: 9px 0;
}

.copilot-empty {
  align-content: center;
  gap: 6px;
  padding: 2px 16px 0;
}

.assistant-mark-empty {
  width: 50px;
  height: 50px;
  margin: 0 0 6px;
}

.copilot-empty strong {
  font-size: 1.03rem;
}

.copilot-empty p {
  max-width: 250px;
  font-size: 0.8rem;
  line-height: 1.32;
}

.dashboard-active .copilot-input {
  min-height: 44px;
  padding: 5px;
}

.dashboard-active .copilot-input input {
  height: 34px;
  font-size: 0.8rem;
}

.dashboard-active .copilot-input .primary-btn {
  min-width: 74px;
  height: 34px;
  padding: 0 12px;
  font-size: 0.8rem;
}

.chat-message p {
  padding: 9px 11px;
  font-size: 0.8rem;
  line-height: 1.42;
}

@media (max-width: 900px) {
  .dashboard-active .copilot-panel {
    bottom: 78px;
    width: calc(100vw - 28px);
    height: min(390px, calc(100vh - 94px));
    padding: 14px;
  }

  .dashboard-active .copilot-button {
    width: min(300px, calc(100vw - 28px));
  }
}

@media (max-width: 520px) {
  .brand-symbol-small {
    width: 34px;
    height: 34px;
  }

  .dashboard-active .copilot-panel {
    bottom: 72px;
    width: calc(100vw - 20px);
    height: min(370px, calc(100vh - 84px));
  }

  .dashboard-active .copilot-button {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 10px;
  }

  [dir="rtl"].dashboard-active .copilot-button {
    right: auto;
    left: 10px;
  }
}

/* Final typography and Copilot compacting layer */
:root {
  --font-ui: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-number: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body,
button,
select,
input {
  font-family: var(--font-ui);
}

[dir="rtl"],
[lang="ar"],
[dir="rtl"] button,
[dir="rtl"] select,
[dir="rtl"] input {
  font-family: var(--font-ar);
}

.metric,
.stat-pill,
.node-score,
.score-row,
.quiz-panel li,
canvas {
  font-family: var(--font-number);
}

.assistant-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  color: #7057f6;
}

.assistant-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mark-ring {
  fill: none;
  stroke: rgba(92, 105, 155, 0.14);
  stroke-width: 1.25;
}

.ring-b {
  stroke: rgba(92, 105, 155, 0.1);
}

.mark-orbit {
  fill: none;
  stroke: rgba(122, 128, 180, 0.2);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.mark-dot {
  filter: drop-shadow(0 6px 10px rgba(43, 72, 132, 0.14));
}

.dot-blue {
  fill: #4f8dff;
}

.dot-green {
  fill: #27c17f;
}

.dot-red {
  fill: #ff735f;
}

.dot-purple {
  fill: #8950f5;
}

.mark-star {
  fill: url("#assistantStarGradient");
}

.assistant-mark svg {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.94) 0 38%, rgba(255, 255, 255, 0.62) 39% 100%);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 9px rgba(82, 101, 155, 0.04),
    0 8px 20px rgba(54, 79, 126, 0.09);
}

.assistant-mark svg defs {
  display: none;
}

.assistant-mark .mark-star {
  fill: #9b8cf8;
}

.dashboard-active .copilot-button {
  grid-template-columns: 54px minmax(0, 1fr) 44px;
  gap: 12px;
  right: 24px;
  bottom: 24px;
  width: min(348px, calc(100vw - 48px));
  min-height: 64px;
  padding: 8px 9px 8px 10px;
  border-radius: 999px 999px 999px 18px;
}

[dir="rtl"].dashboard-active .copilot-button {
  right: auto;
  left: 24px;
  border-radius: 999px 999px 18px 999px;
}

.assistant-mark-launcher {
  width: 48px;
  height: 48px;
}

.assistant-copy strong {
  font-size: 1rem;
  font-weight: 760;
}

.assistant-copy small {
  font-size: 0.78rem;
  font-weight: 520;
}

.assistant-arrow {
  width: 42px;
  height: 42px;
  font-size: 1.32rem;
}

.dashboard-active .copilot-panel {
  right: 24px;
  bottom: 98px;
  width: min(460px, calc(100vw - 48px));
  height: min(406px, calc(100vh - 122px));
  padding: 18px;
  border-radius: 20px;
}

.dashboard-active .copilot-panel.open {
  display: grid;
}

[dir="rtl"].dashboard-active .copilot-panel {
  right: auto;
  left: 24px;
}

.copilot-panel-header {
  grid-template-columns: 44px minmax(0, 1fr) 38px;
  gap: 12px;
}

.assistant-mark-small {
  width: 40px;
  height: 40px;
}

.dashboard-active .copilot-panel .panel-title {
  font-size: 1.12rem;
  line-height: 1.15;
}

.dashboard-active .copilot-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.dashboard-active .copilot-panel .suggestion-row {
  gap: 8px;
  margin-top: 18px;
}

.dashboard-active .copilot-panel .suggestion-row .chip-btn {
  min-height: 31px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.74rem;
}

.dashboard-active .copilot-log {
  margin: 12px 0;
}

.copilot-empty {
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 8px 18px 2px;
}

.assistant-mark-empty {
  width: 52px;
  height: 52px;
  margin: 4px 0 8px;
}

.copilot-empty strong {
  font-size: 1.04rem;
  line-height: 1.16;
}

.copilot-empty p {
  max-width: 280px;
  font-size: 0.8rem;
  line-height: 1.38;
}

.dashboard-active .copilot-input {
  min-height: 50px;
  gap: 8px;
  padding: 6px;
  border-radius: 12px;
}

.dashboard-active .copilot-input input {
  height: 38px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.dashboard-active .copilot-input .primary-btn {
  min-width: 82px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.8rem;
}

.chat-message p {
  font-size: 0.84rem;
}

@media (max-width: 900px) {
  .dashboard-active .copilot-button {
    grid-template-columns: 46px minmax(0, 1fr) 38px;
    right: 14px;
    bottom: 14px;
    width: min(320px, calc(100vw - 28px));
    min-height: 58px;
    gap: 9px;
    padding: 7px 8px;
  }

  [dir="rtl"].dashboard-active .copilot-button {
    right: auto;
    left: 14px;
  }

  .assistant-mark-launcher {
    width: 42px;
    height: 42px;
  }

  .assistant-copy strong {
    font-size: 0.92rem;
  }

  .assistant-copy small {
    font-size: 0.72rem;
  }

  .assistant-arrow {
    width: 36px;
    height: 36px;
    font-size: 1.12rem;
  }

  .dashboard-active .copilot-panel {
    right: 14px;
    bottom: 82px;
    width: calc(100vw - 28px);
    height: min(390px, calc(100vh - 98px));
    padding: 16px;
  }

  [dir="rtl"].dashboard-active .copilot-panel {
    right: auto;
    left: 14px;
  }
}

@media (max-width: 520px) {
  .dashboard-active .copilot-panel {
    right: 10px;
    bottom: 74px;
    width: calc(100vw - 20px);
    height: min(370px, calc(100vh - 86px));
    padding: 14px;
  }

  [dir="rtl"].dashboard-active .copilot-panel {
    right: auto;
    left: 10px;
  }

  .dashboard-active .copilot-panel .suggestion-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .dashboard-active .copilot-input {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dashboard-active .copilot-input .primary-btn {
    width: auto;
    min-width: 76px;
  }
}

/* Copilot refinement: commercial assistant entry and panel */
.dashboard-active .copilot-button {
  grid-template-columns: 70px minmax(0, 1fr) 58px;
  gap: 16px;
  width: min(456px, calc(100vw - 52px));
  min-height: 76px;
  padding: 9px 12px 9px 14px;
  border: 1px solid rgba(111, 183, 255, 0.52);
  border-radius: 999px 999px 999px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.9)),
    radial-gradient(circle at 13% 18%, rgba(139, 95, 255, 0.1), transparent 34%),
    radial-gradient(circle at 86% 50%, rgba(85, 211, 255, 0.16), transparent 32%);
  box-shadow:
    0 18px 42px rgba(42, 77, 124, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.dashboard-active .copilot-panel.open + .copilot-button {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.dashboard-active .copilot-button.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
}

[dir="rtl"].dashboard-active .copilot-button {
  border-radius: 999px 999px 20px 999px;
}

.dashboard-active .copilot-button .assistant-orbit {
  width: 62px;
  height: 62px;
}

.assistant-orbit {
  border-color: rgba(101, 119, 167, 0.18);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.98) 0 30%, rgba(255, 255, 255, 0.72) 31% 100%);
  box-shadow:
    inset 0 0 0 10px rgba(79, 99, 155, 0.045),
    0 12px 28px rgba(61, 88, 135, 0.1);
}

.assistant-orbit i {
  width: 12px;
  height: 12px;
}

.assistant-orbit i:nth-child(1) {
  left: 10px;
  bottom: 12px;
}

.assistant-orbit i:nth-child(2) {
  right: 10px;
  top: 9px;
}

.assistant-orbit i:nth-child(3) {
  right: 10px;
  bottom: 11px;
}

.assistant-orbit b {
  width: 15px;
  height: 15px;
  background: linear-gradient(135deg, #9a72ff, #68d6ff);
}

.assistant-copy {
  gap: 2px;
}

.assistant-copy strong {
  font-size: 1.04rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.assistant-copy small {
  font-size: 0.9rem;
  line-height: 1.2;
}

.assistant-arrow {
  width: 52px;
  height: 52px;
  font-size: 1.72rem;
  background: linear-gradient(135deg, #9869ff 0%, #6fd9ff 100%);
  box-shadow: 0 14px 28px rgba(87, 176, 236, 0.28);
}

.dashboard-active .copilot-panel {
  display: none;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  right: 28px;
  bottom: 118px;
  width: min(520px, calc(100vw - 56px));
  height: min(560px, calc(100vh - 148px));
  padding: 22px;
  border: 1px solid rgba(126, 159, 202, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.94)),
    radial-gradient(circle at 12% 10%, rgba(136, 95, 255, 0.1), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(93, 214, 255, 0.12), transparent 30%);
  box-shadow:
    0 24px 66px rgba(35, 63, 102, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.dashboard-active .copilot-panel.open {
  display: grid;
}

[dir="rtl"].dashboard-active .copilot-panel {
  right: auto;
  left: 28px;
}

.copilot-panel-header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

[dir="rtl"].dashboard-active .copilot-panel-header {
  grid-template-columns: 44px minmax(0, 1fr) 58px;
}

[dir="rtl"].dashboard-active .copilot-panel-header .assistant-orbit-mini {
  grid-column: 3;
}

[dir="rtl"].dashboard-active .copilot-panel-header .panel-title {
  grid-column: 2;
}

[dir="rtl"].dashboard-active .copilot-panel-header .copilot-close {
  grid-column: 1;
  grid-row: 1;
}

.assistant-orbit-mini,
.dashboard-active .copilot-panel .assistant-orbit-mini {
  width: 50px;
  height: 50px;
}

.assistant-orbit-mini::before {
  inset: -6px;
}

.assistant-orbit-mini::after {
  inset: 7px;
}

.assistant-orbit-mini i {
  width: 10px;
  height: 10px;
}

.assistant-orbit-mini i:nth-child(1) {
  left: 8px;
  bottom: 9px;
}

.assistant-orbit-mini i:nth-child(2) {
  right: 8px;
  top: 7px;
}

.assistant-orbit-mini i:nth-child(3) {
  right: 8px;
  bottom: 9px;
}

.assistant-orbit-mini b {
  width: 12px;
  height: 12px;
}

.dashboard-active .copilot-panel .panel-title {
  overflow: hidden;
  color: #0b123c;
  font-size: 1.32rem;
  font-weight: 780;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-active .copilot-close {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(119, 144, 185, 0.28);
  border-radius: 12px;
  color: #22283f;
  background: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
  font-weight: 760;
  box-shadow: 0 8px 18px rgba(43, 70, 114, 0.08);
}

.dashboard-active .copilot-close:hover {
  transform: translateY(-1px);
  border-color: rgba(92, 134, 204, 0.38);
  background: #ffffff;
}

.dashboard-active .copilot-panel .suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding: 0;
  overflow: visible;
}

.dashboard-active .copilot-panel .suggestion-row .chip-btn {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(118, 149, 194, 0.26);
  border-radius: 12px;
  color: #111735;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
}

.dashboard-active .copilot-panel .suggestion-row .chip-btn:hover {
  border-color: rgba(95, 135, 202, 0.42);
  background: #ffffff;
  transform: translateY(-1px);
}

.dashboard-active .copilot-log {
  min-height: 0;
  margin: 18px 0;
  overflow-y: auto;
}

.copilot-empty {
  gap: 10px;
  min-height: 100%;
  padding: 12px 24px 8px;
}

.copilot-empty .assistant-orbit {
  width: 78px;
  height: 78px;
  margin-bottom: 8px;
}

.copilot-empty .assistant-orbit i {
  width: 15px;
  height: 15px;
}

.copilot-empty strong {
  color: #0b123c;
  font-size: 1.34rem;
  font-weight: 780;
  line-height: 1.15;
}

.copilot-empty p {
  max-width: 300px;
  color: #69728b;
  font-size: 0.96rem;
  line-height: 1.42;
}

.dashboard-active .copilot-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 7px;
  border: 1px solid rgba(115, 151, 198, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(46, 71, 109, 0.06);
}

.dashboard-active .copilot-input input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  color: #111735;
  font-size: 0.95rem;
}

.dashboard-active .copilot-input input::placeholder {
  color: #7b8298;
}

.dashboard-active .copilot-input .primary-btn {
  min-width: 94px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #9a66f4, #ff8a76);
  color: #ffffff;
  font-size: 0.94rem;
  font-weight: 760;
  box-shadow: 0 12px 24px rgba(161, 105, 223, 0.2);
  white-space: nowrap;
}

.chat-message {
  gap: 5px;
  max-width: 86%;
  margin-bottom: 10px;
}

.chat-message span {
  font-size: 0.68rem;
  letter-spacing: 0;
}

.chat-message p {
  padding: 10px 12px;
  border-radius: 13px;
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .dashboard-active .copilot-button {
    grid-template-columns: 54px minmax(0, 1fr) 46px;
    width: min(360px, calc(100vw - 32px));
    min-height: 66px;
    right: 16px;
    bottom: 16px;
    gap: 10px;
    padding: 7px 8px 7px 10px;
  }

  [dir="rtl"].dashboard-active .copilot-button {
    right: auto;
    left: 16px;
  }

  .dashboard-active .copilot-button .assistant-orbit {
    width: 48px;
    height: 48px;
  }

  .dashboard-active .copilot-button .assistant-copy {
    display: grid;
  }

  .assistant-copy strong {
    font-size: 1rem;
  }

  .assistant-copy small {
    font-size: 0.8rem;
  }

  .assistant-arrow {
    width: 44px;
    height: 44px;
    font-size: 1.36rem;
  }

  .dashboard-active .copilot-panel {
    right: 16px;
    bottom: 92px;
    width: calc(100vw - 32px);
    height: min(530px, calc(100vh - 114px));
    padding: 18px;
    border-radius: 20px;
  }

  [dir="rtl"].dashboard-active .copilot-panel {
    right: auto;
    left: 16px;
  }

  .copilot-panel-header {
    grid-template-columns: 46px minmax(0, 1fr) 40px;
    gap: 10px;
  }

  .assistant-orbit-mini,
  .dashboard-active .copilot-panel .assistant-orbit-mini {
    width: 42px;
    height: 42px;
  }

  .dashboard-active .copilot-panel .panel-title {
    font-size: 1.12rem;
  }

  .dashboard-active .copilot-close {
    width: 38px;
    height: 38px;
  }

  .dashboard-active .copilot-panel .suggestion-row {
    margin-top: 18px;
    gap: 8px;
  }

  .dashboard-active .copilot-panel .suggestion-row .chip-btn {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.74rem;
  }

  .copilot-empty strong {
    font-size: 1.18rem;
  }

  .copilot-empty p {
    font-size: 0.88rem;
  }
}

@media (max-width: 520px) {
  .dashboard-active .copilot-button {
    grid-template-columns: 46px minmax(0, 1fr) 40px;
    width: calc(100vw - 24px);
    min-height: 60px;
    right: 12px;
    bottom: 12px;
  }

  [dir="rtl"].dashboard-active .copilot-button {
    right: auto;
    left: 12px;
  }

  .dashboard-active .copilot-button .assistant-orbit {
    width: 42px;
    height: 42px;
  }

  .assistant-copy strong {
    font-size: 0.92rem;
  }

  .assistant-copy small {
    font-size: 0.74rem;
  }

  .assistant-arrow {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .dashboard-active .copilot-panel {
    right: 12px;
    bottom: 80px;
    width: calc(100vw - 24px);
    height: min(520px, calc(100vh - 96px));
    padding: 16px;
  }

  [dir="rtl"].dashboard-active .copilot-panel {
    right: auto;
    left: 12px;
  }

  .dashboard-active .copilot-input {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dashboard-active .copilot-input .primary-btn {
    width: 100%;
  }
}

/* Sunny education theme overrides */
:root {
  color-scheme: light;
  --bg: #f8fbff;
  --bg-2: #fff8e7;
  --bg-3: #e9f7ff;
  --glass: rgba(255, 255, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --line: rgba(46, 105, 170, 0.16);
  --line-hot: rgba(31, 169, 220, 0.56);
  --text: #172033;
  --muted: #66758c;
  --cyan: #25b8d8;
  --teal: #20bfa9;
  --violet: #8d7bf2;
  --magenta: #f85e8f;
  --amber: #f6b73c;
  --gold: #f5b84b;
  --danger: #e94f73;
  --panel-blur: blur(18px);
}

body {
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 224, 130, 0.36), transparent 28%),
    radial-gradient(circle at 86% 20%, rgba(95, 211, 245, 0.38), transparent 32%),
    radial-gradient(circle at 94% 78%, rgba(255, 142, 178, 0.22), transparent 30%),
    radial-gradient(circle at 50% 96%, rgba(32, 191, 169, 0.22), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #fff8e7 52%, #eef8ff 100%);
  color: var(--text);
}

.screen::before {
  background-image:
    radial-gradient(circle, rgba(245, 184, 75, 0.3) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(37, 184, 216, 0.28) 0 1px, transparent 1px);
  opacity: 0.36;
}

.screen::after {
  background:
    radial-gradient(ellipse at 52% 46%, rgba(32, 191, 169, 0.1), transparent 34%),
    radial-gradient(ellipse at 72% 62%, rgba(248, 94, 143, 0.08), transparent 28%);
  opacity: 0.55;
}

.role-copy,
.product-sub,
.student-meta,
.quest-box p,
.tooltip span {
  color: var(--muted);
}

.brand-mark {
  border-color: rgba(37, 184, 216, 0.38);
  color: #087a91;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(37, 184, 216, 0.16);
}

.role-kicker,
.eyebrow,
.metric strong,
.keyword,
.copilot-button {
  color: #087a91;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.chip-btn,
.answer-btn {
  border-color: rgba(46, 105, 170, 0.18);
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
}

.primary-btn {
  border-color: rgba(32, 191, 169, 0.36);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.62), rgba(95, 211, 245, 0.56));
  box-shadow: 0 14px 32px rgba(37, 184, 216, 0.14);
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover,
.chip-btn:hover,
.answer-btn:hover {
  border-color: rgba(37, 184, 216, 0.48);
  box-shadow: 0 12px 28px rgba(37, 184, 216, 0.14);
}

.topbar,
.panel,
.insight-panel,
.detail-drawer,
.copilot-panel,
.quiz-panel,
.bottom-sheet {
  background: var(--glass);
  border-color: rgba(46, 105, 170, 0.16);
  box-shadow: 0 20px 48px rgba(59, 88, 121, 0.14);
}

.segmented,
.select-shell,
.metric {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(46, 105, 170, 0.14);
}

.segmented button.active {
  color: #083047;
  background: linear-gradient(135deg, #ffe082, #67dce8);
}

.select-shell select,
.report-stream,
.streamed-explanation,
.copilot-log,
.quiz-panel ol,
.panel-title,
.detail-section h4 {
  color: var(--text);
}

.student-meta span {
  border-bottom-color: rgba(46, 105, 170, 0.12);
}

.keyword.active {
  color: #c47b00;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.38);
}

.quest-box {
  border-color: rgba(245, 184, 75, 0.34);
  background: rgba(255, 241, 188, 0.54);
}

.graph-stage {
  border-color: rgba(46, 105, 170, 0.15);
  background:
    radial-gradient(circle at 45% 42%, rgba(255, 255, 255, 0.82), transparent 28%),
    radial-gradient(circle at 72% 28%, rgba(255, 224, 130, 0.2), transparent 28%),
    linear-gradient(135deg, rgba(246, 251, 255, 0.9), rgba(228, 247, 255, 0.78));
}

.status-pill {
  color: #244056;
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(46, 105, 170, 0.12);
}

.tooltip {
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(37, 184, 216, 0.24);
  box-shadow: 0 18px 34px rgba(59, 88, 121, 0.16);
}

.mastery-ring {
  border-color: rgba(37, 184, 216, 0.28);
  color: #087a91;
  background: radial-gradient(circle, rgba(95, 211, 245, 0.24), rgba(255, 255, 255, 0.72) 66%);
  box-shadow: 0 12px 24px rgba(37, 184, 216, 0.12);
}

.tag {
  color: #244056;
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(46, 105, 170, 0.14);
}

.knowledge-card {
  padding: 11px 12px;
  border: 1px solid rgba(32, 191, 169, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.82), rgba(255, 248, 231, 0.7));
}

.knowledge-card p {
  margin: 0;
  color: #43536a;
  line-height: 1.5;
}

.answer-btn.correct {
  border-color: rgba(32, 191, 169, 0.58);
  background: rgba(218, 255, 246, 0.78);
}

.answer-btn.wrong {
  border-color: rgba(248, 94, 143, 0.5);
  background: rgba(255, 235, 241, 0.8);
}

.copilot-button {
  border-color: rgba(37, 184, 216, 0.42);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 30px rgba(37, 184, 216, 0.18);
}

.copilot-input input {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(46, 105, 170, 0.15);
}

.demo-step {
  color: #4f3300;
  background: rgba(255, 245, 205, 0.9);
  border-color: rgba(245, 184, 75, 0.34);
  box-shadow: 0 18px 38px rgba(245, 184, 75, 0.16);
}

.drawer-tools {
  display: grid;
  justify-items: end;
  gap: 8px;
}

[dir="rtl"] .drawer-tools {
  justify-items: start;
}

.detail-drawer .icon-btn,
.quiz-panel .icon-btn,
.copilot-panel .icon-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

@media (max-width: 1040px) {
  .quiz-panel.open {
    display: none;
  }

  .bottom-sheet {
    background: rgba(255, 255, 255, 0.88);
  }

  .copilot-panel {
    background: rgba(255, 255, 255, 0.92);
  }
}

@media (max-width: 1040px) {
  .role-screen {
    overflow: auto;
  }

  .role-shell,
  [dir="rtl"] .role-shell {
    grid-template-columns: 1fr;
    align-items: start;
  }

  [dir="rtl"] .role-copyblock,
  [dir="rtl"] .role-preview {
    grid-column: auto;
    grid-row: auto;
  }

  .role-copy {
    margin-top: 28px;
  }

  .role-preview {
    min-height: 560px;
  }
}

@media (max-width: 680px) {
  .role-nav {
    align-items: center;
    gap: 10px;
    flex-direction: row;
    min-height: 54px;
    padding: 8px 10px;
  }

  .role-nav-actions {
    width: auto;
    flex-wrap: wrap;
    gap: 8px;
    margin-inline-start: auto;
  }

  .role-nav-actions button {
    min-height: 34px;
    padding: 0 6px;
  }

  .role-nav .brand-mark {
    width: 42px;
    height: 42px;
  }

  .role-nav .product-name {
    max-width: none;
  }

  .brand-full {
    display: none;
  }

  .brand-short {
    display: inline;
  }

  .role-title {
    font-size: clamp(2.7rem, 14vw, 4.35rem);
  }

  .role-copy {
    margin-top: 22px;
    font-size: 1rem;
  }

  .role-choice-grid {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .role-choice {
    min-height: 92px;
  }

  .proof-pills {
    gap: 8px;
    margin-top: 24px;
  }

  .proof-pills span {
    width: 100%;
  }

  .role-footnote {
    margin-top: 24px;
    font-size: 0.9rem;
  }

  .role-preview {
    min-height: 430px;
    border-radius: 16px;
  }

  .preview-top,
  [dir="rtl"] .preview-top {
    left: 16px;
    right: 16px;
    grid-template-columns: 1fr;
  }

  .preview-graph {
    inset: 132px 18px 22px;
  }

  .preview-insight {
    left: 20px;
    top: 96px;
    width: 168px;
    padding: 10px 12px;
  }

  [dir="rtl"] .preview-insight {
    right: 20px;
    left: auto;
  }

  .preview-insight small {
    display: none;
  }

  .preview-node em {
    display: none;
  }

  .preview-node.node-e em,
  .preview-node.node-g em {
    display: block;
    max-width: 126px;
    min-width: 0;
    white-space: normal;
    line-height: 1.15;
  }

  .preview-node.node-h em {
    display: none;
  }

  .next-card {
    width: 64%;
    right: 8px;
    bottom: 0;
    padding: 14px 16px;
  }

  .next-card strong {
    font-size: 1rem;
  }

  .blocked-card {
    display: none;
  }

  [dir="rtl"] .next-card {
    right: auto;
    left: 8px;
  }
}

/* Commercial entry screen */
.screen:has(.commercial-home) {
  color-scheme: light;
  color: #12203a;
}

.screen:has(.commercial-home)::before {
  background-image:
    radial-gradient(circle, rgba(5, 153, 186, 0.32) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 178, 58, 0.22) 0 1px, transparent 1.5px);
  background-position: 16px 12px, 92px 70px;
  background-size: 132px 132px, 188px 188px;
  opacity: 0.38;
  animation-duration: 42s;
}

.screen:has(.commercial-home)::after {
  opacity: 0;
}

.commercial-home {
  position: relative;
  display: grid;
  place-items: center;
  grid-template-rows: 1fr;
  min-height: 100vh;
  padding: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 212, 83, 0.52), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(71, 206, 255, 0.42), transparent 28%),
    radial-gradient(circle at 78% 82%, rgba(255, 111, 166, 0.28), transparent 30%),
    linear-gradient(135deg, #fffdf6 0%, #effdff 48%, #fff6fb 100%);
  color: #121a33;
}

.commercial-home::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.5)),
    radial-gradient(circle at 50% 50%, transparent 0 42%, rgba(255, 255, 255, 0.54) 76%);
  z-index: 1;
}

.commercial-home::after {
  position: absolute;
  inset: auto 5% -18% 5%;
  height: 42%;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 208, 77, 0.34), rgba(54, 204, 236, 0.26), rgba(255, 114, 166, 0.24));
  filter: blur(54px);
  opacity: 0.56;
  z-index: 0;
}

.home-nav {
  position: absolute;
  top: 24px;
  left: 28px;
  right: 28px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px 12px 9px 10px;
  color: #16233d;
  border: 1px solid rgba(36, 149, 184, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 50px rgba(53, 139, 166, 0.12);
  backdrop-filter: blur(18px);
}

.commercial-home .brand-mark {
  width: 42px;
  height: 42px;
  color: #009bc2;
  border-color: rgba(0, 155, 194, 0.38);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.commercial-home .product-name {
  color: #15213a;
  font-size: 1rem;
  letter-spacing: 0;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(36, 149, 184, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 50px rgba(53, 139, 166, 0.12);
  backdrop-filter: blur(18px);
}

.language-picker button {
  min-width: 96px;
  min-height: 42px;
  padding: 0 18px;
  color: #334467;
  font-weight: 800;
  border: 0;
  border-radius: 999px;
  background: transparent;
  transition:
    color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.language-picker button:hover {
  transform: translateY(-1px);
}

.language-picker button.active {
  color: #ffffff;
  background: #151e33;
  box-shadow: 0 10px 22px rgba(21, 30, 51, 0.2);
}

.orbit-visual {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(74vw, 920px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  animation: orbit-breathe 14s ease-in-out infinite alternate;
}

.orbit-lines {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  animation: orbit-spin 82s linear infinite;
  filter: drop-shadow(0 20px 40px rgba(67, 153, 196, 0.16));
}

.orbit-ring {
  fill: none;
  stroke: rgba(31, 139, 175, 0.2);
  stroke-width: 1.3;
  stroke-dasharray: 2 14;
}

.orbit-ring.ring-b {
  stroke: rgba(255, 157, 48, 0.25);
  stroke-dasharray: 7 18;
}

.orbit-ring.ring-c {
  stroke: rgba(246, 83, 139, 0.16);
  stroke-dasharray: 1 12;
}

.orbit-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.orbit-path.hot {
  stroke: rgba(255, 153, 45, 0.72);
  stroke-width: 7;
}

.orbit-path.cool {
  stroke: rgba(25, 138, 184, 0.34);
  stroke-width: 2;
}

.orbit-node {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 5px solid #23b99d;
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.6),
    0 18px 34px rgba(23, 75, 105, 0.18);
  animation: node-glow 5.2s ease-in-out infinite;
}

.orbit-node.n1 {
  left: 19.5%;
  top: 50.3%;
  border-color: #20bfa9;
}

.orbit-node.n2 {
  left: 34.6%;
  top: 43.7%;
  border-color: #ffb238;
  animation-delay: -0.6s;
}

.orbit-node.n3 {
  left: 48%;
  top: 48%;
  border-color: #f85e8f;
  animation-delay: -1.2s;
}

.orbit-node.n4 {
  left: 64.2%;
  top: 39.6%;
  border-color: #ff8a4c;
  animation-delay: -1.8s;
}

.orbit-node.n5 {
  left: 75.2%;
  top: 50.2%;
  border-color: #7d6bea;
  animation-delay: -2.4s;
}

.orbit-node.n6 {
  left: 28%;
  top: 23.8%;
  border-color: #35a7ff;
  animation-delay: -3s;
}

.orbit-node.n7 {
  left: 68.4%;
  top: 21%;
  border-color: #ff5f99;
  animation-delay: -3.6s;
}

.orbit-node.n8 {
  left: 31.2%;
  top: 72%;
  border-color: #ffd166;
  animation-delay: -4.2s;
}

.orbit-label {
  position: absolute;
  display: none;
  max-width: 220px;
  padding: 8px 13px;
  color: #12203a;
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  border: 1px solid rgba(28, 154, 194, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 28px rgba(25, 93, 124, 0.1);
  backdrop-filter: blur(16px);
}

.orbit-label.l1 {
  left: 50.5%;
  top: 45.8%;
}

.orbit-label.l2 {
  left: 64.8%;
  top: 33.8%;
}

.home-center {
  position: relative;
  z-index: 4;
  display: grid;
  justify-items: center;
  width: min(860px, 100%);
  padding-top: 74px;
  text-align: center;
}

.home-kicker {
  margin: 0 0 18px;
  color: #008fb2;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-center h1 {
  max-width: 860px;
  margin: 0;
  color: #141d35;
  font-size: clamp(5.2rem, 11vw, 11rem);
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 24px 52px rgba(255, 255, 255, 0.7);
}

.home-subtitle {
  max-width: 580px;
  margin: 24px 0 0;
  color: #42506d;
  font-size: clamp(1.2rem, 2.1vw, 1.7rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  text-wrap: balance;
}

.home-role-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  width: min(560px, 100%);
  margin-top: 36px;
}

.home-role-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  padding: 16px 18px;
  color: #15213a;
  text-align: start;
  border: 1px solid rgba(36, 149, 184, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 22px 56px rgba(37, 132, 164, 0.14);
  backdrop-filter: blur(18px);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.home-role-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 151, 190, 0.46);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 66px rgba(37, 132, 164, 0.22);
}

.home-role-card:focus-visible,
.language-picker button:focus-visible {
  outline: 3px solid rgba(255, 180, 58, 0.5);
  outline-offset: 3px;
}

.home-role-card span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #0092b8;
  font-size: 0.8rem;
  font-weight: 900;
  border-radius: 50%;
  background: rgba(14, 180, 202, 0.12);
}

.home-role-card strong {
  min-width: 0;
  color: #121a33;
  font-size: 1.15rem;
  line-height: 1.1;
}

.home-role-card.teacher-choice {
  border-color: rgba(255, 178, 58, 0.42);
}

.home-role-card.teacher-choice span {
  color: #6e4300;
  background: rgba(255, 198, 76, 0.26);
}

[dir="rtl"] .home-role-card {
  text-align: right;
}

[dir="rtl"] .home-center h1 {
  max-width: 760px;
  line-height: 0.86;
}

@keyframes orbit-spin {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes orbit-breathe {
  from {
    transform: translate(-50%, -50%) scale(0.985);
  }
  to {
    transform: translate(-50%, -50%) scale(1.025);
  }
}

@keyframes node-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 7px rgba(255, 255, 255, 0.56),
      0 18px 34px rgba(23, 75, 105, 0.14);
  }
  50% {
    box-shadow:
      0 0 0 12px rgba(255, 255, 255, 0.72),
      0 24px 42px rgba(23, 75, 105, 0.2);
  }
}

@media (max-width: 900px) {
  .commercial-home {
    padding: 22px;
  }

  .home-nav {
    left: 18px;
    right: 18px;
    top: 18px;
  }

  .orbit-visual {
    top: 50%;
    width: min(112vw, 760px);
    opacity: 0.72;
  }

  .home-center h1 {
    font-size: clamp(4.4rem, 13vw, 7.2rem);
  }
}

@media (max-width: 680px) {
  .commercial-home {
    min-height: 100svh;
    padding: 18px;
  }

  .home-nav {
    align-items: stretch;
    gap: 10px;
  }

  .home-brand {
    flex: 1 1 auto;
    min-width: 0;
    padding: 7px 8px;
  }

  .commercial-home .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }

  .commercial-home .product-name {
    font-size: 0.94rem;
  }

  .language-picker {
    flex: 0 0 auto;
    padding: 4px;
  }

  .language-picker button {
    min-width: 62px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.74rem;
  }

  .home-center {
    padding-top: 94px;
  }

  .home-kicker {
    margin-bottom: 14px;
    font-size: 0.74rem;
  }

  .home-center h1 {
    font-size: clamp(4.1rem, 18vw, 5.8rem);
    line-height: 0.9;
  }

  [dir="rtl"] .home-center h1 {
    line-height: 0.9;
  }

  .home-subtitle {
    max-width: 330px;
    margin-top: 18px;
    font-size: 1.04rem;
    line-height: 1.35;
  }

  .home-role-actions {
    grid-template-columns: 1fr;
    gap: 10px;
    width: min(390px, 100%);
    margin-top: 26px;
  }

  .home-role-card {
    min-height: 72px;
    padding: 13px 14px;
  }

  .home-role-card strong {
    font-size: 1.03rem;
  }

  .orbit-label {
    display: none;
  }

  .orbit-node {
    width: 18px;
    height: 18px;
    border-width: 4px;
    opacity: 0.7;
  }

  .orbit-lines {
    opacity: 0.62;
  }
}

/* Commercial entry screen v2: product-led layout with a real causal map preview */
.commercial-home {
  display: block;
  padding: 26px 30px;
  background:
    radial-gradient(circle at 10% 16%, rgba(255, 215, 96, 0.45), transparent 22%),
    radial-gradient(circle at 90% 10%, rgba(72, 205, 245, 0.38), transparent 28%),
    radial-gradient(circle at 78% 88%, rgba(255, 126, 172, 0.24), transparent 30%),
    linear-gradient(135deg, #fffdfa 0%, #f0fdff 48%, #fff7fb 100%);
}

.commercial-home .home-nav {
  left: 30px;
  right: 30px;
  top: 26px;
  justify-content: flex-start;
}

[dir="rtl"] .commercial-home .home-nav {
  justify-content: flex-end;
}

.home-layout {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(560px, 1.22fr);
  gap: clamp(30px, 5vw, 72px);
  align-items: center;
  width: min(1360px, 100%);
  min-height: calc(100vh - 52px);
  margin: 0 auto;
  padding-top: 68px;
}

[dir="rtl"] .home-layout {
  grid-template-columns: minmax(560px, 1.22fr) minmax(360px, 0.78fr);
}

.home-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  min-width: 0;
  text-align: start;
}

[dir="rtl"] .home-copy {
  grid-column: 2;
  justify-items: end;
  text-align: right;
}

[dir="rtl"] .causal-preview-card {
  grid-column: 1;
  grid-row: 1;
}

.commercial-home .home-kicker {
  margin: 0 0 18px;
  color: #0089aa;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.commercial-home .home-copy h1 {
  max-width: 650px;
  margin: 0;
  color: #13203a;
  font-size: clamp(3.7rem, 6.2vw, 7.1rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: none;
}

.commercial-home .home-subtitle {
  max-width: 560px;
  margin: 24px 0 0;
  color: #4d5e7a;
  font-size: clamp(1.04rem, 1.35vw, 1.28rem);
  font-weight: 600;
  line-height: 1.58;
}

.entry-controls {
  display: grid;
  gap: 22px;
  width: min(520px, 100%);
  margin-top: 40px;
}

.entry-control {
  display: grid;
  gap: 10px;
}

.entry-control > span {
  color: #5c6c86;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.entry-control .language-picker {
  width: 100%;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.entry-control .language-picker button {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 6px;
}

.entry-control .home-role-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  margin: 0;
}

.entry-control .home-role-card {
  min-height: 72px;
  justify-content: center;
  grid-template-columns: 1fr;
  padding: 16px 18px;
  text-align: center;
}

.entry-control .home-role-card strong {
  font-size: 1.1rem;
}

.causal-preview-card {
  position: relative;
  min-height: min(66vh, 690px);
  overflow: hidden;
  border: 1px solid rgba(37, 150, 188, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 28% 28%, rgba(255, 214, 88, 0.22), transparent 24%),
    radial-gradient(circle at 76% 20%, rgba(61, 199, 242, 0.24), transparent 26%),
    radial-gradient(circle at 82% 76%, rgba(255, 116, 164, 0.18), transparent 30%),
    rgba(255, 255, 255, 0.56);
  box-shadow:
    0 26px 72px rgba(47, 113, 151, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
}

.causal-preview-card::before {
  position: absolute;
  inset: 18px;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(37, 150, 188, 0.12);
  border-radius: 14px;
}

.causal-preview-card::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(6, 146, 183, 0.28) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255, 154, 45, 0.24) 0 1px, transparent 1.4px);
  background-position: 20px 20px, 72px 76px;
  background-size: 72px 72px, 116px 116px;
  opacity: 0.28;
}

.causal-preview-map {
  position: absolute;
  inset: 8% 7%;
  width: 86%;
  height: 84%;
  overflow: visible;
}

.causal-map-rotor {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: causal-map-slow-tilt 24s ease-in-out infinite alternate;
}

#previewArrow path {
  fill: rgba(255, 150, 44, 0.92);
}

#mobilePreviewArrow path {
  fill: rgba(255, 150, 44, 0.92);
}

.preview-edge {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preview-edge.muted {
  stroke: rgba(40, 110, 158, 0.42);
  stroke-width: 2;
}

.preview-edge.active {
  stroke: rgba(255, 150, 44, 0.86);
  stroke-width: 7;
}

.preview-node {
  fill: #ffffff;
  opacity: 0;
  stroke-width: 6;
}

.preview-node.stable {
  stroke: #2eb6f4;
}

.preview-node.focus {
  stroke: #20bfa9;
}

.preview-node.risk {
  stroke: #f85e8f;
}

.preview-node.next {
  stroke: #ff8a4c;
}

.preview-node.watch {
  stroke: #ffd166;
}

.causal-label {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 210px;
  padding: 9px 13px;
  color: #14213a;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  border: 1px solid rgba(37, 150, 188, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 30px rgba(37, 110, 150, 0.12);
  backdrop-filter: blur(14px);
}

.causal-label::before {
  display: block;
  width: 9px;
  height: 9px;
  content: "";
  border-radius: 999px;
  background: #20bfa9;
  box-shadow: 0 0 0 5px rgba(32, 191, 169, 0.12);
}

.label-slope {
  left: 36%;
  top: 54%;
  border-color: rgba(32, 191, 169, 0.28);
}

.label-slope::before {
  background: #20bfa9;
}

.label-rate {
  left: 56%;
  top: 42%;
  border-color: rgba(248, 94, 143, 0.32);
}

.label-rate::before {
  background: #f85e8f;
}

.label-linear {
  right: 9%;
  top: 25%;
  border-color: rgba(255, 138, 76, 0.32);
}

.label-linear::before,
.label-systems::before {
  background: #ff8a4c;
}

.label-systems {
  right: 8%;
  top: 63%;
  border-color: rgba(255, 138, 76, 0.32);
}

.label-word {
  left: 58%;
  bottom: 15%;
  border-color: rgba(255, 209, 102, 0.36);
}

.label-word::before {
  background: #ffd166;
}

.label-quadratic {
  left: 13%;
  top: 27%;
  border-color: rgba(53, 167, 255, 0.32);
}

.label-quadratic::before {
  background: #35a7ff;
}

@keyframes causal-map-slow-tilt {
  0% {
    transform: rotate(-1.2deg) translate(-3px, 2px);
  }
  100% {
    transform: rotate(1.2deg) translate(3px, -2px);
  }
}

@media (max-width: 1080px) {
  .home-layout,
  [dir="rtl"] .home-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 84px;
  }

  [dir="rtl"] .home-copy,
  [dir="rtl"] .causal-preview-card {
    grid-column: auto;
    grid-row: auto;
  }

  .commercial-home .home-copy h1 {
    max-width: 760px;
    font-size: clamp(3.2rem, 8vw, 5.2rem);
  }

  .commercial-home .home-subtitle {
    max-width: 680px;
  }

  .causal-preview-card {
    min-height: 470px;
  }
}

@media (max-width: 680px) {
  .commercial-home {
    padding: 18px;
    overflow-y: auto;
  }

  .commercial-home .home-nav {
    left: 18px;
    right: 18px;
    top: 18px;
  }

  .home-layout,
  [dir="rtl"] .home-layout {
    min-height: auto;
    padding-top: 78px;
  }

  .commercial-home .home-copy h1 {
    font-size: clamp(2.75rem, 12vw, 4rem);
    line-height: 1;
  }

  .commercial-home .home-subtitle {
    margin-top: 16px;
    font-size: 0.98rem;
    line-height: 1.48;
  }

  .entry-controls {
    gap: 16px;
    margin-top: 28px;
  }

  .entry-control .home-role-actions {
    grid-template-columns: 1fr;
  }

  .causal-preview-card {
    min-height: 360px;
    border-radius: 14px;
  }

  .causal-preview-map {
    inset: 12% 4% 6%;
    width: 92%;
    height: 82%;
  }

  .causal-label {
    max-width: 124px;
    padding: 6px 8px;
    font-size: 0.62rem;
    line-height: 1.05;
    white-space: normal;
  }

  .label-slope {
    left: 34%;
    top: 55%;
  }

  .label-rate {
    left: 52%;
    top: 42%;
  }

  .label-linear {
    right: 4%;
    top: 25%;
  }

  .label-systems {
    right: 8%;
    top: 64%;
  }

  .label-word {
    left: 52%;
    bottom: 14%;
  }

  .label-quadratic {
    left: 8%;
    top: 28%;
  }
}

/* Product graph refinement */
.causal-preview-card {
  min-height: min(67vh, 680px);
  border-color: rgba(36, 116, 156, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 253, 255, 0.86)),
    radial-gradient(circle at 80% 20%, rgba(82, 201, 235, 0.1), transparent 30%);
  box-shadow:
    0 30px 80px rgba(39, 93, 130, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.causal-preview-card::before {
  inset: 18px;
  border-color: rgba(36, 116, 156, 0.14);
  border-radius: 12px;
}

.causal-preview-card::after {
  opacity: 0;
}

.product-graph-map {
  inset: 18px;
  width: calc(100% - 36px);
  height: calc(100% - 36px);
}

.mobile-graph-map {
  display: none;
}

.map-panel-bg {
  fill: rgba(255, 255, 255, 0.2);
  stroke: rgba(36, 116, 156, 0.1);
  stroke-width: 1;
}

.map-grid path {
  fill: none;
  stroke: rgba(47, 126, 166, 0.08);
  stroke-width: 1;
}

.product-graph-map .causal-map-rotor {
  animation: causal-map-slow-tilt 28s ease-in-out infinite alternate;
}

.product-graph-map .preview-edge.muted {
  stroke: rgba(60, 123, 162, 0.38);
  stroke-width: 2.2;
}

.product-graph-map .preview-edge.active {
  stroke: rgba(255, 145, 43, 0.86);
  stroke-width: 6.5;
}

.kg-node rect {
  fill: rgba(255, 255, 255, 0.94);
  stroke: rgba(43, 132, 169, 0.28);
  stroke-width: 1.3;
  filter: drop-shadow(0 12px 18px rgba(45, 93, 122, 0.12));
}

.kg-node text {
  fill: #172033;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0;
  dominant-baseline: middle;
  pointer-events: none;
}

.kg-node circle {
  fill: #20bfa9;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 4;
}

.kg-node.focus rect {
  stroke: rgba(32, 191, 169, 0.48);
}

.kg-node.focus circle {
  fill: #20bfa9;
}

.kg-node.risk rect {
  stroke: rgba(248, 94, 143, 0.38);
}

.kg-node.risk circle {
  fill: #f85e8f;
}

.kg-node.next rect {
  stroke: rgba(255, 138, 76, 0.42);
}

.kg-node.next circle {
  fill: #ff8a4c;
}

.kg-node.stable circle {
  fill: #35a7ff;
}

.kg-node.watch rect {
  stroke: rgba(255, 209, 102, 0.58);
}

.kg-node.watch circle {
  fill: #ffd166;
}

@media (max-width: 680px) {
  .causal-preview-card {
    min-height: 360px;
  }

  .product-graph-map {
    display: none;
  }

  .mobile-graph-map {
    display: block;
    inset: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
  }

  .product-graph-map .preview-edge.muted {
    stroke-width: 2.6;
  }

  .product-graph-map .preview-edge.active {
    stroke-width: 7.6;
  }

  .kg-node text {
    font-size: 12px;
  }
}

/* Entry v3: premium shell + dimensional causal graph */
.entry-v3 {
  display: block;
  padding: 26px 32px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 222, 112, 0.34), transparent 22%),
    radial-gradient(circle at 76% 18%, rgba(87, 204, 232, 0.28), transparent 30%),
    radial-gradient(circle at 84% 88%, rgba(255, 130, 166, 0.16), transparent 28%),
    linear-gradient(135deg, #fffdf9 0%, #f2fdff 50%, #fff9fc 100%);
}

.entry-v3 .home-nav,
[dir="rtl"] .entry-v3 .home-nav {
  left: 32px;
  right: 32px;
  top: 24px;
  justify-content: space-between;
  direction: ltr;
}

.entry-v3 .home-brand {
  min-height: 50px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border-color: rgba(32, 151, 190, 0.18);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 20px 50px rgba(43, 118, 153, 0.11);
}

.entry-v3 .brand-mark {
  width: 38px;
  height: 38px;
}

.entry-v3 .product-name {
  font-size: 0.98rem;
  font-weight: 900;
}

.language-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 176px;
  min-height: 46px;
  padding: 4px;
  border: 1px solid rgba(32, 151, 190, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow:
    0 20px 50px rgba(43, 118, 153, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.language-switch .switch-glider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: #111a31;
  box-shadow: 0 12px 24px rgba(17, 26, 49, 0.22);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.language-switch.is-ar .switch-glider {
  transform: translateX(100%);
}

.language-switch button {
  position: relative;
  z-index: 1;
  min-height: 38px;
  padding: 0 14px;
  color: #40506b;
  font-weight: 900;
  border: 0;
  border-radius: 999px;
  background: transparent;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.language-switch button:hover {
  transform: translateY(-1px);
}

.language-switch button.active {
  color: #ffffff;
}

.entry-v3 .home-layout {
  grid-template-columns: minmax(340px, 0.72fr) minmax(620px, 1.28fr);
  gap: clamp(42px, 6vw, 92px);
  min-height: calc(100vh - 56px);
  padding-top: 62px;
}

[dir="rtl"] .entry-v3 .home-layout {
  grid-template-columns: minmax(620px, 1.28fr) minmax(340px, 0.72fr);
}

.entry-v3 .home-copy {
  max-width: 560px;
}

.entry-v3 .home-kicker {
  margin-bottom: 18px;
  color: #0086a8;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.entry-v3 .home-copy h1 {
  max-width: 560px;
  font-size: clamp(3.55rem, 5.7vw, 6.8rem);
  line-height: 0.95;
}

.entry-v3 .home-subtitle {
  max-width: 500px;
  margin-top: 24px;
  color: #50607a;
  font-size: clamp(1.02rem, 1.35vw, 1.22rem);
  font-weight: 650;
  line-height: 1.58;
}

.entry-v3 .home-role-actions {
  width: min(500px, 100%);
  margin-top: 38px;
}

.entry-v3 .home-role-card {
  min-height: 76px;
  border-color: rgba(43, 118, 153, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58));
  box-shadow: 0 18px 44px rgba(43, 118, 153, 0.1);
}

.entry-v3 .home-role-card.teacher-choice {
  border-color: rgba(255, 178, 58, 0.4);
}

.entry-v3 .home-role-card strong {
  font-size: 1.12rem;
}

.entry-v3 .home-role-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px rgba(43, 118, 153, 0.18);
}

.graph-hero {
  position: relative;
  min-height: min(72vh, 720px);
  perspective: 1200px;
  isolation: isolate;
}

[dir="rtl"] .entry-v3 .graph-hero {
  grid-column: 1;
  grid-row: 1;
}

.graph-halo {
  position: absolute;
  inset: 4% 0 0;
  border-radius: 40px;
  background:
    radial-gradient(circle at 58% 42%, rgba(69, 203, 232, 0.22), transparent 35%),
    radial-gradient(circle at 67% 58%, rgba(255, 136, 86, 0.16), transparent 34%),
    radial-gradient(circle at 40% 68%, rgba(35, 191, 169, 0.12), transparent 32%);
  filter: blur(4px);
}

.graph-floor {
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 8%;
  height: 46%;
  transform: rotateX(64deg) translateZ(-80px);
  transform-origin: 50% 100%;
  border-radius: 50%;
  background-image:
    linear-gradient(rgba(45, 125, 160, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 125, 160, 0.14) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.42;
  mask-image: radial-gradient(ellipse, black 0 42%, transparent 72%);
}

.graph-orbit-stage {
  position: absolute;
  inset: 5% 0 2%;
  transform-style: preserve-3d;
}

.graph-orbit {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: hero-graph-yaw 26s ease-in-out infinite alternate;
}

.graph-links {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100%, 820px);
  aspect-ratio: 760 / 520;
  overflow: visible;
  transform: translate(-50%, -50%) translateZ(-18px) rotateX(2deg);
  filter: drop-shadow(0 22px 28px rgba(48, 94, 120, 0.13));
}

.graph-links #heroArrow path {
  fill: rgba(255, 150, 44, 0.92);
}

.graph-links .link {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.graph-links .link.cool {
  stroke: url(#pathCool);
  stroke-width: 2.4;
}

.graph-links .link.warm {
  stroke: url(#pathWarm);
  stroke-width: 7.5;
}

.graph-links .main-flow {
  stroke-dasharray: 24 16;
  animation: graph-flow 3.8s linear infinite;
}

.graph-links .delay-a {
  animation-delay: -1.1s;
}

.graph-links .delay-b {
  animation-delay: -2.2s;
}

.graph-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 15px 0 13px;
  color: #14203a;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--c), white 54%);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.58));
  box-shadow:
    0 18px 35px rgba(44, 96, 126, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 36px color-mix(in srgb, var(--c), transparent 72%);
  backdrop-filter: blur(16px);
  transform: translate(-50%, -50%) translateZ(var(--z));
  transform-style: preserve-3d;
  animation: node-float 6s ease-in-out infinite;
}

.graph-node i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--c);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--c), transparent 84%);
}

.graph-node.depth-front {
  font-size: 0.98rem;
}

.graph-node.depth-back {
  opacity: 0.88;
}

.node-quadratic,
.node-word {
  animation-delay: -2.2s;
}

.node-rate,
.node-linear {
  animation-delay: -1.1s;
}

.signal {
  position: absolute;
  z-index: 3;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffb24a;
  box-shadow: 0 0 16px rgba(255, 160, 64, 0.9);
  opacity: 0;
}

.signal-a {
  offset-path: path("M320 312 C388 276 438 238 506 214");
  animation: signal-flow 4s linear infinite;
}

.signal-b {
  offset-path: path("M506 214 C552 180 600 144 662 108");
  animation: signal-flow 4.8s linear infinite;
  animation-delay: -1.3s;
}

.signal-c {
  offset-path: path("M506 214 C568 282 612 342 642 412");
  animation: signal-flow 4.5s linear infinite;
  animation-delay: -2.4s;
}

@keyframes hero-graph-yaw {
  0% {
    transform: rotateX(5deg) rotateY(-14deg) rotateZ(-1deg) translate3d(-8px, 4px, 0);
  }
  100% {
    transform: rotateX(2deg) rotateY(14deg) rotateZ(1deg) translate3d(8px, -4px, 0);
  }
}

@keyframes node-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -7px;
  }
}

@keyframes graph-flow {
  to {
    stroke-dashoffset: -80;
  }
}

@keyframes signal-flow {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  12%,
  80% {
    opacity: 0.95;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

@media (max-width: 1080px) {
  .entry-v3 .home-layout,
  [dir="rtl"] .entry-v3 .home-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
    padding-top: 78px;
  }

  [dir="rtl"] .entry-v3 .home-copy,
  [dir="rtl"] .entry-v3 .graph-hero {
    grid-column: auto;
    grid-row: auto;
  }

  .entry-v3 .home-copy {
    max-width: 720px;
  }

  .entry-v3 .home-copy h1 {
    max-width: 720px;
    font-size: clamp(3rem, 8vw, 5.2rem);
  }

  .graph-hero {
    min-height: 440px;
  }
}

@media (max-width: 680px) {
  .entry-v3 {
    padding: 18px;
    overflow-y: auto;
  }

  .entry-v3 .home-nav,
  [dir="rtl"] .entry-v3 .home-nav {
    left: 18px;
    right: 18px;
    top: 18px;
  }

  .language-switch {
    width: 132px;
    min-height: 42px;
  }

  .language-switch button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.78rem;
  }

  .entry-v3 .home-layout,
  [dir="rtl"] .entry-v3 .home-layout {
    padding-top: 82px;
    gap: 24px;
  }

  .entry-v3 .home-kicker {
    margin-bottom: 12px;
    font-size: 0.72rem;
  }

  .entry-v3 .home-copy h1 {
    max-width: 360px;
    font-size: clamp(2.55rem, 11.8vw, 3.55rem);
    line-height: 1;
  }

  [dir="rtl"] .entry-v3 .home-copy h1 {
    max-width: 350px;
    line-height: 1.1;
  }

  .entry-v3 .home-subtitle {
    max-width: 350px;
    margin-top: 15px;
    font-size: 0.95rem;
    line-height: 1.48;
  }

  .entry-v3 .home-role-actions {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .entry-v3 .home-role-card {
    min-height: 68px;
  }

  .graph-hero {
    min-height: 330px;
    margin-top: 2px;
  }

  .graph-floor {
    bottom: 3%;
    opacity: 0.34;
  }

  .graph-orbit-stage {
    inset: 0 -7% 0;
  }

  .graph-links {
    width: 120%;
  }

  .graph-links .link.cool {
    stroke-width: 3.1;
  }

  .graph-links .link.warm {
    stroke-width: 9;
  }

  .graph-node {
    min-height: 34px;
    max-width: 142px;
    padding: 0 10px 0 9px;
    gap: 7px;
    font-size: 0.68rem;
    white-space: normal;
  }

  .graph-node.depth-front {
    font-size: 0.74rem;
  }

  .node-quadratic {
    left: 20% !important;
    top: 28% !important;
  }

  .node-slope {
    left: 39% !important;
    top: 58% !important;
  }

  .node-rate {
    left: 63% !important;
    top: 43% !important;
  }

  .node-linear {
    left: 78% !important;
    top: 25% !important;
  }

  .node-systems {
    left: 76% !important;
    top: 70% !important;
  }

  .node-word {
    left: 57% !important;
    top: 84% !important;
  }

  @keyframes hero-graph-yaw {
    0% {
      transform: rotateX(4deg) rotateY(-8deg) rotateZ(-0.8deg);
    }
    100% {
      transform: rotateX(2deg) rotateY(8deg) rotateZ(0.8deg);
    }
  }
}

/* Entry v4: reference-led homepage with abstract 3D causal influence graph */
.entry-v4 {
  display: block;
  min-height: 100svh;
  padding: clamp(18px, 3.2svh, 34px) clamp(20px, 3.6vw, 52px);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 82% 18%, rgba(225, 232, 255, 0.58), transparent 30%),
    radial-gradient(circle at 88% 86%, rgba(232, 214, 255, 0.52), transparent 34%),
    radial-gradient(circle at 50% 64%, rgba(204, 246, 241, 0.2), transparent 30%),
    linear-gradient(135deg, #fffdfb 0%, #f8fcff 42%, #f3f6ff 100%);
}

.entry-v4 .home-nav,
[dir="rtl"] .entry-v4 .home-nav {
  top: clamp(18px, 3.2svh, 34px);
  left: clamp(20px, 3.6vw, 52px);
  right: clamp(20px, 3.6vw, 52px);
  justify-content: space-between;
  direction: ltr;
}

.entry-v4 .home-brand {
  gap: 14px;
  min-height: 58px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.brand-symbol {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
}

.brand-symbol svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.brand-symbol path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 6;
}

.brand-symbol path:nth-child(1) {
  stroke: #63c7ff;
}

.brand-symbol path:nth-child(2) {
  stroke: #7658f4;
}

.brand-symbol path:nth-child(3) {
  stroke: #8f7dff;
}

.entry-v4 .product-name {
  color: #0d1230;
  font-size: 1.72rem;
  font-weight: 800;
}

.entry-v4 .language-switch {
  width: 178px;
  min-height: 52px;
  padding: 5px;
  border-color: rgba(25, 42, 93, 0.12);
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    0 18px 42px rgba(51, 63, 105, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.entry-v4 .language-switch .switch-glider {
  top: 5px;
  left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  background: #080d35;
  box-shadow: 0 12px 26px rgba(8, 13, 53, 0.24);
}

.entry-v4 .language-switch button {
  color: #18254b;
  font-size: 0.9rem;
}

.entry-v4 .language-switch button.active {
  color: #ffffff;
}

.entry-v4 .home-layout,
[dir="rtl"] .entry-v4 .home-layout {
  display: grid;
  grid-template-columns: minmax(380px, 0.82fr) minmax(600px, 1.18fr);
  gap: clamp(30px, 4vw, 76px);
  align-items: center;
  direction: ltr;
  width: min(1500px, 100%);
  min-height: calc(100svh - clamp(36px, 6.4svh, 68px));
  margin: 0 auto;
  padding-top: clamp(70px, 10svh, 92px);
}

[dir="rtl"] .entry-v4 .home-layout {
  grid-template-columns: minmax(600px, 1.18fr) minmax(380px, 0.82fr);
}

.entry-v4 .home-copy {
  position: relative;
  z-index: 3;
  max-width: 620px;
  justify-items: start;
  text-align: start;
}

[dir="rtl"] .entry-v4 .home-copy {
  grid-column: 2;
  direction: rtl;
  justify-items: end;
  text-align: right;
}

[dir="rtl"] .entry-v4 .home-kicker {
  letter-spacing: 0;
}

.entry-v4 .home-kicker {
  margin: 0 0 18px;
  color: #2567ff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.entry-v4 .home-copy h1 {
  max-width: 590px;
  margin: 0;
  color: #080d35;
  font-size: clamp(3rem, 7.3svh, 5.05rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
}

[dir="rtl"] .entry-v4 .home-copy h1 {
  max-width: 560px;
  font-size: clamp(2.85rem, 7svh, 4.8rem);
  font-weight: 800;
  line-height: 1.13;
}

.entry-v4 .home-copy h1 span {
  display: inline-block;
  color: transparent;
  background: linear-gradient(100deg, #236cff 0%, #5b72ff 46%, #8b49f6 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

.entry-v4 .home-subtitle {
  max-width: 470px;
  margin: 24px 0 0;
  color: #263267;
  font-size: clamp(1.02rem, 2.4svh, 1.28rem);
  font-weight: 500;
  line-height: 1.55;
}

.entry-v4 .home-role-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 24px;
  width: min(540px, 100%);
  margin-top: 34px;
}

.entry-v4 .home-role-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 86px;
  padding: 16px 20px;
  border: 1px solid rgba(45, 105, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    0 20px 54px rgba(49, 70, 136, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.entry-v4 .home-role-card.teacher-choice {
  border-color: rgba(45, 105, 255, 0.22);
}

.entry-v4 .home-role-card.student-choice {
  border-color: rgba(31, 173, 138, 0.22);
}

.entry-v4 .home-role-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 28px 66px rgba(49, 70, 136, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.entry-v4 .role-icon {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  color: transparent;
  font-size: 0;
  border-radius: 0;
  background: transparent;
}

.entry-v4 .role-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #2f6fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.entry-v4 .student-choice .role-icon svg {
  stroke: #23a87f;
}

.entry-v4 .role-text {
  display: grid;
  flex: 1 1 auto;
  gap: 5px;
  place-items: start;
  width: auto !important;
  height: auto !important;
  min-width: 0;
  margin: 0;
  color: #080d35;
  border-radius: 0 !important;
  background: transparent !important;
}

.entry-v4 .home-role-card .role-text {
  display: grid;
  place-items: start;
  width: auto !important;
  height: auto !important;
  min-width: 0;
  color: #080d35;
  border-radius: 0 !important;
  background: transparent !important;
}

.entry-v4 .role-text small {
  color: #2f6fff;
  font-size: 0.84rem;
  font-weight: 650;
}

.entry-v4 .student-choice .role-text small,
.entry-v4 .student-choice .role-arrow {
  color: #1c9b76;
}

.entry-v4 .role-text strong {
  color: #080d35;
  font-size: 1.04rem;
  line-height: 1.1;
}

.entry-v4 .role-arrow {
  flex: 0 0 auto;
  color: #2f6fff;
  font-size: 1.55rem;
  line-height: 1;
  transition: transform 180ms ease;
}

.entry-v4 .home-role-card:hover .role-arrow {
  transform: translateX(5px);
}

[dir="rtl"] .entry-v4 .role-arrow {
  transform: scaleX(-1);
}

[dir="rtl"] .entry-v4 .home-role-card:hover .role-arrow {
  transform: scaleX(-1) translateX(5px);
}

[dir="rtl"] .entry-v4 .home-role-card {
  direction: rtl;
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .entry-v4 .role-text {
  justify-items: end;
  text-align: right;
}

[dir="rtl"] .entry-v4 .role-text small {
  display: none;
}

.causal-cloud {
  position: relative;
  z-index: 2;
  min-height: min(62svh, 600px);
  perspective: 1300px;
  transform-style: preserve-3d;
}

[dir="rtl"] .entry-v4 .causal-cloud {
  grid-column: 1;
  grid-row: 1;
  transform: scaleX(-1);
}

[dir="rtl"] .entry-v4 .causal-cloud .cause-node,
[dir="rtl"] .entry-v4 .causal-cloud .cause-pulse {
  transform: translate(-50%, -50%) translateZ(var(--z)) scaleX(-1);
}

.causal-depth {
  position: absolute;
  inset: 2% -2% 0;
  transform-style: preserve-3d;
  animation: causal-yaw 30s ease-in-out infinite alternate;
}

.causal-depth::before {
  position: absolute;
  inset: 8% 2% 4%;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 48% 48%, rgba(106, 218, 214, 0.26), transparent 28%),
    radial-gradient(circle at 82% 34%, rgba(255, 139, 76, 0.18), transparent 26%),
    radial-gradient(circle at 80% 72%, rgba(144, 91, 244, 0.12), transparent 30%);
  filter: blur(8px);
  transform: translateZ(-160px);
}

.causal-depth::after {
  position: absolute;
  left: 8%;
  right: 4%;
  bottom: 6%;
  height: 34%;
  content: "";
  pointer-events: none;
  transform: rotateX(68deg) translateZ(-180px);
  transform-origin: 50% 100%;
  background-image:
    linear-gradient(rgba(60, 108, 160, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 108, 160, 0.12) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.34;
  mask-image: radial-gradient(ellipse, black 0 42%, transparent 72%);
}

.causal-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: translateZ(-28px);
}

.network-floor {
  opacity: 0.18;
  transform: translateY(20px);
}

.network-floor path {
  fill: none;
  stroke: #95add3;
  stroke-width: 1;
}

.home-edge {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
  opacity: 0.78;
}

.home-edge.cool {
  stroke: url(#homePathCool);
}

.home-edge.warm {
  stroke: url(#homePathWarm);
}

.home-edge.faint {
  opacity: 0.34;
  stroke-width: 1.8;
}

.home-edge.active {
  stroke-width: 3.2;
  opacity: 0.88;
}

.home-node {
  transform-box: fill-box;
  transform-origin: center;
  animation: home-node-drift 7.5s ease-in-out infinite;
}

.home-node.depth-front {
  opacity: 0.98;
}

.home-node.depth-mid {
  opacity: 0.88;
}

.home-node.depth-back {
  opacity: 0.72;
}

.home-node:nth-child(2),
.home-node:nth-child(5),
.home-node:nth-child(7) {
  animation-delay: -2.6s;
}

.home-node:nth-child(3),
.home-node:nth-child(8) {
  animation-delay: -4.2s;
}

.node-halo {
  fill: rgba(255, 255, 255, 0.46);
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 8;
}

.node-core {
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 2;
}

.node-glint {
  fill: rgba(255, 255, 255, 0.78);
}

.node-shadow {
  fill: rgba(95, 139, 178, 0.12);
  filter: blur(4px);
}

.home-pulse {
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(255, 154, 75, 0.55));
  animation: home-pulse-fade 5.8s linear infinite;
}

.home-pulse.cool {
  fill: #58ccb8;
}

.home-pulse.warm {
  fill: #ff9b4e;
}

.causal-lines {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(104%, 930px);
  aspect-ratio: 920 / 640;
  overflow: visible;
  transform: translate(-50%, -50%) translateZ(-30px) rotateX(1deg);
  filter: drop-shadow(0 22px 26px rgba(71, 82, 135, 0.12));
}

#cloudArrowA path {
  fill: rgba(236, 88, 172, 0.72);
}

#cloudArrowB path {
  fill: rgba(255, 139, 49, 0.74);
}

.cause-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cause-line.soft,
.cause-line.faint {
  stroke: url(#cloudPathA);
  stroke-width: 2.4;
}

.cause-line.faint {
  opacity: 0.4;
}

.cause-line.main {
  stroke: url(#cloudPathA);
  stroke-width: 3.2;
}

.cause-line.main.hot,
.cause-line.warm {
  stroke: url(#cloudPathB);
}

.cause-line.main,
.cause-line.warm {
  stroke-dasharray: 16 13;
  animation: cause-flow 4.8s linear infinite;
}

.cause-line.warm {
  stroke-width: 3.1;
}

.cause-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.96) 0 16%, color-mix(in srgb, var(--c), white 28%) 28%, var(--c) 62%, color-mix(in srgb, var(--c), #111a46 24%) 100%);
  border: 8px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    0 18px 28px color-mix(in srgb, var(--c), transparent 70%),
    0 0 0 9px color-mix(in srgb, var(--c), transparent 88%),
    inset -5px -7px 12px rgba(6, 11, 45, 0.2),
    inset 5px 6px 12px rgba(255, 255, 255, 0.7);
  transform: translate(-50%, -50%) translateZ(var(--z));
  transform-style: preserve-3d;
  animation: cause-node-float 7s ease-in-out infinite;
}

.cause-node::after {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 58px;
  height: 16px;
  content: "";
  border-radius: 50%;
  background: color-mix(in srgb, var(--c), transparent 74%);
  filter: blur(8px);
  transform: translate(-50%, 20px) rotateX(70deg) translateZ(-40px);
}

.node-b,
.node-f,
.node-g {
  width: 38px;
  height: 38px;
  border-width: 10px;
}

.node-d,
.node-e {
  width: 34px;
  height: 34px;
}

.node-c,
.node-h {
  animation-delay: -1.8s;
}

.node-b,
.node-e {
  animation-delay: -3.2s;
}

.cause-pulse {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffae42;
  box-shadow: 0 0 18px rgba(255, 153, 57, 0.78);
  opacity: 0;
}

.pulse-a {
  offset-path: path("M374 240 C442 302 470 372 548 378");
  animation: cause-pulse-flow 5.2s linear infinite;
}

.pulse-b {
  offset-path: path("M548 378 C642 342 694 282 792 238");
  animation: cause-pulse-flow 5.6s linear infinite;
  animation-delay: -1.5s;
}

.pulse-c {
  offset-path: path("M548 378 C600 452 666 490 770 516");
  animation: cause-pulse-flow 5.8s linear infinite;
  animation-delay: -3s;
}

@keyframes causal-yaw {
  0% {
    transform: rotateX(4deg) rotateY(-12deg) rotateZ(-0.5deg) translate3d(-8px, 3px, 0);
  }
  100% {
    transform: rotateX(2deg) rotateY(12deg) rotateZ(0.5deg) translate3d(8px, -3px, 0);
  }
}

@keyframes cause-node-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -9px;
  }
}

@keyframes home-node-drift {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -8px;
  }
}

@keyframes home-pulse-fade {
  0%,
  100% {
    opacity: 0;
  }
  20%,
  78% {
    opacity: 0.95;
  }
}

@keyframes cause-flow {
  to {
    stroke-dashoffset: -58;
  }
}

@keyframes cause-pulse-flow {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  18%,
  78% {
    opacity: 0.9;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

@media (max-height: 760px) and (min-width: 1081px) {
  .brand-symbol {
    width: 46px;
    height: 46px;
  }

  .entry-v4 .product-name {
    font-size: 1.48rem;
  }

  .entry-v4 .language-switch {
    width: 166px;
    min-height: 46px;
  }

  .entry-v4 .home-layout,
  [dir="rtl"] .entry-v4 .home-layout {
    min-height: calc(100svh - 44px);
    padding-top: 62px;
  }

  .entry-v4 .home-kicker {
    margin-bottom: 12px;
    font-size: 0.74rem;
  }

  .entry-v4 .home-copy h1 {
    max-width: 520px;
    font-size: 3.35rem;
  }

  [dir="rtl"] .entry-v4 .home-copy h1 {
    max-width: 520px;
    font-size: 3.2rem;
  }

  .entry-v4 .home-subtitle {
    max-width: 430px;
    margin-top: 16px;
    font-size: 1rem;
    line-height: 1.42;
  }

  .entry-v4 .home-role-actions {
    gap: 16px;
    margin-top: 22px;
  }

  .entry-v4 .home-role-card {
    min-height: 72px;
    padding: 13px 16px;
  }

  .causal-cloud {
    min-height: min(54svh, 440px);
  }
}

@media (max-width: 1080px) {
  .entry-v4 .home-layout,
  [dir="rtl"] .entry-v4 .home-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: auto;
    padding-top: 92px;
  }

  [dir="rtl"] .entry-v4 .home-copy,
  [dir="rtl"] .entry-v4 .causal-cloud {
    grid-column: auto;
    grid-row: auto;
  }

  .entry-v4 .home-copy,
  [dir="rtl"] .entry-v4 .home-copy {
    max-width: 760px;
  }

  .causal-cloud {
    min-height: 420px;
  }
}

@media (max-width: 1080px) {
  .entry-v4 {
    padding: 24px 28px;
  }

  .entry-v4 .home-nav,
  [dir="rtl"] .entry-v4 .home-nav {
    left: 28px;
    right: 28px;
    top: 24px;
  }

  .entry-v4 .home-layout,
  [dir="rtl"] .entry-v4 .home-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    min-height: auto;
    padding-top: 88px;
  }

  [dir="rtl"] .entry-v4 .home-copy,
  [dir="rtl"] .entry-v4 .causal-cloud {
    grid-column: auto;
    grid-row: auto;
  }

  .entry-v4 .home-copy h1 {
    max-width: 760px;
    font-size: 4.35rem;
  }

  [dir="rtl"] .entry-v4 .home-copy h1 {
    max-width: 700px;
    font-size: 4.05rem;
  }

  .entry-v4 .home-subtitle {
    max-width: 610px;
  }

  .causal-cloud {
    min-height: 390px;
  }
}

@media (max-width: 1080px) and (min-width: 760px) and (max-height: 800px) {
  .entry-v4 {
    padding: 22px 28px;
  }

  .entry-v4 .home-layout,
  [dir="rtl"] .entry-v4 .home-layout {
    grid-template-columns: minmax(320px, 0.76fr) minmax(480px, 1.24fr);
    gap: 24px;
    align-items: center;
    min-height: calc(100svh - 44px);
    padding-top: 64px;
  }

  [dir="rtl"] .entry-v4 .home-layout {
    grid-template-columns: minmax(480px, 1.24fr) minmax(320px, 0.76fr);
  }

  [dir="rtl"] .entry-v4 .home-copy {
    grid-column: 2;
  }

  [dir="rtl"] .entry-v4 .causal-cloud {
    grid-column: 1;
    grid-row: 1;
  }

  .entry-v4 .home-copy,
  [dir="rtl"] .entry-v4 .home-copy {
    max-width: 360px;
  }

  .entry-v4 .home-kicker {
    margin-bottom: 10px;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
  }

  .entry-v4 .home-copy h1,
  [dir="rtl"] .entry-v4 .home-copy h1 {
    max-width: 360px;
    font-size: 2.7rem;
  }

  .entry-v4 .home-subtitle {
    max-width: 340px;
    margin-top: 14px;
    font-size: 0.96rem;
    line-height: 1.42;
  }

  .entry-v4 .home-role-actions {
    grid-template-columns: 1fr;
    gap: 10px;
    width: min(340px, 100%);
    margin-top: 20px;
  }

  .entry-v4 .home-role-card {
    min-height: 62px;
    padding: 10px 14px;
  }

  .entry-v4 .role-icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .entry-v4 .role-text small {
    font-size: 0.74rem;
  }

  .entry-v4 .role-text strong {
    font-size: 1.02rem;
  }

  .causal-cloud {
    min-height: min(56svh, 430px);
  }
}

@media (max-width: 680px) {
  .entry-v4 {
    padding: 18px;
    overflow-y: auto;
  }

  .entry-v4 .home-nav,
  [dir="rtl"] .entry-v4 .home-nav {
    left: 18px;
    right: 18px;
    top: 18px;
  }

  .brand-symbol {
    width: 38px;
    height: 38px;
  }

  .entry-v4 .product-name {
    font-size: 1.08rem;
  }

  .entry-v4 .language-switch {
    width: 132px;
    min-height: 42px;
  }

  .entry-v4 .language-switch button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 0.75rem;
  }

  .entry-v4 .home-layout,
  [dir="rtl"] .entry-v4 .home-layout {
    gap: 16px;
    padding-top: 78px;
  }

  .entry-v4 .home-kicker {
    margin-bottom: 12px;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
  }

  .entry-v4 .home-copy h1 {
    max-width: 360px;
    font-size: 2.72rem;
    line-height: 1.02;
  }

  [dir="rtl"] .entry-v4 .home-copy h1 {
    max-width: 350px;
    font-size: 2.6rem;
    line-height: 1.1;
  }

  .entry-v4 .home-subtitle {
    max-width: 348px;
    margin-top: 16px;
    font-size: 0.98rem;
    line-height: 1.45;
  }

  .entry-v4 .home-role-actions {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    margin-top: 26px;
  }

  .entry-v4 .home-role-card {
    min-height: 72px;
    padding: 13px 15px;
  }

  .entry-v4 .role-icon {
    width: 34px;
    height: 34px;
  }

  .entry-v4 .role-text small {
    font-size: 0.78rem;
  }

  .entry-v4 .role-text strong {
    font-size: 1.1rem;
  }

  .causal-cloud {
    min-height: 285px;
  }

  .causal-depth {
    inset: 0 -2% 0;
  }

  .causal-network {
    width: 100%;
  }

  .cause-node {
    width: 22px;
    height: 22px;
    border-width: 6px;
  }

  .node-b,
  .node-f,
  .node-g {
    width: 30px;
    height: 30px;
    border-width: 8px;
  }

  .node-d,
  .node-e {
    width: 28px;
    height: 28px;
  }

  @keyframes causal-yaw {
    0% {
      transform: rotateX(3deg) rotateY(-7deg) rotateZ(-0.4deg);
    }
    100% {
      transform: rotateX(2deg) rotateY(7deg) rotateZ(0.4deg);
    }
  }
}

/* Final override layer: typography and compact AI assistant */
:root {
  --font-ui: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-number: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

html,
body,
button,
select,
input {
  font-family: var(--font-ui);
}

[dir="rtl"],
[lang="ar"],
[dir="rtl"] button,
[dir="rtl"] select,
[dir="rtl"] input {
  font-family: var(--font-ar);
  line-height: 1.58;
}

.metric,
.stat-pill,
.score-row,
.node-score,
.quiz-panel li {
  font-family: var(--font-number);
}

.assistant-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
}

.assistant-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.96) 0 36%, rgba(255, 255, 255, 0.66) 37% 100%);
  box-shadow:
    inset 0 0 0 9px rgba(82, 101, 155, 0.04),
    0 8px 20px rgba(54, 79, 126, 0.1);
}

.mark-ring {
  fill: none;
  stroke: rgba(92, 105, 155, 0.14);
  stroke-width: 1.25;
}

.ring-b {
  stroke: rgba(92, 105, 155, 0.1);
}

.mark-orbit {
  fill: none;
  stroke: rgba(122, 128, 180, 0.2);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.mark-dot {
  filter: drop-shadow(0 6px 10px rgba(43, 72, 132, 0.14));
}

.dot-blue {
  fill: #4f8dff;
}

.dot-green {
  fill: #27c17f;
}

.dot-red {
  fill: #ff735f;
}

.dot-purple {
  fill: #8950f5;
}

.mark-star {
  fill: #9b8cf8;
}

.dashboard-active .copilot-button {
  grid-template-columns: 54px minmax(0, 1fr) 44px;
  gap: 12px;
  right: 24px;
  bottom: 24px;
  width: min(348px, calc(100vw - 48px));
  min-height: 64px;
  padding: 8px 9px 8px 10px;
  border: 1px solid rgba(111, 183, 255, 0.52);
  border-radius: 999px 999px 999px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.9)),
    radial-gradient(circle at 13% 18%, rgba(139, 95, 255, 0.1), transparent 34%),
    radial-gradient(circle at 86% 50%, rgba(85, 211, 255, 0.16), transparent 32%);
  box-shadow:
    0 18px 42px rgba(42, 77, 124, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

[dir="rtl"].dashboard-active .copilot-button {
  right: auto;
  left: 24px;
  border-radius: 999px 999px 18px 999px;
}

.dashboard-active .copilot-button.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
}

.assistant-mark-launcher {
  width: 48px;
  height: 48px;
}

.assistant-copy {
  gap: 2px;
}

.assistant-copy strong,
.assistant-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-copy strong {
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.12;
}

.assistant-copy small {
  color: #68748d;
  font-size: 0.78rem;
  font-weight: 520;
  line-height: 1.2;
}

.assistant-arrow {
  width: 42px;
  height: 42px;
  font-size: 1.32rem;
}

.dashboard-active .copilot-panel {
  display: none;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  right: 24px;
  bottom: 98px;
  width: min(460px, calc(100vw - 48px));
  height: min(406px, calc(100vh - 122px));
  padding: 18px;
  border: 1px solid rgba(126, 159, 202, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.94)),
    radial-gradient(circle at 12% 10%, rgba(136, 95, 255, 0.1), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(93, 214, 255, 0.12), transparent 30%);
  box-shadow:
    0 24px 66px rgba(35, 63, 102, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.dashboard-active .copilot-panel.open {
  display: grid;
}

[dir="rtl"].dashboard-active .copilot-panel {
  right: auto;
  left: 24px;
}

.copilot-panel-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

[dir="rtl"].dashboard-active .copilot-panel-header {
  grid-template-columns: 38px minmax(0, 1fr) 44px;
}

[dir="rtl"].dashboard-active .copilot-panel-header .assistant-mark-small {
  grid-column: 3;
}

[dir="rtl"].dashboard-active .copilot-panel-header .panel-title {
  grid-column: 2;
}

[dir="rtl"].dashboard-active .copilot-panel-header .copilot-close {
  grid-column: 1;
  grid-row: 1;
}

.assistant-mark-small {
  width: 40px;
  height: 40px;
}

.dashboard-active .copilot-panel .panel-title {
  overflow: hidden;
  color: #0b123c;
  font-size: 1.12rem;
  font-weight: 780;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-active .copilot-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(119, 144, 185, 0.28);
  border-radius: 10px;
  color: #22283f;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 18px rgba(43, 70, 114, 0.08);
  font-size: 0.9rem;
  font-weight: 760;
}

.dashboard-active .copilot-panel .suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding: 0;
  overflow: visible;
}

.dashboard-active .copilot-panel .suggestion-row .chip-btn {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid rgba(118, 149, 194, 0.26);
  border-radius: 10px;
  color: #111735;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
  font-size: 0.74rem;
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
}

.dashboard-active .copilot-log {
  min-height: 0;
  margin: 12px 0;
  overflow-y: auto;
}

.copilot-empty {
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 8px 18px 2px;
}

.assistant-mark-empty {
  width: 52px;
  height: 52px;
  margin: 4px 0 8px;
}

.copilot-empty strong {
  color: #0b123c;
  font-size: 1.04rem;
  font-weight: 780;
  line-height: 1.16;
}

.copilot-empty p {
  max-width: 280px;
  color: #69728b;
  font-size: 0.8rem;
  line-height: 1.38;
}

.dashboard-active .copilot-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 6px;
  border: 1px solid rgba(115, 151, 198, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(46, 71, 109, 0.06);
}

.dashboard-active .copilot-input input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 0;
  color: #111735;
  background: transparent;
  font-size: 0.8rem;
}

.dashboard-active .copilot-input input::placeholder {
  color: #7b8298;
}

.dashboard-active .copilot-input .primary-btn {
  min-width: 82px;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, #9a66f4, #ff8a76);
  box-shadow: 0 12px 24px rgba(161, 105, 223, 0.2);
  font-size: 0.8rem;
  font-weight: 760;
  white-space: nowrap;
}

.chat-message {
  gap: 5px;
  max-width: 86%;
  margin-bottom: 10px;
}

.chat-message p {
  padding: 10px 12px;
  border-radius: 13px;
  font-size: 0.84rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .dashboard-active .copilot-button {
    grid-template-columns: 46px minmax(0, 1fr) 38px;
    right: 14px;
    bottom: 14px;
    width: min(320px, calc(100vw - 28px));
    min-height: 58px;
    gap: 9px;
    padding: 7px 8px;
  }

  [dir="rtl"].dashboard-active .copilot-button {
    right: auto;
    left: 14px;
  }

  .assistant-mark-launcher {
    width: 42px;
    height: 42px;
  }

  .assistant-copy strong {
    font-size: 0.92rem;
  }

  .assistant-copy small {
    font-size: 0.72rem;
  }

  .assistant-arrow {
    width: 36px;
    height: 36px;
    font-size: 1.12rem;
  }

  .dashboard-active .copilot-panel {
    right: 14px;
    bottom: 82px;
    width: calc(100vw - 28px);
    height: min(390px, calc(100vh - 98px));
    padding: 16px;
  }

  [dir="rtl"].dashboard-active .copilot-panel {
    right: auto;
    left: 14px;
  }
}

@media (max-width: 520px) {
  .dashboard-active .copilot-panel {
    right: 10px;
    bottom: 74px;
    width: calc(100vw - 20px);
    height: min(370px, calc(100vh - 86px));
    padding: 14px;
  }

  [dir="rtl"].dashboard-active .copilot-panel {
    right: auto;
    left: 10px;
  }

  .dashboard-active .copilot-panel .suggestion-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .dashboard-active .copilot-input {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dashboard-active .copilot-input .primary-btn {
    width: auto;
    min-width: 76px;
  }
}
