[data-mc-config-panel="1"] {
  display: block;
  box-sizing: border-box;
  width: 100%;
  flex: 1 1 auto;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable both-edges;
}

.mc-config-shell {
  width: 100%;
  min-height: 100%;
  height: auto;
  flex: 0 0 auto;
  box-sizing: border-box;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  padding-bottom: 1.35rem;
  overflow: visible;
  background:
    radial-gradient(circle at top right, rgba(94, 178, 103, 0.14), transparent 32%),
    linear-gradient(180deg, #fbfffa 0%, #eef6eb 100%);
  color: #17301c;
}

.mc-config-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.mc-config-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.mc-config-copy {
  margin: 0.35rem 0 0;
  color: #4d6650;
  line-height: 1.45;
  max-width: 60rem;
}

.mc-config-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.mc-config-button {
  border: 1px solid #bcd2b8;
  border-radius: 999px;
  background: #ffffff;
  color: #24502c;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.mc-config-button:hover {
  background: #f3faef;
}

.mc-config-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.mc-config-button-primary {
  background: linear-gradient(135deg, #3f8f47 0%, #79bb61 100%);
  border-color: #3f8f47;
  color: #ffffff;
}

.mc-config-button-primary:hover {
  background: linear-gradient(135deg, #367f3e 0%, #69ab52 100%);
}

.mc-config-summary {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: #e1f1dd;
  color: #24502c;
  font-size: 0.88rem;
  font-weight: 600;
}

.mc-config-note {
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid #d6e4d1;
  background: rgba(255, 255, 255, 0.82);
  color: #33553b;
  line-height: 1.5;
}

.mc-config-card {
  padding: 1rem;
  border-radius: 1.1rem;
  border: 1px solid #d6e4d1;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 22px rgba(42, 82, 49, 0.06);
}

.mc-config-secondary-stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 0;
  max-height: min(34vh, 22rem);
  overflow-y: scroll;
  overflow-x: hidden;
  padding-right: 0.2rem;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #78b95f rgba(23, 48, 28, 0.08);
}

.mc-config-section-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mc-config-section-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.mc-config-section-copy {
  margin: 0;
  color: #4d6650;
  line-height: 1.5;
}

.mc-config-inline-note {
  margin: 0.8rem 0 0;
  color: #33553b;
  line-height: 1.5;
}

.mc-config-auth-form {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  align-items: end;
}

.mc-config-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.mc-config-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #24502c;
}

.mc-config-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #c8d8c4;
  border-radius: 0.8rem;
  background: #ffffff;
  color: #17301c;
  padding: 0.7rem 0.8rem;
  font: inherit;
  box-sizing: border-box;
}

.mc-config-input:focus {
  outline: none;
  border-color: #4f9656;
  box-shadow: 0 0 0 3px rgba(79, 150, 86, 0.18);
}

.mc-config-error {
  margin-top: 0.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.8rem;
  background: #fff0f0;
  border: 1px solid #efc3c3;
  color: #9b2e2e;
  font-weight: 600;
}

.mc-config-session {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.mc-config-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: #e1f1dd;
  color: #24502c;
  font-size: 0.84rem;
  font-weight: 700;
}

.mc-config-download-actions {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.mc-config-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mc-config-package-note {
  color: #4d6650;
  line-height: 1.4;
}

.mc-config-link-title {
  margin-top: 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #24502c;
}

.mc-config-download-links {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.mc-config-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #c8d8c4;
  background: #ffffff;
  color: #24502c;
  text-decoration: none;
  font-weight: 600;
}

.mc-config-link:hover {
  background: #f3faef;
}

.mc-config-steps {
  margin: 0.95rem 0 0;
  padding-left: 1.2rem;
  color: #33553b;
  line-height: 1.55;
}

.mc-config-step + .mc-config-step {
  margin-top: 0.45rem;
}

.mc-config-list-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 0;
  max-height: min(60vh, 40rem);
  overflow-y: scroll;
  overflow-x: hidden;
  padding-right: 0.2rem;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #78b95f rgba(23, 48, 28, 0.08);
}

.mc-config-list-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding-top: 0.35rem;
  padding-bottom: 0.1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.98) 28%);
}

.mc-config-list {
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 0.2rem 0.2rem 0.35rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.75rem;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: #78b95f rgba(23, 48, 28, 0.08);
}

.mc-config-list-card::-webkit-scrollbar,
.mc-config-secondary-stack::-webkit-scrollbar,
[data-mc-config-panel="1"]::-webkit-scrollbar,
.mc-config-shell::-webkit-scrollbar {
  width: 0.75rem;
}

.mc-config-list-card::-webkit-scrollbar-track,
.mc-config-secondary-stack::-webkit-scrollbar-track,
[data-mc-config-panel="1"]::-webkit-scrollbar-track,
.mc-config-shell::-webkit-scrollbar-track {
  background: rgba(23, 48, 28, 0.06);
  border-radius: 999px;
}

.mc-config-list-card::-webkit-scrollbar-thumb,
.mc-config-secondary-stack::-webkit-scrollbar-thumb,
[data-mc-config-panel="1"]::-webkit-scrollbar-thumb,
.mc-config-shell::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #86c96b 0%, #4d9654 100%);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.mc-config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.9rem;
  padding: 1.2rem 1rem 1rem;
  border-radius: 1rem;
  border: 1px solid #d6e4d1;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 22px rgba(42, 82, 49, 0.06);
  cursor: pointer;
}

.mc-config-row-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mc-config-preview-wrap {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 0.4rem;
  min-height: 5.2rem;
}

.mc-config-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #17301c;
  overflow-wrap: anywhere;
}

.mc-config-opcode {
  font-size: 0.76rem;
  color: #667b68;
  font-family: Consolas, "Courier New", monospace;
  display: inline-flex;
  align-self: flex-start;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: #edf6ea;
  border: 1px solid #d4e4d0;
}

.mc-config-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #24502c;
}

.mc-config-toggle input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: #3c8f49;
  cursor: pointer;
}

.mc-config-state {
  min-width: 3.8rem;
  text-align: right;
}

.mc-config-preview {
  --mc-preview-fill: linear-gradient(180deg, #1ec99c 0%, #11b88d 100%);
  --mc-preview-stroke: #0e8b6a;
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.34rem;
  max-width: 100%;
  min-height: 4.25rem;
  padding: 1rem 1.15rem 1.05rem;
  border-radius: 1rem;
  border: 1px solid rgba(12, 124, 93, 0.45);
  background: var(--mc-preview-fill);
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.4;
  box-shadow:
    inset 0 -3px 0 rgba(7, 88, 68, 0.28),
    0 10px 18px rgba(18, 111, 88, 0.16);
}

.mc-config-preview-command::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: -0.28rem;
  width: 1.35rem;
  height: 0.62rem;
  border-radius: 0 0 0.55rem 0.55rem;
  background: #eef6eb;
  box-shadow: 0 0 0 2px #15b88e;
}

.mc-config-preview-reporter {
  border-radius: 999px;
  padding-inline: 1rem;
}

.mc-config-preview-boolean {
  padding-inline: 1rem;
  border-radius: 0.9rem;
  clip-path: polygon(1rem 0, calc(100% - 1rem) 0, 100% 50%, calc(100% - 1rem) 100%, 1rem 100%, 0 50%);
}

.mc-config-preview-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mc-config-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 1.85rem;
  max-width: 100%;
  padding: 0.18rem 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  color: #0f6b53;
  font-size: 0.98rem;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(11, 126, 94, 0.12);
}

.mc-config-slot-input {
  min-width: 3.4rem;
}

.mc-config-slot-number {
  min-width: 2.2rem;
  justify-content: center;
}

.mc-config-slot-dropdown {
  padding-right: 0.48rem;
}

.mc-config-slot-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mc-config-slot-caret {
  flex: 0 0 auto;
  font-size: 0.56rem;
  opacity: 0.76;
}

.mc-config-tab-icon {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3f8f47 0%, #79bb61 100%);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
}

@media (max-width: 900px) {
  .mc-config-shell {
    padding: 0.85rem;
  }

  .mc-config-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mc-config-row {
    grid-template-columns: 1fr;
  }

  .mc-config-toggle {
    width: 100%;
    justify-content: flex-end;
  }

  .mc-config-auth-form {
    grid-template-columns: 1fr;
  }
}
