:root {
  --bg: #f2f1ed;
  --panel: #ffffff;
  --panel-soft: #f7f6f2;
  --text: #181917;
  --muted: #74766f;
  --line: #e4e2da;
  --dark: #171817;
  --dark-2: #292b28;
  --accent: #9b8768;
  --success: #4f7a5e;
  --danger: #9d5050;
  --shadow: 0 18px 55px rgba(22, 23, 21, .07);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.topbar {
  background: var(--dark);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar-inner {
  width: min(1440px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: 156px; height: 30px; object-fit: contain; object-position: left center; display: block; }
.brand-divider { width: 1px; height: 26px; background: rgba(255,255,255,.2); }
.brand-tool { font-size: 12px; color: rgba(255,255,255,.62); white-space: nowrap; }
.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  white-space: nowrap;
}
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: #78b58c; box-shadow: 0 0 0 4px rgba(120,181,140,.12); flex: 0 0 auto; }
.privacy-dot.mini { width: 6px; height: 6px; box-shadow: none; }

.app-shell { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 64px; }
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 48px;
  align-items: end;
  padding: 0 4px 28px;
}
.eyebrow { display: block; margin-bottom: 10px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.intro h1 { margin: 0; max-width: 800px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 4vw, 58px); line-height: 1.02; font-weight: 400; letter-spacing: -.03em; }
.intro > p { margin: 0 0 4px; color: var(--muted); font-size: 14px; line-height: 1.65; max-width: 590px; justify-self: end; }

.workspace { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 18px; align-items: start; }
.controls-column { display: grid; gap: 14px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid rgba(23,24,21,.075); border-radius: var(--radius); box-shadow: var(--shadow); }
.upload-panel, .logo-panel, .settings-panel { padding: 20px; }
.settings-panel { position: sticky; top: 14px; }
.section-title { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; min-width: 0; }
.section-title.compact-title { margin-bottom: 15px; }
.step { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; display: grid; place-items: center; background: var(--dark); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.section-title h2 { margin: 0; font-size: 16px; line-height: 1.2; }
.section-title p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.3; }

.dropzone {
  min-height: 135px;
  border: 1.5px dashed #c7c4ba;
  border-radius: 15px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--panel-soft);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: #f3efe8; transform: translateY(-1px); }
.drop-icon { width: 38px; height: 38px; margin-bottom: 10px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--line); font-size: 18px; }
.dropzone strong { font-size: 13px; }
.dropzone > span:last-child { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.file-summary { padding: 12px 2px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.file-count-wrap { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.file-count-wrap strong { font-size: 17px; }
.file-count-wrap span { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-summary-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.add-more-button { text-decoration: none; }
.image-queue { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 310px; overflow: auto; padding: 2px 3px 3px 2px; scrollbar-width: thin; }
.queue-item { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
.queue-item.is-active { border-color: #88857d; box-shadow: 0 0 0 1px #88857d; }
.queue-preview { width: 100%; aspect-ratio: 1.18 / 1; position: relative; display: block; overflow: hidden; padding: 0; border: 0; border-radius: 10px 10px 0 0; background: #e9e7e1; cursor: pointer; }
.queue-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.queue-number { position: absolute; left: 6px; bottom: 6px; min-width: 20px; height: 20px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: rgba(18,19,18,.78); color: #fff; font-size: 8px; font-weight: 800; backdrop-filter: blur(5px); }
.queue-meta { padding: 7px 28px 7px 8px; min-width: 0; }
.queue-name { display: block; overflow: hidden; color: var(--text); font-size: 8.5px; font-weight: 750; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.queue-size { display: block; margin-top: 2px; color: var(--muted); font-size: 7.5px; }
.queue-remove { width: 23px; height: 23px; position: absolute; right: 4px; bottom: 7px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #99958c; font-size: 16px; line-height: 1; cursor: pointer; }
.queue-remove:hover { background: #f4eceb; color: var(--danger); }
.text-button { border: 0; padding: 5px 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.text-button:hover { color: var(--dark); }
.text-button.danger:hover { color: var(--danger); }

.logo-card { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 13px; align-items: center; }
.logo-preview-box { width: 74px; height: 66px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #20211f; border: 1px solid rgba(0,0,0,.08); }
.logo-preview-box img { width: 88%; height: 72%; object-fit: contain; display: block; }
.logo-info { min-width: 0; }
.logo-info strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-info span { display: block; margin-top: 4px; color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.logo-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d7d3ca; background: #fff; border-radius: 10px; color: var(--text); font-weight: 750; cursor: pointer; }
.secondary-button.small { min-height: 36px; padding: 0 12px; font-size: 10px; }
.secondary-button:hover { border-color: #aaa69c; background: var(--panel-soft); }

.setting-block { margin: 14px 0; }
.control-label-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.control-label-row label { font-size: 11px; font-weight: 750; }
.control-label-row output { min-width: 38px; color: var(--muted); font-size: 10px; text-align: right; }
.tiny-hint { color: var(--muted); font-size: 9px; text-align: right; }
.range { width: 100%; appearance: none; height: 4px; border-radius: 999px; background: #dbd8cf; outline: none; }
.range::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--dark); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--dark); cursor: pointer; }
.range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--dark); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--dark); cursor: pointer; }
.position-block { margin-top: 16px; }
.position-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-soft); }
.position-grid button { height: 34px; position: relative; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; }
.position-grid button::after { content: ""; width: 7px; height: 7px; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); border-radius: 2px; background: #aaa79f; }
.position-grid button:hover { background: #fff; }
.position-grid button.is-active { border-color: #d6d1c7; background: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.035); }
.position-grid button.is-active::after { background: var(--dark); }
.advanced-settings { margin-top: 10px; border-top: 1px solid var(--line); }
.advanced-settings summary { padding: 12px 0 0; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.advanced-inner { margin-bottom: 0; }
.process-instruction {
  margin-top: 16px;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #dcd7cc;
  border-radius: 12px;
  background: #f5f1e9;
}
.process-instruction-number {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--dark);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
}
.process-instruction div { min-width: 0; }
.process-instruction strong { display: block; font-size: 11px; line-height: 1.25; }
.process-instruction div > span { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.45; }

.primary-button { width: 100%; min-height: 50px; margin-top: 18px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 13px; background: var(--dark); color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; transition: transform .18s ease, background .18s ease, opacity .18s ease; }
.primary-button:hover:not(:disabled) { background: var(--dark-2); transform: translateY(-1px); }
.primary-button:disabled { opacity: .34; cursor: not-allowed; }
.button-arrow { font-size: 17px; }
.local-note { margin: 10px 2px 0; display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.local-note .privacy-dot { margin-top: 4px; }

.preview-panel { padding: 20px; min-width: 0; }
.preview-header { min-height: 42px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.preview-title { margin-bottom: 0; }
.preview-title-copy { min-width: 0; }
.preview-title-copy p { max-width: min(48vw, 620px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-actions { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.icon-button:hover:not(:disabled) { border-color: #aaa69c; }
.icon-button:disabled { opacity: .35; cursor: default; }
.preview-stage-wrap { width: 100%; height: clamp(560px, calc(100vh - 230px), 760px); min-height: 560px; display: grid; place-items: center; overflow: hidden; position: relative; border-radius: 16px; background: #20211f; }
.preview-stage { width: 100%; height: 100%; display: grid; place-items: center; position: relative; overflow: hidden; touch-action: none; }
#previewCanvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: 0 16px 50px rgba(0,0,0,.28); user-select: none; -webkit-user-drag: none; }
.preview-empty { max-width: 420px; padding: 36px 24px; text-align: center; color: #c5c7c1; }
.empty-frame { width: 76px; height: 60px; margin: 0 auto 16px; position: relative; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; }
.empty-frame::before { content: ""; width: 44px; height: 20px; position: absolute; left: 14px; bottom: 13px; border-left: 1px solid rgba(255,255,255,.22); border-bottom: 1px solid rgba(255,255,255,.22); transform: skew(-28deg); }
.preview-empty strong { display: block; margin-bottom: 6px; color: #fff; font-size: 13px; }
.preview-empty span { display: block; color: #8f918b; font-size: 10px; line-height: 1.5; }
.drag-tip { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 7px 10px; border-radius: 999px; background: rgba(8,8,8,.72); color: rgba(255,255,255,.82); font-size: 9px; backdrop-filter: blur(8px); pointer-events: none; opacity: 0; transition: opacity .18s ease; }
.preview-stage:hover .drag-tip { opacity: 1; }
.preview-help { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.preview-help > div { min-width: 0; padding: 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.help-key { flex: 0 0 auto; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.preview-help span:last-child { color: var(--muted); font-size: 9px; line-height: 1.35; }

.results-panel { margin-top: 18px; padding: 24px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.results-head h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-weight: 400; }
.results-head p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.zip-button { min-height: 46px; padding: 0 15px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; background: var(--dark); color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }
.zip-button:disabled { opacity: .4; cursor: wait; }
.zip-icon { font-size: 16px; }
.progress-area { margin: 20px 0 2px; }
.progress-meta { margin-bottom: 7px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: #e7e4dc; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--dark); transition: width .15s ease; }
.results-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.result-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); }
.result-image { aspect-ratio: 4 / 3; overflow: hidden; background: #ddd; }
.result-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.result-meta { padding: 10px; }
.result-name { display: block; font-size: 10px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-size { display: block; margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.result-download { width: 100%; min-height: 42px; margin-top: 10px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; background: var(--dark); color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.result-download:hover { background: var(--dark-2); transform: translateY(-1px); }
.result-download span { font-size: 15px; line-height: 1; }
.result-card.is-error { border-color: rgba(157,80,80,.35); }
.result-error { margin-top: 7px; color: var(--danger); font-size: 9px; line-height: 1.4; }

.footer { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 20px 0 30px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.toast { position: fixed; z-index: 100; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 11px 14px; border-radius: 11px; background: #181917; color: #fff; font-size: 10px; line-height: 1.45; box-shadow: 0 14px 35px rgba(0,0,0,.2); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 350px minmax(0,1fr); }
  .intro { grid-template-columns: 1fr; gap: 12px; }
  .intro > p { max-width: 760px; justify-self: start; }
  .preview-stage-wrap { height: 600px; min-height: 520px; }
  .results-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .topbar-inner, .app-shell, .footer { width: min(100% - 28px, 760px); }
  .topbar-inner { min-height: 66px; }
  .privacy-pill span:last-child { display: none; }
  .privacy-pill { width: 31px; height: 31px; padding: 0; justify-content: center; }
  .brand-logo { width: 138px; height: 27px; }
  .app-shell { padding-top: 30px; }
  .intro { padding-bottom: 22px; }
  .intro h1 { font-size: clamp(34px, 7vw, 50px); }
  .workspace { grid-template-columns: 1fr; }
  .settings-panel { position: static; }
  .preview-panel { order: 2; }
  .preview-stage-wrap { height: min(72vh, 650px); min-height: 480px; }
  .results-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 560px) {
  .topbar-inner, .app-shell, .footer { width: calc(100% - 18px); }
  .topbar-inner { min-height: 62px; }
  .brand { gap: 10px; }
  .brand-logo { width: 118px; height: 24px; }
  .brand-divider { height: 21px; }
  .brand-tool { font-size: 9px; }
  .privacy-pill { display: none; }
  .app-shell { padding: 24px 0 44px; }
  .intro { padding: 0 3px 18px; }
  .eyebrow { margin-bottom: 8px; font-size: 9px; }
  .intro h1 { font-size: 34px; line-height: 1.03; }
  .intro > p { font-size: 12px; line-height: 1.55; }
  .controls-column { gap: 10px; }
  .panel { border-radius: 16px; }
  .upload-panel, .logo-panel, .settings-panel, .preview-panel, .results-panel { padding: 15px; }
  .section-title { margin-bottom: 13px; }
  .step { width: 30px; height: 30px; flex-basis: 30px; }
  .section-title h2 { font-size: 15px; }
  .section-title p { font-size: 9px; }
  .dropzone { min-height: 122px; padding: 16px 12px; }
  .file-summary { align-items: flex-start; }
  .file-summary-actions { gap: 7px; }
  .image-queue { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 360px; }
  .queue-preview { aspect-ratio: 1.3 / 1; }
  .logo-card { grid-template-columns: 68px minmax(0,1fr); gap: 11px; }
  .logo-preview-box { width: 68px; height: 60px; }
  .logo-actions { gap: 10px; }
  .stacked-mobile { align-items: flex-start; }
  .tiny-hint { max-width: 155px; line-height: 1.3; }
  .position-grid button { height: 37px; }
  .primary-button { min-height: 52px; }
  .preview-header { align-items: flex-start; gap: 10px; }
  .preview-title { min-width: 0; }
  .preview-title-copy p { max-width: 48vw; }
  .preview-actions { gap: 6px; }
  .icon-button { width: 32px; height: 32px; }
  .preview-stage-wrap { height: min(62vh, 520px); min-height: 360px; border-radius: 13px; }
  .preview-empty { padding: 28px 18px; }
  .preview-help { grid-template-columns: 1fr; gap: 6px; }
  .preview-help > div { padding: 9px; }
  .drag-tip { bottom: 10px; }
  .results-head { flex-direction: column; align-items: stretch; }
  .zip-button { width: 100%; justify-content: center; }
  .results-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; gap: 4px; }
  .toast { left: 10px; right: 10px; bottom: 10px; max-width: none; }
}

@media (max-width: 380px) {
  .brand-tool, .brand-divider { display: none; }
  .file-summary { flex-direction: column; }
  .file-summary-actions { width: 100%; justify-content: space-between; }
  .intro h1 { font-size: 31px; }
  .preview-title-copy p { max-width: 42vw; }
  .preview-actions span { display: none; }
}


/* v3.2 — unmistakable download controls */
.download-dock {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 18px;
  width: min(760px, calc(100% - 32px));
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 36px rgba(0,0,0,.18));
}
.download-dock[hidden] { display: none !important; }
.download-dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 12px 12px 17px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(24,25,23,.96);
  color: #fff;
  backdrop-filter: blur(16px);
}
.download-dock-copy { min-width: 0; }
.download-dock-copy strong { display: block; font-size: 12px; line-height: 1.25; }
.download-dock-copy span { display: block; margin-top: 3px; color: rgba(255,255,255,.62); font-size: 9px; line-height: 1.35; }
.zip-button-dock { flex: 0 0 auto; background: #fff; color: var(--dark); }
.zip-button-dock:hover:not(:disabled) { background: #f1f0eb; }
.results-head .zip-button { min-height: 48px; padding: 0 18px; font-size: 11px; }
.result-card { display: flex; flex-direction: column; }
.result-meta { margin-top: auto; }

@media (max-width: 560px) {
  body { padding-bottom: 94px; }
  .download-dock { width: calc(100% - 18px); bottom: 9px; }
  .download-dock-inner { padding: 10px; border-radius: 14px; }
  .download-dock-copy span { display: none; }
  .download-dock-copy strong { font-size: 10px; }
  .zip-button-dock { min-height: 44px; padding: 0 12px; font-size: 10px; }
  .result-download { min-height: 46px; font-size: 12px; }
}


/* v3.3 — mobile usability pass + clearer final step */
@media (max-width: 560px) {
  html { scroll-padding-bottom: 160px; }
  body { padding-bottom: calc(154px + env(safe-area-inset-bottom)); }

  .topbar { position: relative; z-index: 2; }
  .topbar-inner, .app-shell, .footer { width: calc(100% - 16px); }
  .app-shell { padding-top: 20px; }

  .panel { overflow: hidden; }
  .upload-panel, .logo-panel, .settings-panel, .preview-panel, .results-panel { padding: 14px; }

  .dropzone { min-height: 132px; padding: 18px 12px; }
  .dropzone strong { font-size: 14px; }
  .dropzone > span:last-child { max-width: 280px; font-size: 10.5px; }

  .file-summary { flex-direction: column; align-items: stretch; gap: 10px; }
  .file-count-wrap { justify-content: center; }
  .file-summary-actions { width: 100%; justify-content: space-between; gap: 8px; }
  .secondary-button.small { min-height: 44px; padding: 0 14px; font-size: 11px; }
  .file-summary-actions .secondary-button { flex: 1 1 auto; }
  .text-button { min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; }

  .image-queue { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 390px; }
  .queue-preview { aspect-ratio: 1.18 / 1; }
  .queue-meta { padding-right: 42px; }
  .queue-remove { width: 36px; height: 36px; right: 3px; bottom: 3px; font-size: 20px; }

  .logo-card { grid-template-columns: 64px minmax(0, 1fr); }
  .logo-preview-box { width: 64px; height: 58px; }
  .logo-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .logo-actions .secondary-button { min-height: 44px; }

  .control-label-row { gap: 8px; }
  .control-label-row label { font-size: 11.5px; }
  .range { height: 6px; margin: 8px 0 4px; }
  .range::-webkit-slider-thumb { width: 24px; height: 24px; }
  .range::-moz-range-thumb { width: 18px; height: 18px; }
  .tiny-hint { max-width: 180px; text-align: left; }
  .position-grid { gap: 7px; padding: 7px; }
  .position-grid button { height: 46px; }
  .position-grid button::after { width: 8px; height: 8px; }

  .process-instruction { margin-top: 15px; padding: 12px; }
  .process-instruction strong { font-size: 12px; }
  .process-instruction div > span { font-size: 10px; }
  .primary-button { min-height: 56px; margin-top: 10px; padding: 0 15px; font-size: 12.5px; }

  .preview-header { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 10px; }
  .preview-title-copy p { max-width: 100%; white-space: normal; overflow: visible; text-overflow: clip; }
  .preview-actions { width: 100%; justify-content: space-between; padding-top: 2px; }
  .preview-actions span { display: inline-block; min-width: 52px; text-align: center; font-size: 11px; }
  .icon-button { width: 46px; height: 46px; border-radius: 12px; font-size: 16px; }

  .preview-stage-wrap { height: min(58dvh, 520px); min-height: 300px; max-height: 520px; }
  .preview-stage { touch-action: none; }
  #previewCanvas { max-width: 100%; max-height: 100%; touch-action: none; }
  .drag-tip { bottom: 8px; max-width: calc(100% - 20px); opacity: .92; white-space: nowrap; }
  .preview-help > div { align-items: flex-start; }
  .preview-help span:last-child { font-size: 9.5px; }

  .results-head h2 { font-size: 25px; }
  .zip-button { min-height: 50px; font-size: 12px; }
  .result-download { min-height: 50px; font-size: 12px; }

  .download-dock { width: calc(100% - 16px); bottom: max(8px, env(safe-area-inset-bottom)); }
  .download-dock-inner { flex-direction: column; align-items: stretch; gap: 9px; padding: 10px; }
  .download-dock-copy { text-align: center; }
  .download-dock-copy strong { font-size: 11px; }
  .zip-button-dock { width: 100%; min-height: 48px; justify-content: center; font-size: 11px; }

  .toast { bottom: calc(120px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .intro h1 { font-size: 30px; }
  .image-queue { grid-template-columns: 1fr 1fr; }
  .logo-actions { grid-template-columns: 1fr; }
  .logo-actions .text-button { width: 100%; }
  .preview-stage-wrap { min-height: 280px; }
  .drag-tip { font-size: 8.5px; }
}
