:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #64706a;
  --line: #d8ded8;
  --surface: #ffffff;
  --panel: #f4f7f2;
  --accent: #23684a;
  --accent-strong: #174c36;
  --focus: #f2b84b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #eef2ed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workspace {
  display: grid;
  gap: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

h2 {
  font-size: 16px;
}

.ghost-link,
.download-link {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 280px) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.drop-zone {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 14px;
  border: 1px dashed #9eaaa1;
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.drop-title {
  font-weight: 800;
}

.drop-subtitle,
.status,
.field label {
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 8px;
}

select,
button {
  min-height: 44px;
  border-radius: 8px;
  font: inherit;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

button {
  border: 0;
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.status {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
}

.status[data-error="true"] {
  color: #a13b2c;
  font-weight: 700;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.preview-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
}

.image-frame {
  display: grid;
  place-items: center;
  min-height: 440px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.image-frame img {
  display: none;
  width: 100%;
  height: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.image-frame img[src] {
  display: block;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 840px) {
  .control-panel,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .image-frame {
    min-height: 300px;
  }
}
