:root {
  color-scheme: light;
  --bg: #f4f1ec;
  --surface: #fffdf9;
  --surface-strong: #ffffff;
  --ink: #202124;
  --muted: #686f77;
  --line: #d9d5ce;
  --accent: #0f766e;
  --accent-dark: #0a5953;
  --accent-soft: #dff4ef;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(34, 31, 27, 0.14);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 34rem),
    linear-gradient(135deg, #f8f5ef 0%, #ebf3f2 48%, #f7f7f5 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(720px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.intro {
  width: 100%;
  text-align: center;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.lede {
  max-width: 36rem;
  margin: 0 auto;
  color: #4f5960;
  font-size: 1.1rem;
  line-height: 1.65;
}

.wizard {
  width: 100%;
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.steps {
  border-bottom: 1px solid var(--line);
  padding: 22px 24px 18px;
}

.steps ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--muted);
}

.step span {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.step strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step.is-active,
.step.is-complete {
  color: var(--ink);
}

.step.is-active span,
.step.is-complete span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.panel {
  padding: 30px;
}

.panel-header {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.split {
  align-items: flex-start;
}

.drop-zone {
  min-height: 236px;
  padding: 28px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1.5px dashed #a9b4b2;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 250, 248, 0.86)),
    var(--surface-strong);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.13);
  transform: translateY(-1px);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.upload-icon,
.success-mark {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.upload-icon svg,
.success-mark svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.drop-title {
  display: block;
  margin-top: 16px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
}

.drop-copy {
  display: block;
  max-width: 30rem;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.upload-preview,
.upload-preview[hidden] {
  display: none;
  margin-top: 20px;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.preview-frame,
.checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #d7ddd9 25%, transparent 25%),
    linear-gradient(-45deg, #d7ddd9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d7ddd9 75%),
    linear-gradient(-45deg, transparent 75%, #d7ddd9 75%);
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
  background-size: 16px 16px;
}

.preview-frame {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0px;
  overflow: hidden;
}

.preview-frame img {
  max-width: 100%;
  max-height: 100%;
}

.file-details,
.summary-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.file-details div,
.summary-list div {
  min-width: 0;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
}

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

dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.message {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.message.is-error {
  color: var(--danger);
  font-weight: 700;
}

.actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

[data-page="1"] .actions {
  display: none;
}

[data-page="2"] .actions {
  justify-content: space-between;
}

.button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

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

.button.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.convert-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.icon-preview {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.checker {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0px;
  overflow: hidden;
}

#live-preview {
  width: 100%;
  height: 100%;
}

.size-picker {
  margin: 0;
  padding: 0;
  border: 0;
}

.size-picker legend {
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 800;
}

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

.size-option {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.size-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.summary {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 840px) {
  .shell {
    min-height: auto;
    padding: 28px 0;
    gap: 24px;
  }

  h1 {
    font-size: 3rem;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1060px);
  }

  .steps,
  .panel {
    padding: 18px;
  }

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

  .convert-grid,
  .summary {
    grid-template-columns: 1fr;
  }

  .preview-frame {
    width: 96px;
    height: 96px;
  }

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

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  [data-page="2"] .actions {
    justify-content: stretch;
  }
}
