:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #667085;
  --line: #d8dee8;
  --panel: rgba(255, 255, 255, 0.92);
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #dc7d28;
  --paper: #f6f8fb;
  --shadow: 0 24px 70px rgba(25, 38, 55, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), transparent 34%),
    linear-gradient(315deg, rgba(220, 125, 40, 0.16), transparent 30%),
    var(--paper);
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.workspace {
  width: min(980px, 100%);
  background: var(--panel);
  border: 1px solid rgba(216, 222, 232, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 28px;
}

.topbar,
.panel,
.result {
  display: grid;
  gap: 20px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: start;
  margin-bottom: 24px;
}

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

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

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.35rem;
}

.limit-badge {
  min-width: 112px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 12px 14px;
  text-align: right;
}

.limit-badge span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.limit-badge strong {
  display: block;
  margin-top: 2px;
  color: var(--accent);
  font-size: 1.2rem;
}

.panel {
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: stretch;
}

.dropzone {
  min-height: 340px;
  border: 2px dashed #a9b5c5;
  background: #fff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--brand);
  background: #f0fdfa;
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
}

.upload-icon svg {
  width: 40px;
  height: 40px;
  fill: currentColor;
}

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

.drop-copy {
  max-width: 440px;
  color: var(--muted);
  line-height: 1.45;
}

.settings {
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 18px;
  display: grid;
  gap: 16px;
  align-content: start;
}

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

label {
  font-weight: 800;
  font-size: 0.88rem;
}

select,
button,
.download {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  font: inherit;
}

select {
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.primary,
.download {
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.primary:hover,
.download:hover {
  background: var(--brand-dark);
}

.primary:disabled {
  background: #b8c2cf;
  cursor: not-allowed;
}

.result {
  grid-template-columns: minmax(0, 1fr) 300px;
  margin-top: 22px;
  align-items: stretch;
}

.preview-wrap {
  min-height: 260px;
  background: #111827;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview-wrap img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
}

.summary {
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px;
  display: grid;
  gap: 16px;
  align-content: start;
}

dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef1f5;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 900;
}

.download {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.status {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 760px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .panel,
  .result {
    grid-template-columns: 1fr;
  }

  .limit-badge {
    text-align: left;
  }

  .dropzone {
    min-height: 280px;
  }
}
