:root {
  --paper: #f6f3ec;
  --ink: #1f2633;
  --muted: #667085;
  --line: #d8d3c8;
  --panel: #fffefa;
  --green: #1c7c67;
  --blue: #1e6bff;
  --gold: #ffbf3f;
  --rose: #d45b7a;
  --shadow: 0 18px 60px rgba(31, 38, 51, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(31, 38, 51, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(31, 38, 51, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  width: min(1480px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 4px 20px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 4.8rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.05rem;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255, 254, 250, 0.76);
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(31, 38, 51, 0.07);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.reset-button {
  min-height: 42px;
  border: 1px solid #151a23;
  border-radius: 8px;
  padding: 0 16px;
  background: #151a23;
  color: #fffefa;
  font-weight: 800;
}

.reset-button:hover {
  background: #2f3849;
}

.maker-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.08fr) minmax(290px, 0.72fr) minmax(340px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.92);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  margin-bottom: 14px;
}

.tool-row,
.control-grid {
  display: flex;
  gap: 8px;
}

.compact {
  flex: 0 0 auto;
}

.icon-button,
.export-button,
.generate-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 800;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 1.25rem;
}

.export-button {
  min-width: 56px;
  height: 38px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.icon-button:hover,
.export-button:hover {
  border-color: var(--ink);
}

.canvas-card,
.preview-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.canvas-card {
  aspect-ratio: 1.18;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.canvas-hint {
  position: absolute;
  inset: auto 16px 16px;
  pointer-events: none;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 80px;
  margin-top: 12px;
}

.control-grid.two {
  grid-template-columns: 1fr 1fr;
}

.control-grid.two .control:nth-child(3),
.control-grid.two .control:nth-child(4) {
  grid-column: 1 / -1;
}

.control,
.prompt-field {
  display: grid;
  gap: 7px;
}

.control span,
.prompt-field span,
.note-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

input[type="file"],
input[type="range"],
input[type="color"],
input[type="text"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input[type="file"] {
  padding: 10px;
  font-size: 0.78rem;
}

input[type="color"] {
  padding: 4px;
}

select {
  padding: 0 10px;
}

input[type="text"] {
  padding: 0 12px;
}

textarea {
  min-height: 150px;
  padding: 12px;
  line-height: 1.45;
  resize: vertical;
}

.toggle-line {
  margin: 14px 0;
  color: var(--muted);
  font-weight: 800;
}

.toggle-line label {
  display: flex;
  gap: 9px;
  align-items: center;
}

.generate-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  border-color: #151a23;
  background: #151a23;
  color: #fffefa;
}

.generate-button:hover {
  background: #2f3849;
}

.generate-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.preview-stage {
  display: grid;
  place-items: center;
  min-height: 440px;
  background:
    radial-gradient(circle at 12% 10%, rgba(28, 124, 103, 0.13), transparent 22%),
    linear-gradient(135deg, #ffffff 0%, #f5f7fb 100%);
}

.logo-preview {
  display: grid;
  place-items: center;
  width: min(92%, 500px);
  aspect-ratio: 1;
}

.empty-preview {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
  line-height: 1.4;
}

.logo-preview svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 22px 30px rgba(31, 38, 51, 0.16));
}

.generated-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 22px 30px rgba(31, 38, 51, 0.16));
}

.submission-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.submission-heading {
  min-height: 0;
}

.email-button {
  border-color: #151a23;
  background: #151a23;
  color: #fffefa;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.comparison-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fffefa;
}

.comparison-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
}

.comparison-card img.is-empty {
  opacity: 0.28;
}

.submission-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.logo-preview.is-updating {
  animation: preview-pop 420ms ease-out;
}

@keyframes preview-pop {
  0% {
    transform: scale(0.965);
    opacity: 0.72;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.notes {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
  margin-top: 12px;
}

.notes > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.notes strong {
  display: block;
  margin-top: 5px;
  font-size: 0.95rem;
}

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

  .preview-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .top-actions,
  .panel-heading,
  .notes {
    display: grid;
  }

  .maker-grid,
  .control-grid,
  .control-grid.two,
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .tool-row {
    flex-wrap: wrap;
  }

  .preview-stage {
    min-height: 320px;
  }
}
