:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0d1726;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --muted: #96a6bf;
  --accent: #4f8cff;
  --accent-2: #8b5cf6;
  --ok: #2dd4bf;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  --radius: 22px;
  --radius-sm: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(79, 140, 255, 0.18), transparent 35%),
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.16), transparent 28%),
    linear-gradient(180deg, #050b14 0%, var(--bg) 100%);
}

button,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px;
  border-right: 1px solid var(--panel-border);
  background: rgba(3, 7, 18, 0.35);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 800;
}

.brand p,
.panel-card p,
.hero p {
  color: var(--muted);
  line-height: 1.5;
}

.panel-card,
.chat-card,
.design-card,
.hero {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-card {
  padding: 18px;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  margin-top: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.inline-form {
  display: flex;
  gap: 10px;
}

.inline-form input {
  flex: 1;
}

.panel-label,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: #9bb5ff;
}

.status-pill {
  display: inline-flex;
  margin: 8px 0 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(79, 140, 255, 0.15);
  color: #cfe0ff;
}

.small-muted {
  font-size: 0.9rem;
  color: var(--muted);
}

.main {
  padding: 28px;
}

.hero {
  padding: 26px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.hero h2 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.04;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
}

button.primary,
.chat-actions button {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

button.secondary {
  color: var(--text);
  background: rgba(148, 163, 184, 0.14);
}

button.danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.full-width {
  width: 100%;
}

input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(3, 7, 18, 0.65);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.chat-card,
.design-card {
  padding: 20px;
}

.chat-card {
  min-height: 0;
}

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

.card-title h3,
.notes h4 {
  margin: 0;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 420px;
  max-height: 420px;
  overflow: auto;
  padding-right: 6px;
}

.bubble {
  max-width: 86%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  line-height: 1.5;
}

.bubble.user {
  align-self: flex-end;
  background: rgba(79, 140, 255, 0.15);
}

.bubble.assistant {
  align-self: flex-start;
  background: rgba(15, 23, 42, 0.9);
}

.bubble small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.chat-form {
  margin-top: 16px;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  padding: 14px;
  color: var(--text);
  background: rgba(3, 7, 18, 0.65);
}

.chat-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.helper-text {
  font-size: 0.9rem;
  color: var(--muted);
}

.design-list {
  display: grid;
  gap: 12px;
}

.design-empty {
  padding: 16px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px dashed rgba(148, 163, 184, 0.24);
  color: var(--muted);
}

.design-list--inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.design-inline {
  margin: 16px 0 6px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(7, 17, 31, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.design-inline__head {
  margin-bottom: 14px;
}

.design-inline__head h3,
.design-gallery-message__head strong {
  margin: 0 0 6px;
  font-size: 1rem;
}

.design-inline__head p,
.design-gallery-message__head span {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.design-option {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(7, 17, 31, 0.7);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.design-option:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 140, 255, 0.5);
}

.design-preview {
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.82);
  aspect-ratio: 5 / 4;
  min-height: 240px;
}

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

.design-option.active {
  outline: 2px solid rgba(79, 140, 255, 0.5);
}

.design-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.design-accent {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

.design-action {
  display: inline-flex;
  margin-top: 10px;
  font-size: 0.84rem;
  color: #cfe0ff;
  opacity: 0.92;
}

.design-gallery-message {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(7, 17, 31, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.design-gallery-message__head {
  margin-bottom: 14px;
}

.review-gallery {
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(7, 17, 31, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.review-gallery__head {
  margin-bottom: 14px;
  display: grid;
  gap: 6px;
}

.review-gallery__head strong {
  font-size: 1rem;
}

.review-gallery__head span {
  color: var(--muted);
  font-size: 0.92rem;
}

.review-gallery__grid {
  display: grid;
  gap: 14px;
}

.review-page-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.review-page-card img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.review-page-card__body h4,
.review-page-card__body p {
  margin: 0 0 8px;
}

.review-section-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.review-section-item {
  display: grid;
  gap: 6px;
}

.review-section-item img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.review-section-item span {
  color: var(--muted);
  font-size: 0.8rem;
}

.payload-preview {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(3, 7, 18, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #dbe7ff;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
  font-size: 0.82rem;
}

.block-card {
  margin: 14px 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(7, 17, 31, 0.72);
}

.block-card textarea {
  min-height: 86px;
  margin-top: 8px;
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--panel-border);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .chat-card {
    grid-row: auto;
  }

  .design-list--inline {
    grid-template-columns: 1fr;
  }

  .review-page-card {
    grid-template-columns: 1fr;
  }

  .review-section-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .hero {
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions button {
    flex: 1;
  }
}
