:root {
  color-scheme: light;
  --ink: #15171a;
  --muted: #68707c;
  --line: #d9dde3;
  --panel: #f6f7f9;
  --accent: #ff3d7f;
  --accent-dark: #c91758;
  --blue: #2f7dd1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.workspace {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgb(21 23 26 / 12%);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
}

.button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  padding: 11px 16px;
  cursor: pointer;
}

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

.button:disabled {
  background: #c7ccd4;
  cursor: not-allowed;
}

.button.secondary {
  background: var(--ink);
}

.button.secondary:hover {
  background: #2a2d32;
}

.button.secondary:disabled {
  background: #e1e5eb;
  color: #8a929d;
}

.button.secondary:disabled:hover {
  background: #e1e5eb;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
  margin-bottom: 24px;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: #fff3f8;
}

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

.dropzone strong,
.dropzone span {
  display: block;
}

.dropzone span {
  color: var(--muted);
  margin-top: 6px;
}

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

figure {
  margin: 0;
}

figcaption {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.preview-frame {
  min-height: 380px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef0f3 25%, transparent 25%),
    linear-gradient(-45deg, #eef0f3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef0f3 75%),
    linear-gradient(-45deg, transparent 75%, #eef0f3 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  overflow: hidden;
}

.preview-frame img {
  max-width: 100%;
  max-height: 70vh;
  display: block;
}

.panel {
  border-left: 1px solid var(--line);
  background: var(--panel);
  padding: 28px;
}

form {
  display: grid;
  gap: 22px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 0 10px;
}

input[type="range"] {
  accent-color: var(--accent);
}

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

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats {
  margin: 28px 0 0;
  display: grid;
  gap: 12px;
}

.stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

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

.status {
  color: var(--muted);
  margin-top: 20px;
}

.download-action {
  width: 100%;
  margin-top: 18px;
}

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

  .panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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