body .btn,
body .mode-btn,
body button.btn,
body button.mode-btn {
  opacity: 1 !important;
  visibility: visible !important;
  -webkit-text-fill-color: currentColor;
}

body .btn:not(.secondary):not(.ghost) {
  color: #fff !important;
  border-color: #1f5fbf !important;
  background: linear-gradient(135deg, #1f5fbf, #0f766e) !important;
  box-shadow: 0 10px 22px rgba(31, 95, 191, .18);
}

body .btn.secondary,
body .mode-btn {
  color: #143f89 !important;
  border-color: #b8cdf2 !important;
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
}

body .mode-btn {
  color: #111827 !important;
}

body .mode-btn span {
  color: #667085 !important;
  -webkit-text-fill-color: #667085;
}

body .btn.ghost {
  color: #475467 !important;
  background: transparent !important;
}

body .modal-head .btn {
  color: #102a56 !important;
  border-color: #fff !important;
  background: #fff !important;
}

body .btn:disabled,
body .mode-btn:disabled {
  opacity: .58 !important;
  cursor: not-allowed;
}

body.advanced-motion :is(.btn, .mode-btn).motion-item {
  opacity: 1 !important;
  animation: none !important;
  filter: none !important;
  translate: 0 0 !important;
}

#planModal {
  align-items: stretch;
  justify-items: center;
  padding: 12px;
}

#planModal .modal-panel {
  width: min(1440px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#planModal .modal-head {
  flex: 0 0 auto;
  z-index: 8;
}

#planModal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#planModal .select-row {
  flex: 0 0 auto;
  display: grid !important;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

#planModal .select-row > div {
  min-width: 0;
}

#planModal #loadPlanBtn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 138px;
  min-height: 44px;
  padding: 0 18px;
  color: #fff !important;
  white-space: nowrap;
  animation-fill-mode: both;
}

#planModal #planStatus {
  flex: 0 0 auto;
}

#planModal #planRenderArea {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#planModal #planRenderArea > .summary-grid {
  flex: 0 0 auto;
}

#planModal .plan-matrix-wrap {
  flex: 1 1 auto;
  min-height: 320px;
  max-height: min(64vh, 760px);
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

#planModal .plan-matrix-table {
  width: max-content;
  min-width: 1280px;
}

#planModal .plan-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

#planModal .plan-matrix-table th:first-child,
#planModal .plan-matrix-table td:first-child {
  position: sticky;
  left: 0;
}

#planModal .plan-matrix-table thead th:first-child {
  z-index: 7;
}

#planModal .plan-matrix-table tbody th:first-child {
  z-index: 4;
}

#planModal .plan-matrix-table td {
  min-width: 170px;
}

#planModal .plan-block {
  gap: 8px;
  padding: 10px;
}

#planModal .plan-block-head {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

#planModal .plan-course-list li {
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

#planModal .plan-subject-stack {
  display: grid;
  gap: 7px;
}

#planModal .plan-subject-card {
  display: grid;
  gap: 3px;
  min-width: 0;
}

#planModal .plan-subject-name {
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.28;
  word-break: keep-all;
}

#planModal .plan-subject-meta {
  color: #5f6f85;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

#planModal .plan-block-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid #e5edf6;
  color: #667085;
  font-size: 11px;
  font-weight: 900;
}

@media (max-width: 680px) {
  #planModal {
    padding: 8px;
  }

  #planModal .modal-panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  #planModal .modal-body {
    padding: 12px;
  }

  #planModal .select-row {
    grid-template-columns: 1fr;
  }

  #planModal #loadPlanBtn {
    width: 100%;
  }

  #planModal .plan-matrix-wrap {
    min-height: 300px;
    max-height: 58vh;
  }
}
