.aimp-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.5;
}

.aimp-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header Card */
.aimp-header-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.aimp-top-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.aimp-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.aimp-model-select-group {
  flex: 2;
  min-width: 260px;
}

.aimp-api-group {
  flex: 1;
  min-width: 220px;
}

.aimp-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.aimp-input,
.aimp-select {
  height: 44px;
  padding: 0 0.85rem;
  font-size: 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: inherit;
  box-sizing: border-box;
  width: 100%;
}

.aimp-input:focus,
.aimp-select:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #2563eb;
}

/* Presets Row */
.aimp-presets-row {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.aimp-presets-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  margin-right: 0.25rem;
}

.aimp-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.aimp-pill-btn {
  height: 44px;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.aimp-pill-btn:hover {
  background: #e2e8f0;
}

.aimp-pill-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Workspace Grid */
.aimp-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .aimp-workspace-grid {
    grid-template-columns: 1fr;
  }
}

.aimp-input-pane,
.aimp-output-pane {
  display: flex;
  flex-direction: column;
}

.aimp-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.aimp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.aimp-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}

.aimp-token-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.aimp-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.aimp-textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.92rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: inherit;
  box-sizing: border-box;
  font-family: inherit;
  resize: vertical;
}

.aimp-system-textarea {
  min-height: 60px;
}

.aimp-user-textarea {
  font-family: monospace, monospace;
}

.aimp-textarea:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #2563eb;
}

/* Hyperparameters Grid */
.aimp-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem;
}

.aimp-param-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.aimp-param-label-row {
  display: flex;
  justify-content: space-between;
}

.aimp-param-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.aimp-range {
  width: 100%;
  accent-color: #2563eb;
  cursor: pointer;
  height: 20px;
}

.aimp-param-sub {
  font-size: 0.72rem;
  color: #64748b;
}

/* Actions Row */
.aimp-actions-row {
  display: flex;
  gap: 0.75rem;
}

.aimp-btn {
  height: 44px;
  min-height: 44px;
  padding: 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-sizing: border-box;
  transition: background-color 0.15s ease;
}

.aimp-btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.aimp-btn-primary:hover {
  background: #1d4ed8;
}

.aimp-btn-secondary {
  background: #e2e8f0;
  color: #334155;
}

.aimp-btn-secondary:hover {
  background: #cbd5e1;
}

/* Status Indicator */
.aimp-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.aimp-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
}

.aimp-status-dot.running {
  background: #f59e0b;
}

.aimp-output-actions {
  display: flex;
  align-items: center;
}

.aimp-copy-btn {
  height: 44px;
  padding: 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  cursor: pointer;
}

.aimp-copy-btn:hover {
  background: #e2e8f0;
}

/* Telemetry Bar */
.aimp-telemetry-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: #64748b;
  background: #f8fafc;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.aimp-stat-item strong {
  color: #0f172a;
}

/* Output Box */
.aimp-output-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  min-height: 280px;
  max-height: 520px;
  overflow-y: auto;
}

.aimp-code-output {
  margin: 0;
  font-family: monospace, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1e293b;
}

/* Ad Containers */
.aimp-ad-container {
  min-height: 280px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 1.5rem 0;
}

/* In-Cluster Links */
.aimp-related-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
}

.aimp-related-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: #0f172a;
}

.aimp-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.aimp-related-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.aimp-related-card:hover {
  border-color: #2563eb;
}

.aimp-related-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #2563eb;
}

.aimp-related-desc {
  font-size: 0.82rem;
  color: #64748b;
}

.aimp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
