/* Final presentation overrides. Keep this file loaded after styles.css. */

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

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

.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: 24px;
}

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

.dashboard-active .action-row .primary-btn,
.dashboard-active .action-row .ghost-btn {
  min-width: 124px;
  padding-inline: 16px;
}

.graph-stage {
  cursor: grab;
}

.graph-stage:active {
  cursor: grabbing;
}

.graph-hud {
  gap: 8px;
}

.graph-hud .status-pill {
  border-color: rgba(125, 170, 210, 0.16);
  background: rgba(255, 255, 255, 0.74);
}

.graph-legend {
  position: absolute;
  z-index: 2;
  left: 18px;
  bottom: 18px;
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid rgba(94, 152, 197, 0.18);
  border-radius: 12px;
  color: #40516f;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 34px rgba(43, 73, 112, 0.1);
  backdrop-filter: blur(14px);
  font-size: 0.72rem;
  font-weight: 620;
  pointer-events: none;
}

[dir="rtl"].dashboard-active .graph-legend {
  right: 18px;
  left: auto;
}

.graph-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

[dir="rtl"].dashboard-active .graph-legend span {
  flex-direction: row-reverse;
}

.graph-legend i {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.legend-arrow {
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #37b7d9, #ff8a59);
}

.legend-arrow::after {
  position: absolute;
  right: -1px;
  top: 50%;
  width: 7px;
  height: 7px;
  content: "";
  border-top: 2px solid #ff8a59;
  border-right: 2px solid #ff8a59;
  transform: translateY(-50%) rotate(45deg);
}

.legend-node {
  width: 12px;
  height: 12px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #35a7ff;
  box-shadow: 0 0 0 3px rgba(53, 167, 255, 0.16);
}

.legend-zoom {
  width: 14px;
  height: 14px;
  border: 2px solid #24b89a;
  border-radius: 50%;
}

.legend-zoom::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: #24b89a;
  transform: rotate(45deg);
}

.dashboard-active .copilot-button {
  grid-template-columns: 42px minmax(0, 1fr) 36px;
  gap: 9px;
  width: min(292px, calc(100vw - 48px));
  min-height: 52px;
  padding: 6px 7px 6px 8px;
}

.dashboard-active .assistant-mark-launcher {
  width: 40px;
  height: 40px;
}

.dashboard-active .assistant-copy strong {
  font-size: 0.9rem;
}

.dashboard-active .assistant-copy small {
  font-size: 0.68rem;
}

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

.dashboard-active .copilot-panel {
  width: min(450px, calc(100vw - 48px));
  height: min(372px, calc(100vh - 114px));
  bottom: 86px;
  padding: 14px;
}

.dashboard-active .copilot-panel .suggestion-row {
  margin-top: 12px;
}

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

.copilot-empty {
  padding: 4px 18px 0;
}

.assistant-mark-empty {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
}

.dashboard-active .copilot-input {
  min-height: 42px;
}

.dashboard-active .copilot-input input,
.dashboard-active .copilot-input .primary-btn {
  height: 32px;
}

@media (max-width: 1180px) {
  .dashboard-active .main-layout,
  [dir="rtl"].dashboard-active .main-layout {
    grid-template-columns: clamp(390px, 38vw, 460px) minmax(0, 1fr);
  }

  [dir="rtl"].dashboard-active .main-layout {
    grid-template-columns: minmax(0, 1fr) clamp(390px, 38vw, 460px);
  }
}

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

  .graph-legend {
    left: 12px;
    bottom: 74px;
    gap: 5px;
    padding: 8px 10px;
    font-size: 0.66rem;
  }

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

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

@media (max-width: 520px) {
  .graph-legend {
    display: none;
  }

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

/* Workspace layout refresh: full-width product console, not card-based. */
.dashboard-active .app-shell {
  height: 100svh;
  padding: 0;
  gap: 0;
  grid-template-rows: clamp(78px, 8.4svh, 96px) minmax(0, 1fr);
  background:
    radial-gradient(circle at 88% 14%, rgba(95, 211, 245, 0.16), transparent 30%),
    radial-gradient(circle at 20% 94%, rgba(255, 209, 102, 0.12), transparent 28%),
    linear-gradient(135deg, #fbfdff 0%, #f8fbff 46%, #eef8ff 100%);
}

.dashboard-active .topbar {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0;
  min-height: 0;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid rgba(46, 105, 170, 0.14);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(59, 88, 121, 0.08);
  backdrop-filter: blur(18px);
}

.dashboard-active .product-button {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0 28px 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  justify-content: flex-start;
}

.dashboard-active .product-button::after,
.dashboard-active .selection-controls::after {
  position: absolute;
  inset-inline-end: 0;
  top: 26%;
  bottom: 26%;
  width: 1px;
  content: "";
  background: rgba(46, 105, 170, 0.16);
}

.dashboard-active .product-button .brand-symbol-small {
  width: 50px;
  height: 50px;
}

.dashboard-active .product-name {
  color: #091234;
  font-size: clamp(1.04rem, 1.35vw, 1.24rem);
  font-weight: 760;
}

.dashboard-active .product-sub {
  margin-top: 2px;
  color: #60708c;
  font-size: 0.76rem;
  font-weight: 560;
}

.dashboard-active .controls {
  display: grid;
  grid-template-columns: minmax(340px, 520px) minmax(0, 1fr);
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
}

.dashboard-active .selection-controls {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  align-items: stretch;
  min-width: 0;
}

.dashboard-active.student-mode .selection-controls {
  grid-template-columns: minmax(180px, 260px);
}

.dashboard-active .top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 2.2vw, 34px);
  min-width: 0;
  padding-inline: clamp(18px, 2.4vw, 34px);
}

.dashboard-active .select-shell {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 0;
  padding: 0 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-active .select-shell + .select-shell {
  border-inline-start: 1px solid rgba(46, 105, 170, 0.12);
}

.dashboard-active .select-shell span {
  color: #3e5376;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1;
}

.dashboard-active .select-shell select {
  width: 100%;
  max-width: none;
  color: #091234;
  font-size: clamp(0.92rem, 1.1vw, 1.05rem);
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

.dashboard-active .chip-btn {
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #172542;
  background: transparent;
  box-shadow: none;
  font-size: 0.88rem;
  font-weight: 650;
  white-space: nowrap;
}

.dashboard-active .chip-btn:hover {
  color: #0a8dab;
  transform: none;
  box-shadow: none;
}

.dashboard-active .metrics {
  align-items: center;
  gap: 12px;
  padding-inline-start: 6px;
}

.dashboard-active .metric {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: #34496c;
  background: rgba(241, 247, 255, 0.9);
  box-shadow: none;
  font-size: 0.86rem;
  font-weight: 620;
  white-space: nowrap;
}

.dashboard-active .metric:nth-child(2) {
  background: rgba(255, 247, 230, 0.92);
}

.dashboard-active .metric strong {
  margin-inline-start: 4px;
  color: #2a7eaa;
  font-size: 1rem;
  font-weight: 780;
}

.dashboard-active .metric:nth-child(2) strong {
  color: #e28a24;
}

.dashboard-active .main-layout,
[dir="rtl"].dashboard-active .main-layout {
  grid-template-columns: clamp(450px, 39vw, 650px) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
}

[dir="rtl"].dashboard-active .main-layout {
  grid-template-columns: minmax(0, 1fr) clamp(450px, 39vw, 650px);
}

.dashboard-active .insight-panel {
  border: 0;
  border-inline-end: 1px solid rgba(46, 105, 170, 0.13);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
  backdrop-filter: blur(10px);
  padding: clamp(22px, 3vw, 44px) clamp(24px, 3.4vw, 48px);
}

[dir="rtl"].dashboard-active .insight-panel {
  border-inline: 1px solid rgba(46, 105, 170, 0.13) 0;
}

.dashboard-active .graph-stage {
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 42% 44%, rgba(255, 255, 255, 0.82), transparent 28%),
    radial-gradient(circle at 78% 30%, rgba(95, 211, 245, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(247, 252, 255, 0.94), rgba(231, 246, 255, 0.82));
}

.dashboard-active .detail-drawer {
  top: calc(clamp(78px, 8.4svh, 96px) + 20px);
  bottom: 92px;
  inset-inline-end: clamp(18px, 2vw, 28px);
  width: min(468px, calc(100vw - 56px));
}

[dir="rtl"].dashboard-active .detail-drawer {
  inset-inline-end: auto;
  inset-inline-start: clamp(18px, 2vw, 28px);
}

.dashboard-active .detail-drawer .action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-active .detail-drawer .action-row .primary-btn,
.dashboard-active .detail-drawer .action-row .ghost-btn {
  width: 100%;
  flex: initial;
  min-width: 0;
  padding-inline: 8px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.dashboard-active .graph-hud {
  top: clamp(20px, 3.2svh, 36px);
  inset-inline-start: clamp(28px, 3.4vw, 50px);
  max-width: min(620px, calc(100% - 80px));
}

.dashboard-active .status-pill {
  min-height: 34px;
  padding: 0 16px;
  color: #40516f;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(46, 105, 170, 0.13);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 560;
}

.dashboard-active .graph-legend {
  left: clamp(24px, 3vw, 42px);
  bottom: clamp(24px, 3vw, 42px);
}

[dir="rtl"].dashboard-active .graph-legend {
  right: clamp(24px, 3vw, 42px);
  left: auto;
}

.dashboard-active .copilot-button {
  right: clamp(18px, 2.6vw, 36px);
  bottom: clamp(18px, 2.4vw, 32px);
}

[dir="rtl"].dashboard-active .copilot-button {
  right: auto;
  left: clamp(18px, 2.6vw, 36px);
}

@media (max-width: 1260px) {
  .dashboard-active .topbar {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) auto;
    padding: 0 14px;
  }

  .dashboard-active .controls {
    grid-template-columns: minmax(300px, 450px) minmax(0, 1fr);
  }

  .dashboard-active .select-shell {
    padding-inline: 20px;
  }

  .dashboard-active .top-actions {
    gap: 18px;
    padding-inline: 18px;
  }

  .dashboard-active .main-layout,
  [dir="rtl"].dashboard-active .main-layout {
    grid-template-columns: clamp(420px, 37vw, 560px) minmax(0, 1fr);
  }

  [dir="rtl"].dashboard-active .main-layout {
    grid-template-columns: minmax(0, 1fr) clamp(420px, 37vw, 560px);
  }
}

@media (max-width: 1040px) {
  .dashboard-active .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .dashboard-active .topbar {
    grid-template-columns: minmax(210px, auto) minmax(0, 1fr);
    row-gap: 0;
    padding: 8px 14px;
  }

  .dashboard-active .controls {
    grid-template-columns: 1fr;
  }

  .dashboard-active .selection-controls {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .dashboard-active .selection-controls::after,
  .dashboard-active .product-button::after {
    display: none;
  }

  .dashboard-active .top-actions {
    justify-content: flex-start;
    padding-inline: 20px;
    gap: 18px;
  }

  .dashboard-active .metrics {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 8px;
  }
}

@media (max-width: 900px) {
  .dashboard-active .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
    padding: 10px 14px 12px;
  }

  .dashboard-active .product-button {
    height: auto;
    padding: 0;
  }

  .dashboard-active .controls {
    gap: 8px;
  }

  .dashboard-active .selection-controls {
    grid-template-columns: 1fr 1fr;
    border: 1px solid rgba(46, 105, 170, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.62);
  }

  .dashboard-active.student-mode .selection-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-active .select-shell {
    padding: 10px 12px;
  }

  .dashboard-active .top-actions {
    justify-content: space-between;
    padding-inline: 0;
  }

  .dashboard-active .metrics {
    justify-content: stretch;
    padding: 0;
  }

  .dashboard-active .metric {
    flex: 1 1 0;
    justify-content: center;
  }

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

  .dashboard-active .insight-panel {
    border-inline-end: 0;
    border-bottom: 1px solid rgba(46, 105, 170, 0.13);
    max-height: 44svh;
    padding: 18px 18px 16px;
  }

  [dir="rtl"].dashboard-active .insight-panel {
    border-inline: 0;
    border-bottom: 1px solid rgba(46, 105, 170, 0.13);
  }

  .dashboard-active .graph-stage {
    min-height: 52svh;
  }
}

@media (max-width: 560px) {
  .dashboard-active .topbar {
    padding: 9px 12px 11px;
  }

  .dashboard-active .product-button .brand-symbol-small {
    width: 42px;
    height: 42px;
  }

  .dashboard-active .product-name {
    font-size: 1rem;
  }

  .dashboard-active .product-sub {
    font-size: 0.7rem;
  }

  .dashboard-active .selection-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-active .select-shell + .select-shell {
    border-inline-start: 0;
    border-top: 1px solid rgba(46, 105, 170, 0.1);
  }

  .dashboard-active .metrics {
    gap: 8px;
  }

  .dashboard-active .metric {
    min-height: 40px;
    padding-inline: 10px;
    font-size: 0.76rem;
  }

  .dashboard-active .metric strong {
    font-size: 0.88rem;
  }
}

/* Console density polish. */
.dashboard-active .app-shell {
  grid-template-rows: clamp(70px, 7.6svh, 84px) minmax(0, 1fr);
}

.dashboard-active .topbar {
  grid-template-columns: minmax(230px, 315px) minmax(0, 1fr) auto;
  padding-inline: clamp(14px, 1.7vw, 24px);
}

.dashboard-active .product-button {
  padding-inline-end: clamp(20px, 2.2vw, 30px);
}

.dashboard-active .product-button .brand-symbol-small {
  width: 46px;
  height: 46px;
}

.dashboard-active .product-name {
  font-size: clamp(1rem, 1.2vw, 1.16rem);
}

.dashboard-active .product-sub {
  font-size: 0.72rem;
}

.dashboard-active .controls {
  grid-template-columns: minmax(315px, 480px) minmax(0, 1fr);
}

.dashboard-active .selection-controls {
  grid-template-columns: repeat(2, minmax(138px, 1fr));
}

.dashboard-active .select-shell {
  padding-inline: clamp(18px, 2vw, 26px);
  gap: 4px;
}

.dashboard-active .select-shell span {
  font-size: 0.68rem;
}

.dashboard-active .select-shell select {
  font-size: clamp(0.88rem, 1vw, 1rem);
}

.dashboard-active .top-actions {
  gap: clamp(16px, 2vw, 28px);
  padding-inline: clamp(16px, 2vw, 28px);
}

.dashboard-active .chip-btn {
  font-size: 0.82rem;
}

.dashboard-active .metric {
  min-height: 44px;
  padding-inline: 15px;
  font-size: 0.8rem;
}

.dashboard-active .metric strong {
  font-size: 0.94rem;
}

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

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

.dashboard-active .insight-panel {
  padding: clamp(22px, 2.35vw, 34px) clamp(24px, 2.7vw, 38px);
}

.dashboard-active .panel-header {
  margin-bottom: 18px;
}

.dashboard-active .eyebrow {
  margin-bottom: 7px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.dashboard-active .insight-panel .panel-title {
  font-size: clamp(1.1rem, 1.35vw, 1.26rem);
}

.dashboard-active .badge {
  min-height: 26px;
  padding: 0 10px;
  font-size: 0.72rem;
}

.dashboard-active .student-meta {
  gap: 0;
  margin-bottom: 18px;
  font-size: 0.72rem;
}

.dashboard-active .student-meta span {
  align-items: center;
  gap: 14px;
  min-height: 34px;
  padding-block: 7px;
}

.dashboard-active .student-meta strong {
  max-width: 78%;
  text-align: end;
  line-height: 1.25;
}

[dir="rtl"].dashboard-active .student-meta strong {
  text-align: start;
}

.dashboard-active .report-stream {
  font-size: clamp(0.88rem, 1vw, 0.98rem);
  line-height: 1.62;
}

.dashboard-active .insight-panel .action-row {
  gap: 10px;
  padding-top: 20px;
}

.dashboard-active .insight-panel .action-row .primary-btn,
.dashboard-active .insight-panel .action-row .ghost-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  padding-inline: 10px;
  font-size: 0.86rem;
  white-space: nowrap;
}

.dashboard-active .graph-hud {
  top: clamp(18px, 2.8svh, 30px);
  inset-inline-start: clamp(24px, 3vw, 42px);
}

.dashboard-active .status-pill {
  min-height: 31px;
  padding-inline: 14px;
  font-size: 0.78rem;
}

.dashboard-active .graph-legend {
  gap: 6px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 0.68rem;
}

.dashboard-active .detail-drawer {
  top: calc(clamp(70px, 7.6svh, 84px) + 20px);
}

@media (max-width: 1260px) {
  .dashboard-active .main-layout,
  [dir="rtl"].dashboard-active .main-layout {
    grid-template-columns: clamp(410px, 35vw, 500px) minmax(0, 1fr);
  }

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

@media (max-width: 1040px) {
  .dashboard-active .topbar {
    grid-template-columns: minmax(190px, auto) minmax(0, 1fr);
  }

  .dashboard-active .controls {
    grid-template-columns: 1fr;
  }

  .dashboard-active .selection-controls {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-active .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

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

  .dashboard-active .insight-panel {
    padding: 18px 18px 14px;
    max-height: 43svh;
  }

  .dashboard-active .report-stream {
    font-size: 0.86rem;
  }
}

/* RTL graph workspace correction. Keep report on the right and the graph dominant. */
[dir="rtl"].dashboard-active .main-layout {
  grid-template-columns: clamp(380px, 30vw, 470px) minmax(0, 1fr);
}

.dashboard-active .insight-panel {
  grid-column: 1;
}

.dashboard-active .graph-stage {
  grid-column: 2;
  grid-row: 1;
}

[dir="rtl"].dashboard-active .insight-panel {
  grid-column: 1;
  border-inline: 1px solid rgba(46, 105, 170, 0.13) 0;
}

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

[dir="rtl"].dashboard-active .detail-drawer {
  position: absolute !important;
  inset: calc(clamp(70px, 7.6svh, 84px) + 20px) auto 92px clamp(18px, 2vw, 28px) !important;
  width: min(420px, 29vw, calc(100vw - 56px));
  text-align: right;
}

@media (max-width: 1260px) {
  [dir="rtl"].dashboard-active .main-layout {
    grid-template-columns: clamp(360px, 32vw, 430px) minmax(0, 1fr);
  }

  [dir="rtl"].dashboard-active .detail-drawer {
    inset: calc(clamp(70px, 7.6svh, 84px) + 20px) auto 92px clamp(18px, 2vw, 28px) !important;
    width: min(390px, 34vw, calc(100vw - 44px));
  }
}

@media (max-width: 900px) {
  .dashboard-active .insight-panel,
  .dashboard-active .graph-stage,
  [dir="rtl"].dashboard-active .insight-panel,
  [dir="rtl"].dashboard-active .graph-stage {
    grid-column: 1;
  }

  [dir="rtl"].dashboard-active .detail-drawer {
    inset: auto 12px 90px 12px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto;
  }
}

/* Node inspector polish */
.dashboard-active .detail-drawer {
  display: flex;
  flex-direction: column;
  width: min(440px, calc(100vw - 56px));
  padding: 18px 20px 16px;
  overflow: hidden;
  border: 1px solid rgba(46, 105, 170, 0.16);
  border-radius: 10px;
  background:
    radial-gradient(circle at 88% 12%, rgba(95, 211, 245, 0.12), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(250, 253, 255, 0.88));
  box-shadow: 0 24px 54px rgba(59, 88, 121, 0.18);
}

.dashboard-active .drawer-top {
  align-items: flex-start;
  gap: 18px;
  min-height: 92px;
}

.dashboard-active .drawer-heading {
  min-width: 0;
  padding-top: 1px;
}

.dashboard-active .detail-drawer .eyebrow {
  margin-bottom: 7px;
  color: #2f8daf;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
}

.dashboard-active .detail-drawer .panel-title {
  max-width: 255px;
  font-size: clamp(1.28rem, 1.55vw, 1.55rem);
  line-height: 1.12;
}

.dashboard-active .detail-drawer .badge {
  margin-top: 10px;
  min-height: 25px;
  padding-inline: 12px;
  font-size: 0.72rem;
  box-shadow: 0 8px 18px rgba(248, 94, 143, 0.16);
}

.dashboard-active .drawer-tools {
  display: grid;
  justify-items: end;
  gap: 14px;
  flex: 0 0 auto;
}

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

.dashboard-active .detail-drawer .icon-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 9px;
  color: #172033;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(59, 88, 121, 0.08);
}

.dashboard-active .mastery-ring {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  width: 66px;
  height: 66px;
  border: 0;
  background: conic-gradient(#2f8daf var(--mastery), rgba(46, 105, 170, 0.12) 0);
  box-shadow: 0 12px 22px rgba(47, 141, 175, 0.12);
  color: #237c9b;
  font-size: 1.08rem;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 1px 0 #fff;
}

.dashboard-active .mastery-ring::before {
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.94);
  content: "";
}

.dashboard-active .mastery-ring span {
  position: relative;
  z-index: 1;
}

.dashboard-active .drawer-divider {
  height: 1px;
  margin: 0 0 14px;
  background: linear-gradient(90deg, rgba(46, 105, 170, 0.14), rgba(46, 105, 170, 0.04));
}

[dir="rtl"].dashboard-active .drawer-divider {
  background: linear-gradient(270deg, rgba(46, 105, 170, 0.14), rgba(46, 105, 170, 0.04));
}

.dashboard-active .drawer-body {
  min-height: 0;
  overflow: auto;
  padding-inline-end: 4px;
}

[dir="rtl"].dashboard-active .drawer-body {
  padding-inline: 4px 0;
}

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

.dashboard-active .detail-section:first-child {
  margin-top: 0;
}

.dashboard-active .detail-section h4 {
  margin-bottom: 8px;
  color: #14213d;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.dashboard-active .knowledge-card {
  position: relative;
  padding: 11px 12px 12px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.dashboard-active .knowledge-card::before {
  position: absolute;
  top: 11px;
  bottom: 13px;
  inset-inline-start: 0;
  width: 4px;
  border-radius: 999px;
  background: #2f8daf;
  content: "";
}

[dir="rtl"].dashboard-active .knowledge-card {
  padding: 11px 18px 12px 12px;
}

.dashboard-active .knowledge-card p,
.dashboard-active .streamed-explanation {
  color: #31405b;
  font-size: 0.88rem;
  line-height: 1.52;
}

.dashboard-active .tag-list {
  gap: 7px;
}

.dashboard-active .tag {
  min-height: 29px;
  padding: 0 11px;
  border-radius: 999px;
  color: #526077;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 15px rgba(59, 88, 121, 0.06);
  font-size: 0.75rem;
  white-space: nowrap;
}

.dashboard-active .intervention-section {
  margin-top: 17px;
}

.dashboard-active .detail-actions {
  margin-top: auto;
  padding-top: 14px;
}

.dashboard-active .detail-actions .action-row {
  margin-top: 0;
  padding-top: 0;
}

.dashboard-active .detail-drawer .action-row {
  grid-template-columns: 1.16fr 0.9fr 1.08fr;
  gap: 9px;
}

.dashboard-active .detail-drawer .action-row .primary-btn,
.dashboard-active .detail-drawer .action-row .ghost-btn {
  min-height: 38px;
  padding-inline: 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 690;
}

[dir="rtl"].dashboard-active .detail-drawer {
  width: min(410px, 28vw, calc(100vw - 56px));
}

[dir="rtl"].dashboard-active .detail-drawer .panel-title {
  max-width: 230px;
}

[dir="rtl"].dashboard-active .detail-drawer .action-row {
  grid-template-columns: 1fr 0.9fr 1.06fr;
}

[dir="rtl"].dashboard-active .detail-drawer .action-row .primary-btn,
[dir="rtl"].dashboard-active .detail-drawer .action-row .ghost-btn {
  font-size: 0.68rem;
}

@media (max-width: 1260px) {
  .dashboard-active .detail-drawer {
    width: min(410px, calc(100vw - 44px));
  }

  [dir="rtl"].dashboard-active .detail-drawer {
    width: min(380px, 33vw, calc(100vw - 44px));
  }
}

@media (max-width: 900px) {
  .dashboard-active .detail-drawer,
  [dir="rtl"].dashboard-active .detail-drawer {
    width: auto;
    max-height: min(68svh, 580px);
    padding: 16px;
  }

  .dashboard-active .drawer-top {
    min-height: 84px;
  }

  .dashboard-active .detail-drawer .panel-title {
    max-width: none;
    font-size: 1.2rem;
  }

  .dashboard-active .mastery-ring {
    width: 58px;
    height: 58px;
    font-size: 0.98rem;
  }

  .dashboard-active .detail-drawer .action-row,
  [dir="rtl"].dashboard-active .detail-drawer .action-row {
    grid-template-columns: 1fr;
  }
}

/* Commercial education visual system refinement */
:root {
  --edu-ink: #101936;
  --edu-muted: #68758d;
  --edu-line: rgba(74, 122, 176, 0.16);
  --edu-sky: #67b7f7;
  --edu-teal: #43c6b7;
  --edu-lavender: #8f7dff;
  --edu-coral: #ff826a;
  --edu-sun: #ffd86f;
  --edu-rose: #ec6f9b;
}

.brand-symbol svg {
  filter: drop-shadow(0 10px 16px rgba(78, 106, 180, 0.14));
}

.brand-symbol .brand-planet-bg {
  fill: rgba(255, 255, 255, 0.92);
}

.brand-symbol .brand-orbit {
  fill: none;
  stroke: rgba(255, 216, 111, 0.82);
  stroke-linecap: round;
  stroke-width: 3.4;
}

.brand-symbol .brand-ribbon {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 6.2;
}

.brand-symbol .brand-ribbon-blue {
  stroke: #67b7f7;
}

.brand-symbol .brand-ribbon-cyan {
  stroke: #43c6b7;
}

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

.brand-symbol .brand-core {
  fill: rgba(143, 125, 255, 0.13);
  stroke: #8f7dff;
  stroke-linejoin: round;
  stroke-width: 3.4;
}

.brand-symbol .brand-star {
  fill: url("#brandWarmStar");
  stroke: rgba(255, 255, 255, 0.72);
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.assistant-mark svg {
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.98), transparent 30%),
    radial-gradient(circle at 54% 58%, rgba(246, 251, 255, 0.98), rgba(234, 244, 255, 0.9));
  box-shadow:
    inset 0 0 0 7px rgba(103, 183, 247, 0.08),
    0 8px 20px rgba(78, 106, 180, 0.12);
}

.assistant-face {
  fill: url("#assistantFace");
  stroke: rgba(103, 183, 247, 0.18);
  stroke-width: 1.2;
}

.mark-orbit {
  stroke: rgba(130, 140, 190, 0.22);
  stroke-width: 2.2;
}

.dot-blue {
  fill: #5d95ff;
}

.dot-green {
  fill: #45c681;
}

.dot-red {
  fill: #ff8068;
}

.dot-purple {
  fill: #8958ef;
}

.mark-star {
  fill: #a28df8;
}

.mark-eye {
  fill: rgba(16, 25, 54, 0.44);
}

.mark-smile {
  fill: none;
  stroke: rgba(16, 25, 54, 0.36);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.entry-v4 .role-icon {
  border-radius: 16px;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.96), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(241, 248, 255, 0.5));
  box-shadow:
    inset 0 0 0 1px rgba(103, 183, 247, 0.14),
    0 10px 22px rgba(78, 106, 180, 0.1);
}

.entry-v4 .role-icon svg {
  width: 88%;
  height: 88%;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.entry-v4 .teacher-choice .role-icon svg {
  stroke: #5d95ff;
}

.entry-v4 .teacher-choice .role-icon svg path:nth-child(n + 4) {
  fill: rgba(255, 216, 111, 0.7);
  stroke: #f5b84b;
}

.entry-v4 .student-choice .role-icon svg {
  stroke: #43bfa8;
}

.entry-v4 .student-choice .role-icon svg circle {
  fill: rgba(103, 183, 247, 0.16);
  stroke: #67b7f7;
}

.entry-v4 .student-choice .role-icon svg path:nth-child(5) {
  fill: rgba(255, 216, 111, 0.72);
  stroke: #f5b84b;
}

.dashboard-active .metric {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-active .metric::before {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--edu-sky);
  box-shadow: 0 0 0 4px rgba(103, 183, 247, 0.12);
  content: "";
}

.dashboard-active .metric:nth-child(2)::before {
  background: var(--edu-sun);
  box-shadow: 0 0 0 4px rgba(255, 216, 111, 0.16);
}

.dashboard-active .metric:nth-child(3)::before {
  background: var(--edu-teal);
  box-shadow: 0 0 0 4px rgba(67, 198, 183, 0.13);
}

.dashboard-active .action-row .primary-btn,
.dashboard-active .action-row .ghost-btn,
.dashboard-active .chip-btn[data-demo] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dashboard-active .action-row .primary-btn::before,
.dashboard-active .action-row .ghost-btn::before,
.dashboard-active .chip-btn[data-demo]::before {
  display: inline-block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 32%, rgba(255, 255, 255, 0.96) 0 18%, transparent 19%),
    linear-gradient(135deg, var(--edu-sun), var(--edu-coral));
  box-shadow: 0 4px 10px rgba(255, 130, 106, 0.16);
  content: "";
}

.dashboard-active .action-row .ghost-btn[data-highlight]::before {
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 0 33%, var(--edu-sky) 34% 47%, transparent 48%),
    linear-gradient(135deg, var(--edu-sky), var(--edu-lavender));
  clip-path: polygon(0 42%, 65% 42%, 65% 20%, 100% 50%, 65% 80%, 65% 58%, 0 58%);
}

.dashboard-active .action-row .ghost-btn[data-action="assign"]::before {
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent 42%),
    linear-gradient(135deg, var(--edu-teal), var(--edu-sky));
  clip-path: polygon(18% 8%, 72% 8%, 72% 24%, 88% 24%, 88% 92%, 12% 92%, 12% 24%, 18% 24%);
}

.dashboard-active .chip-btn[data-demo]::before {
  border-radius: 4px;
  background: var(--edu-sun);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 92%, 50% 70%, 21% 92%, 32% 56%, 2% 35%, 39% 35%);
}

[dir="rtl"].dashboard-active .action-row .primary-btn,
[dir="rtl"].dashboard-active .action-row .ghost-btn,
[dir="rtl"].dashboard-active .chip-btn[data-demo] {
  flex-direction: row-reverse;
}

.dashboard-active .detail-drawer {
  width: fit-content;
  min-width: min(520px, calc(100vw - 56px));
  max-width: min(660px, calc(100vw - 56px));
  padding: 18px 20px 16px;
  border-color: rgba(103, 183, 247, 0.2);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 216, 111, 0.14), transparent 24%),
    radial-gradient(circle at 88% 16%, rgba(103, 183, 247, 0.16), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(249, 253, 255, 0.9));
}

.dashboard-active .drawer-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  min-height: 0;
  direction: ltr;
}

.dashboard-active .drawer-heading {
  min-width: 0;
  padding-top: 1px;
}

[dir="rtl"].dashboard-active .drawer-heading {
  direction: rtl;
  text-align: right;
}

.dashboard-active .drawer-close {
  grid-column: 3;
  justify-self: end;
  margin-top: 0;
}

.dashboard-active .mastery-ring {
  grid-column: 1;
  grid-row: 1;
  width: 60px;
  height: 60px;
  margin-top: 2px;
  background: conic-gradient(var(--node-color, var(--edu-sky)) var(--mastery), rgba(103, 183, 247, 0.16) 0);
  box-shadow: 0 10px 20px rgba(78, 106, 180, 0.12);
  color: #237c9b;
  font-size: 0.98rem;
}

.dashboard-active .mastery-ring::before {
  inset: 4px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 1), rgba(249, 253, 255, 0.92));
}

.dashboard-active .detail-drawer .eyebrow {
  color: #4a91ad;
}

.dashboard-active .detail-drawer .panel-title {
  max-width: none;
  color: var(--edu-ink);
}

.dashboard-active .detail-drawer .badge {
  color: #101936;
}

.dashboard-active .drawer-divider {
  margin: 16px 0 15px;
}

.dashboard-active .detail-section h4 {
  color: var(--edu-ink);
  font-weight: 780;
}

.dashboard-active .knowledge-card::before {
  background: linear-gradient(180deg, var(--edu-sky), var(--edu-teal));
}

.dashboard-active .tag {
  border-color: rgba(103, 183, 247, 0.2);
  color: #526077;
  background: rgba(255, 255, 255, 0.74);
}

.dashboard-active .detail-actions {
  margin-top: auto;
  padding-top: 16px;
}

.dashboard-active .detail-drawer .action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

[dir="rtl"].dashboard-active .detail-drawer .action-row {
  justify-content: flex-end;
}

.dashboard-active .detail-drawer .action-row .primary-btn,
.dashboard-active .detail-drawer .action-row .ghost-btn {
  flex: 0 1 auto;
  width: auto;
  min-width: max-content;
  max-width: 100%;
  min-height: 42px;
  padding-inline: 17px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 740;
  line-height: 1.1;
  white-space: nowrap;
}

.dashboard-active .detail-drawer .action-row .primary-btn {
  border-color: rgba(67, 198, 183, 0.46);
  background: linear-gradient(135deg, rgba(255, 216, 111, 0.72), rgba(103, 215, 224, 0.64));
}

.dashboard-active .detail-drawer .action-row .ghost-btn {
  background: rgba(255, 255, 255, 0.76);
}

[dir="rtl"].dashboard-active .detail-drawer {
  width: fit-content;
  min-width: min(520px, calc(100vw - 56px));
  max-width: min(640px, calc(100vw - 56px));
}

[dir="rtl"].dashboard-active .detail-drawer .action-row .primary-btn,
[dir="rtl"].dashboard-active .detail-drawer .action-row .ghost-btn {
  font-size: 0.72rem;
}

@media (max-width: 900px) {
  body,
  .dashboard-active .app-shell,
  .dashboard-active .main-layout,
  .dashboard-active .graph-stage {
    overflow-x: hidden;
  }

  .dashboard-active .bottom-sheet {
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    max-width: none;
    transform: none !important;
  }

  [dir="rtl"].dashboard-active .bottom-sheet {
    right: 12px !important;
    left: 12px !important;
  }

  .dashboard-active .action-row {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .dashboard-active .insight-panel .action-row .primary-btn,
  .dashboard-active .insight-panel .action-row .ghost-btn {
    flex: 1 1 150px;
    min-width: 0;
    white-space: normal;
  }

  .dashboard-active .copilot-button {
    right: 16px;
    bottom: calc(46vh + 22px);
    display: grid;
    grid-template-columns: 1fr;
    width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 7px;
    border-radius: 20px;
  }

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

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

  .bottom-sheet.expanded ~ .copilot-button {
    top: 92px;
    bottom: auto;
  }

  .dashboard-active .detail-drawer,
  [dir="rtl"].dashboard-active .detail-drawer {
    width: auto;
    min-width: 0;
    max-width: none;
  }

  .dashboard-active .drawer-top {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 11px;
  }

  .dashboard-active .mastery-ring {
    width: 54px;
    height: 54px;
    font-size: 0.9rem;
  }

  .dashboard-active .detail-drawer .action-row .primary-btn,
  .dashboard-active .detail-drawer .action-row .ghost-btn {
    flex: 1 1 150px;
    min-width: 0;
    white-space: normal;
  }
}

/* Node detail analyzer redesign */
.dashboard-active .detail-drawer {
  min-width: min(620px, calc(100vw - 56px));
  max-width: min(760px, calc(100vw - 56px));
  padding: 22px 24px 24px;
  border: 1px solid rgba(88, 124, 162, 0.18);
  background: #ffffff;
  box-shadow: 0 22px 42px rgba(45, 72, 105, 0.13);
}

[dir="rtl"].dashboard-active .detail-drawer {
  min-width: min(620px, calc(100vw - 56px));
  max-width: min(760px, calc(100vw - 56px));
}

.dashboard-active .drawer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 36px;
  gap: 18px;
  align-items: start;
  direction: ltr;
}

[dir="rtl"].dashboard-active .drawer-top {
  grid-template-columns: 36px auto minmax(0, 1fr);
}

.dashboard-active .drawer-heading {
  grid-row: 1;
  min-width: 0;
}

[dir="rtl"].dashboard-active .drawer-heading {
  grid-column: 3;
}

.dashboard-active .drawer-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

[dir="rtl"].dashboard-active .drawer-title-row {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.dashboard-active .detail-drawer .panel-title {
  max-width: none;
  font-size: clamp(1.24rem, 1.34vw, 1.5rem);
  line-height: 1.12;
}

.dashboard-active .detail-drawer .badge {
  flex: 0 0 auto;
  margin-top: 0;
  min-height: 24px;
  padding-inline: 11px;
  font-size: 0.7rem;
  box-shadow: none;
}

.dashboard-active .mastery-ring {
  display: none;
}

.dashboard-active .mastery-compact {
  display: grid;
  grid-row: 1;
  grid-template-columns: auto auto;
  gap: 4px 8px;
  align-items: center;
  min-width: 128px;
  padding: 8px 10px;
  border: 1px solid rgba(236, 111, 155, 0.18);
  border-radius: 10px;
  background: #fff7f9;
}

[dir="rtl"].dashboard-active .mastery-compact {
  grid-column: 2;
  direction: rtl;
}

.dashboard-active .mastery-compact span {
  color: #68758d;
  font-size: 0.68rem;
  font-weight: 720;
}

.dashboard-active .mastery-compact strong {
  justify-self: end;
  color: #b94c75;
  font-size: 0.92rem;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

[dir="rtl"].dashboard-active .mastery-compact strong {
  justify-self: start;
}

.dashboard-active .mastery-compact i {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(236, 111, 155, 0.14);
}

.dashboard-active .mastery-compact i::before {
  display: block;
  width: var(--mastery);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ec6f9b, #ff9a78);
  content: "";
}

.dashboard-active .drawer-close {
  grid-column: 3;
  grid-row: 1;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-color: rgba(88, 124, 162, 0.18);
  background: #f8fbff;
}

[dir="rtl"].dashboard-active .drawer-close {
  grid-column: 1;
}

.dashboard-active .drawer-divider {
  margin: 18px 0 18px;
  background: rgba(88, 124, 162, 0.16);
}

.dashboard-active .drawer-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
  gap: 18px;
  min-height: 0;
  overflow: auto;
  padding: 0 4px 0 0;
  scrollbar-color: rgba(103, 133, 166, 0.42) transparent;
  scrollbar-width: thin;
}

.dashboard-active .drawer-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.dashboard-active .drawer-body::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-active .drawer-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(103, 133, 166, 0.32);
}

.dashboard-active .drawer-body::-webkit-scrollbar-thumb:hover {
  background: rgba(103, 133, 166, 0.5);
}

[dir="rtl"].dashboard-active .drawer-body {
  padding: 0 0 0 4px;
  direction: rtl;
}

.dashboard-active .detail-column {
  min-width: 0;
}

.dashboard-active .detail-section {
  margin-top: 16px;
}

.dashboard-active .detail-section:first-child,
.dashboard-active .intervention-section {
  margin-top: 0;
}

.dashboard-active .knowledge-card {
  padding: 14px 14px 14px 18px;
  border: 1px solid rgba(103, 183, 247, 0.14);
  border-radius: 10px;
  background: #f7fbff;
}

[dir="rtl"].dashboard-active .knowledge-card {
  padding: 14px 18px 14px 14px;
}

.dashboard-active .knowledge-card::before {
  top: 14px;
  bottom: 14px;
}

.dashboard-active .relation-section {
  padding: 12px;
  border: 1px solid rgba(103, 183, 247, 0.12);
  border-radius: 10px;
  background: rgba(247, 251, 255, 0.72);
}

.dashboard-active .downstream-section {
  border-color: rgba(236, 111, 155, 0.12);
  background: rgba(255, 248, 252, 0.68);
}

.dashboard-active .relation-tag {
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.dashboard-active .relation-tag::before {
  color: #67b7f7;
  content: "←";
}

.dashboard-active .downstream-tag::before {
  color: #ec6f9b;
  content: "→";
}

[dir="rtl"].dashboard-active .prerequisite-tag::before {
  content: "→";
}

[dir="rtl"].dashboard-active .downstream-tag::before {
  content: "←";
}

.dashboard-active .relation-tag:hover {
  border-color: rgba(103, 183, 247, 0.4);
  background: #ffffff;
  transform: translateY(-1px);
}

.dashboard-active .downstream-tag:hover {
  border-color: rgba(236, 111, 155, 0.36);
}

.dashboard-active .insight-card {
  height: 100%;
  min-height: 220px;
  padding: 16px 18px;
  border: 1px solid rgba(88, 124, 162, 0.14);
  border-radius: 12px;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 216, 111, 0.16), transparent 30%),
    linear-gradient(145deg, #f8fbff, #fffdf7);
}

.dashboard-active .insight-card .streamed-explanation {
  margin-top: 10px;
  color: #253651;
  font-size: 0.92rem;
  line-height: 1.58;
}

.dashboard-active .detail-actions {
  margin-top: 24px;
  padding-top: 0;
}

.dashboard-active .detail-drawer .action-row {
  gap: 12px;
  justify-content: flex-start;
}

.dashboard-active .detail-drawer .action-row .primary-btn,
.dashboard-active .detail-drawer .action-row .ghost-btn {
  min-height: 42px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 750;
}

.dashboard-active .detail-drawer .action-row .primary-btn {
  color: #ffffff;
  border-color: #2f9fc1;
  background: #2f9fc1;
  box-shadow: 0 10px 20px rgba(47, 159, 193, 0.16);
}

.dashboard-active .detail-drawer .action-row .primary-btn::before {
  background: #ffffff;
  box-shadow: none;
  opacity: 0.9;
}

.dashboard-active .detail-drawer .action-row .ghost-btn {
  min-width: 170px;
  color: #172033;
  border-color: rgba(88, 124, 162, 0.2);
  background: #ffffff;
}

.dashboard-active .detail-drawer .action-row .ghost-btn::before {
  background: #67b7f7;
  box-shadow: none;
}

.dashboard-active .detail-drawer .action-row .ghost-btn[data-action="assign"]::before {
  background: #67b7f7;
}

@media (max-width: 1320px) {
  .dashboard-active .detail-drawer,
  [dir="rtl"].dashboard-active .detail-drawer {
    min-width: min(560px, calc(100vw - 44px));
    max-width: min(680px, calc(100vw - 44px));
  }

  .dashboard-active .drawer-body {
    grid-template-columns: 1fr;
  }

  .dashboard-active .insight-card {
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .dashboard-active .detail-drawer,
  [dir="rtl"].dashboard-active .detail-drawer {
    min-width: 0;
    max-width: none;
  }

  .dashboard-active .drawer-top,
  [dir="rtl"].dashboard-active .drawer-top {
    grid-template-columns: minmax(0, 1fr) auto 34px;
  }

  [dir="rtl"].dashboard-active .drawer-heading {
    grid-column: 1;
  }

  [dir="rtl"].dashboard-active .mastery-compact {
    grid-column: 2;
  }

  [dir="rtl"].dashboard-active .drawer-close {
    grid-column: 3;
  }

  .dashboard-active .mastery-compact {
    min-width: 112px;
  }

  .dashboard-active .drawer-body {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
  }

  .dashboard-active .detail-drawer .action-row .primary-btn,
  .dashboard-active .detail-drawer .action-row .ghost-btn {
    flex: 1 1 170px;
    min-width: 0;
  }
}

/* Node detail panel V2: premium single-column education analytics */
.dashboard-active .detail-drawer {
  display: flex;
  flex-direction: column;
  bottom: auto !important;
  height: auto !important;
  width: min(560px, calc(100vw - 56px));
  min-width: min(520px, calc(100vw - 56px));
  max-width: min(560px, calc(100vw - 56px));
  max-height: calc(100vh - 124px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(92, 121, 154, 0.18);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(37, 66, 97, 0.14);
}

[dir="rtl"].dashboard-active .detail-drawer {
  bottom: auto !important;
  height: auto !important;
  width: min(560px, calc(100vw - 56px));
  min-width: min(520px, calc(100vw - 56px));
  max-width: min(560px, calc(100vw - 56px));
  max-height: calc(100vh - 124px);
}

.dashboard-active .drawer-top,
[dir="rtl"].dashboard-active .drawer-top {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 34px;
  gap: 14px;
  align-items: center;
  padding: 18px 26px 16px;
  direction: ltr;
}

[dir="rtl"].dashboard-active .drawer-top {
  direction: rtl;
  grid-template-columns: 34px minmax(0, 1fr) 58px;
}

.dashboard-active .drawer-heading {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 0;
}

[dir="rtl"].dashboard-active .drawer-heading {
  grid-column: 2;
  text-align: right;
}

.dashboard-active .detail-drawer .eyebrow {
  margin: 0 0 5px;
  color: #4b94a7;
  font-size: 0.66rem;
  font-weight: 680;
  letter-spacing: 0.24em;
  line-height: 1.1;
  text-transform: uppercase;
}

[dir="rtl"].dashboard-active .detail-drawer .eyebrow {
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: none;
}

.dashboard-active .drawer-title-row,
[dir="rtl"].dashboard-active .drawer-title-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}

[dir="rtl"].dashboard-active .drawer-title-row {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.dashboard-active .detail-drawer .panel-title {
  color: #101936;
  font-size: clamp(1.1rem, 1.35vw, 1.26rem);
  font-weight: 760;
  line-height: 1.1;
}

.dashboard-active .detail-drawer .badge {
  flex: 0 0 auto;
  min-height: 24px;
  margin: 0;
  padding: 0 10px;
  border-radius: 999px;
  color: #101936;
  box-shadow: none;
  font-size: 0.72rem;
  font-weight: 740;
}

.dashboard-active .mastery-compact {
  display: none;
}

.dashboard-active .mastery-ring {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  isolation: isolate;
  width: 54px;
  height: 54px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(#ec6f9b var(--mastery), rgba(105, 128, 154, 0.14) 0);
  box-shadow: none;
  color: #b94c75;
  font-size: 0.86rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: none;
}

[dir="rtl"].dashboard-active .mastery-ring {
  grid-column: 3;
}

.dashboard-active .mastery-ring::before {
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: #ffffff;
  content: "";
}

.dashboard-active .mastery-ring span {
  position: relative;
  z-index: 1;
}

.dashboard-active .drawer-close {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid rgba(92, 121, 154, 0.18);
  border-radius: 10px;
  color: #22304a;
  background: #f8fbff;
  box-shadow: none;
  font-size: 1rem;
}

[dir="rtl"].dashboard-active .drawer-close {
  grid-column: 1;
  justify-self: start;
}

.dashboard-active .drawer-divider {
  height: 1px;
  margin: 0;
  background: rgba(92, 121, 154, 0.16);
}

.dashboard-active .drawer-body,
[dir="rtl"].dashboard-active .drawer-body {
  flex: 0 1 auto;
  display: block;
  min-height: 0;
  max-height: calc(100vh - 238px);
  overflow: auto;
  padding: 18px 26px 14px;
  direction: inherit;
  scrollbar-color: rgba(105, 128, 154, 0.42) transparent;
  scrollbar-width: thin;
}

.dashboard-active .drawer-body::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.dashboard-active .drawer-body::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-active .drawer-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(105, 128, 154, 0.36);
}

.dashboard-active .drawer-body::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.dashboard-active .detail-column {
  min-width: 0;
}

.dashboard-active .detail-section {
  margin: 0;
  padding: 0;
}

.dashboard-active .detail-section + .detail-section,
.dashboard-active .detail-column + .detail-column {
  margin-top: 16px;
}

.dashboard-active .detail-section h4 {
  margin: 0 0 8px;
  color: #172033;
  font-size: 0.82rem;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.25;
}

.dashboard-active .knowledge-card,
[dir="rtl"].dashboard-active .knowledge-card {
  position: relative;
  padding: 0 0 0 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

[dir="rtl"].dashboard-active .knowledge-card {
  padding: 0 13px 0 0;
}

.dashboard-active .knowledge-card::before {
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 999px;
  background: #42b7ba;
}

.dashboard-active .knowledge-card p,
.dashboard-active .streamed-explanation {
  margin: 0;
  color: #2c3d58;
  font-size: 0.9rem;
  line-height: 1.52;
  min-height: 0;
}

.dashboard-active .relation-section,
.dashboard-active .downstream-section {
  border: 0;
  border-top: 1px solid rgba(92, 121, 154, 0.12);
  border-radius: 0;
  background: transparent;
  padding-top: 16px;
}

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

.dashboard-active .tag,
.dashboard-active .relation-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 11px;
  border: 1px solid rgba(105, 128, 154, 0.22);
  border-radius: 15px;
  color: #4f6079;
  background: #ffffff;
  box-shadow: none;
  font-size: 0.79rem;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
}

.dashboard-active .relation-tag::before,
.dashboard-active .downstream-tag::before,
[dir="rtl"].dashboard-active .prerequisite-tag::before,
[dir="rtl"].dashboard-active .downstream-tag::before {
  display: none;
  content: "";
}

.dashboard-active .relation-tag {
  cursor: pointer;
}

.dashboard-active .relation-tag:hover {
  border-color: rgba(66, 183, 186, 0.42);
  background: #f7fcfd;
  transform: none;
}

.dashboard-active .downstream-tag:hover {
  border-color: rgba(236, 111, 155, 0.34);
  background: #fff8fb;
}

.dashboard-active .insight-card {
  height: auto;
  min-height: 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid rgba(92, 121, 154, 0.12);
  border-radius: 0;
  background: transparent;
}

.dashboard-active .insight-card .streamed-explanation {
  color: #253651;
  font-size: 0.9rem;
  line-height: 1.54;
}

.dashboard-active .detail-actions {
  flex: 0 0 auto;
  margin: 0 26px;
  padding: 16px 0 18px;
  border-top: 1px solid rgba(92, 121, 154, 0.14);
}

.dashboard-active .detail-actions .action-row,
.dashboard-active .detail-drawer .action-row,
[dir="rtl"].dashboard-active .detail-drawer .action-row {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1.12fr) minmax(0, 0.84fr);
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.dashboard-active .detail-drawer .action-row .primary-btn,
.dashboard-active .detail-drawer .action-row .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1.1;
  white-space: nowrap;
}

.dashboard-active .detail-drawer .action-row .primary-btn {
  color: #ffffff;
  border-color: #2e9cb7;
  background: #2e9cb7;
  box-shadow: none;
}

.dashboard-active .detail-drawer .action-row .ghost-btn {
  color: #172033;
  border-color: rgba(105, 128, 154, 0.24);
  background: #ffffff;
}

.dashboard-active .detail-drawer .action-row .primary-btn::before,
.dashboard-active .detail-drawer .action-row .ghost-btn::before {
  display: none;
  content: "";
}

.dashboard-active .insight-panel.detail-context > .action-row {
  display: none;
}

@media (max-width: 900px) {
  .dashboard-active .detail-drawer,
  [dir="rtl"].dashboard-active .detail-drawer {
    width: auto;
    min-width: 0;
    max-width: none;
    border-radius: 16px;
  }

  .dashboard-active .drawer-top,
  [dir="rtl"].dashboard-active .drawer-top {
    grid-template-columns: 56px minmax(0, 1fr) 34px;
    gap: 12px;
    padding: 18px 20px 15px;
    direction: ltr;
  }

  [dir="rtl"].dashboard-active .drawer-top {
    direction: rtl;
    grid-template-columns: 34px minmax(0, 1fr) 56px;
  }

  [dir="rtl"].dashboard-active .drawer-heading {
    grid-column: 2;
  }

  .dashboard-active .mastery-ring {
    width: 54px;
    height: 54px;
    font-size: 0.86rem;
  }

  [dir="rtl"].dashboard-active .mastery-ring {
    grid-column: 3;
  }

  .dashboard-active .drawer-close {
    grid-column: 3;
  }

  [dir="rtl"].dashboard-active .drawer-close {
    grid-column: 1;
  }

  .dashboard-active .drawer-body,
  [dir="rtl"].dashboard-active .drawer-body {
    padding: 18px 20px 12px;
    overflow: visible;
  }

  .dashboard-active .detail-actions {
    margin: 0 20px;
    padding: 16px 0 18px;
  }

  .dashboard-active .detail-actions .action-row,
  .dashboard-active .detail-drawer .action-row,
  [dir="rtl"].dashboard-active .detail-drawer .action-row {
    grid-template-columns: 1fr;
  }

  .dashboard-active .detail-drawer .action-row .primary-btn,
  .dashboard-active .detail-drawer .action-row .ghost-btn {
    min-height: 44px;
    white-space: normal;
  }
}
