.agent-studio-dialog-lock {
  overflow: hidden;
}

.agent-studio-dialog-host {
  position: relative;
  z-index: 2147483000;
}

.agent-studio-dialog-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(14px) saturate(1.25);
  opacity: 0;
  transition: opacity .16s ease-out;
}

.agent-studio-dialog-overlay.is-open {
  opacity: 1;
}

.agent-studio-dialog-overlay.is-closing {
  opacity: 0;
}

.agent-studio-dialog-card {
  width: min(580px, calc(100vw - 32px));
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, .18);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, .28), transparent 34%),
    radial-gradient(circle at bottom right, rgba(168, 85, 247, .22), transparent 38%),
    linear-gradient(145deg, rgba(15, 23, 42, .98), rgba(2, 6, 23, .98));
  box-shadow: 0 34px 110px rgba(0, 0, 0, .56), inset 0 1px 0 rgba(255, 255, 255, .07);
  transform: translateY(12px) scale(.97);
  transition: transform .18s cubic-bezier(.22, 1, .36, 1);
}

.agent-studio-dialog-overlay.is-open .agent-studio-dialog-card {
  transform: translateY(0) scale(1);
}

.agent-studio-dialog-glow {
  position: absolute;
  inset: -90px auto auto -80px;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .22);
  filter: blur(20px);
  pointer-events: none;
}

.agent-studio-dialog-danger .agent-studio-dialog-glow {
  background: rgba(239, 68, 68, .24);
}

.agent-studio-dialog-warning .agent-studio-dialog-glow {
  background: rgba(245, 158, 11, .24);
}

.agent-studio-dialog-success .agent-studio-dialog-glow {
  background: rgba(34, 197, 94, .22);
}

.agent-studio-dialog-head {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 28px 28px 14px;
}

.agent-studio-dialog-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 19px;
  background: linear-gradient(135deg, rgba(59, 130, 246, .34), rgba(168, 85, 247, .30));
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  font-size: 25px;
}

.agent-studio-dialog-danger .agent-studio-dialog-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, .46), rgba(249, 115, 22, .32));
}

.agent-studio-dialog-warning .agent-studio-dialog-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, .42), rgba(236, 72, 153, .24));
}

.agent-studio-dialog-success .agent-studio-dialog-icon {
  background: linear-gradient(135deg, rgba(34, 197, 94, .42), rgba(20, 184, 166, .30));
}

.agent-studio-dialog-title-wrap {
  min-width: 0;
}

.agent-studio-dialog-kicker {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(191, 219, 254, .72);
  font-weight: 800;
}

.agent-studio-dialog-title {
  margin: 3px 42px 0 0;
  font-size: 23px;
  line-height: 1.18;
  font-weight: 850;
  color: #f8fafc;
}

.agent-studio-dialog-x {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(15, 23, 42, .55);
  color: rgba(226, 232, 240, .88);
  font-size: 26px;
  line-height: 1;
}

.agent-studio-dialog-x:hover {
  background: rgba(30, 41, 59, .84);
}

.agent-studio-dialog-message {
  padding: 4px 28px 18px;
  color: rgba(226, 232, 240, .86);
  line-height: 1.56;
  font-size: 15px;
  white-space: pre-line;
}

.agent-studio-dialog-input {
  display: block;
  width: calc(100% - 56px);
  margin: 0 28px 8px;
  min-height: 128px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, .26);
  background: rgba(2, 6, 23, .48);
  color: #f8fafc;
  padding: 14px 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.agent-studio-dialog-input:focus {
  border-color: rgba(96, 165, 250, .72);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .18);
}

.agent-studio-dialog-input-single {
  min-height: 52px;
  resize: none;
}

.agent-studio-dialog-validation {
  margin: 0 28px 12px;
  color: #fecaca;
  font-size: 13px;
}

.agent-studio-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 28px 27px;
}

.agent-studio-dialog-btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 19px;
  font-weight: 800;
  letter-spacing: .01em;
  min-width: 112px;
}

.agent-studio-dialog-btn-ghost {
  color: #dbeafe;
  background: rgba(15, 23, 42, .54);
  border: 1px solid rgba(148, 163, 184, .22);
}

.agent-studio-dialog-btn-ghost:hover {
  background: rgba(30, 41, 59, .84);
}

.agent-studio-dialog-btn-main {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 12px 30px rgba(37, 99, 235, .30);
}

.agent-studio-dialog-danger .agent-studio-dialog-btn-main {
  background: linear-gradient(135deg, #dc2626, #f97316);
  box-shadow: 0 12px 30px rgba(220, 38, 38, .30);
}

.agent-studio-dialog-warning .agent-studio-dialog-btn-main {
  background: linear-gradient(135deg, #d97706, #db2777);
  box-shadow: 0 12px 30px rgba(217, 119, 6, .25);
}

.agent-studio-dialog-success .agent-studio-dialog-btn-main {
  background: linear-gradient(135deg, #16a34a, #0d9488);
  box-shadow: 0 12px 30px rgba(22, 163, 74, .25);
}

.agent-studio-dialog-btn:focus-visible,
.agent-studio-dialog-x:focus-visible {
  outline: 3px solid rgba(147, 197, 253, .72);
  outline-offset: 2px;
}

html[data-theme="light"] .agent-studio-dialog-card {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, .16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(168, 85, 247, .13), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .98));
  color: #0f172a;
  border-color: rgba(15, 23, 42, .10);
  box-shadow: 0 28px 90px rgba(15, 23, 42, .20), inset 0 1px 0 rgba(255, 255, 255, .65);
}

html[data-theme="light"] .agent-studio-dialog-title {
  color: #0f172a;
}

html[data-theme="light"] .agent-studio-dialog-message {
  color: rgba(15, 23, 42, .78);
}

html[data-theme="light"] .agent-studio-dialog-kicker {
  color: rgba(37, 99, 235, .78);
}

html[data-theme="light"] .agent-studio-dialog-input {
  background: rgba(255, 255, 255, .74);
  color: #0f172a;
}

html[data-theme="light"] .agent-studio-dialog-btn-ghost {
  color: #1e293b;
  background: rgba(241, 245, 249, .90);
}

html[data-theme="light"] .agent-studio-dialog-x {
  color: #334155;
  background: rgba(241, 245, 249, .85);
}

@media (max-width: 540px) {
  .agent-studio-dialog-overlay {
    padding: 16px;
  }
  .agent-studio-dialog-head,
  .agent-studio-dialog-message,
  .agent-studio-dialog-actions {
    padding-left: 20px;
    padding-right: 20px;
  }
  .agent-studio-dialog-input {
    width: calc(100% - 40px);
    margin-left: 20px;
    margin-right: 20px;
  }
  .agent-studio-dialog-actions {
    flex-direction: column-reverse;
  }
  .agent-studio-dialog-btn {
    width: 100%;
  }
}


/* AgentFactory dialog-system alignment: professional centered alert/input dialog with hidden scrollbars. */
.agent-studio-dialog-overlay { overflow:hidden !important; padding:clamp(14px,2.4vw,34px) !important; }
.agent-studio-dialog-card { max-height:calc(100dvh - 48px) !important; display:flex !important; flex-direction:column !important; overflow:hidden !important; }
.agent-studio-dialog-message { min-height:0 !important; overflow:auto !important; scrollbar-width:none; -ms-overflow-style:none; }
.agent-studio-dialog-message::-webkit-scrollbar { width:0 !important; height:0 !important; display:none !important; }
@media(max-width:640px){ .agent-studio-dialog-card{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important;} }
