:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --ink: #1e2524;
  --muted: #6b7470;
  --line: #d9d3c8;
  --panel: #fffdf8;
  --accent: #116a62;
  --accent-strong: #0c4f49;
  --rose: #c25a4b;
  --gold: #d7a642;
  --shadow: 0 24px 60px rgb(45 38 25 / 12%);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgb(17 106 98 / 12%) 0 1px, transparent 1px 28px),
    linear-gradient(45deg, rgb(194 90 75 / 10%) 0 1px, transparent 1px 32px),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 28px;
  align-items: stretch;
}

.workspace,
.results {
  border: 1px solid rgb(30 37 36 / 10%);
  background: rgb(255 253 248 / 86%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.workspace {
  min-height: calc(100vh - 96px);
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.intro {
  padding: 4px 2px 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(2.4rem, 4.2vw, 4rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.tool-panel {
  display: grid;
  gap: 20px;
}

.dropzone {
  position: relative;
  min-height: 310px;
  padding: 26px;
  border: 1px dashed rgb(17 106 98 / 48%);
  background:
    radial-gradient(circle at 18% 18%, rgb(215 166 66 / 22%), transparent 24%),
    linear-gradient(145deg, #fdfaf2, #eef4ee);
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.dropzone.is-dragging {
  border-color: var(--accent);
  transform: translateY(-2px);
  background:
    radial-gradient(circle at 18% 18%, rgb(215 166 66 / 32%), transparent 24%),
    linear-gradient(145deg, #f8fff9, #eaf6f5);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-visual {
  position: relative;
  width: min(260px, 68vw);
  height: 160px;
  margin-bottom: 18px;
  display: block;
}

.photo-stack {
  position: absolute;
  width: 148px;
  height: 104px;
  border: 8px solid #fffdf8;
  box-shadow: 0 18px 38px rgb(30 37 36 / 18%);
}

.photo-stack::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 55%, rgb(30 37 36 / 16%) 55%),
    radial-gradient(circle at 30% 30%, #f7d26b 0 12px, transparent 13px),
    linear-gradient(135deg, #78b8ad, #e3efe7);
}

.photo-stack-a {
  left: 6px;
  top: 38px;
  rotate: -9deg;
}

.photo-stack-b {
  left: 58px;
  top: 18px;
  rotate: 4deg;
}

.photo-stack-c {
  right: 6px;
  top: 42px;
  rotate: 10deg;
}

.drop-title,
.drop-hint {
  display: block;
}

.drop-title {
  font-size: 1.28rem;
  font-weight: 800;
}

.drop-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.controls {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.9fr;
  gap: 12px;
}

.field {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  gap: 10px;
}

.field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field strong {
  font-size: 1.4rem;
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.field input[type="number"],
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgb(30 37 36 / 14%);
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  outline: none;
}

.field input[type="number"]:focus,
.field select:focus {
  border-color: var(--accent);
}

.actions {
  display: flex;
  gap: 12px;
}

.primary-button,
.ghost-button,
.download-button,
.status-pill {
  min-height: 48px;
  padding: 0 18px;
  font-weight: 800;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.primary-button {
  flex: 1;
  color: #fff;
  background: var(--accent);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.ghost-button {
  color: var(--accent-strong);
  border: 1px solid rgb(17 106 98 / 24%);
  background: transparent;
}

.ghost-button:hover:not(:disabled) {
  background: rgb(17 106 98 / 8%);
}

.results {
  min-height: calc(100vh - 96px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.result-list {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding-right: 2px;
}

.empty-state {
  min-height: 430px;
  border: 1px solid var(--line);
  background: #fbf8f0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  color: var(--muted);
  text-align: center;
}

.empty-preview {
  width: 210px;
  aspect-ratio: 4 / 3;
  border: 10px solid #fffdf8;
  box-shadow: 0 20px 38px rgb(30 37 36 / 12%);
  background:
    radial-gradient(circle at 26% 28%, var(--gold) 0 16px, transparent 17px),
    linear-gradient(135deg, transparent 58%, rgb(17 106 98 / 28%) 59%),
    linear-gradient(135deg, #8dc8bd, #f5efe0);
}

.result-item {
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.thumb {
  width: 104px;
  aspect-ratio: 1;
  object-fit: cover;
  background: #eee7dc;
}

.result-meta {
  min-width: 0;
}

.result-name {
  margin: 0 0 8px;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-detail {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.save-rate {
  color: var(--rose);
  font-weight: 800;
}

.download-button {
  color: #fff;
  background: #24302e;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.download-button:hover {
  background: #111716;
  transform: translateY(-1px);
}

.status-pill {
  color: var(--accent-strong);
  border: 1px solid rgb(17 106 98 / 22%);
  background: rgb(17 106 98 / 8%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .shell {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 22px 0;
  }

  .workspace,
  .results {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 18px, 1180px);
  }

  .workspace,
  .results {
    padding: 18px;
  }

  .controls,
  .result-item {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  .download-button {
    width: 100%;
  }

  .status-pill {
    width: 100%;
  }
}
