.root {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
  gap: var(--space-5);
}

.sourcePanel,
.resultPanel {
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 20% 0%, rgba(124, 58, 237, 0.16), transparent 38%),
    rgba(255, 255, 255, 0.04);
  box-shadow: var(--glass-shadow);
}

.sourcePanel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
}

.resultPanel {
  min-height: 520px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

.panelHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.panelHeader h3 {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xl);
  color: var(--color-text-primary);
}

.eyebrow {
  font-size: 10px;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-violet-light);
  font-weight: var(--font-semibold);
}

.healthOk,
.healthWarn {
  max-width: 220px;
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
}

.healthOk { color: var(--color-green); }
.healthWarn { color: var(--color-amber); }

.uploadFrame {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text-secondary);
  overflow: hidden;
  cursor: pointer;
}

.uploadFrame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.uploadEmpty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.fileInput { display: none; }

.roomGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.roomButton,
.roomActive {
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.035);
  color: var(--color-text-secondary);
  padding: var(--space-3);
  font-size: var(--text-sm);
  cursor: pointer;
}

.roomActive {
  color: var(--color-text-primary);
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

.promptLabel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 10px;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  font-weight: var(--font-semibold);
}

.promptLabel textarea {
  min-height: 108px;
  resize: vertical;
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-primary);
  padding: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.6;
  outline: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: var(--font-normal);
}

.promptLabel textarea:focus {
  border-color: rgba(124, 58, 237, 0.44);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

.generateButton {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  padding: var(--space-3) var(--space-5);
  font-weight: var(--font-semibold);
  cursor: pointer;
}

.generateButton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.resultState,
.errorState {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--color-text-secondary);
  text-align: center;
  padding: var(--space-8);
}

.resultState strong,
.errorState strong {
  color: var(--color-text-primary);
  font-size: var(--text-lg);
}

.resultState span,
.errorState span {
  max-width: 420px;
  font-size: var(--text-sm);
}

.errorState {
  background: rgba(127, 29, 29, 0.14);
  color: var(--color-red);
}

.resultReady {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.resultReady img {
  width: 100%;
  min-height: 420px;
  flex: 1;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.28);
}

.resultActions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4);
  border-top: var(--glass-border);
  background: rgba(0, 0, 0, 0.18);
}

.resultActions button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.spin { animation: spin 1s linear infinite; }

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

@media (max-width: 1100px) {
  .root { grid-template-columns: 1fr; }
  .resultPanel { min-height: 380px; }
}
