/* Website Builder — Geist / v0 inspired (2026) */

.wb-app {
  --wb-aside: 340px;
  --wb-top: 56px;
  --wb-radius: 12px;
  --wb-radius-lg: 16px;
  --wb-canvas: #fafafa;
  --wb-ink: #171717;
  --wb-muted: #737373;
  --wb-hairline: rgb(0 0 0 / 0.06);
  --wb-hairline-strong: rgb(0 0 0 / 0.1);
  --wb-surface: #ffffff;
  --wb-surface-2: #f5f5f5;
  --wb-surface-3: #fafafa;
  --wb-accent: var(--accent, #4f46e5);
  --wb-accent-soft: var(--accent-soft, #eef2ff);
  --wb-shadow-panel: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 28px rgb(0 0 0 / 0.06);
  --wb-shadow-float: 0 16px 48px rgb(0 0 0 / 0.12);
  min-height: 100vh;
  color: var(--wb-ink);
  background: linear-gradient(165deg, #fafafa 0%, var(--page-bg) 42%, #f0f4ff 100%);
}

/* Scoped form polish */
.wb-app select,
.wb-app textarea:not(.wb-prompt-hero):not(#wbDebugLogText),
.wb-app input[type='range'] {
  font-family: inherit;
  font-size: 0.8125rem;
  border-radius: 8px;
  border: 1px solid var(--wb-hairline-strong);
  background: var(--wb-surface);
  color: var(--wb-ink);
}

.wb-app select {
  padding: 0.4rem 0.65rem;
  cursor: pointer;
}

.wb-app select:focus-visible,
.wb-app textarea:focus-visible {
  outline: none;
  border-color: var(--wb-accent);
  box-shadow: 0 0 0 3px rgb(79 70 229 / 0.15);
}

.wb-app .btn.primary {
  background: var(--wb-ink);
  border-color: var(--wb-ink);
  color: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}

.wb-app .btn.primary:hover {
  background: #262626;
  border-color: #262626;
}

.wb-ghost-btn {
  background: transparent;
  border-color: transparent;
  color: var(--wb-muted);
}

.wb-ghost-btn:hover {
  background: rgb(0 0 0 / 0.04);
  color: var(--wb-ink);
}

/* —— Top bar —— */
.wb-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--wb-top);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  background: rgb(255 255 255 / 0.8);
  border-bottom: 1px solid var(--wb-hairline);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

body.aztools-tool-page.wb-app {
  padding-top: var(--wb-top);
}

.wb-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.wb-topbar-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--wb-ink);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.wb-topbar-icon [data-lucide] {
  width: 16px;
  height: 16px;
}

.wb-topbar-text h1 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wb-topbar-text p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--wb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.wb-chip {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--wb-muted);
  background: var(--wb-surface-2);
  border: none;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.tool-app-pill.ok {
  color: var(--ok);
  background: var(--ok-soft);
  border: none;
}

.tool-app-pill.err {
  color: var(--danger);
  background: var(--danger-soft);
  border: none;
}

.tool-app-pill.warn {
  color: #b45309;
  background: #fffbeb;
  border: none;
}

/* —— Main —— */
.wb-main {
  max-width: 1760px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}

.wb-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.wb-error-banner,
.wb-preflight-banner {
  padding: 0.75rem 1rem;
  border-radius: var(--wb-radius);
  font-size: 0.8125rem;
  line-height: 1.45;
  border: none;
}

.wb-error-banner {
  background: rgb(254 242 242 / 0.9);
  color: #991b1b;
  box-shadow: inset 0 0 0 1px rgb(254 202 202 / 0.8);
}

.wb-preflight-banner {
  background: rgb(255 251 235 / 0.95);
  color: #92400e;
  box-shadow: inset 0 0 0 1px rgb(253 230 138 / 0.8);
}

.wb-error-banner[hidden],
.wb-preflight-banner[hidden] {
  display: none !important;
}

/* —— Composer —— */
.wb-composer {
  margin-bottom: 1rem;
  background: var(--wb-surface);
  border-radius: var(--wb-radius-lg);
  box-shadow: var(--wb-shadow-panel);
  overflow: hidden;
}

.wb-composer-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--wb-hairline);
  background: linear-gradient(180deg, rgb(250 250 250 / 0.9), var(--wb-surface));
}

.wb-generate-hero {
  min-height: 2.5rem;
  padding: 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 999px;
  flex-shrink: 0;
}

.wb-generate-hero [data-lucide] {
  width: 1rem;
  height: 1rem;
}

.wb-composer-top .wb-progress {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  color: var(--wb-muted);
  min-height: auto;
}

.wb-composer-top .wb-progress:empty::before {
  content: 'Bereit — Briefing eingeben und Generieren starten.';
}

.wb-composer-prompt {
  padding: 1rem 1rem 0.5rem;
}

.wb-composer-prompt-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.wb-composer-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--wb-muted);
}

.wb-prompt-hero {
  width: 100%;
  min-height: 7.5rem;
  max-height: 32vh;
  resize: vertical;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--wb-ink);
}

.wb-prompt-hero::placeholder {
  color: #a3a3a3;
}

.wb-prompt-hero:focus {
  outline: none;
}

.wb-composer:focus-within .wb-composer-prompt {
  box-shadow: inset 0 0 0 2px rgb(94 106 210 / 0.2);
}

.wb-composer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 1rem 0.85rem;
  border-top: 1px solid var(--wb-hairline);
  background: var(--wb-surface-3);
}

.wb-composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  position: relative;
}

.wb-toolbar-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.wb-toolbar-field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--wb-muted);
  white-space: nowrap;
}

.wb-toolbar-mode select {
  min-width: 11rem;
  max-width: 16rem;
}

.wb-toolbar-images {
  gap: 0.35rem;
}

.wb-toolbar-images label span {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--wb-accent);
  font-weight: 600;
}

.wb-toolbar-images input[type='range'] {
  width: 5.5rem;
  border: none;
  padding: 0;
  accent-color: var(--wb-accent);
}

.wb-toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--wb-muted);
  cursor: pointer;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: var(--wb-surface);
  border: 1px solid var(--wb-hairline);
}

.wb-toolbar-check input {
  accent-color: var(--wb-accent);
}

.wb-toolbar-ref summary {
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--wb-muted);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--wb-hairline);
  background: var(--wb-surface);
}

.wb-toolbar-ref summary::-webkit-details-marker {
  display: none;
}

.wb-toolbar-ref[open] summary {
  color: var(--wb-accent);
  background: var(--wb-accent-soft);
}

.wb-ref-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.35rem);
  padding: 0.85rem;
  background: var(--wb-surface);
  border-radius: var(--wb-radius);
  box-shadow: var(--wb-shadow-float);
  z-index: 30;
}

.wb-ref-panel label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--wb-muted);
}

.wb-ref-panel textarea {
  width: 100%;
  min-height: 100px;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.wb-enhance-cta {
  flex-shrink: 0;
  border-radius: 999px;
  font-weight: 500;
}

.wb-char-count {
  font-size: 0.75rem;
  color: var(--wb-muted);
  font-variant-numeric: tabular-nums;
}

.wb-char-count.warn {
  color: #b45309;
}

.wb-char-count.err {
  color: #b91c1c;
  font-weight: 600;
}

/* —— Workspace —— */
.wb-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--wb-aside);
  gap: 1rem;
  align-items: stretch;
  min-height: calc(100vh - var(--wb-top) - 14rem);
}

@media (max-width: 1100px) {
  .wb-workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

/* —— Preview stage —— */
.wb-stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--wb-surface);
  border-radius: var(--wb-radius-lg);
  box-shadow: var(--wb-shadow-panel);
  overflow: hidden;
}

.wb-stage-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--wb-hairline);
}

.wb-stage-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--wb-muted);
}

.wb-stage-toolbar .spacer {
  flex: 1;
}

.wb-vp-group {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: var(--wb-surface-2);
}

.wb-vp-group button {
  border: none;
  background: transparent;
  width: 2rem;
  height: 2rem;
  padding: 0;
  cursor: pointer;
  color: var(--wb-muted);
  border-radius: 6px;
  display: grid;
  place-items: center;
}

.wb-vp-group button:hover {
  color: var(--wb-ink);
  background: rgb(255 255 255 / 0.8);
}

.wb-vp-group button.active {
  background: var(--wb-surface);
  color: var(--wb-ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.wb-stage-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  padding: 1rem;
  background: var(--wb-surface-2);
}

.wb-device-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--wb-radius);
  background: var(--wb-surface);
  box-shadow: var(--wb-shadow-panel);
  overflow: hidden;
}

.wb-device-chrome {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.85rem;
  border-bottom: 1px solid var(--wb-hairline);
  background: var(--wb-surface);
  flex-shrink: 0;
}

.wb-device-dots {
  display: inline-flex;
  gap: 5px;
}

.wb-device-dots i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e5e5e5;
  font-style: normal;
}

.wb-device-dots i:nth-child(1) {
  background: #ff5f57;
}

.wb-device-dots i:nth-child(2) {
  background: #febc2e;
}

.wb-device-dots i:nth-child(3) {
  background: #28c840;
}

.wb-device-url {
  flex: 1;
  font-size: 0.75rem;
  color: var(--wb-muted);
  text-align: center;
  font-family: var(--mono);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--wb-surface-2);
}

.wb-preview-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 280px;
  overflow: auto;
  background: #fafafa;
}

.wb-preview-wrap iframe {
  flex: 1;
  min-height: 260px;
  border: none;
  background: #fff;
}

.wb-preview-wrap.vp-tablet iframe {
  width: 768px;
  max-width: 100%;
  margin: 0 auto;
}

.wb-preview-wrap.vp-mobile iframe {
  width: 390px;
  max-width: 100%;
  margin: 0 auto;
}

.wb-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  text-align: center;
  color: var(--wb-muted);
  pointer-events: none;
}

.wb-preview-empty-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: var(--wb-surface-2);
  display: grid;
  place-items: center;
  margin-bottom: 0.25rem;
}

.wb-preview-empty-icon [data-lucide] {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--wb-accent);
  opacity: 0.7;
}

.wb-preview-empty strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--wb-ink);
}

.wb-preview-empty p {
  margin: 0;
  font-size: 0.8125rem;
  max-width: 20rem;
  line-height: 1.5;
}

.wb-preview-wrap.has-preview .wb-preview-empty {
  display: none;
}

.wb-stage-foot {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--wb-hairline);
}

.wb-export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.wb-export-bar .spacer {
  flex: 1;
}

.wb-version {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--wb-muted);
}

.wb-copy-banner {
  margin: 0 0.75rem 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
}

.wb-copy-banner[hidden] {
  display: none !important;
}

.wb-copy-banner.ok {
  background: var(--ok-soft);
  color: #166534;
}

.wb-copy-banner.warn {
  background: #fffbeb;
  color: #b45309;
}

.wb-gen-details {
  margin: 0 0.75rem;
  font-size: 0.75rem;
  border-radius: 8px;
  background: var(--wb-surface-2);
}

.wb-gen-details[hidden] {
  display: none !important;
}

.wb-gen-details > summary {
  cursor: pointer;
  padding: 0.45rem 0.65rem;
  font-weight: 500;
  list-style: none;
}

.wb-gen-details-bd {
  padding: 0 0.65rem 0.55rem;
}

.wb-report-line {
  margin: 0.35rem 0.75rem 0;
  font-size: 0.6875rem;
  color: var(--wb-muted);
  font-family: var(--mono);
}

.wb-report-line[hidden] {
  display: none !important;
}

/* —— Chat —— */
.wb-aside {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.wb-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  background: var(--wb-surface);
  border-radius: var(--wb-radius-lg);
  box-shadow: var(--wb-shadow-panel);
  overflow: hidden;
}

.wb-chat > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--wb-hairline);
}

.wb-chat > summary::-webkit-details-marker {
  display: none;
}

@media (min-width: 1101px) {
  .wb-chat > summary {
    cursor: default;
    pointer-events: none;
  }
  .wb-chat > summary [data-lucide='chevron-down'] {
    display: none;
  }
}

.wb-chat-bd {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wb-chat-messages {
  flex: 1;
  min-height: 140px;
  max-height: min(48vh, 420px);
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wb-chat-messages:empty::before {
  content: 'Nach der Generierung kannst du hier Änderungen anfordern.';
  color: var(--wb-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.wb-chat-msg {
  max-width: 92%;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.5;
  border: none;
}

.wb-chat-msg-user {
  align-self: flex-end;
  background: var(--wb-surface-2);
  color: var(--wb-ink);
}

.wb-chat-msg-assistant {
  align-self: flex-start;
  background: transparent;
  padding-left: 0;
}

.wb-chat-role {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--wb-muted);
  margin-bottom: 0.15rem;
}

.wb-chat-intent {
  font-size: 0.75rem;
  color: var(--wb-accent);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.wb-chat-summary {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--wb-hairline);
  font-size: 0.75rem;
  color: var(--wb-muted);
}

.wb-chat-compose {
  padding: 0.65rem 0.75rem;
  border-top: 1px solid var(--wb-hairline);
  display: grid;
  gap: 0.45rem;
}

#wbChatInput {
  min-height: 56px;
  resize: vertical;
  font-size: 0.8125rem;
  border: 1px solid var(--wb-hairline-strong);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
}

.wb-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* —— History —— */
.wb-history-panel {
  margin-top: 1rem;
  background: var(--wb-surface);
  border-radius: var(--wb-radius-lg);
  box-shadow: var(--wb-shadow-panel);
  overflow: hidden;
}

.wb-history-panel > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  font-weight: 600;
  font-size: 0.8125rem;
}

.wb-history-panel > summary::-webkit-details-marker {
  display: none;
}

.wb-history-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.wb-history-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--wb-hairline);
}

.wb-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.wb-history-table th,
.wb-history-table td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--wb-hairline);
}

.wb-history-table th {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--wb-muted);
  background: var(--wb-surface-3);
}

.wb-history-table tbody tr:hover td {
  background: rgb(0 0 0 / 0.02);
}

.wb-history-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--wb-muted);
  font-size: 0.8125rem;
}

.wb-history-empty[hidden] {
  display: none !important;
}

.wb-history-actions {
  display: flex;
  gap: 0.2rem;
}

.wb-btn-icon {
  padding: 0.25rem 0.4rem;
}

.wb-btn-danger {
  color: var(--danger);
}

.wb-status-ok {
  color: #15803d;
  font-weight: 500;
}

.wb-status-err {
  color: #b91c1c;
  font-weight: 500;
}

/* —— Debug / modals —— */
.wb-logpanel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(480px, 100vw);
  display: none;
  z-index: 99999;
  background: var(--wb-surface);
  box-shadow: -8px 0 32px rgb(0 0 0 / 0.1);
  flex-direction: column;
}

.wb-logpanel.show {
  display: flex;
}

.wb-logpanel .hd {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--wb-hairline);
}

.wb-logpanel textarea {
  flex: 1;
  border: 0;
  background: var(--wb-surface-3);
  font-family: var(--mono);
  font-size: 0.6875rem;
  padding: 0.75rem 1rem;
}

.wb-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 50000;
  background: rgb(10 10 10 / 0.88);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  padding: 0.75rem;
}

.wb-fullscreen.open {
  display: flex;
}

.wb-fullscreen-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: #fafafa;
}

.wb-fullscreen-body {
  flex: 1;
  min-height: 0;
  border-radius: var(--wb-radius-lg);
  overflow: hidden;
  background: #fff;
}

.wb-fullscreen-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.wb-info-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(0 0 0 / 0.4);
  backdrop-filter: blur(6px);
}

.wb-info-modal.show {
  display: flex;
}

.wb-info-panel {
  width: min(560px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--wb-surface);
  border-radius: var(--wb-radius-lg);
  box-shadow: var(--wb-shadow-float);
  padding: 1.25rem;
}

.wb-info-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.wb-info-title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.wb-info-panel pre {
  font-size: 0.7rem;
  overflow: auto;
  max-height: 40vh;
  background: var(--wb-surface-2);
  padding: 0.65rem;
  border-radius: 8px;
}

.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;
}

.wb-gen-sec {
  margin-top: 0.55rem;
}

.wb-gen-sec h4 {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--wb-muted);
}

.wb-gen-dl {
  display: grid;
  grid-template-columns: minmax(6rem, 38%) 1fr;
  gap: 0.15rem 0.5rem;
  margin: 0;
}

.wb-gen-dl dt {
  color: var(--wb-muted);
  font-weight: 500;
}

.wb-gen-dl dd {
  margin: 0;
  word-break: break-word;
}

/* —— Generation modal (glass card) —— */
.wb-gen-modal {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: none;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
  background: rgb(15 23 42 / 0.2);
  backdrop-filter: blur(10px) saturate(1.1);
}

.wb-gen-modal.show {
  display: grid;
}

.wb-gen-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.wb-gen-mesh {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(ellipse 55% 45% at 25% 35%, rgb(94 106 210 / 0.35), transparent 60%),
    radial-gradient(ellipse 50% 40% at 75% 65%, rgb(129 140 248 / 0.28), transparent 55%);
  filter: blur(48px);
  animation: wbGenMesh 20s ease-in-out infinite alternate;
}

@keyframes wbGenMesh {
  to {
    transform: translate(3%, -2%) scale(1.05);
  }
}

.wb-gen-card {
  position: relative;
  width: min(520px, 100%);
  max-height: min(88vh, 680px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border-radius: 20px;
  background: rgb(255 255 255 / 0.78);
  border: 1px solid rgb(255 255 255 / 0.65);
  box-shadow: var(--wb-shadow-float);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  overflow-y: auto;
}

.wb-gen-head-text {
  min-width: 0;
}

.wb-gen-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.wb-gen-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--wb-muted);
}

.wb-gen-copy-diag {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.05);
  color: var(--wb-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.wb-gen-copy-diag:hover {
  background: rgb(0 0 0 / 0.08);
  color: var(--wb-ink);
}

.wb-gen-copy-diag.is-copied {
  background: var(--ok-soft);
  color: var(--ok);
}

.wb-gen-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.wb-gen-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
  color: var(--wb-muted);
}

.wb-gen-phase {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--wb-ink);
  line-height: 1.4;
}

.wb-gen-modal:not(.is-success):not(.is-error) .wb-gen-phase {
  background: linear-gradient(90deg, var(--wb-ink) 0%, #5e6ad2 50%, var(--wb-ink) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: wbGenShimmer 2.5s ease-in-out infinite;
}

@keyframes wbGenShimmer {
  0%,
  100% {
    background-position: 100% 0;
  }
  50% {
    background-position: 0 0;
  }
}

.wb-gen-bar {
  height: 3px;
  margin-top: 0.75rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.06);
  overflow: hidden;
}

.wb-gen-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5e6ad2, #818cf8, #5e6ad2);
  background-size: 200% 100%;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  animation: wbGenSheen 2s linear infinite;
}

@keyframes wbGenSheen {
  to {
    background-position: 200% 0;
  }
}

.wb-gen-ring-wrap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.wb-gen-tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
}

.wb-gen-task {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.65rem;
  padding: 0.45rem 0;
  font-size: 0.8125rem;
  color: var(--wb-muted);
  position: relative;
}

.wb-gen-task:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 1.65rem;
  bottom: -0.1rem;
  width: 1px;
  background: var(--wb-hairline);
}

.wb-gen-task[data-status='active'] {
  color: var(--wb-ink);
  font-weight: 500;
}

.wb-gen-task[data-status='active'] .wb-gen-task-icon {
  color: #5e6ad2;
}

.wb-gen-task[data-status='done'] {
  color: rgb(0 0 0 / 0.4);
}

.wb-gen-task[data-status='pending'] {
  opacity: 0.45;
}

.wb-gen-task[data-status='error'] {
  color: #b91c1c;
}

.wb-gen-task-icon {
  width: 16px;
  height: 16px;
}

.wb-gen-telemetry {
  border-top: 1px solid var(--wb-hairline);
  padding-top: 0.5rem;
}

.wb-gen-telemetry summary {
  font-size: 0.8125rem;
  color: var(--wb-muted);
  cursor: pointer;
  font-weight: 500;
}

.wb-gen-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  margin-top: 0.65rem;
}

.wb-gen-stat label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--wb-muted);
  margin-bottom: 0.1rem;
}

.wb-gen-stat output {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.wb-gen-footer {
  margin: 0;
  font-size: 0.75rem;
  color: var(--wb-muted);
  line-height: 1.4;
}

.wb-gen-error-msg {
  display: none;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgb(254 242 242 / 0.9);
  color: #991b1b;
  font-size: 0.8125rem;
}

.wb-gen-modal.is-error .wb-gen-error-msg {
  display: block;
}

.wb-gen-modal.is-success .wb-gen-bar-fill {
  background: #10b981;
  animation: none;
}

.wb-gen-modal.is-success .wb-gen-phase {
  animation: none;
  background: none;
  color: #059669;
  -webkit-background-clip: unset;
}

.wb-gen-modal.is-error .wb-gen-bar-fill {
  background: #ef4444;
  animation: none;
}

.wb-gen-close-btn {
  display: none;
  align-self: flex-start;
}

.wb-gen-modal.is-error .wb-gen-close-btn {
  display: inline-flex;
}

.wb-gen-modal.is-success .wb-gen-ring-fill {
  stroke: #059669;
}

.wb-gen-modal.is-error .wb-gen-ring-fill {
  stroke: #dc2626;
}

@media (max-width: 700px) {
  .wb-composer-top {
    flex-direction: column;
    align-items: stretch;
  }
  .wb-generate-hero {
    width: 100%;
    justify-content: center;
  }
  .wb-composer-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .wb-enhance-cta {
    width: 100%;
    justify-content: center;
  }
  .wb-topbar-text p {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wb-gen-mesh,
  .wb-gen-phase,
  .wb-gen-bar-fill {
    animation: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .wb-gen-modal,
  .wb-gen-card,
  .wb-topbar {
    backdrop-filter: none;
  }
  .wb-gen-card {
    background: #fff;
  }
}
