body {
  background:
    radial-gradient(circle at 12% 0%, rgba(91, 176, 255, 0.2), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(92, 225, 230, 0.14), transparent 24%),
    linear-gradient(180deg, #0a121f 0%, #08101b 56%, #05080f 100%);
  color: #e6eef7;
}

.builder-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px 0;
}

.builder-topbar__row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(76, 110, 157, 0.28);
  border-radius: 999px;
  background: rgba(10, 18, 31, 0.82);
  color: #e6eef7;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.24);
}

.builder-profile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  margin-left: auto;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(76, 110, 157, 0.28);
  background:
    radial-gradient(circle at top right, rgba(92, 225, 230, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(15, 25, 43, 0.94), rgba(8, 15, 26, 0.96));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  text-decoration: none;
}

.builder-profile:hover,
.builder-profile:focus-visible {
  border-color: rgba(110, 160, 227, 0.5);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.3);
  outline: none;
}

.builder-profile__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8fb5e8;
}

.builder-profile__name {
  font-size: 15px;
  font-weight: 700;
  color: #f3f8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-profile__meta {
  font-size: 12px;
  color: #abc2df;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-topbar .top-buttons {
  justify-content: flex-start;
  max-width: none;
  margin: 0;
  padding: 8px;
  border-radius: 20px;
  background: rgba(10, 18, 31, 0.76);
  border: 1px solid rgba(76, 110, 157, 0.24);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.builder-topbar .top-buttons a {
  background: rgba(13, 22, 37, 0.78);
  border-color: rgba(76, 110, 157, 0.22);
  color: #dbe9fb;
}

.builder-topbar .top-buttons a:hover,
.builder-topbar .top-buttons a:focus-visible {
  background: rgba(92, 176, 255, 0.18);
  border-color: rgba(92, 176, 255, 0.34);
  color: #ffffff;
}

.page {
  max-width: 1080px;
  margin: 0 auto 64px;
  padding: 24px;
}

.hero {
  margin-bottom: 24px;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid rgba(76, 110, 157, 0.24);
  background:
    radial-gradient(circle at top right, rgba(92, 225, 230, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(16, 27, 46, 0.92), rgba(8, 15, 26, 0.94));
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
}

.hero .pill-row {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card {
  background: linear-gradient(180deg, rgba(16, 27, 46, 0.94), rgba(10, 18, 31, 0.96));
  border: 1px solid rgba(36, 56, 85, 0.96);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.card + .card {
  margin-top: 16px;
}

.card section + section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #1f2d45;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-header h2 {
  margin: 4px 0;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

#builder-request {
  min-height: 116px;
}

#iteration-request {
  margin-top: 8px;
}

label {
  display: block;
  font-weight: 600;
  color: #c7d7ee;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #233554;
  background: #0a1220;
  color: #e6eef7;
  margin-top: 6px;
  box-sizing: border-box;
}

textarea {
  min-height: 80px;
}

.primary {
  background: linear-gradient(135deg, #4bb0ff, #5ce1e6);
  border: none;
  color: #0a0f18;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.primary:disabled,
.secondary:disabled,
.ghost:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.secondary {
  background: #172842;
  color: #e6eef7;
  border: 1px solid #26436d;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
}

a.primary,
a.secondary {
  text-decoration: none;
  display: inline-block;
}

.ghost {
  background: transparent;
  color: #9bb4da;
  border: 1px dashed #2f486e;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.status {
  margin: 4px 0;
  color: #9bb4da;
  font-size: 0.95rem;
  border-radius: 8px;
  padding: 6px 10px;
  border: 1px solid transparent;
}

.status--info {
  color: #b8d4ff;
  border-color: rgba(104, 146, 214, 0.45);
  background: rgba(16, 34, 62, 0.5);
}

.status--success {
  color: #8fe5b7;
  border-color: rgba(55, 168, 117, 0.45);
  background: rgba(16, 49, 36, 0.5);
}

.status--warning {
  color: #ffd79a;
  border-color: rgba(255, 185, 90, 0.45);
  background: rgba(53, 39, 14, 0.55);
}

.status--error {
  color: #ffb3b3;
  border-color: rgba(214, 92, 92, 0.5);
  background: rgba(57, 20, 25, 0.6);
}

.config-card {
  margin-top: 20px;
}

.column-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.column-stack > .config-card {
  margin-top: 0;
}

.inline-panel {
  margin-top: 12px;
  box-shadow: none;
  background: #0a1220;
  border-color: #233554;
}

.inline-panel section + section {
  border-top-color: #233554;
}


.config-card summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  color: #d6e5fb;
  padding: 4px 0;
}

.config-card summary::-webkit-details-marker {
  display: none;
}

.config-card summary::after {
  content: 'Show';
  float: right;
  color: #8fb5e8;
  font-weight: 500;
}

.config-card[open] summary::after {
  content: 'Hide';
}

.config-card > .meta {
  margin-top: 8px;
}

.output {
  min-height: 120px;
  background: linear-gradient(180deg, rgba(8, 15, 27, 0.96), rgba(7, 13, 23, 0.98));
  border: 1px solid rgba(36, 55, 84, 0.95);
  border-radius: 10px;
  padding: 12px;
  white-space: pre-wrap;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  min-height: 56px;
  padding: 4px 0;
  color: #b9cde6;
}

.source-link {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(52, 78, 114, 0.88);
  background: rgba(11, 20, 35, 0.82);
  color: #d6e9ff;
  line-height: 1.5;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.source-link:hover,
.source-link:focus-visible {
  border-color: rgba(92, 176, 255, 0.55);
  background: rgba(18, 30, 49, 0.94);
  outline: none;
}

.preview-stage {
  margin-top: 12px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(7, 13, 23, 0.72);
}

iframe#preview {
  width: 100%;
  min-height: 440px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.pill-row .pill {
  background: rgba(24, 40, 66, 0.85);
  border: 1px solid rgba(52, 78, 114, 0.88);
  color: #b6dcff;
}

@media (max-width: 720px) {
  .builder-topbar {
    padding: 16px 16px 0;
  }

  #menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .builder-profile {
    min-width: 0;
    flex: 1 1 auto;
    padding: 11px 14px;
  }

  .builder-topbar .top-buttons {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 12px;
    gap: 10px;
    margin-top: 10px;
    border-radius: 20px;
  }

  body.nav-open .builder-topbar .top-buttons {
    display: flex;
  }

  .builder-topbar .top-buttons a {
    width: 100%;
    justify-content: flex-start;
  }

  .page {
    padding: 16px;
  }

  .config-card summary::after {
    float: none;
    margin-left: 8px;
  }
}
