:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-muted: #eef3f2;
  --text: #1e2524;
  --muted: #66716f;
  --border: #d8dedb;
  --accent: #246b5a;
  --accent-strong: #174c40;
  --warning: #8a4f13;
  --error: #9f2a2a;
  --shadow: 0 18px 50px rgba(28, 38, 36, 0.11);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body { height: 100%; overflow: hidden; }

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.wizard {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.wizard-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  gap: 12px;
}

.test-mode-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.test-mode-badge__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--error);
}

.welcome-banner {
  margin: 0 auto;
  max-width: 600px;
  padding: 14px 18px;
  border: 1px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  background: #fff5f5;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}

.success-screen .success-notice {
  margin: 0 auto;
  max-width: 560px;
  color: var(--error);
}

.legal-links {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.legal-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease;
}

.legal-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.stepper {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.stepper__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.stepper__icon {
  display: none;
  width: 18px;
  height: 18px;
}

.stepper__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.stepper__button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.stepper__button--current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.stepper__button--available {
  background: var(--surface-muted);
}

.stepper__button--available:not(:disabled):hover {
  background: #e3eae8;
}

.wizard-steps {
  position: relative;
  flex: 1;
  min-height: 0;
}

.wizard-step {
  display: none;
  flex-direction: column;
  height: 100%;
  padding: 24px 32px;
  overflow: hidden;
}

.wizard-step.is-active {
  display: flex;
}

.wizard-step__header {
  flex-shrink: 0;
  margin-bottom: 18px;
}

.wizard-step__header .lead {
  margin-bottom: 0;
}

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

h1 { margin-bottom: 10px; font-size: 56px; line-height: 0.98; }
h2 { margin-bottom: 4px; font-size: 19px; line-height: 1.2; }

.lead {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  text-align: center;
}

.ghost-button,
.primary-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.ghost-button {
  padding: 0 14px;
  color: var(--accent);
  background: var(--surface-muted);
}

.primary-button {
  width: 100%;
  padding: 0 18px;
  color: #ffffff;
  background: var(--accent);
}

.primary-button--auto { width: auto; }

.button-icon {
  display: none;
  width: 18px;
  height: 18px;
}

.button-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.ghost-button:disabled,
.primary-button:disabled,
fieldset:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.preview-empty {
  display: grid;
  gap: 10px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.preview-empty span { font-size: 42px; line-height: 1; }
.preview-empty p { margin-bottom: 0; }

.preview-frame {
  display: flex;
  position: relative;
  min-height: 300px;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border: 2px dashed #9ab0aa;
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(36, 107, 90, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(36, 107, 90, 0.06) 25%, transparent 25%),
    var(--surface-muted);
  background-size: 28px 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

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

.preview-frame.is-dragover {
  border-color: var(--accent);
  background-color: #e8f1ee;
  transform: translateY(-1px);
}

.preview-frame.has-image {
  border: 1px solid var(--border);
  background:
    linear-gradient(45deg, #eef1ef 25%, transparent 25%),
    linear-gradient(-45deg, #eef1ef 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1ef 75%),
    linear-gradient(-45deg, transparent 75%, #eef1ef 75%),
    #ffffff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  cursor: default;
}

#previewImage {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#uploadCanvas {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-frame.has-image .preview-empty { display: none; }
.preview-frame.has-image #uploadCanvas { display: block; }

.file-facts {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfb;
}
.file-facts strong {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
}
.file-facts ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.file-facts li span {
  color: var(--text);
  font-weight: 700;
}

.button-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.upload-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 3fr);
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.upload-panel,
.preview-panel,
.controls-panel,
.halftone-preview,
.delivery-info,
.delivery-form,
.summary-panel,
.confirmed-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.upload-panel,
.preview-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-panel .preview-frame {
  flex: 1;
  min-height: 0;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 3fr);
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.editor-mobile-toolbar,
.editor-mobile-panel {
  display: none;
}

.controls-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.control-group {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow-y: auto;
}

.control-group legend {
  margin-bottom: 14px;
  font-size: 17px;
  font-weight: 800;
}

.field,
.select-field { display: grid; gap: 8px; }
.field span,
.select-field span { color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.field output { color: var(--accent-strong); font-size: 14px; font-weight: 800; }
.field input[type="range"] { width: 100%; accent-color: var(--accent); }
.field input[type="text"] {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
}
.field input[readonly] {
  background: var(--surface-muted);
  color: var(--muted);
  cursor: not-allowed;
}
.range-with-input {
  display: flex;
  align-items: center;
  gap: 10px;
}
.range-with-input input[type="range"] {
  flex: 1;
}
.range-with-input input[type="number"] {
  width: 64px;
  min-height: 36px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
  text-align: center;
}

.size-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfb;
}

.size-box__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.size-box__heading strong { font-size: 15px; }
.size-box__heading span { color: var(--accent); font-size: 13px; font-weight: 800; }
.size-box__heading span.is-error { color: var(--error); }

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.segmented-control button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
  cursor: pointer;
  font-weight: 800;
}
.segmented-control button.is-active { color: #ffffff; border-color: var(--accent); background: var(--accent); }

.select-field select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
}

.size-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.size-fields label { display: grid; gap: 7px; }
.size-fields span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.size-fields input {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
}
.size-fields input.is-error { border-color: var(--error); color: var(--error); }
.size-fields input[readonly] {
  background: var(--surface-muted);
  color: var(--muted);
  cursor: not-allowed;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.check-field input { width: 18px; height: 18px; accent-color: var(--accent); }

.consent-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
.consent-field input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.consent-field a {
  color: var(--accent);
  text-decoration: underline;
}
.consent-field a:hover {
  color: var(--accent-strong);
}
.consent-field.is-error {
  border-color: var(--error);
  background: #fff0f0;
}

.welcome-consent-field {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

.production-note {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.production-note strong { display: block; margin-bottom: 10px; }
.production-note ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.halftone-preview {
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.canvas-frame {
  display: flex;
  position: relative;
  flex: 1;
  min-height: 0;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef1ef 25%, transparent 25%),
    linear-gradient(-45deg, #eef1ef 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1ef 75%),
    linear-gradient(-45deg, transparent 75%, #eef1ef 75%),
    #ffffff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

#halftoneCanvas {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.canvas-frame.has-render #canvasEmpty { display: none; }
.canvas-frame.has-render #halftoneCanvas { display: block; }

.delivery-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 3fr);
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.delivery-info,
.delivery-form {
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.delivery-info h3 { margin: 0 0 10px; font-size: 17px; }
.delivery-info p { margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.delivery-info ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.delivery-form fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow-y: auto;
}

.delivery-form legend { margin-bottom: 14px; font-size: 17px; font-weight: 800; }
.delivery-form .field,
.delivery-form .select-field { display: grid; gap: 8px; }
.delivery-form .field span,
.delivery-form .select-field span { color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.delivery-form input,
.delivery-form select,
.delivery-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}
.delivery-form textarea { min-height: 80px; padding-top: 10px; padding-bottom: 10px; resize: vertical; }
.delivery-form input:focus,
.delivery-form select:focus,
.delivery-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.delivery-form input.is-error,
.delivery-form textarea.is-error { border-color: var(--error); color: var(--error); }

.delivery-form .field:last-child,
.delivery-form .delivery-note,
.delivery-form .field-hint,
.delivery-form button[type="submit"] {
  grid-column: 1 / -1;
}

.required-mark {
  color: var(--error);
  font-weight: 800;
}

.field-hint {
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.field-hint.is-error {
  color: var(--error);
  background: #fff0f0;
}

.delivery-note {
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  color: var(--warning);
  background: #fff7ed;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 3fr);
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.confirmed-preview {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.confirmed-preview__content {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  min-height: 300px;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border: 2px dashed #9ab0aa;
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(36, 107, 90, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(36, 107, 90, 0.06) 25%, transparent 25%),
    var(--surface-muted);
  background-size: 28px 28px;
  text-align: center;
}

.confirmed-preview__content.has-image {
  border: 1px solid var(--border);
  background:
    linear-gradient(45deg, #eef1ef 25%, transparent 25%),
    linear-gradient(-45deg, #eef1ef 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1ef 75%),
    linear-gradient(-45deg, transparent 75%, #eef1ef 75%),
    #ffffff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

#reviewImage {
  display: none;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.confirmed-preview.has-render .preview-empty { display: none; }
.confirmed-preview.has-render #reviewImage { display: block; }
.confirmed-preview.has-render .review-status { display: none; }

.confirmed-preview.has-error .preview-empty { display: none; }
.confirmed-preview.has-error #reviewImage { display: none; }
.confirmed-preview.has-error .review-status { display: flex; }

.review-status {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 16px;
  text-align: center;
  font-size: 0.95rem;
}

.review-status--loading {
  color: var(--muted, #6b7280);
}

.review-status--error {
  color: #b91c1c;
}

.summary-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.summary-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  overflow-y: auto;
}

.summary-list div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfb;
}

.summary-list dt { margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.summary-list dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 700; line-height: 1.4; }

.success-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  height: 100%;
  text-align: center;
}


.success-screen h1 { font-size: 48px; margin-bottom: 0; }
.success-screen p { color: var(--muted); font-size: 18px; }
.success-screen .primary-button { width: auto; min-width: 160px; }

@media (max-width: 860px) {
  .upload-layout,
  .editor-layout,
  .delivery-layout,
  .review-layout {
    grid-template-columns: 1fr;
  }

  .editor-layout {
    padding-bottom: 58px;
  }

  .controls-panel {
    display: none;
  }

  .editor-mobile-toolbar {
    display: flex;
    position: fixed;
    bottom: 0;
    bottom: env(safe-area-inset-bottom);
    left: 0;
    right: 0;
    z-index: 1100;
    gap: 4px;
    padding: 6px 8px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--surface);
    overflow-x: auto;
  }

  .editor-mobile-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    background: var(--surface-muted);
  }

  .editor-mobile-toolbar button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
  }

  .editor-mobile-toolbar button.is-active {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
  }

  .editor-mobile-panel {
    display: none;
    position: fixed;
    bottom: calc(52px + env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    z-index: 1101;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .editor-mobile-panel.is-open {
    display: block;
  }

  .editor-mobile-panel__header {
    display: none;
  }

  .is-mobile-clone .size-box {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .is-mobile-clone .size-box .size-fields {
    display: none;
  }

  .delivery-form fieldset {
    grid-template-columns: 1fr;
  }

  .controls-panel,
  .delivery-info {
    overflow-y: auto;
  }

  .wizard-step[data-step="delivery"],
  .wizard-step[data-step="review"] {
    overflow-y: auto;
  }

  .delivery-layout,
  .review-layout {
    flex: none;
    min-height: auto;
    height: auto;
  }

  .delivery-info,
  .delivery-form,
  .summary-panel {
    overflow: visible;
  }

  .delivery-form fieldset,
  .summary-list {
    overflow-y: visible;
  }

  .canvas-frame,
  .confirmed-preview {
    min-height: 320px;
  }
}

.welcome-screen {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 100%;
  padding: 24px 0;
  overflow-y: auto;
}

.welcome-content {
  display: grid;
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.welcome-content h1 { font-size: 56px; margin-bottom: 0; }

.welcome-lead {
  margin: 0 auto;
  max-width: 560px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.welcome-features {
  display: grid;
  gap: 14px;
  margin: 10px 0;
  text-align: left;
}

.welcome-feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.welcome-feature__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.welcome-feature strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.welcome-feature p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.welcome-content .primary-button {
  justify-self: center;
  min-width: 200px;
}

@media (max-width: 560px) {
  .welcome-content h1 { font-size: 40px; }
  .welcome-lead { font-size: 18px; }
  .welcome-banner { font-size: 14px; }
  .welcome-feature { padding: 14px; }
}

@media (max-width: 560px) {
  .wizard-step { padding: 16px; }

  .stepper__button {
    padding: 8px;
    min-height: 34px;
  }

  .stepper__icon {
    display: inline-flex;
  }

  .stepper__label {
    display: none;
  }

  .button-icon {
    display: inline-flex;
  }

  .button-label {
    display: none;
  }

  .ghost-button,
  .primary-button {
    min-height: 34px;
    padding: 8px;
  }

  .button-row {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .wizard-step__header .lead,
  .welcome-lead {
    font-size: 13px;
  }

  .upload-layout {
    grid-template-columns: 1fr;
  }

  .upload-panel {
    display: none;
  }

  .wizard-header {
    padding: 10px 12px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
  }

  .test-mode-badge {
    font-size: 12px;
  }

  .legal-links {
    justify-content: center;
    gap: 10px;
    font-size: 12px;
  }

  .welcome-screen {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100%;
    height: auto;
    padding: 16px;
    overflow-y: auto;
  }

  .welcome-content {
    flex-shrink: 0;
    gap: 10px;
    width: 100%;
  }

  .welcome-content h1 {
    font-size: 32px;
  }

  .welcome-lead {
    font-size: 16px;
    line-height: 1.4;
  }

  .welcome-features {
    gap: 8px;
    margin: 4px 0;
  }

  .welcome-feature {
    padding: 10px;
    gap: 10px;
  }

  .welcome-feature__icon {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  .welcome-feature strong {
    font-size: 14px;
  }

  .welcome-feature p {
    font-size: 13px;
    line-height: 1.4;
  }

  .welcome-content .primary-button {
    justify-self: center;
    min-width: 160px;
    margin-top: 6px;
  }

  .ghost-button { width: 100%; }
  .primary-button--auto { width: 100%; }
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  bottom: env(safe-area-inset-bottom);
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 -4px 20px rgba(28, 38, 36, 0.12);
}

.cookie-banner__text {
  margin: 0;
  max-width: 720px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.cookie-banner__text a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-banner__accept,
.cookie-banner__decline {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.cookie-banner__accept {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.cookie-banner__decline {
  color: var(--text);
  background: transparent;
}

@media (max-width: 560px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }

  .cookie-banner__actions {
    justify-content: stretch;
  }

  .cookie-banner__accept,
  .cookie-banner__decline {
    flex: 1;
  }
}
