.ctm-widget {
  display: grid;
  gap: 20px;
}

.ctm-access-card {
  max-width: 520px;
  margin: 24px auto;
  padding: 24px;
  border: 1px solid #e2e6ea;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.ctm-access-form {
  display: grid;
  gap: 16px;
}

.ctm-access-field {
  display: grid;
  gap: 8px;
}

.ctm-access-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccd0d4;
  border-radius: 10px;
}

.ctm-access-help {
  margin: 0;
  color: #50575e;
  font-size: 13px;
}

.ctm-access-message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff1f0;
  color: #8a1f11;
}

.ctm-access-submit,
.ctm-access-switch__button {
  border: 0;
  border-radius: 10px;
  background: #0f62fe;
  color: #fff;
  padding: 10px 16px;
  cursor: pointer;
}

.ctm-toolbar {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}

.ctm-search {
  width: min(100%, 320px);
  padding: 10px 12px;
  border: 1px solid #ccd0d4;
  border-radius: 10px;
}

.ctm-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 20px;
}

.ctm-panel {
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.ctm-tree-panel {
  position: sticky;
  top: 24px;
  align-self: start;
}

.ctm-tree-scroll {
  height: min(70vh, 720px);
  max-height: min(70vh, 720px);
  min-height: 420px;
  overflow: auto;
  padding-right: 8px;
  overscroll-behavior: contain;
  border-top: 1px solid #eef2f5;
}

.ctm-tree-list,
.ctm-tree-list ul {
  list-style: none;
  margin: 0;
  padding-left: 18px;
}

.ctm-tree-item {
  background: none;
  border: 0;
  color: #1d2327;
  border-radius: 8px;
  cursor: pointer;
  padding: 4px 8px;
  text-align: left;
}

.ctm-tree-item.is-match {
  color: #005ae0;
  font-weight: 600;
}

.ctm-tree-item.is-selected {
  background: #e7f1ff;
  color: #004a99;
  font-weight: 700;
}

.ctm-detail-grid {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 12px;
}

.ctm-detail-label {
  color: #50575e;
}

.ctm-chart {
  width: 100%;
  height: 420px;
}

@media (max-width: 780px) {
  .ctm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ctm-layout {
    grid-template-columns: 1fr;
  }

  .ctm-tree-panel {
    position: static;
  }

  .ctm-tree-scroll {
    height: 420px;
    max-height: 420px;
    min-height: 420px;
  }
}
