:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17201b;
  background: #f6f8f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

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

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: #176b55;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

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

.secondary {
  background: #e4e8e4;
  color: #17201b;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(246, 248, 246, 0.88), rgba(246, 248, 246, 0.88)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1600&q=80") center / cover;
}

.login-shell {
  width: min(100%, 420px);
}

.login-panel {
  display: grid;
  gap: 20px;
  padding: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 60px rgba(23, 32, 27, 0.18);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid #dce2dc;
  background: #ffffff;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 6px;
  color: #53645d;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
  gap: 28px;
  padding: 28px clamp(16px, 4vw, 48px);
}

.controls {
  display: grid;
  align-content: start;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #594f44;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8d2;
  border-radius: 6px;
  padding: 11px 12px;
  background: #ffffff;
  color: #17201b;
}

textarea {
  resize: vertical;
  min-height: 190px;
}

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

.prompt-field,
.upload-field,
.uploads,
.actions {
  grid-column: 1 / -1;
}

.uploads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

.upload-preview {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #dce2dc;
  border-radius: 8px;
  background: #ffffff;
}

.upload-preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: #e8ece9;
}

.upload-preview span {
  overflow: hidden;
  color: #53645d;
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
}

#status,
.message {
  min-height: 1.4em;
  color: #7b4237;
  font-weight: 700;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-content: start;
  gap: 18px;
}

.image-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #dfd8cc;
  border-radius: 8px;
  background: #ffffff;
}

.image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 6px;
  background: #e8ece9;
}

.image-card a {
  color: #176b55;
  font-weight: 800;
}

.usage {
  grid-column: 1 / -1;
  margin: 0;
  color: #594f44;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

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

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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