:root {
  color-scheme: light;
  --page: #f7f3ee;
  --shell: rgba(255, 255, 255, .76);
  --card: rgba(255, 255, 255, .9);
  --card-solid: #ffffff;
  --ink: #111827;
  --text: #1f2937;
  --muted: #6b7280;
  --soft: #f5f1ff;
  --line: #e7dfeb;
  --line-strong: #d8c9f3;
  --purple: #7c3aed;
  --purple-2: #9f67ff;
  --coral: #ee9467;
  --coral-2: #f6b187;
  --danger: #b42318;
  --danger-bg: #fff1ee;
  --warning: #9a6700;
  --warning-bg: #fff7df;
  --good: #13795b;
  --good-bg: #eafaf3;
  --shadow: 0 26px 90px rgba(88, 56, 125, .14);
  --shadow-soft: 0 16px 45px rgba(88, 56, 125, .1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(124, 58, 237, .16), transparent 28%),
    radial-gradient(circle at 86% 16%, rgba(238, 148, 103, .18), transparent 30%),
    radial-gradient(circle at 82% 90%, rgba(246, 177, 135, .15), transparent 30%),
    linear-gradient(135deg, #f9fbff 0%, #fff7f2 45%, #fbf1ff 100%);
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }

.app-shell {
  width: min(1220px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  border: 1px solid rgba(152, 125, 183, .22);
  border-radius: 26px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, .82), rgba(255, 250, 244, .74)),
    radial-gradient(circle at 18% 18%, rgba(124, 58, 237, .1), transparent 28%),
    radial-gradient(circle at 88% 76%, rgba(238, 148, 103, .12), transparent 28%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 30px 56px;
}

.site-header nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-header a,
.site-footer a {
  color: #475467;
  font-weight: 800;
  text-decoration: none;
}

.site-header a:hover,
.site-footer a:hover { color: var(--purple); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink) !important;
  font-size: 1.02rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  box-shadow: 0 10px 28px rgba(124, 58, 237, .28);
  font-size: .62rem;
  font-weight: 950;
  letter-spacing: -.04em;
  text-transform: uppercase;
}

main {
  padding: 46px 56px 58px;
}

.site-footer {
  margin: 0 56px;
  padding: 26px 0 34px;
  border-top: 1px solid rgba(152, 125, 183, .2);
  color: #98a2b3;
  font-weight: 800;
}

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

h1 {
  margin-bottom: 20px;
  color: var(--ink);
  font-size: clamp(2.3rem, 5vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -.055em;
}

h2 {
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: -.02em;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--purple);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

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

.card,
.upload-card,
.preview-shell {
  border: 1px solid rgba(152, 125, 183, .24);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

button,
.button,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  padding: 14px 22px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  box-shadow: 0 14px 34px rgba(124, 58, 237, .25);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

button:hover,
.button:hover,
.secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(124, 58, 237, .3);
}

.secondary {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(88, 56, 125, .08);
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

select,
input[type="number"] {
  width: 100%;
  margin-top: 8px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  outline: none;
}

select:focus,
input[type="number"]:focus {
  border-color: var(--purple-2);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .12);
}

input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.error {
  margin-top: 15px;
  padding: 13px 15px;
  border: 1px solid rgba(180, 35, 24, .25);
  border-radius: 14px;
  color: var(--danger);
  background: var(--danger-bg);
}

[hidden] { display: none !important; }

/* Upload */

.upload-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 500px);
  gap: clamp(34px, 6vw, 90px);
  align-items: center;
  min-height: 430px;
}

.hero-copy h1 span {
  color: var(--purple);
}

.hero-subtitle {
  max-width: 520px;
  margin-bottom: 34px;
  color: #475467;
  font-size: clamp(1.08rem, 2vw, 1.34rem);
  line-height: 1.36;
}

.process-steps {
  display: grid;
  grid-template-columns: auto auto auto auto auto auto auto;
  align-items: start;
  gap: clamp(12px, 2vw, 24px);
  max-width: 650px;
  padding-top: 28px;
  border-top: 1px solid rgba(152, 125, 183, .18);
}

.process-step {
  min-width: 86px;
}

.process-step span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border: 3px solid #d9cdfd;
  border-radius: 999px;
  color: var(--purple);
  background: #f4efff;
  font-weight: 950;
}

.process-step.is-active span {
  background: linear-gradient(135deg, #f6efff, #efe7ff);
  box-shadow: 0 8px 22px rgba(124, 58, 237, .17);
}

.process-step.is-cleanup span {
  border-color: #e2d2ff;
  color: var(--purple);
  background: linear-gradient(135deg, #fbf8ff, #fff4ee);
  box-shadow: 0 8px 22px rgba(124, 58, 237, .11);
}

.process-step.is-final span {
  border-color: #f6c7ad;
  color: #d56f39;
  background: #fff2eb;
}

.process-step p {
  margin: 0;
  color: #344054;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.25;
}

.process-arrow {
  padding-top: 6px;
  color: #c9b8f9;
  font-size: 2rem;
  font-weight: 900;
}

.process-arrow.warm { color: #f3c4a8; }

.upload-card {
  padding: 26px;
  background: rgba(255, 255, 255, .76);
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 342px;
  padding: 38px 28px;
  border: 2px dashed #d7c5ff;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 8%, rgba(124, 58, 237, .1), transparent 30%),
    rgba(255, 255, 255, .66);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--purple);
  background: #fbf8ff;
  transform: translateY(-2px);
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 22px;
  border-radius: 20px;
  color: var(--purple);
  background: linear-gradient(135deg, #f6efff, #ece3ff);
  box-shadow: inset 0 1px 0 #fff, 0 18px 38px rgba(124, 58, 237, .16);
  font-size: 2.9rem;
  font-weight: 400;
  line-height: 1;
}

.drop-title {
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 950;
}

.drop-browse {
  margin-top: 4px;
  color: var(--muted);
}

.browse-link {
  color: var(--purple);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.file-name {
  display: block;
  max-width: 100%;
  margin-top: 24px;
  color: #98a2b3;
  font-size: .92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-card button {
  margin-top: 22px;
}

/* FAQ */

.faq-section {
  max-width: 940px;
  margin: 76px auto 0;
}

.faq-section h2 {
  margin-bottom: 24px;
  text-align: center;
  font-size: 1.45rem;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  margin: 0;
  border: 1px solid rgba(152, 125, 183, .18);
  border-radius: 13px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 8px 28px rgba(88, 56, 125, .06);
  overflow: hidden;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 24px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "⌄";
  color: var(--purple);
  font-size: 1.4rem;
  transition: transform .18s ease;
}

.faq-item[open] summary::after { transform: rotate(180deg); }

.faq-item p {
  margin: -4px 24px 20px;
  color: var(--muted);
}

/* Selection page */

.page-heading {
  margin-bottom: 28px;
}

.select-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.page-heading h1 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
}

.step-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
}

.step-pills span {
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
}

.step-pills .is-current {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
}

.selection-grid {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.file-panel {
  padding: 18px;
  position: sticky;
  top: 20px;
}

.file-section,
.check-panel,
.advanced-settings {
  padding: 16px;
  border: 1px solid rgba(152, 125, 183, .18);
  border-radius: 18px;
  background: rgba(255, 255, 255, .76);
}

.file-section h2,
.advanced-settings h2 {
  margin-bottom: 3px;
}

.file-section .muted,
.settings-note {
  margin-bottom: 13px;
  font-size: .86rem;
}

.file-list {
  display: grid;
  gap: 9px;
}

.file-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.file-option:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 26px rgba(88, 56, 125, .08);
}

.file-option:has(input:checked) {
  border-color: var(--purple);
  background: #fbf8ff;
  box-shadow: 0 10px 30px rgba(124, 58, 237, .12);
}

.file-option input { margin-top: 4px; accent-color: var(--purple); }

details {
  margin: 16px 4px;
  color: var(--muted);
}

details code {
  display: block;
  margin-top: 8px;
  white-space: normal;
}

.check-panel,
.advanced-settings {
  margin-top: 16px;
}

.check-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.check-status {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.status-good { color: var(--good); background: var(--good-bg); }
.status-warning { color: var(--warning); background: var(--warning-bg); }
.status-error { color: var(--danger); background: var(--danger-bg); }

.check-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  margin-top: 12px;
}

.check-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.35;
}

.check-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 950;
}

.check-good .check-icon { color: var(--good); background: var(--good-bg); }
.check-warning .check-icon { color: var(--warning); background: var(--warning-bg); }
.check-error .check-icon { color: var(--danger); background: var(--danger-bg); }

.passed-checks {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.passed-checks summary {
  padding: 13px 0 3px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 850;
  cursor: pointer;
  list-style-position: inside;
}

.passed-checks[open] summary { color: var(--ink); }
.passed-check-list { padding-bottom: 2px; }

.warning-confirmation {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 15px;
  color: var(--warning);
  font-size: .9rem;
}

.warning-confirmation input {
  margin-top: 4px;
  accent-color: var(--purple);
}

.settings-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.setting-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.setting-field span,
.setting-field legend {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 800;
}

.setting-field small {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}

.radio-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.duration-setting { grid-column: 1 / -1; }
.duration-options { grid-template-columns: 1fr; }

.radio-card {
  display: grid;
  gap: 2px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.radio-card input {
  margin: 0 0 4px;
  accent-color: var(--purple);
}

.radio-card span {
  color: var(--ink);
  font-weight: 900;
}

.radio-card:has(input:checked) {
  border-color: var(--purple);
  background: #fbf8ff;
  box-shadow: 0 10px 26px rgba(124, 58, 237, .1);
}

.radio-card.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}

.manual-duration-input {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.manual-duration-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0 7px;
}

.manual-duration-part {
  display: grid;
  gap: 2px;
}

.manual-duration-part span {
  color: var(--muted);
  font-size: .76rem;
}

.speed-setting { grid-column: 1 / -1; }

.speed-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.speed-option {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

.speed-option:has(input[type="radio"]:checked) {
  border-color: var(--purple);
  background: #fbf8ff;
}

.speed-option input[type="radio"] {
  margin: 0;
  accent-color: var(--purple);
}

.custom-speed-option input[type="number"] {
  width: 74px;
  padding: 6px 7px;
}

.apply-speed-option {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  color: var(--text);
  font-size: .86rem;
}

.apply-speed-option input {
  margin: 0;
  accent-color: var(--purple);
}

.speed-duration-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.settings-note {
  margin: 13px 0 0;
}

/* Preview */

.preview-shell {
  min-height: 70vh;
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .78);
}

.preview-toolbar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .86rem;
}

.preview-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.preview-actions .compact,
.element-list-panel summary .compact {
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid var(--line);
  font-size: .8rem;
}

.preview-actions .compact.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
}

.element-list-panel {
  margin: 0;
  padding: 12px 18px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: rgba(250, 248, 255, .7);
}

.element-list-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.element-list-panel summary::-webkit-details-marker { display: none; }

.element-list-panel summary small {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 700;
}

.element-list-help {
  margin: 7px 0 10px;
  color: var(--muted);
  font-size: .8rem;
}

.element-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 190px;
  overflow: auto;
}

.element-check-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.element-check-item:hover { border-color: var(--line-strong); }

.element-check-item:has(input:checked) {
  border-color: var(--purple);
  background: #fbf8ff;
}

.element-check-item input {
  margin: 3px 0 0;
  accent-color: var(--purple);
}

.element-check-copy { min-width: 0; }

.element-check-copy strong,
.element-check-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-check-copy strong { font-size: .79rem; }
.element-check-copy span { color: var(--muted); font-size: .71rem; }

.preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(70vh - 80px);
  padding: 28px;
  background:
    linear-gradient(45deg, rgba(124, 58, 237, .05), rgba(238, 148, 103, .06)),
    #fbf9ff;
}

.preview-stage.is-horizontal { min-height: 560px; }

.preview-stage.is-picking {
  background: #fbf3ec;
  box-shadow: inset 0 0 0 2px var(--coral);
}

.preview-stage.is-picking iframe { cursor: crosshair; }

.preview-frame-box {
  position: relative;
  flex: 0 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: #030712;
  box-shadow: 0 22px 56px rgba(15, 23, 42, .18);
}

#design-preview {
  position: absolute;
  inset: 0 auto auto 0;
  width: var(--preview-native-width, 1080px);
  height: var(--preview-native-height, 1920px);
  border: 0;
  background: #000;
  transform-origin: top left;
}

.picker-banner {
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 36px);
  padding: 10px 14px;
  border-radius: 999px;
  color: #44220d;
  background: linear-gradient(135deg, #ffd1b8, #f2a06f);
  box-shadow: 0 12px 32px rgba(120, 56, 18, .18);
  font-size: .84rem;
  font-weight: 950;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Conversion/result */

.status-card {
  max-width: 780px;
  margin: 5vh auto;
  padding: clamp(32px, 5vw, 56px);
  text-align: center;
}

.progress-card,
.result-card {
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 58, 237, .12), transparent 35%),
    rgba(255, 255, 255, .86);
}

.status-card h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.progress-track {
  height: 12px;
  margin-top: 30px;
  border-radius: 999px;
  background: #eee7f7;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--coral));
  transition: width .4s ease;
}

.spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 26px;
  border: 4px solid #ede6f7;
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 24px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  box-shadow: 0 18px 38px rgba(124, 58, 237, .26);
  font-size: 2.8rem;
  font-weight: 950;
}

.log-panel {
  margin: 26px 0 0;
  text-align: left;
}

.log-panel summary {
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.job-log {
  max-height: 220px;
  margin: 12px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: #475467;
  background: #fff;
  overflow: auto;
  text-align: left;
  white-space: pre-wrap;
}

.status-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 20px;
}

.status-actions .secondary {
  margin-top: 0;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 8px;
}

.result-meta span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #475467;
  background: #fff;
  font-size: .86rem;
  font-weight: 850;
}

.result-card .button,
.result-card .secondary {
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .site-header,
  main {
    padding-left: 28px;
    padding-right: 28px;
  }

  .site-footer {
    margin-left: 28px;
    margin-right: 28px;
  }

  .upload-hero,
  .selection-grid {
    grid-template-columns: 1fr;
  }

  .file-panel {
    position: static;
  }

  .select-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 16px, 1220px);
    margin: 8px auto;
    border-radius: 20px;
  }

  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .site-header,
  main {
    padding: 22px 18px;
  }

  .site-footer {
    margin: 0 18px;
    padding-bottom: 24px;
  }

  .site-header nav,
  .site-footer nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .upload-hero {
    min-height: 0;
  }

  .process-steps {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .process-arrow {
    display: none;
  }

  .upload-card {
    padding: 16px;
  }

  .drop-zone {
    min-height: 260px;
  }

  .step-pills {
    flex-wrap: wrap;
  }

  .preview-toolbar,
  .element-list-panel summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-actions {
    width: 100%;
  }

  .preview-actions .compact {
    flex: 1;
  }

  .element-checklist {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    padding: 16px;
  }

  .status-card {
    padding: 28px 18px;
  }
}
