:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #607080;
  --line: #cfd8e3;
  --panel: #ffffff;
  --page: #eef2f6;
  --purple: #7814b3;
  --purple-strong: #5f0d91;
  --focus: #0f766e;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.tool,
.preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool {
  align-self: start;
  padding: 24px;
}

.header {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.drop-zone {
  display: grid;
  gap: 14px;
}

input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-picker {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 22px;
  place-content: center;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}

input[type="file"]:focus-visible + .file-picker {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 60%);
  outline-offset: 3px;
}

.label-title {
  font-weight: 700;
}

.label-detail {
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
}

.switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #aeb9c5;
  pointer-events: none;
  transition: background 120ms ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.22);
  transition: transform 120ms ease;
}

.switch input:checked + .switch-track {
  background: var(--purple);
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 60%);
  outline-offset: 3px;
}

button,
.download {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--purple);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

button {
  padding: 0 18px;
}

button:hover,
.download:hover {
  background: var(--purple-strong);
}

.status {
  min-height: 24px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: grid;
  margin-top: 16px;
}

.download {
  display: grid;
  place-items: center;
  padding: 0 18px;
}

.preview {
  min-height: calc(100vh - 48px);
  overflow: hidden;
}

iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 50px);
  border: 0;
  background: #d9e0e8;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .preview {
    min-height: 70vh;
  }

  h1 {
    font-size: 24px;
  }
}
