.ai-design-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: var(--ss-color-surface-muted, #f1f5f9);
}

.ai-design-page .ss-site-header {
  flex-shrink: 0;
}

.ai-design-page > .ai-design-layout {
  flex: 1 1 auto;
  min-height: min(72vh, 780px);
  align-items: start;
  padding-bottom: max(2rem, 6vh);
}

.ai-design-page > .ai-design-layout.ai-design-layout--final-design {
  padding-bottom: max(4rem, 14vh);
}

.ai-design-page > .ai-design-layout.ai-design-layout--refinement {
  min-height: auto;
  align-items: start;
}

.ai-design-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.ai-design-layout {
  --ai-design-rail-min: 220px;
  --ai-design-rail-max: 300px;
  --ai-design-selection-min: 180px;
  --ai-design-selection-max: 240px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(var(--ai-design-rail-min), var(--ai-design-rail-max));
  gap: 1rem;
  flex: 1 1 auto;
  min-height: auto;
  align-items: start;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 0.5rem 1.25rem;
  box-sizing: border-box;
  overflow: visible;
}

.ai-design-layout--refinement {
  grid-template-columns: minmax(0, 1fr) minmax(var(--ai-design-rail-min), var(--ai-design-rail-max));
  align-items: start;
}

.ai-design-layout--refinement .ai-design-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: auto;
  overflow: visible;
}

.ai-design-layout--refinement .ai-design-chat-panel {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  min-height: auto;
  max-height: none;
  overflow: visible;
}

.ai-design-layout--refinement .ai-design-accordion-body--chat,
.ai-design-layout--refinement #ai-design-chat-scroll {
  flex: 0 1 auto;
  min-height: auto;
  max-height: none;
  overflow: visible;
  overflow-x: hidden;
}

.ai-design-layout--refinement > .ai-design-sidebar,
.ai-design-layout--refinement > .ai-design-main {
  overflow: visible;
  min-height: auto;
  height: auto;
}

.ai-design-layout--refinement.ai-design-layout--side-rail-visible .ai-design-asset-rail {
  align-self: start;
  max-height: none;
  overflow: visible;
}

.ai-design-layout--refinement.ai-design-layout--side-rail-visible .ai-design-selection-rail {
  max-height: none;
  overflow: visible;
}

.ai-design-layout:not(.ai-design-layout--asset-rail-visible):not(
    .ai-design-layout--side-rail-visible
  ) {
  grid-template-columns: minmax(0, 1fr);
  max-width: 100%;
}

.ai-design-layout:not(.ai-design-layout--asset-rail-visible):not(
    .ai-design-layout--side-rail-visible
  )
  .ai-design-sidebar,
.ai-design-layout:not(.ai-design-layout--asset-rail-visible):not(
    .ai-design-layout--side-rail-visible
  )
  .ai-design-chat-panel {
  width: 100%;
  max-width: 100%;
}

.ai-design-layout:not(.ai-design-layout--asset-rail-visible) .chat-bubble--assistant,
.ai-design-layout:not(.ai-design-layout--asset-rail-visible) .chat-actions-panel {
  max-width: 100%;
  width: 100%;
}

.ai-design-layout:not(.ai-design-layout--asset-rail-visible):not(
    .ai-design-layout--side-rail-visible
  )
  .ai-design-asset-rail {
  display: none;
}

.ai-design-layout:not(.ai-design-layout--asset-rail-visible):not(
    .ai-design-layout--side-rail-visible
  )
  .ai-design-sidebar,
.ai-design-layout:not(.ai-design-layout--asset-rail-visible):not(
    .ai-design-layout--side-rail-visible
  )
  .ai-design-main {
  border-right: none;
}

.ai-design-layout--side-rail-visible:not(.ai-design-layout--asset-rail-visible) {
  grid-template-columns: minmax(0, 1fr) minmax(var(--ai-design-rail-min), var(--ai-design-rail-max));
  max-width: 100%;
  align-items: start;
}

.ai-design-layout--side-rail-visible:not(.ai-design-layout--asset-rail-visible) .ai-design-asset-rail {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.75rem;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  align-self: stretch;
}

.ai-design-layout--side-rail-visible:not(.ai-design-layout--asset-rail-visible) .ai-design-asset-rail-title,
.ai-design-layout--side-rail-visible:not(.ai-design-layout--asset-rail-visible) .ai-design-asset-rail-main,
.ai-design-layout--side-rail-visible:not(.ai-design-layout--asset-rail-visible) .ai-design-preview-footer {
  display: none !important;
}

.ai-design-layout--side-rail-visible:not(.ai-design-layout--asset-rail-visible) .ai-design-asset-rail-body {
  flex: 1 1 auto;
  min-height: 0;
}

.ai-design-layout--side-rail-visible:not(.ai-design-layout--asset-rail-visible) .ai-design-selection-rail {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  justify-content: flex-start;
  border: none;
  background: transparent;
  padding: 0;
}

.ai-design-layout > .ai-design-sidebar,
.ai-design-layout > .ai-design-main {
  display: flex;
  flex-direction: column;
  background: transparent;
  min-height: 0;
  height: auto;
  align-self: start;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  border: none;
}

.ai-design-sidebar,
.ai-design-main {
  display: flex;
  flex-direction: column;
  background: transparent;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  border: none;
}

.ai-design-layout .ai-design-chat-panel {
  flex: 0 1 auto;
  min-height: 0;
  max-height: none;
}

.ai-design-chat-panel {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

#ai-design-chat-scroll,
.ai-design-accordion-body--chat#ai-design-chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-bottom: 1rem;
  box-sizing: border-box;
}

.ai-design-chat-composer {
  flex-shrink: 0;
}

.ai-design-chat-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.15rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  box-sizing: border-box;
}

.ai-design-chat-footer:not(.hidden) {
  margin-top: auto;
  position: static;
  z-index: 4;
  box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.08);
}

.ai-design-chat-stream > .ai-design-final-brief:not(.hidden) {
  flex-shrink: 0;
  margin: 0;
  margin-top: 0.75rem;
  border-radius: 12px;
}

.ai-design-layout--final-design .ai-design-chat-stream > .ai-design-final-brief:not(.hidden) {
  margin-top: 0.75rem;
}

.ai-design-chat-stream > .ai-design-final-brief:not(.hidden) + .ai-design-chat-footer:not(.hidden) {
  margin-top: 0.35rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.ai-design-completion-spacer {
  flex-shrink: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
}

.ai-design-chat-stream:has(.ai-design-chat-footer:not(.hidden)) .ai-design-completion-spacer,
.ai-design-chat-stream:has(.ai-design-final-brief:not(.hidden)) .ai-design-completion-spacer {
  height: max(8rem, 18vh);
  min-height: 6rem;
}

.ai-design-chat-footer .ai-design-rounds {
  margin: 0 0 0.15rem;
  padding: 0 0.15rem;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
  line-height: 1.45;
}

.ai-design-chat-footer .btn-primary {
  width: 100%;
}

/* Continue CTA — override wizard global `button { background: var(--panel-3) }` reset */
html[data-theme="schlauesocke-2026"] .ai-design-chat-footer .btn-primary,
html[data-theme="schlauesocke-2026"] .ai-design-final-brief-continue-btn,
html[data-theme="schlauesocke-2026"] .ai-design-rail-continue-btn,
body.wizard-ai-design-active .ai-design-chat-footer .btn-primary,
body.wizard-ai-design-active .ai-design-final-brief-continue-btn,
body.wizard-ai-design-active .ai-design-rail-continue-btn,
.ai-design-page .ai-design-chat-footer .btn-primary,
.ai-design-page .ai-design-final-brief-continue-btn,
.ai-design-page .ai-design-rail-continue-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 0.55rem 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  border-radius: var(--ss-radius-md, 10px);
  border: 1px solid rgba(26, 110, 72, 0.42);
  background: var(
    --ss-btn-primary-gradient,
    linear-gradient(128deg, #08cf6f 0%, #16c578 44%, #23aa68 100%)
  );
  color: var(--ss-text-inverse, #fff);
  box-shadow: var(--ss-btn-primary-shadow, 0 4px 14px rgba(8, 207, 111, 0.26));
  opacity: 1;
  cursor: pointer;
}

html[data-theme="schlauesocke-2026"] .ai-design-chat-footer .btn-primary:hover:not(:disabled),
html[data-theme="schlauesocke-2026"] .ai-design-final-brief-continue-btn:hover:not(:disabled),
html[data-theme="schlauesocke-2026"] .ai-design-rail-continue-btn:hover:not(:disabled),
body.wizard-ai-design-active .ai-design-chat-footer .btn-primary:hover:not(:disabled),
body.wizard-ai-design-active .ai-design-final-brief-continue-btn:hover:not(:disabled),
body.wizard-ai-design-active .ai-design-rail-continue-btn:hover:not(:disabled),
.ai-design-page .ai-design-chat-footer .btn-primary:hover:not(:disabled),
.ai-design-page .ai-design-final-brief-continue-btn:hover:not(:disabled),
.ai-design-page .ai-design-rail-continue-btn:hover:not(:disabled) {
  background: var(
    --ss-btn-primary-gradient-hover,
    linear-gradient(128deg, #07bf65 0%, #14b06a 48%, #1d955b 100%)
  );
  color: var(--ss-text-inverse, #fff);
  box-shadow: var(--ss-btn-primary-shadow-hover, 0 5px 16px rgba(8, 207, 111, 0.32));
}

html[data-theme="schlauesocke-2026"] .ai-design-chat-footer .btn-primary:disabled,
html[data-theme="schlauesocke-2026"] .ai-design-final-brief-continue-btn:disabled,
html[data-theme="schlauesocke-2026"] .ai-design-rail-continue-btn:disabled,
body.wizard-ai-design-active .ai-design-chat-footer .btn-primary:disabled,
body.wizard-ai-design-active .ai-design-final-brief-continue-btn:disabled,
body.wizard-ai-design-active .ai-design-rail-continue-btn:disabled,
.ai-design-page .ai-design-chat-footer .btn-primary:disabled,
.ai-design-page .ai-design-final-brief-continue-btn:disabled,
.ai-design-page .ai-design-rail-continue-btn:disabled {
  background: #e2e8f0 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  cursor: not-allowed;
}

.ai-design-main-header,
.ai-design-workspace-header {
  flex-shrink: 0;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.ai-design-main-title,
.ai-design-workspace-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.ai-design-workspace-panel {
  flex-shrink: 0;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.ai-design-asset-rail {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  gap: 0.5rem;
  background: #fff;
  min-height: 0;
  height: auto;
  max-height: min(85vh, 880px);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  align-self: stretch;
}

.ai-design-asset-rail-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

.ai-design-asset-rail-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  gap: 0.45rem;
}

.ai-design-asset-rail-main > .ai-design-main-preview {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ai-design-asset-rail-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ai-design-accordion-item {
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.ai-design-accordion-item[open] {
  flex-shrink: 0;
}

.ai-design-layout:not(.ai-design-layout--refinement) .ai-design-accordion-item--chat[open] {
  flex-shrink: 0;
  overflow: visible;
}

.ai-design-accordion-item--round[open] {
  background: #f8fafc;
}

.ai-design-accordion-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ai-design-accordion-summary::-webkit-details-marker {
  display: none;
}

.ai-design-accordion-summary::before {
  content: "";
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  margin-right: 0.15rem;
}

.ai-design-accordion-item[open] > .ai-design-accordion-summary::before {
  transform: rotate(45deg);
}

.ai-design-accordion-body {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.ai-design-accordion-body--chat {
  min-height: 0;
  flex: 1 1 0%;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.ai-design-layout:not(.ai-design-layout--refinement) .ai-design-accordion-body--chat,
.ai-design-layout--refinement .ai-design-accordion-body--chat {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.ai-design-layout:not(.ai-design-layout--refinement) .ai-design-accordion-item--chat {
  flex: none;
  position: relative;
  min-height: auto;
  overflow: visible;
  border-bottom: none;
  background: transparent;
}

.ai-design-layout:not(.ai-design-layout--refinement) .ai-design-accordion-item--chat[open] > .ai-design-accordion-body--chat {
  position: static;
  inset: auto;
  flex: none;
  width: 100%;
  max-height: none;
  box-sizing: border-box;
}

.ai-design-layout:not(.ai-design-layout--refinement) .ai-design-accordion-item--chat > .ai-design-accordion-summary {
  display: none;
}

.ai-design-round-accordions {
  display: none !important;
}

.ai-design-layout--refinement .ai-design-sidebar-step {
  display: none;
}

.ai-design-layout--refinement .ai-design-sidebar-step:has(.ai-design-final-brief:not(.hidden)) {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: auto;
  overflow: visible;
}

.ai-design-layout--refinement .ai-design-sidebar-step.hidden {
  display: none !important;
}

.ai-design-accordion-body--step {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  padding-bottom: 0.75rem;
}

.ai-design-sidebar .ai-design-preview-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
}

.ai-design-round-accordions .ai-design-round-thumb {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  aspect-ratio: 2 / 1;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.ai-design-round-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.ai-design-round-meta label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.ai-design-round-view-btn {
  border: none;
  background: transparent;
  color: #0f766e;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.ai-design-chat-stream {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.25rem max(3rem, 10vh);
  min-height: auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: visible;
}

.ai-design-chat-stream > .ai-design-chat-footer:not(.hidden) {
  position: sticky;
  bottom: 0;
  z-index: 6;
  margin-top: 0.5rem;
  background: #fff;
  border-radius: 12px;
}

.ai-design-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.ai-design-chat-step {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: 0.35rem;
  scroll-margin-bottom: 1.25rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.ai-design-chat-step > .chat-actions,
.ai-design-chat-step > .chat-actions-panel,
.ai-design-chat-step > .chat-mockup-interaction {
  scroll-margin-bottom: 1.25rem;
}

.chat-mockup-interaction {
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  scroll-margin-bottom: 1.5rem;
  padding-bottom: 0.35rem;
  box-sizing: border-box;
}

.ai-design-mockup-dock .chat-mockup-interaction,
.ai-design-chat-step .chat-mockup-interaction {
  padding: 0.15rem 0 0.35rem;
}

.ai-design-chat-step:empty {
  display: none;
}

.ai-design-chat-step .chat-actions-panel,
.ai-design-chat-step .chat-mode-select,
.ai-design-chat-step > .chat-actions {
  margin: 0;
}

.ai-design-chat-step .chat-actions-panel--scroll-foot {
  max-height: none;
  overflow: visible;
}

.ai-design-chat-step .chat-actions-panel--scroll-foot > .chat-actions-panel__body {
  overflow: visible;
  max-height: none;
}

.ai-design-chat-step .chat-actions-panel--choices {
  max-height: none;
  overflow: visible;
}

.ai-design-layout--refinement .ai-design-accordion-body--chat {
  max-height: none;
}

.ai-design-mockup-dock {
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
  padding: 0.75rem 1rem 0.85rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  overflow-x: hidden;
  box-sizing: border-box;
}

.ai-design-mockup-dock:not(.hidden) {
  box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.08);
}

.ai-design-mockup-dock .chat-mockup-review-prompt {
  margin-top: 0;
}

.ai-design-mockup-dock .chat-mockup-review-actions {
  margin-top: 0.35rem;
}

.ai-design-mockup-dock .chat-mockup-review-actions .chat-action-btn {
  width: 100%;
}

.ai-design-mockup-dock .chat-mockup-actions {
  margin-top: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px dashed #e2e8f0;
}

.ai-design-mockup-dock .chat-mockup-refine {
  margin-top: 0;
}

.chat-color-common {
  margin-bottom: 0.25rem;
}

.chat-color-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.ai-design-chat-step .chat-color-picker {
  max-height: none;
}

.ai-design-chat-step .chat-color-panels {
  flex: 1;
  min-height: 8rem;
  max-height: none;
  overflow: visible;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.ai-design-chat-step .chat-color-panel {
  max-height: none;
  overflow: visible;
}

.chat-color-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chat-color-tab {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: #334155;
}

.chat-color-tab.active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
  font-weight: 600;
}

.chat-color-panels {
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.chat-color-panel {
  max-height: min(34vh, 320px);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.chat-color-panel-intro {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.35;
}

.chat-color-empty {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.chat-color-same-base {
  align-self: flex-start;
}

.chat-rgb-controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.75rem;
  align-items: end;
  margin-bottom: 0.5rem;
}

.chat-rgb-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: #475569;
}

.chat-rgb-input {
  width: 3.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.chat-hex-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  text-transform: uppercase;
}

.chat-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.45rem;
}

.chat-catalog-grid--full {
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
}

.chat-catalog-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.35rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  font: inherit;
}

.chat-catalog-tile:hover,
.chat-catalog-tile:focus-visible {
  border-color: #0f766e;
  background: #f0fdfa;
}

.chat-catalog-tile-color {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f1f5f9;
}

.chat-catalog-tile-color img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-catalog-tile-code {
  font-size: 0.62rem;
  line-height: 1.2;
  color: #0f172a;
  word-break: break-word;
}

.chat-catalog-tile-meta {
  font-size: 0.58rem;
  color: #64748b;
}

.chat-bubble {
  max-width: 92%;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
}

.chat-bubble--assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  white-space: pre-line;
}

.chat-bubble--confirm {
  max-width: 100%;
  width: 100%;
  padding: 0.85rem 1rem;
}

.chat-confirm-title {
  margin: 0 0 0.55rem;
  font-weight: 600;
  color: #0f172a;
}

.chat-confirm-list {
  margin: 0 0 0.65rem;
  padding-left: 1.15rem;
  color: #334155;
}

.chat-confirm-list li + li {
  margin-top: 0.35rem;
}

.chat-confirm-warnings {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.65rem 0.55rem 1.15rem;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  list-style: disc;
}

.chat-confirm-resolved {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
}

.chat-bubble--confirm-generating {
  border-color: #99f6e4;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.14);
}

.chat-confirm-progress {
  margin-top: 0.85rem;
  padding: 1rem 1.1rem 1.05rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #ecfdf5 0%, #f0fdfa 55%, #fff 100%);
  border: 1px solid #99f6e4;
}

.chat-confirm-progress-label {
  margin: 0 0 0.85rem;
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  font-weight: 700;
  line-height: 1.35;
  color: #0f766e;
  letter-spacing: -0.01em;
}

.chat-confirm-progress-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.14);
  overflow: hidden;
}

.chat-confirm-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0d9488 0%, #14b8a6 45%, #2dd4bf 100%);
  transition: width 0.45s ease;
}

.chat-confirm-progress-fill--indeterminate {
  width: 42%;
  animation: chat-confirm-progress-slide 1.35s ease-in-out infinite;
}

.chat-confirm-progress--done .chat-confirm-progress-fill {
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.45);
}

.chat-confirm-progress--failed {
  background: linear-gradient(145deg, #fef2f2 0%, #fff5f5 55%, #fff 100%);
  border-color: #fecaca;
}

.chat-confirm-progress--failed .chat-confirm-progress-label,
.chat-confirm-progress--failed .chat-confirm-progress-sub {
  color: #b91c1c;
}

.chat-confirm-progress--failed .chat-confirm-progress-track {
  background: rgba(185, 28, 28, 0.12);
}

.chat-confirm-resolved--superseded {
  color: #64748b;
  font-style: italic;
}

.chat-bubble--confirm .chat-mockup-refine--adjust {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
}

.chat-mockup-refine-adjust-hint {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f766e;
  line-height: 1.4;
}

.chat-confirm-progress-sub {
  margin: 0.7rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #115e59;
  line-height: 1.4;
}

@keyframes chat-confirm-progress-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-confirm-progress-fill--indeterminate {
    animation: none;
    width: 100%;
    opacity: 0.65;
  }
}

.chat-actions--confirm {
  margin-top: 0.35rem;
}

.chat-bubble--user {
  align-self: flex-end;
  background: #dcf8c6;
  border: 1px solid #b8e0a8;
  border-bottom-right-radius: 4px;
}

.chat-bubble--mockup {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.75rem 0.75rem 1rem;
  margin-bottom: 0.35rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: visible;
  box-sizing: border-box;
  scroll-margin-bottom: 1.5rem;
}

.chat-bubble--mockup-latest {
  border-color: #99f6e4;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.chat-mockup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-mockup-round {
  font-size: 0.72rem;
  font-weight: 600;
  color: #0f766e;
  background: #ecfdf5;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.chat-mockup-image-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: visible;
}

.chat-mockup-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(58vh, 560px);
  object-fit: contain;
  border-radius: 12px;
  background: #f1f5f9;
}

.chat-mockup-note {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #64748b;
}

.chat-mockup-refine {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.chat-mockup-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: min(100%, 720px);
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.chat-mockup-image-wrap .chat-mockup-image {
  width: 100%;
  height: auto;
  max-height: min(72vh, 680px);
  object-fit: contain;
  display: block;
  background: #fff;
}

.chat-mockup-image-wrap .ai-design-markup-layer:not(.hidden) {
  pointer-events: auto;
}

.chat-mockup-markup-list {
  margin: 0;
}

/* Canvas annotations — draw on the same chat mockup preview */
.chat-bubble--annotating .chat-mockup-image-btn--annotate {
  display: block;
  width: 100%;
  max-width: min(100%, 720px);
  margin: 0.35rem 0 0;
  padding: 0;
  border: 2px solid #93c5fd;
  border-radius: 12px;
  background: #fff;
  cursor: crosshair;
  overflow: hidden;
  line-height: 0;
}

.chat-bubble--annotating .chat-mockup-image-btn--annotate:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.chat-mockup-annotate-overlay-wrap {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
}

.chat-mockup-annotate-overlay-wrap .chat-mockup-annotate-canvas,
.chat-mockup-annotate-overlay-wrap .ai-design-annotate-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(72vh, 680px);
  touch-action: none;
  cursor: crosshair;
}

.ai-annotate-toolbar--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  width: 100%;
  max-width: min(100%, 720px);
  margin: 0.5rem 0 0.35rem;
  padding: 0.45rem 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-sizing: border-box;
}

.chat-mockup-refine--form {
  margin-top: 0.5rem;
}

/* Fallback when bubble preview is not in DOM */
.chat-mockup-annotate-wrap--fallback {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: min(100%, 720px);
  margin: 0 0 0.75rem;
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-sizing: border-box;
}

.chat-mockup-annotate-stage--fallback {
  width: 100%;
  min-height: 200px;
  max-height: min(72vh, 680px);
}

.ai-annotate-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.25rem;
}

.ai-annotate-tool,
.ai-annotate-stamp-btn,
.ai-annotate-color {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 6px;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: #0f172a;
}

.ai-annotate-tool.active,
.ai-annotate-stamp-btn.active,
.ai-annotate-color.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.ai-annotate-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ai-annotate-color {
  width: 1.6rem;
  min-width: 1.6rem;
  padding: 0;
}

.ai-annotate-size {
  width: 4.5rem;
  vertical-align: middle;
}

.ai-annotate-stamps {
  display: flex;
  gap: 0.2rem;
}

.ai-design-annotate-stage,
.chat-mockup-annotate-stage {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.ai-design-annotate-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: min(72vh, 680px);
  touch-action: none;
  cursor: crosshair;
}

.ai-annotate-text-input {
  position: absolute;
  z-index: 5;
  min-width: 8rem;
  max-width: 90%;
  padding: 0.25rem 0.4rem;
  border: 2px solid #2563eb;
  border-radius: 4px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.95);
}

.ai-annotate-clear-btn {
  font-size: 0.75rem;
}

.ai-annotate-logo-btn {
  font-size: 0.75rem;
  font-weight: 600;
}

.chat-mockup-refine-intro,
.chat-mockup-refine-hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #64748b;
}

.chat-mockup-refine-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-mockup-refine-label--secondary {
  margin-top: 0.15rem;
}

.chat-mockup-refine-input,
.chat-mockup-refine-visible {
  width: 100%;
}

.chat-mockup-refine-btn {
  align-self: flex-start;
  width: auto;
  min-width: 10rem;
}

.chat-mockup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.chat-mockup-review-prompt {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.chat-mockup-review-actions {
  margin-top: 0.25rem;
}

.chat-bubble--mockup-latest .chat-mockup-review-prompt {
  margin-top: 0.65rem;
}

.chat-bubble--mockup-latest .chat-mockup-review-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.chat-bubble--mockup-latest .chat-mockup-review-actions .chat-action-btn {
  width: 100%;
  justify-content: center;
}

.chat-mockup-actions .btn-secondary {
  width: auto;
  flex: 0 0 auto;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

.chat-bubble--has-image {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.45rem;
  max-width: min(92%, 280px);
}

.chat-bubble--user.chat-bubble--has-image {
  background: #fff;
  border-color: #cfe8c4;
  align-self: flex-end;
}

.chat-bubble--library-pick {
  max-width: 100%;
  min-width: 0;
}

.chat-bubble-image--library {
  max-height: min(42vh, 340px);
  cursor: zoom-in;
}

.chat-bubble-image {
  display: block;
  width: 100%;
  max-height: min(240px, 42vh);
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.chat-bubble-caption {
  display: block;
  font-size: 0.78rem;
  line-height: 1.3;
  color: #334155;
  word-break: break-all;
  padding: 0 0.15rem 0.1rem;
}

.chat-bubble--system {
  align-self: center;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.chat-bubble--system.chat-bubble--loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid #cbd5e1;
  border-top-color: #334155;
  border-radius: 50%;
  animation: chat-loading-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes chat-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.chat-actions {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 92%;
  margin: 0.15rem 0 0.35rem;
  padding: 0 0.15rem;
}

.chat-actions-panel {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0.15rem 0 0.35rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  animation: chat-action-in 0.4s ease-out both;
  overflow: visible;
  box-sizing: border-box;
}

.chat-actions-panel--text {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-actions-panel--choices {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-readability-hint {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #475569;
}

.chat-actions-panel--references {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-reference-hint {
  margin: 0;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.45;
}

.chat-reference-status {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}

.chat-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.65rem;
}

.chat-reference-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.45rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.chat-reference-tile:hover {
  border-color: #94a3b8;
  background: #fff;
}

.chat-reference-tile.is-selected {
  border-color: #0f766e;
  background: #ecfdf5;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.25);
}

.chat-reference-thumb-wrap {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #fff;
}

.chat-reference-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-reference-badge {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}

.chat-reference-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.chat-reference-sublabel {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.3;
}

.chat-actions-panel--library .chat-reference-grid {
  grid-template-columns: 1fr;
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.chat-actions-panel--library .chat-reference-tile {
  padding: 0.75rem;
  cursor: pointer;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.chat-actions-panel--library .chat-reference-thumb-wrap {
  aspect-ratio: auto;
  width: 100%;
  min-height: min(28vh, 220px);
}

.chat-actions-panel--library .chat-reference-thumb {
  width: 100%;
  height: auto;
  min-height: min(28vh, 220px);
  max-height: min(72vh, 640px);
  object-fit: contain;
  background: #fff;
}

.chat-actions-panel--library .chat-reference-label {
  font-size: 0.9rem;
}

.chat-actions-panel--library .chat-reference-sublabel {
  font-size: 0.8rem;
}

.chat-library-show-more-btn:not(:disabled) {
  flex: 0 0 auto;
}

.chat-reference-tile-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
}

.chat-reference-fullsize-btn {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 2;
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  cursor: pointer;
}

.chat-reference-fullsize-btn:hover {
  background: #fff;
  color: #0f766e;
}

.chat-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0.62rem 1.2rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 1px 2px rgba(15, 23, 42, 0.14),
    0 4px 10px rgba(15, 23, 42, 0.16),
    0 10px 22px rgba(15, 23, 42, 0.1);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  animation: chat-action-in 0.42s ease-out both;
}

.chat-action-btn:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
  filter: none;
}

.chat-action-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.chat-action-btn__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chat-action-btn__label {
  position: relative;
  top: 0.5px;
}

.chat-action-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.chat-action-btn:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

.chat-action-btn--primary {
  background: linear-gradient(180deg, #6fbf5c 0%, var(--ss-green, #5ba54a) 52%, #4a9238 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 2px 0 rgba(58, 120, 46, 0.55),
    0 4px 12px rgba(58, 120, 46, 0.28),
    0 12px 24px rgba(15, 23, 42, 0.12);
}

.chat-action-btn--primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 3px 0 rgba(58, 120, 46, 0.5),
    0 6px 16px rgba(58, 120, 46, 0.32),
    0 16px 28px rgba(15, 23, 42, 0.14);
}

.chat-action-btn--primary:active {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(58, 120, 46, 0.45),
    0 2px 6px rgba(58, 120, 46, 0.2);
}

.chat-action-btn--secondary {
  background: linear-gradient(180deg, #fce878 0%, var(--ss-yellow, #f8d749) 55%, #e3c33a 100%);
  color: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 2px 0 rgba(180, 145, 20, 0.45),
    0 4px 12px rgba(180, 145, 20, 0.22),
    0 10px 20px rgba(15, 23, 42, 0.08);
}

.chat-action-btn--secondary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 3px 0 rgba(180, 145, 20, 0.42),
    0 6px 16px rgba(180, 145, 20, 0.28),
    0 14px 24px rgba(15, 23, 42, 0.1);
}

.chat-action-btn--secondary:active {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.12),
    0 1px 0 rgba(180, 145, 20, 0.4),
    0 2px 6px rgba(180, 145, 20, 0.16);
}

.chat-action-btn--generate {
  background: linear-gradient(180deg, #6fbf5c 0%, var(--ss-green, #5ba54a) 52%, #4a9238 100%);
  color: #fff;
  padding: 0.72rem 1.4rem;
  font-size: 0.95rem;
  animation: chat-action-in 0.42s ease-out both, chat-action-pulse 2.2s ease-in-out 0.55s infinite;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 2px 0 rgba(58, 120, 46, 0.55),
    0 4px 12px rgba(58, 120, 46, 0.28),
    0 12px 24px rgba(15, 23, 42, 0.12);
}

.chat-action-btn--generate:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 3px 0 rgba(58, 120, 46, 0.5),
    0 6px 16px rgba(58, 120, 46, 0.32),
    0 16px 28px rgba(15, 23, 42, 0.14);
}

.chat-actions-panel--logo {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-actions-panel--scroll-foot {
  gap: 0;
  min-height: auto;
  max-height: none;
  overflow: visible;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.chat-actions-panel--scroll-foot > .chat-actions-panel__body {
  flex: none;
  min-height: auto;
  overflow: visible;
  overflow-x: hidden;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-actions-panel--scroll-foot > .chat-actions--panel-footer {
  flex-shrink: 0;
  margin: 0;
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.04);
}

.chat-logo-scrape-or {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.chat-logo-either-or-hint {
  margin: 0;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.chat-logo-source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.chat-logo-source-or {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  align-self: center;
}

.chat-logo-source-column {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-logo-source-column--active {
  border-color: #0f766e;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.chat-logo-source-column__title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.chat-logo-source-column .chat-actions {
  margin: 0;
  padding: 0;
}

.chat-logo-source-column .chat-action-btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 760px) {
  .chat-logo-source-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .chat-logo-source-or {
    padding: 0.15rem 0;
    justify-self: center;
  }
}

.chat-logo-scrape {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.chat-logo-scrape-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.chat-logo-scrape-hint {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.chat-logo-scrape-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.chat-logo-scrape-input:focus {
  outline: 2px solid rgba(91, 165, 74, 0.35);
  border-color: #5ba54a;
}

.chat-logo-scrape-status {
  min-height: 1.2rem;
  font-size: 0.8rem;
  color: #64748b;
}

.chat-logo-scrape-status--success {
  color: #15803d;
}

.chat-logo-scrape-status--error {
  color: #b91c1c;
}

.chat-logo-scrape-grid-title {
  margin: 0.35rem 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

.chat-logo-scrape-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.5rem;
  max-height: 12rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.15rem;
  overscroll-behavior: contain;
}

.chat-logo-scrape-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: 0.45rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 2px 6px rgba(15, 23, 42, 0.08);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  animation: chat-action-in 0.35s ease-out both;
}

.chat-logo-scrape-tile:hover {
  border-color: #5ba54a;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 4px 12px rgba(91, 165, 74, 0.18);
}

.chat-logo-scrape-tile img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.chat-logo-scrape-tile--selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.chat-ai-logo-selected {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #166534;
}

.chat-ai-context-input {
  min-height: 5rem;
}

.chat-actions-panel--ai-start {
  gap: 0.65rem;
}

.chat-actions-panel--multi {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-multi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chat-actions--mode {
  flex-direction: column;
  align-items: stretch;
  max-width: 100%;
}

.chat-mode-select {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: none;
}

.chat-mode-select__hint {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #64748b;
}

.chat-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.chat-mode-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.chat-mode-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.chat-freedom-select {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
}

.chat-freedom-select__hint {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.45;
}

.chat-freedom-select__label {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.chat-freedom-select__summary {
  margin: 0;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.45;
}

.chat-freedom-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.5rem 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.chat-freedom-slider {
  width: 100%;
  accent-color: #0f766e;
  cursor: pointer;
}

.chat-freedom-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 0.15rem;
}

.chat-freedom-tick {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  min-width: 1.25rem;
  text-align: center;
}

.chat-freedom-tick.is-active {
  color: #0f766e;
  font-weight: 700;
}

.chat-mode-card--featured {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
}

.chat-mode-card__visual {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0;
  overflow: hidden;
  background: #e2e8f0;
}

.chat-mode-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-mode-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 0.55rem 0.65rem;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.02) 0%,
    rgba(15, 23, 42, 0.35) 55%,
    rgba(15, 23, 42, 0.72) 100%
  );
  pointer-events: none;
}

.chat-mode-card__tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.chat-mode-card__title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.4);
}

.chat-mode-card__subtitle {
  margin: 0;
  padding: 0.55rem 0.65rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #334155;
  background: #fff;
}

@media (max-width: 760px) {
  .chat-mode-grid {
    grid-template-columns: 1fr;
  }
}

.chat-actions--mode .chat-action-btn {
  width: 100%;
  justify-content: center;
}

.chat-action-btn--file {
  cursor: pointer;
}

.chat-action-btn--file input {
  display: none;
}

@keyframes chat-action-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chat-action-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.42),
      0 2px 0 rgba(58, 120, 46, 0.55),
      0 4px 12px rgba(58, 120, 46, 0.24),
      0 10px 20px rgba(15, 23, 42, 0.1);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.48),
      0 3px 0 rgba(58, 120, 46, 0.5),
      0 8px 20px rgba(58, 120, 46, 0.36),
      0 18px 32px rgba(15, 23, 42, 0.14);
  }
}

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.chat-chip {
  border: 1px solid #94a3b8;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.chat-chip:hover {
  border-color: #0f766e;
  background: #f0fdfa;
}

.chat-yarn-colors-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.chat-yarn-colors-hint {
  margin: 0;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.45;
}

.chat-yarn-colors-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
}

@media (max-width: 640px) {
  .chat-yarn-colors-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.chat-yarn-color-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.45rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  min-width: 0;
}

.chat-yarn-color-card--active {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

.chat-yarn-color-card--empty .chat-yarn-color-card__swatch {
  background: repeating-linear-gradient(
    45deg,
    #f1f5f9,
    #f1f5f9 6px,
    #e2e8f0 6px,
    #e2e8f0 12px
  );
}

.chat-yarn-color-card__swatch {
  display: block;
  width: 100%;
  aspect-ratio: 1.1;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.chat-yarn-color-card__zone {
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.chat-yarn-color-card__name {
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.3;
  word-break: break-word;
}

.chat-yarn-colors-zone-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.chat-yarn-colors-picker {
  width: 100%;
}

.chat-bubble--yarn-colors {
  max-width: 100%;
  width: 100%;
}

.chat-yarn-colors-bubble-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.chat-actions-panel--yarn-colors {
  max-width: 100%;
  overflow: visible;
}

.ai-design-chat-step .chat-actions-panel--yarn-colors {
  overflow: visible;
  max-height: none;
}

.chat-swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
}

.chat-swatch {
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0.25rem;
  background: #fff;
  cursor: pointer;
  text-align: center;
  font-size: 0.65rem;
}

.chat-swatch:hover,
.chat-swatch.selected {
  border-color: #0f766e;
}

.chat-swatch-color {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.chat-upload-btn {
  display: inline-block;
  margin-top: 0.5rem;
  cursor: pointer;
}

.chat-text-input {
  width: 100%;
  min-height: 72px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  resize: vertical;
}

.ai-design-preview {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0.65rem;
  background: #fff;
  min-height: auto;
  height: auto;
  overflow: visible;
}

.ai-design-layout--refinement .ai-design-thumbs {
  display: flex;
}

.ai-design-thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: visible;
  padding-bottom: 0.25rem;
  min-height: auto;
  flex: 0 0 auto;
}

.ai-design-thumb {
  flex: 0 0 auto;
  width: 100%;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.35rem;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-design-thumb:hover {
  border-color: #94a3b8;
}

.ai-design-thumb.active {
  border-color: #0f766e;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.25);
}

.ai-design-thumb img {
  width: 100%;
  aspect-ratio: 2 / 1;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
  background: #fff;
}

.ai-design-thumb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.7rem;
}

.ai-design-sidebar .ai-design-markup-panel,
.ai-design-sidebar .ai-design-refinement,
.ai-design-sidebar .ai-design-final-brief {
  margin-top: 0;
}

.ai-design-layout--refinement .ai-design-thumb {
  padding: 0.35rem;
}

.ai-design-layout--refinement .ai-design-thumb img {
  max-height: none;
  object-fit: contain;
  background: #fff;
}

.ai-design-selection-rail {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.4rem 0.3rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  align-self: stretch;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ai-design-rounds-rail {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.ai-design-rounds-rail:empty,
.ai-design-rounds-rail:not(:has(.ai-design-thumb)) {
  display: none;
}

.ai-design-selection-rail .ai-design-thumbs {
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
}

.ai-design-selection-block,
.ai-design-selected-strip.ai-design-selection-block {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.ai-design-selection-block.hidden {
  display: none !important;
}

.ai-design-selected-strip-label {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.25;
  hyphens: auto;
}

.ai-design-selection-rail .ai-design-selected-grid,
.ai-design-selected-grid {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: stretch;
}

.ai-design-selection-rail .ai-design-selected-item,
.ai-design-selected-item {
  flex: 0 0 auto;
  width: 100%;
  padding: 0.15rem;
  border: 2px solid #0f766e;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  line-height: 0;
}

.ai-design-selected-item:hover {
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.35);
}

.ai-design-selected-item img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.ai-design-layout--refinement .ai-design-asset-rail-main {
  display: none !important;
}

.ai-design-layout--refinement .ai-design-asset-rail-body {
  flex: 1 1 auto;
  min-height: 0;
}

.ai-design-selected-empty {
  margin: 0;
  font-size: 0.62rem;
  color: #94a3b8;
  line-height: 1.3;
}

.ai-design-rail-completion {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
  padding: 0.75rem 0 0;
  border-top: 1px solid #e2e8f0;
  scroll-margin-bottom: max(2rem, 10vh);
}

.ai-design-rail-completion.hidden {
  display: none !important;
}

.ai-design-rail-final-brief {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ai-design-rail-final-brief.hidden {
  display: none !important;
}

.ai-design-rail-final-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.ai-design-rail-final-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.ai-design-rail-final-comments {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  font-size: 0.8rem;
}

.ai-design-rail-rounds {
  margin: 0;
  font-size: 0.62rem;
  color: #64748b;
  line-height: 1.35;
  text-align: center;
}

.ai-design-rail-continue-btn {
  width: 100%;
  flex-shrink: 0;
}

.ai-design-layout--refinement .ai-design-selection-rail {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: none;
  padding-bottom: max(2rem, 10vh);
  -webkit-overflow-scrolling: touch;
}

.ai-design-main-preview {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  overflow: hidden;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 0.5rem;
  background: #f8fafc;
  gap: 0.45rem;
}

.ai-design-preview-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: auto;
  overflow-x: hidden;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.ai-design-main-preview--refinement .ai-design-preview-viewport {
  flex: 1 1 0;
  min-height: min(320px, 42vh);
  max-height: none;
}

.ai-design-preview-viewport:has(.ai-design-preview-empty:not(.hidden)) {
  justify-content: center;
}

.ai-design-preview-controls {
  flex: 0 0 auto;
  width: 100%;
  max-width: 42rem;
  align-self: center;
}

.ai-design-main-preview.is-generating {
  opacity: 0.72;
}

.ai-design-preview-viewport .ai-design-preview-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(248, 250, 252, 0.88);
  color: #0f172a;
  font-weight: 600;
  text-align: center;
  z-index: 2;
  pointer-events: none;
}

.ai-design-preview-status.hidden {
  display: none;
}

.ai-design-preview-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  line-height: 0;
}

.ai-design-preview-image-wrap.hidden {
  display: none;
}

.ai-design-preview-image-wrap img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(62vh, 680px);
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.ai-design-layout--refinement .ai-design-preview-image-wrap img {
  max-height: min(calc(100vh - 11rem), 820px);
}

.ai-design-markup-layer {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
}

.ai-design-markup-layer:not(.hidden) {
  pointer-events: auto;
}

.ai-design-markup-layer--draw {
  cursor: crosshair;
}

.ai-design-preview-image-wrap--draw img {
  user-select: none;
}

.ai-design-markup-rect {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #0d9488;
  background: rgba(13, 148, 136, 0.12);
  border-radius: 4px;
  pointer-events: none;
}

.ai-design-markup-rect--draft {
  border-style: dashed;
  background: rgba(13, 148, 136, 0.2);
}

.ai-design-markup-rect-label {
  position: absolute;
  top: -1px;
  left: -1px;
  min-width: 1.1rem;
  padding: 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: #0d9488;
  border-radius: 4px 0 4px 0;
}

.ai-design-markup-panel {
  width: 100%;
}

.ai-design-markup-panel.hidden {
  display: none;
}

.ai-design-markup-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.ai-design-markup-toolbar-hint {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.ai-design-markup-draw-btn.active {
  border-color: #0d9488;
  background: #ccfbf1;
  color: #0f766e;
}

.ai-design-markup-empty {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.ai-design-markup-item {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.ai-design-markup-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

.ai-design-markup-delete {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.ai-design-markup-comment {
  width: 100%;
  min-height: 2.5rem;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.4;
  pointer-events: auto;
  user-select: text;
  cursor: text;
}

.ai-design-markup-comment:focus {
  outline: 2px solid #0d9488;
  outline-offset: 1px;
  border-color: #0d9488;
}

.ai-design-preview-empty {
  color: #64748b;
  text-align: center;
  max-width: 100%;
  font-size: 0.78rem;
  padding: 0.5rem;
}

.ai-design-asset-rail .ai-design-disclaimer,
.ai-design-asset-rail .ai-design-preview-footer {
  flex-shrink: 0;
}

.ai-design-wizard-id {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.45rem 0.5rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.68rem;
  color: #64748b;
}

.ai-design-wizard-id.hidden {
  display: none !important;
}

.ai-design-wizard-id__label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.62rem;
  color: #475569;
}

.ai-design-wizard-id__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0f172a;
  word-break: break-all;
  line-height: 1.35;
}

.ai-design-selection-rail > .ai-design-disclaimer {
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-top: 0;
  order: 0;
  padding: 0.55rem 0.6rem;
  font-size: 0.72rem;
  line-height: 1.4;
  border-radius: 8px;
  overflow-wrap: break-word;
  word-break: normal;
}

.ai-design-selection-rail > .ai-design-disclaimer strong {
  font-size: 0.74rem;
  margin-bottom: 0.35rem;
}

.ai-design-selection-rail > .ai-design-disclaimer p {
  margin: 0 0 0.35rem;
}

.ai-design-selection-rail > .ai-design-disclaimer p:last-child {
  margin-bottom: 0;
}

.ai-design-asset-rail > .ai-design-disclaimer {
  display: none;
}

.ai-design-asset-rail .ai-design-preview-footer {
  display: none;
}

.ai-design-asset-rail .ai-design-preview-footer:has(.btn-primary:not(.hidden)) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.ai-design-asset-rail .ai-design-preview-footer .btn-primary {
  width: 100%;
}

.ai-design-main-preview .ai-design-preview-image-wrap img,
.ai-design-layout--refinement .ai-design-preview-image-wrap img {
  max-height: min(28vh, 220px);
  cursor: zoom-in;
}

.ai-design-preview-actions {
  display: flex;
  flex-shrink: 0;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.25rem 0 0;
}

.ai-design-preview-actions .btn-secondary {
  width: auto;
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
}

.ai-design-main-preview > .ai-design-preview-actions {
  margin-top: 0;
}

.ai-design-layout--refinement .ai-design-selection-rail > .ai-design-disclaimer {
  font-size: 0.7rem;
}

.ai-design-refinement {
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ai-design-refinement-intro {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #334155;
}

.ai-design-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
}

.ai-design-field-group--instruction {
  background: #fff;
  border-color: #cbd5e1;
}

.ai-design-field-group--visible-text {
  background: #f0fdf4;
  border-color: #86efac;
}

.ai-design-field-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.ai-design-field-group--visible-text .ai-design-field-label {
  color: #14532d;
}

.ai-design-field-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #64748b;
}

.ai-design-field-group--visible-text .ai-design-field-hint {
  color: #166534;
}

.ai-design-refinement-visible-input {
  min-height: 2.75rem;
  font-weight: 600;
}

.chat-visible-text-hint {
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
}

.chat-actions-panel--text .chat-text-input {
  border-color: #86efac;
}

.ai-design-final-brief {
  margin-top: 0;
  padding: 1.25rem 1.25rem 0;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
  scroll-margin-bottom: 2rem;
  box-sizing: border-box;
}

.ai-design-layout--refinement .ai-design-final-brief:not(.hidden),
.ai-design-layout--refinement .ai-design-chat-footer:not(.hidden) {
  position: relative;
  z-index: 2;
}

.ai-design-layout--final-design .ai-design-chat-panel,
.ai-design-layout--refinement.ai-design-layout--final-design .ai-design-chat-panel {
  overflow: visible;
  max-height: none;
  min-height: auto;
}

.ai-design-layout--final-design #ai-design-chat-scroll,
.ai-design-layout--refinement.ai-design-layout--final-design #ai-design-chat-scroll {
  flex: 0 1 auto;
  max-height: none;
  overflow: visible;
  min-height: auto;
  padding-bottom: max(3rem, 10vh);
}

.ai-design-layout--final-design .ai-design-chat-stream,
.ai-design-layout--refinement.ai-design-layout--final-design .ai-design-chat-stream {
  padding-bottom: 1.25rem;
}

.ai-design-layout--final-design .ai-design-chat-footer:not(.hidden) {
  scroll-margin-bottom: max(4rem, 20vh);
  padding: 1rem 1.25rem max(2rem, calc(1.25rem + env(safe-area-inset-bottom, 0px)));
}

.ai-design-layout--refinement .ai-design-chat-footer:not(.hidden) {
  scroll-margin-bottom: max(3rem, 16vh);
  padding: 1rem 1.25rem max(1.75rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
}

.ai-design-layout--final-design .ai-design-final-brief:not(.hidden) {
  scroll-margin-bottom: 1.5rem;
  padding: 1.25rem 1.25rem 0;
}

.ai-design-layout--final-design .ai-design-final-comments-input {
  min-height: 5.5rem;
}

.ai-design-final-brief-title {
  margin: 0;
  padding: 0 0.1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.ai-design-refinement-continue-btn {
  display: none !important;
}

.ai-design-refinement-continue-hint {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #475569;
}

.ai-design-final-continue-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #475569;
}

.ai-design-final-brief-label {
  display: block;
  margin: 0.1rem 0 0;
  padding: 0 0.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.ai-design-final-brief-label--secondary {
  margin-top: 0.35rem;
  font-weight: 600;
  color: #334155;
}

.ai-design-final-brief-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #475569;
}

.ai-design-final-comments-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 3.5rem;
  margin: 0.15rem 0 0;
  padding: 0.75rem 0.85rem;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  line-height: 1.45;
}

.ai-design-final-comments-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.ai-design-final-brief-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.25rem -0.05rem 0;
  padding: 1rem 0.1rem 1.25rem;
  border-top: 1px solid rgba(191, 219, 254, 0.9);
  flex-shrink: 0;
}

.ai-design-final-brief-rounds {
  margin: 0;
  padding: 0 0.15rem;
  font-size: 0.8rem;
  color: #475569;
  text-align: center;
  line-height: 1.45;
}

.ai-design-final-brief-continue-btn {
  width: 100%;
  margin: 0;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.ai-design-final-brief:not(.hidden) .ai-design-final-brief-continue-btn:not(.hidden) {
  display: inline-flex;
  visibility: visible;
}

.ai-design-final-brief:not(.hidden) .ai-design-final-brief-continue-btn {
  display: inline-flex;
  visibility: visible;
}

.ai-design-refinement-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.ai-design-refinement-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.ai-design-refinement-input {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  line-height: 1.45;
}

.ai-design-refinement-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ai-design-refinement .btn-primary:disabled {
  opacity: 0.72;
  cursor: wait;
}

.ai-design-disclaimer {
  flex-shrink: 0;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #9a3412;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-design-disclaimer strong {
  display: block;
  margin-bottom: 0.45rem;
}

.ai-design-disclaimer p {
  margin: 0 0 0.65rem;
}

.ai-design-disclaimer p:last-child {
  margin-bottom: 0;
}

.ai-design-preview-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ai-design-rounds {
  flex: 1;
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
}

.btn-primary,
.btn-secondary {
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font: inherit;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: #0f766e;
  color: #fff;
}

.btn-primary:disabled {
  cursor: not-allowed;
}

.ai-design-chat-footer .btn-primary:disabled,
.ai-design-final-brief-continue-btn:disabled,
.ai-design-rail-continue-btn:disabled {
  opacity: 1;
}

.btn-secondary {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  text-decoration: none;
}

.ai-design-lightbox {
  border: none;
  padding: 0;
  max-width: 96vw;
  max-height: 96vh;
  width: auto;
  background: transparent;
  overflow: visible;
}

.ai-design-lightbox::backdrop {
  background: rgba(15, 23, 42, 0.88);
  cursor: zoom-out;
}

.ai-design-lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  display: block;
}

.ai-design-lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  background: #fff;
  border: none;
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .ai-design-page {
    min-height: 100dvh;
  }

  .ai-design-layout,
  .ai-design-layout--refinement {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .ai-design-sidebar,
  .ai-design-main {
    border: none;
    max-height: none;
  }

  .ai-design-asset-rail {
    border: 1px solid #e2e8f0;
    max-height: none;
  }

  .ai-design-asset-rail-body {
    flex-direction: column;
  }

  .ai-design-selection-rail {
    position: static;
    max-height: none;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow: visible;
  }

  .ai-design-selection-rail .ai-design-selected-grid,
  .ai-design-selected-grid {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .ai-design-selection-rail .ai-design-selected-item,
  .ai-design-selected-item {
    width: 100%;
  }

  .ai-design-selection-rail .ai-design-thumbs,
  .ai-design-thumbs {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow: visible;
    max-height: none;
  }

  .ai-design-thumb {
    width: 100%;
  }

  .chat-mockup-image {
    max-height: min(42vh, 360px);
  }
}

.ai-design-chat-stream > .ai-design-mockup-dock:not(.hidden) {
  border-top: none;
  box-shadow: none;
  padding-top: 0.15rem;
}

.chat-mockup-interaction .chat-mockup-review-prompt {
  margin-top: 0.35rem;
}

.chat-mockup-interaction .chat-mockup-review-actions {
  margin-top: 0.35rem;
}

/* Wizard embed loads this sheet last — keep chat log from ever clipping. */
body.wizard-ai-design-active .ai-design-layout,
body.wizard-ai-design-active .ai-design-layout > .ai-design-sidebar,
body.wizard-ai-design-active .ai-design-layout > .ai-design-main,
body.wizard-ai-design-active .ai-design-sidebar,
body.wizard-ai-design-active .ai-design-main,
body.wizard-ai-design-active .ai-design-chat-panel,
body.wizard-ai-design-active .ai-design-chat-stream,
body.wizard-ai-design-active .ai-design-chat-step,
body.wizard-ai-design-active .ai-design-chat-messages,
body.wizard-ai-design-active .ai-design-mockup-dock,
body.wizard-ai-design-active .chat-mockup-interaction,
body.wizard-ai-design-active .ai-design-chat-footer,
body.wizard-ai-design-active .ai-design-final-brief {
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  min-height: 0;
  flex: none !important;
}

body.wizard-ai-design-active #ai-design-chat-scroll,
body.wizard-ai-design-active .ai-design-accordion-body--chat {
  overflow-x: hidden !important;
  overflow-y: visible !important;
  max-height: none !important;
  flex: none !important;
  height: auto !important;
  padding-bottom: max(3rem, 10vh);
}

body.wizard-ai-design-active .ai-design-layout--final-design .ai-design-chat-stream {
  padding-bottom: 1rem !important;
}

/* Wizard embed: keep submit + final comments visible — no huge scroll gap */
body.wizard-ai-design-active .ai-design-chat-stream:has(.ai-design-final-brief:not(.hidden)) .ai-design-completion-spacer,
body.wizard-ai-design-active .ai-design-chat-stream:has(.ai-design-chat-footer:not(.hidden)) .ai-design-completion-spacer {
  height: 0 !important;
  min-height: 0 !important;
}

body.wizard-ai-design-active .ai-design-final-brief:not(.hidden) {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin-top: 0.75rem;
  padding: 1.25rem 1.25rem 0 !important;
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.12);
  scroll-margin-bottom: 5rem;
}

body.wizard-ai-design-active .ai-design-final-brief:not(.hidden) .ai-design-final-brief-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 0.35rem;
  padding: 1rem 0.1rem max(1.25rem, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(
    180deg,
    rgba(239, 246, 255, 0.92) 0%,
    #eff6ff 28%
  );
}

body.wizard-ai-design-active .ai-design-final-brief:not(.hidden) .ai-design-final-brief-continue-btn {
  width: 100%;
  flex-shrink: 0;
}

/* Wizard embed: beat global `button` / `textarea` resets inside the light final-brief card */
body.wizard-ai-design-active .ai-design-final-brief textarea.ai-design-final-comments-input {
  background: #fff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.wizard-ai-design-active .ai-design-final-brief textarea.ai-design-final-comments-input::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

body.wizard-ai-design-active .ai-design-final-brief-continue-btn.btn-primary:not(:disabled),
body.wizard-ai-design-active .ai-design-chat-footer .btn-primary:not(:disabled),
body.wizard-ai-design-active .ai-design-rail-continue-btn.btn-primary:not(:disabled) {
  background: var(
    --ss-btn-primary-gradient,
    linear-gradient(128deg, #08cf6f 0%, #16c578 44%, #23aa68 100%)
  ) !important;
  color: var(--ss-text-inverse, #fff) !important;
  -webkit-text-fill-color: currentColor;
  border: 1px solid rgba(26, 110, 72, 0.42) !important;
  box-shadow: var(--ss-btn-primary-shadow, 0 4px 14px rgba(8, 207, 111, 0.26)) !important;
}

body.wizard-ai-design-active .ai-design-chat-footer:not(.hidden) {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin-top: 0.75rem;
  scroll-margin-bottom: 5rem;
}

body.wizard-ai-design-active .ai-design-rail-completion:not(.hidden) {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 0.5rem;
  padding: 0.75rem 0 max(0.5rem, env(safe-area-inset-bottom, 0px));
  background: #fff;
  box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.1);
  scroll-margin-bottom: 4rem;
}

body.wizard-ai-design-active .ai-design-rail-completion:not(.hidden) .ai-design-rail-continue-btn {
  width: 100%;
}

body.wizard-ai-design-active .ai-design-layout--side-rail-visible .ai-design-selection-rail {
  padding-bottom: 0.5rem;
}

/* —— On-screen KI debug panel —— */
.ai-design-debug-panel {
  position: fixed;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 1200;
  width: min(440px, calc(100vw - 1.5rem));
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.ai-design-debug-panel.is-hidden {
  display: none;
}

.ai-design-debug-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.ai-design-debug-panel__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
}

.ai-design-debug-panel__actions {
  display: flex;
  gap: 0.35rem;
}

.ai-design-debug-btn {
  appearance: none;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.ai-design-debug-btn:hover {
  background: #334155;
}

.ai-design-debug-log {
  overflow: auto;
  padding: 0.45rem;
  flex: 1 1 auto;
  min-height: 120px;
}

.ai-design-debug-empty {
  margin: 0.5rem;
  color: #94a3b8;
  font-size: 11px;
}

.ai-design-debug-entry {
  margin-bottom: 0.45rem;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #1e293b;
}

.ai-design-debug-entry__summary {
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  font-weight: 600;
  color: #7dd3fc;
  list-style: none;
}

.ai-design-debug-entry__summary::-webkit-details-marker {
  display: none;
}

.ai-design-debug-entry__body {
  padding: 0 0.45rem 0.45rem;
}

.ai-design-debug-section-title {
  margin: 0.35rem 0 0.15rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.ai-design-debug-pre {
  margin: 0;
  padding: 0.4rem;
  background: #0b1220;
  border-radius: 4px;
  overflow: auto;
  max-height: 200px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cbd5e1;
}

.ai-design-debug-pre--prompt {
  max-height: 280px;
  font-size: 10px;
}

.ai-design-debug-warnings {
  margin: 0.35rem 0;
  padding: 0.35rem 0.45rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 4px;
}

.ai-design-debug-warnings p {
  margin: 0.2rem 0;
  color: #fecaca;
  font-size: 10px;
}

.ai-design-debug-info {
  margin: 0.35rem 0;
  padding: 0.35rem 0.45rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 4px;
}

.ai-design-debug-info p {
  margin: 0.2rem 0;
  color: #bae6fd;
  font-size: 10px;
}

.ai-design-debug-entry--mockup {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.ai-design-debug-entry--mockup .ai-design-debug-entry__summary {
  color: #fde68a;
}

.ai-design-debug-attach-line {
  margin: 0.15rem 0 0.15rem 0.5rem;
  color: #a5f3fc;
  font-size: 10px;
  word-break: break-all;
}

.ai-design-debug-toggle {
  font-size: 0.8125rem;
}

@media (max-width: 720px) {
  .ai-design-debug-panel {
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    max-height: 50vh;
  }
}
