#modelToggleBtn.model-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1201;
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#modelToggleBtn.model-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.32);
}

.model-panel {
  box-sizing: border-box;
  position: fixed;
  width: min(400px, calc(100vw - 20px));
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
  padding: 10px 12px;
  z-index: 1206;
  display: none;
}

.model-panel.is-open {
  display: block;
}

.model-panel__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: min(56vh, 420px);
  overflow: auto;
  padding: 4px;
}

/* Reuse the teaching workflow's button surface and selected state. */
.model-panel__item {
  min-width: 0;
  min-height: 44px;
  font-family: inherit;
  line-height: 1.4;
  touch-action: manipulation;
}

.model-panel__item .workflow-panel__slot-name {
  font-size: 13px;
  line-height: 1.5;
}

.model-panel__item:not(.is-selected) {
  background: #fff;
}

.model-panel__item:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 2px;
}

.model-panel__item:active:not(:disabled) {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .model-panel__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .model-panel__item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (hover: none) {
  .model-panel__item:hover:not(:disabled) {
    transform: none;
  }

  .model-panel__item:hover:not(:disabled):not(.is-selected) {
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .model-panel__item {
    transition: none;
  }

  .model-panel__item:hover:not(:disabled) {
    transform: none;
  }
}

.model-panel__hint,
.model-panel__empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(15, 23, 42, 0.16);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
  background: rgba(248, 250, 252, 0.7);
}
