:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: rgba(12, 19, 34, 0.92);
  --text: #f5f7fb;
  --muted: #a9b4c7;
  --brand: #74c0fc;
  --brand-strong: #4dabf7;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(116, 192, 252, 0.18), transparent 35%),
    radial-gradient(circle at top right, rgba(140, 233, 154, 0.12), transparent 28%),
    linear-gradient(180deg, #08111f 0%, #0b1324 44%, #050913 100%);
  color: var(--text);
}
body { min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1320px, calc(100vw - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.hero { display: grid; grid-template-columns: 1.7fr 0.9fr; gap: 20px; align-items: stretch; margin-bottom: 24px; }
.hero-copy, .hero-card, .wizard, .export-card, .editor-panel { background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.hero-copy { border-radius: 32px; padding: 32px; }
.hero-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hero-actions { display: grid; gap: 8px; justify-items: end; }
.eyebrow { margin: 0 0 8px; color: var(--brand); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.78rem; }
h1 { margin: 0; font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: 1; }
.lede { max-width: 62ch; margin: 16px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.version-label { margin: 0; color: var(--muted); font-size: 0.95rem; }
.settings-button { display: inline-flex; align-items: center; gap: 8px; }
.settings-button span[aria-hidden="true"] { font-size: 1rem; }
.hero-card { border-radius: 32px; padding: 22px; display: grid; gap: 14px; align-content: center; }
.hero-stat { padding: 18px 20px; border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)); border: 1px solid var(--border); }
.hero-stat span { display: block; font-size: 1.8rem; font-weight: 700; }
.hero-stat small { color: var(--muted); }
.wizard { border-radius: 32px; padding: 24px; }
.step1-action-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.assistant-launch,
.restart-launch {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  padding: 12px;
  align-content: start;
}
.assistant-launch .primary,
.restart-launch .secondary {
  justify-self: start;
}
.assistant-launch p,
.restart-launch p {
  margin: 0;
  color: var(--muted);
}
.progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.step-chip { border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--muted); border-radius: 999px; padding: 12px 16px; }
.step-chip.active { color: var(--text); border-color: rgba(116, 192, 252, 0.45); background: rgba(116, 192, 252, 0.15); }
.step-panel { display: none; animation: fade-up 220ms ease-out; }
.step-panel.active { display: block; }
.panel-head { margin-bottom: 18px; }
.panel-head h2, .panel-head h3 { margin: 0 0 6px; }
.panel-head p, .helper { margin: 0; color: var(--muted); line-height: 1.5; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.preset { position: relative; border-radius: 20px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text); padding: 12px; min-height: 96px; display: flex; align-items: center; justify-content: center; }
.preset.active { border-color: rgba(140, 233, 154, 0.6); background: rgba(140, 233, 154, 0.12); }
.preset strong { display: block; margin-top: 8px; font-size: 1.1rem; }
.grid-mini { display: grid; gap: 4px; width: 64px; height: 64px; max-width: 100%; max-height: 100%; }
.grid-mini span { border-radius: 5px; background: rgba(255,255,255,0.16); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.field {margin-top: 10px;display: grid; gap: 8px; padding: 16px; border-radius: 20px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); }
.field span { color: var(--muted); font-size: 0.95rem; }
.field strong { font-size: 1rem; }
.field input[type="number"], .field input[type="text"], .field textarea, .field select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(5,9,19,0.75);
  color: var(--text);
  padding: 10px 12px;
}
.field textarea { resize: vertical; min-height: 72px; }
.field input[type="range"] { width: 100%; }
.layout-mode-suggestion {
  margin-top: 4px;
  display: grid;
  gap: 8px;
}
.layout-mode-suggestion span {
  color: #ffd39a;
}
.layout-mode-suggestion .secondary {
  justify-self: start;
  padding: 8px 12px;
}
.step-actions { display: flex; gap: 12px; justify-content: space-between; margin-top: 18px; }
.primary, .secondary { border: 1px solid transparent; border-radius: 999px; padding: 12px 18px; transition: transform 120ms ease, border-color 120ms ease, background 120ms ease; }
.primary { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #04111f; font-weight: 700; }
.secondary { color: var(--text); background: rgba(255,255,255,0.05); border-color: var(--border); }
.primary:hover, .secondary:hover, .preset:hover, .step-chip:hover, .slot:hover, .preview-cell:hover { transform: translateY(-1px); }
.secondary.active {
  border-color: rgba(140, 233, 154, 0.8);
  background: rgba(140, 233, 154, 0.18);
  color: #e8ffe6;
}
.settings-dialog::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); }
.settings-dialog { border: none; padding: 0; background: transparent; color: var(--text); max-width: calc(100vw - 8px); max-width: calc(100dvw - 8px); }
.settings-panel { width: min(560px, calc(100vw - 24px)); width: min(560px, calc(100dvw - 24px)); max-width: calc(100vw - 24px); max-width: calc(100dvw - 24px); border-radius: 28px; border: 1px solid var(--border); background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(10, 16, 30, 0.98)); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 14px; box-sizing: border-box; }
.help-panel { width: min(840px, calc(100vw - 24px)); }
.assistant-panel {
  width: min(880px, calc(100vw - 20px));
  width: min(880px, calc(100dvw - 20px));
  max-width: calc(100vw - 20px);
  max-width: calc(100dvw - 20px);
  max-height: min(86vh, 900px);
  overflow: auto;
  overflow-x: hidden;
}
.confirm-panel { width: min(460px, calc(100vw - 24px)); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-copy { margin: 0; color: var(--muted); }
.settings-stack { display: grid; gap: 10px; }
.updates-block { border: 1px solid var(--border); border-radius: 18px; background: rgba(255,255,255,0.03); padding: 14px; display: grid; gap: 10px; }
.updates-block h3 { margin: 0; font-size: 1rem; }
.settings-status { margin: 0; color: var(--muted); line-height: 1.5; }
.settings-status.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.settings-status.loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(116, 192, 252, 0.25);
  border-top-color: rgba(116, 192, 252, 1);
  animation: spin 0.8s linear infinite;
}
.assistant-suggestions {
  display: grid;
  gap: 12px;
}
.assistant-suggestions-title {
  color: var(--text);
  font-size: 1rem;
}
.assistant-suggestion-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
}
.assistant-suggestion-card .grid-mini {
  grid-row: span 4;
  margin: 0;
}
.assistant-suggestion-card strong {
  font-size: 1rem;
}
.assistant-suggestion-card p {
  margin: 0;
  overflow-wrap: anywhere;
}
.assistant-orientation-hint {
  margin: 0;
  padding: 6px 9px;
  border-radius: 10px;
  font-size: 0.86rem;
}
.assistant-orientation-hint--multiline {
  white-space: pre-line;
  line-height: 1.4;
}
.assistant-orientation-hint--good {
  border: 1px solid rgba(140, 233, 154, 0.45);
  background: rgba(140, 233, 154, 0.12);
  color: #d7ffd2;
}
.assistant-orientation-hint--warn {
  border: 1px solid rgba(255, 213, 102, 0.5);
  background: rgba(255, 213, 102, 0.14);
  color: #fff0b3;
}
.assistant-orientation-hint--bad {
  border: 1px solid rgba(255, 140, 140, 0.5);
  background: rgba(255, 140, 140, 0.14);
  color: #ffd1d1;
}
.assistant-suggestion-card button {
  justify-self: start;
  padding: 10px 14px;
}
.watermark-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.exif-disabled {
  opacity: 0.72;
}
.help-content { margin: 0; max-height: min(62vh, 680px); overflow: auto; border: 1px solid var(--border); border-radius: 14px; padding: 16px; background: rgba(5,9,19,0.75); color: var(--muted); line-height: 1.65; }
.help-content h1,
.help-content h2,
.help-content h3 { color: var(--text); margin: 20px 0 10px; }
.help-content h1:first-child,
.help-content h2:first-child,
.help-content h3:first-child { margin-top: 0; }
.help-content p,
.help-content ul,
.help-content ol,
.help-content blockquote,
.help-content table,
.help-content figure,
.help-content pre { margin: 0 0 14px; }
.help-content ul,
.help-content ol { padding-left: 20px; }
.help-content blockquote { padding: 12px 14px; border-left: 4px solid rgba(116, 192, 252, 0.8); background: rgba(255,255,255,0.06); border-radius: 12px; color: var(--text); }
.help-content code,
.help-content pre { font-family: Consolas, "Courier New", monospace; }
.help-content code { color: #b5e3ff; }
.help-content pre { overflow-x: auto; padding: 14px; border-radius: 14px; background: rgba(2,6,14,0.9); color: var(--text); border: 1px solid rgba(255,255,255,0.09); }
.help-content a { color: var(--brand); }
.help-content hr { border: 0; border-top: 1px solid rgba(255,255,255,0.16); margin: 18px 0; }
.help-content table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 12px; background: rgba(255,255,255,0.04); }
.help-content th,
.help-content td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: left; vertical-align: top; }
.help-content th { color: var(--text); background: rgba(255,255,255,0.06); }
.help-content img { max-width: 100%; height: auto; display: block; border-radius: 12px; }
.settings-footer { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.upload-zone { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 24px; border: 1px dashed rgba(116, 192, 252, 0.5); background: rgba(116, 192, 252, 0.08); margin-bottom: 18px; }
.upload-zone.dragging { border-color: rgba(140, 233, 154, 0.75); background: rgba(140, 233, 154, 0.12); }
.upload-zone input { max-width: 290px; }
.upload-zone.disabled { opacity: 0.6; border-style: solid; border-color: var(--border); }
.touch-upload-mode .upload-zone {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
  cursor: pointer;
  border-style: solid;
  border-color: rgba(116, 192, 252, 0.35);
  background: rgba(116, 192, 252, 0.1);
}
.touch-upload-mode .upload-zone.dragging {
  border-color: rgba(116, 192, 252, 0.35);
  background: rgba(116, 192, 252, 0.1);
}
.touch-upload-mode .upload-zone input {
  max-width: none;
  width: 100%;
}
.touch-upload-mode .upload-zone > div {
  width: 100%;
}
.slot-status { margin-bottom: 14px; color: var(--muted); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.slot { position: relative; overflow: hidden; min-height: 150px; border-radius: 20px; border: 1px solid var(--border); background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03)), rgba(255,255,255,0.04); color: var(--text); text-align: left; cursor: pointer; }
.slot.drag-source { opacity: 0.65; }
.slot.drag-over { outline: 2px solid rgba(116, 192, 252, 0.7); outline-offset: -2px; }
.slot-tools {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  display: inline-flex;
  gap: 6px;
}
.slot-tool {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(5, 9, 19, 0.72);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
.slot-tool:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.slot-tool:not(:disabled):hover {
  background: rgba(20, 32, 56, 0.9);
  border-color: rgba(148, 197, 255, 0.5);
}
.slot img, .preview-cell img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; display: block; transform-origin: center center; }
.preview-cell img {
  -webkit-touch-callout: none;
  user-select: none;
}
.slot-index, .cell-index { position: absolute; z-index: 2; top: 10px; left: 10px; padding: 5px 8px; border-radius: 999px; background: rgba(5,9,19,0.68); font-size: 0.78rem; letter-spacing: 0.04em; }
.preview-cell.shape-circle .cell-index,
.preview-cell.shape-diamond .cell-index,
.preview-cell.shape-hexagon .cell-index {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 9, 19, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.slot-label, .empty-note { position: absolute; inset: auto 12px 12px 12px; z-index: 2; color: var(--muted); font-size: 0.92rem; }
.slot.empty::before, .preview-cell.empty::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255,255,255,0.05), rgba(255,255,255,0.05) 14px, rgba(255,255,255,0.02) 14px, rgba(255,255,255,0.02) 28px); }
.hex-tuning {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.hex-tuning-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.editor-layout, .export-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr); gap: 18px; }
.collage-preview-wrap { min-width: 0; }
.collage-preview { --grid-gap: 12px; --outer-gap: 12px; position: relative; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 0; aspect-ratio: 1 / 1; width: 100%; overflow: hidden; }
.collage-preview { touch-action: none; }
.preview-cell { position: absolute; overflow: hidden; border-radius: 0; border: 1px solid rgba(255,255,255,0.08); background: rgba(4,8,16,0.8); min-height: 0; touch-action: none; }
.preview-cell.shape-rect { border-radius: 0; clip-path: none; }
.preview-cell.shape-rounded-rect { border-radius: 16px; clip-path: none; }
.preview-cell.shape-circle { border-radius: 50%; }
.preview-cell.shape-diamond {
  border-radius: 0;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.preview-cell.shape-hexagon {
  border-radius: 0;
  clip-path: polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%);
}
.preview-cell.drag-source { opacity: 0.68; }
.preview-cell.drag-over { outline: 2px solid rgba(116, 192, 252, 0.75); outline-offset: -2px; }
.preview-text-overlay {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 20px);
  text-align: center;
  white-space: pre;
  line-height: 1.2;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  z-index: 3;
}
.preview-text-overlay.interactive { pointer-events: auto; cursor: grab; }
.preview-text-overlay.dragging { cursor: grabbing; }
.preview-cell.selected { outline: 3px solid var(--active-outline-color, rgba(116, 192, 252, 0.75)); outline-offset: -3px; }
.preview-cell.reorder-source { outline: 3px solid rgba(140, 233, 154, 0.9); outline-offset: -3px; }
.preview-cell img { position: absolute; inset: 0; }
.editor-panel, .export-card { border-radius: 28px; padding: 20px; }
.compact { margin-bottom: 12px; }
.editor-frame {
  position: relative;
  overflow: visible;
  min-height: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.editor-info {
  margin: 0 0 2px;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.4;
}
.editor-text-overlay {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 20px);
  text-align: center;
  white-space: pre;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  z-index: 4;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.editor-text-overlay.dragging { cursor: grabbing; }
.editor-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.editor-controls .control-wide { grid-column: 1 / -1; }
.zoom-field { margin-top: 12px; }
#resetZoom {
  margin-top: 10px;
  width: 100%;
}
.text-editor-field { margin-top: 12px; align-content: start; }
.text-editor-field > label { display: grid; gap: 8px; }
.text-toggle-row { display: flex; gap: 16px; flex-wrap: wrap; }
.export-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}
.export-preset-select {
  display: none;
}
.export-preset-group-title {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.export-preset {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 4px;
  min-height: 82px;
}
.export-preset strong {
  font-size: 0.98rem;
  line-height: 1.2;
}
.export-preset small {
  color: var(--muted);
  line-height: 1.35;
}
.export-preset.active {
  border-color: rgba(116, 192, 252, 0.62);
  background: rgba(116, 192, 252, 0.14);
}
.export-preset:disabled {
  opacity: 1;
}
.export-card { align-self: start; }
.export-preview { min-width: 0; border-radius: 0; border: 1px solid var(--border); background: rgba(255,255,255,0.04); padding: 20px; }
.export-preview canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  background: rgba(4,8,16,0.85);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.16);
}
.export-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.export-actions button { flex: 1 1 220px; }
.export-status { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; }
.export-status.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(116, 192, 252, 0.25);
  border-top-color: rgba(116, 192, 252, 1);
  animation: spin 0.8s linear infinite;
}
.helper { margin: 10px 0 16px; }
.safe-area-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 102, 0.35);
  background: rgba(255, 213, 102, 0.08);
}
.safe-area-info .settings-status {
  margin: 0;
}
.safe-area-info .icon-only {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
#autoFitSafeAreaButton {
  width: 100%;
  margin: 0 0 12px;
}
.export-warning {
  margin: 0 0 14px;
}
.warning-text {
  margin-top: 8px;
  color: #ffd39a;
  border: 1px solid rgba(255, 171, 99, 0.42);
  background: rgba(255, 171, 99, 0.12);
  border-radius: 12px;
  padding: 8px 10px;
}
input[type="file"] { color: var(--muted); }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (max-width: 980px) {
  .hero, .editor-layout, .export-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .hex-tuning-grid { grid-template-columns: 1fr 1fr; }
  .progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assistant-panel { width: calc(100vw - 12px); width: calc(100dvw - 12px); max-width: calc(100vw - 12px); max-width: calc(100dvw - 12px); }
  .confirm-panel { width: calc(100vw - 12px); width: calc(100dvw - 12px); max-width: calc(100vw - 12px); max-width: calc(100dvw - 12px); }
  .editor-layout { align-items: start; }
  .collage-preview-wrap {
    position: sticky;
    top: 8px;
    z-index: 4;
    background: rgba(8, 17, 31, 0.95);
    border-radius: 14px;
    padding: 4px;
  }
}
@media (max-width: 640px) {
  .shell { width: min(100vw - 18px, 1320px); padding-top: 10px; }
  .hero-copy, .wizard, .editor-panel, .export-card { border-radius: 22px; padding: 18px; }
  .hero-title-row { align-items: stretch; }
  .hero-actions { justify-items: stretch; width: 100%; }
  .settings-button { width: 100%; justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  .editor-controls { grid-template-columns: 1fr 1fr; }
  .hex-tuning-grid { grid-template-columns: 1fr; }
  #resetZoom { width: 100%; }
  .upload-zone { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 10px; }
  .upload-zone input { max-width: none; width: 100%; }
  .step-actions { flex-direction: column; position: sticky; bottom: 8px; z-index: 2; padding-top: 8px; background: linear-gradient(180deg, rgba(8, 17, 31, 0), rgba(8, 17, 31, 0.92) 35%); }
  .settings-panel { width: calc(100vw - 12px); width: calc(100dvw - 12px); max-width: calc(100vw - 12px); max-width: calc(100dvw - 12px); padding: 16px; }
  .assistant-panel { width: calc(100vw - 8px); width: calc(100dvw - 8px); max-width: calc(100vw - 8px); max-width: calc(100dvw - 8px); }
  .confirm-panel { width: calc(100vw - 8px); width: calc(100dvw - 8px); max-width: calc(100vw - 8px); max-width: calc(100dvw - 8px); }
  .step1-action-cards { grid-template-columns: 1fr; }
  .assistant-launch .primary,
  .restart-launch .secondary { justify-self: stretch; }
  .assistant-suggestion-card {
    grid-template-columns: 1fr;
  }
  .assistant-suggestion-card .grid-mini {
    grid-row: auto;
    justify-self: center;
  }
  .export-preset-grid { display: none; }
  .export-preset-select { display: block; }
}
