/* Integrated Form Studio AI Builder shell.
   The AI application itself remains isolated under /ai-tool. */

.df-ai-builder-modal[hidden] {
  display: none !important;
}

.df-ai-builder-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.df-ai-builder-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.df-ai-builder-dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 48px));
  height: min(820px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #d9dde5;
  border-radius: 16px;
  background: #ffffff;
  box-shadow:
    0 28px 80px rgba(15, 23, 42, 0.22),
    0 8px 24px rgba(15, 23, 42, 0.12);
}

.df-ai-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 13px 18px;
  border-bottom: 1px solid #e6e8ec;
  background: #ffffff;
}

.df-ai-builder-header h2 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 700;
  color: #20242a;
}

.df-ai-builder-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.df-ai-builder-close {
  width: 34px;
  height: 34px;
  border: 1px solid #d9dde5;
  border-radius: 9px;
  background: #ffffff;
  color: #4b5563;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.df-ai-builder-close:hover {
  background: #f7f8fa;
}

.df-ai-builder-frame-wrap {
  min-height: 0;
  background: #f4f5f7;
}

.df-ai-builder-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f4f5f7;
}

body.df-ai-builder-open {
  overflow: hidden !important;
}

@media (max-width: 820px) {
  .df-ai-builder-modal {
    padding: 8px;
  }

  .df-ai-builder-dialog {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    border-radius: 12px;
  }
}
