:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f2ee;
  color: #202124;
  --ink: #1e2228;
  --muted: #697079;
  --line: #dedbd3;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --accent: #176b87;
  --accent-strong: #114d62;
  --accent-soft: #dceff4;
  --warm: #f3c969;
  --shadow: 0 20px 55px rgba(37, 41, 47, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(23, 107, 135, 0.18), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(243, 201, 105, 0.2), transparent 32%),
    linear-gradient(180deg, #fbfaf7 0%, #f4f2ee 48%, #efeee9 100%);
}

button,
input,
select {
  font: inherit;
}

button,
select,
label,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0 44px;
}

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

h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(23, 107, 135, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.95;
  font-weight: 820;
  color: var(--ink);
}

h2 {
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}

.topbar p,
.results-head p,
.meta,
.status {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.topbar p {
  margin-top: 10px;
  max-width: 640px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel,
.results {
  border: 1px solid rgba(222, 219, 211, 0.92);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel {
  padding: 18px;
  display: grid;
  gap: 16px;
  position: sticky;
  top: 18px;
}

.dropzone {
  min-height: 146px;
  border: 1.5px dashed rgba(23, 107, 135, 0.42);
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 8px;
  cursor: pointer;
  color: #353b42;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 250, 0.86)),
    repeating-linear-gradient(45deg, rgba(23, 107, 135, 0.06) 0 8px, transparent 8px 16px);
  text-align: center;
  padding: 18px;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.dropzone:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

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

.drop-icon {
  inline-size: 42px;
  block-size: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 10px 25px rgba(23, 107, 135, 0.28);
}

#file-label {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dropzone small {
  color: var(--muted);
  font-size: 12px;
}

.preview-wrap {
  display: grid;
  gap: 8px;
}

#source-preview {
  width: 100%;
  max-height: 245px;
  object-fit: contain;
  background:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 18px 18px;
  background-position:
    0 0,
    0 9px,
    9px -9px,
    -9px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.meta {
  min-height: 21px;
}

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

.label {
  font-size: 12px;
  font-weight: 820;
  color: #3f454d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented label {
  min-height: 44px;
  border: 1px solid #d4d6d1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.76);
  color: #343941;
  font-size: 14px;
  font-weight: 720;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.segmented input {
  accent-color: var(--accent);
}

.segmented label:has(input:checked) {
  border-color: rgba(23, 107, 135, 0.6);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(23, 107, 135, 0.18);
}

select,
input[type="text"] {
  min-height: 44px;
  width: 100%;
  border: 1px solid #cacdc8;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #1f2024;
  padding: 0 12px;
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

select:focus,
input[type="text"]:focus {
  border-color: rgba(23, 107, 135, 0.72);
  box-shadow: 0 0 0 4px rgba(23, 107, 135, 0.12);
  background: #fff;
}

.color-row {
  grid-template-columns: 1fr 58px;
  align-items: center;
}

.color-row .label {
  grid-column: 1 / -1;
}

input[type="color"] {
  inline-size: 58px;
  block-size: 44px;
  border: 1px solid #cacdc8;
  border-radius: 8px;
  padding: 5px;
  background: #fff;
}

.primary,
.button {
  min-height: 46px;
  border: 1px solid var(--accent-strong);
  border-radius: 8px;
  background: var(--accent-strong);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 820;
  box-shadow: 0 13px 28px rgba(17, 77, 98, 0.22);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.primary:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(17, 77, 98, 0.26);
}

.primary:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.button {
  min-height: 40px;
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: none;
}

.results {
  min-height: 590px;
  padding: 18px;
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 3px 2px 16px;
  border-bottom: 1px solid rgba(222, 219, 211, 0.82);
}

.results-head p {
  margin-top: 4px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 16px;
  padding-top: 18px;
}

.result-grid.empty {
  min-height: 430px;
  place-items: center;
  color: #777a80;
  border: 1px dashed rgba(23, 107, 135, 0.28);
  border-radius: 8px;
  margin-top: 18px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(247, 248, 245, 0.74)),
    repeating-linear-gradient(90deg, rgba(23, 107, 135, 0.05) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(23, 107, 135, 0.05) 0 1px, transparent 1px 28px);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
}

.empty-mark {
  inline-size: 82px;
  block-size: 82px;
  border-radius: 8px;
  border: 1px solid rgba(23, 107, 135, 0.3);
  background:
    linear-gradient(90deg, transparent 48%, rgba(23, 107, 135, 0.32) 48% 52%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(23, 107, 135, 0.32) 48% 52%, transparent 52%),
    var(--accent-soft);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.48);
}

.result-card {
  border: 1px solid rgba(224, 225, 220, 0.96);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-solid);
  box-shadow: 0 10px 28px rgba(37, 41, 47, 0.08);
}

.result-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  background-image:
    linear-gradient(45deg, #e8e8e2 25%, transparent 25%),
    linear-gradient(-45deg, #e8e8e2 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8e8e2 75%),
    linear-gradient(-45deg, transparent 75%, #e8e8e2 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
}

.result-body {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.result-name {
  font-size: 13px;
  font-weight: 820;
  color: #2d333a;
  overflow-wrap: anywhere;
}

.result-size {
  font-size: 12px;
  color: var(--muted);
}

.result-body .button {
  min-height: 38px;
}

.status {
  min-height: 21px;
}

.status.error {
  color: #b3261e;
}

@media (max-width: 900px) {
  .panel {
    position: static;
  }

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

  .results {
    min-height: 380px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 20px;
  }

  h1 {
    font-size: 38px;
  }

  .panel,
  .results {
    padding: 14px;
  }

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

  .results-head {
    align-items: stretch;
    flex-direction: column;
  }

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