:root {
  --ink: #1b1b1b;
  --muted: #7c7d80;
  --muted-light: #a5a6aa;
  --line: #e7e8e9;
  --panel: #ffffff;
  --paper: #f4f5f7;
  --coral: #ff654d;
  --coral-dark: #e95841;
  --mint: #d8f3e5;
  --blue: #dcecff;
  --yellow: #fef0be;
  --shadow: 0 18px 50px rgba(33, 38, 45, 0.06);
  --sans: "Manrope", "Noto Sans SC", system-ui, sans-serif;
  --mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 0%, rgba(255, 224, 208, 0.5), transparent 26rem),
    radial-gradient(circle at 95% 35%, rgba(215, 239, 255, 0.54), transparent 28rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; overflow: hidden; }

.topbar {
  height: 82px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(27, 27, 27, 0.05);
}

.brand { display: flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px 10px 10px 3px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 800; letter-spacing: -0.08em; transform: rotate(-4deg); }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font-size: 15px; letter-spacing: 0.02em; }
.brand-copy small { color: var(--muted); font: 9px var(--mono); letter-spacing: 0.11em; }

.top-nav { display: flex; gap: 36px; margin-left: 150px; }
.top-nav a { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; position: relative; padding: 31px 0 28px; transition: color .2s ease; }
.top-nav a:hover, .top-nav a.active { color: var(--ink); }
.top-nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--coral); }

.privacy-badge { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #e3e5e6; border-radius: 999px; color: #6d7673; font-size: 11px; font-weight: 600; background: rgba(255,255,255,.44); }
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: #5fca89; box-shadow: 0 0 0 4px rgba(95, 202, 137, .14); }

.workspace { max-width: 1356px; margin: 0 auto; padding: 34px 42px 40px; }
.intro-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--coral); font: 10px var(--mono); font-weight: 500; letter-spacing: .17em; }
h1 { margin: 0; font-size: clamp(36px, 4.1vw, 58px); line-height: 1.08; font-weight: 800; letter-spacing: -.055em; }
h1 em { color: var(--coral); font-style: normal; }
.intro-copy { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.intro-meta { display: flex; align-items: center; gap: 24px; padding-bottom: 0; }
.meta-item { display: flex; align-items: baseline; gap: 9px; }
.meta-item strong { font-size: 25px; letter-spacing: -.04em; }
.meta-item span { color: var(--muted); font-size: 11px; }
.meta-line { width: 1px; height: 26px; background: #dcdedf; }

.studio-grid { display: grid; grid-template-columns: minmax(300px, 0.78fr) minmax(550px, 1.52fr); gap: 22px; align-items: start; }
.panel { background: var(--panel); border: 1px solid rgba(28, 30, 33, .055); border-radius: 17px; box-shadow: var(--shadow); }
.queue-panel { padding: 24px 22px 22px; min-height: 703px; }
.editor-column { display: flex; flex-direction: column; gap: 17px; min-width: 0; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; min-height: 33px; }
.panel-heading > div { display: flex; align-items: center; gap: 11px; }
.step-number { color: var(--coral); font: 10px var(--mono); font-weight: 500; letter-spacing: .08em; }
h2 { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.text-button { border: 0; background: none; padding: 1px 0; color: var(--muted); font-size: 11px; transition: color .2s ease; }
.text-button:hover { color: var(--coral); }
.hidden { display: none !important; }

.dropzone { min-height: 236px; margin-top: 26px; padding: 26px 18px; border: 1px dashed #cdd0d0; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: linear-gradient(145deg, #fff, #fafbfb); transition: border-color .2s, background .2s, transform .2s; }
.dropzone.dragging { border-color: var(--coral); background: #fff7f5; transform: translateY(-2px); }
.dropzone input { display: none; }
.dropzone-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #fff0ec; color: var(--coral); margin-bottom: 13px; }
.dropzone-icon svg { width: 21px; height: 21px; }
.dropzone strong { font-size: 13px; }
.dropzone > span { margin: 6px 0; color: var(--muted-light); font-size: 10px; }
.upload-button { min-width: 98px; padding: 9px 14px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; transition: background .2s, transform .2s; }
.upload-button:hover { background: #3c3c3c; transform: translateY(-1px); }
.dropzone small { margin-top: 15px; color: var(--muted-light); font-size: 9px; }

.queue-summary { display: flex; align-items: center; justify-content: space-between; padding: 19px 2px 12px; color: var(--muted); font-size: 10px; }
.queue-summary-label { display: flex; align-items: center; gap: 8px; }
.status-pip { width: 7px; height: 7px; border-radius: 50%; background: #f1b747; }
.status-pip.done { background: #62c991; }
.queue-count { font: 10px var(--mono); }
.image-list { display: flex; flex-direction: column; gap: 8px; max-height: 338px; overflow: auto; padding-right: 2px; }
.image-list::-webkit-scrollbar { width: 3px; }
.image-list::-webkit-scrollbar-thumb { border-radius: 4px; background: #d6d8d9; }
.image-item { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid transparent; border-radius: 10px; transition: border-color .2s, background .2s; }
.image-item:hover { background: #fbfbfb; }
.image-item.selected { background: #fff7f5; border-color: #ffd8cf; }
.image-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 7px; background: #eef0f1; }
.image-details { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.image-name { overflow: hidden; color: #353638; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.image-status { color: var(--muted-light); font-size: 9px; }
.image-status.done { color: #53ad78; }
.image-actions { display: flex; align-items: center; gap: 4px; }
.image-action { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; display: grid; place-items: center; color: #a3a5a6; background: transparent; font-size: 15px; transition: color .2s, background .2s; }
.image-action:hover { color: var(--ink); background: #f0f1f2; }
.image-action.remove:hover { color: var(--coral); background: #fff0ec; }
.queue-empty { min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted-light); }
.queue-empty p { margin: 16px 0 0; font-size: 11px; line-height: 1.7; }
.empty-stack { position: relative; width: 47px; height: 37px; display: block; }
.empty-stack i { position: absolute; display: block; width: 32px; height: 24px; border: 1px solid #d9dddd; border-radius: 4px; background: #fafafa; transform: rotate(-8deg); }
.empty-stack i:nth-child(1) { left: 1px; top: 8px; }
.empty-stack i:nth-child(2) { left: 8px; top: 4px; transform: rotate(2deg); background: #fdfdfd; }
.empty-stack i:nth-child(3) { left: 14px; top: 0; transform: rotate(10deg); background: #fff; }

.preview-panel { padding: 24px 22px 22px; }
.preview-heading { align-items: center; }
.preview-size { color: var(--muted-light); font: 10px var(--mono); }
.preview-stage { position: relative; min-height: 348px; margin-top: 20px; overflow: hidden; border-radius: 12px; background: #eef0f1; display: grid; place-items: center; }
.preview-stage::before { content: ""; position: absolute; inset: 0; opacity: .42; background-image: radial-gradient(#c8ccce 0.8px, transparent 0.8px); background-size: 12px 12px; }
.preview-empty { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); text-align: center; }
.preview-empty strong { margin-top: 8px; color: #616467; font-size: 12px; }
.preview-empty > span { color: #a4a8aa; font-size: 10px; }
.preview-empty-art { position: relative; width: 83px; height: 71px; }
.art-photo { position: absolute; left: 12px; top: 8px; width: 60px; height: 53px; border-radius: 6px; border: 1px solid rgba(255,255,255,.75); background: linear-gradient(135deg, #f4c48c 0 28%, #d8645b 28% 58%, #6d93a8 58% 78%, #223746 78%); box-shadow: 0 9px 18px rgba(47, 58, 64, .14); transform: rotate(-6deg); }
.art-photo::before { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.8); border-radius: 50%; top: 10px; left: 21px; }
.art-photo::after { content: ""; position: absolute; width: 33px; height: 15px; border-radius: 30px 30px 0 0; border-top: 2px solid rgba(255,255,255,.8); bottom: 8px; left: 13px; }
.art-spark { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #fff; opacity: .85; }
.spark-one { top: 2px; right: 2px; }
.spark-two { bottom: 6px; left: 3px; width: 4px; height: 4px; }
#previewCanvas { position: relative; z-index: 1; display: none; max-width: 100%; max-height: 430px; object-fit: contain; box-shadow: 0 14px 28px rgba(28, 39, 42, .14); }
.preview-label { position: absolute; z-index: 2; top: 12px; left: 12px; padding: 4px 7px; border-radius: 5px; background: rgba(24,25,25,.62); color: #fff; font: 9px var(--mono); }

.settings-panel { padding: 24px 22px 21px; }
.settings-heading { align-items: center; }
.settings-note { color: var(--muted-light); font-size: 10px; }
.watermark-input-wrap { position: relative; margin-top: 22px; }
.watermark-source { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.watermark-source > label { margin: 0; color: var(--muted); font-size: 10px; font-weight: 600; }
.source-picker { margin: 0; }
.watermark-text-panel { position: relative; }
.watermark-input-wrap label, .control-group > label, .label-with-value label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 10px; font-weight: 600; }
.watermark-input-wrap textarea { width: 100%; min-height: 47px; resize: vertical; padding: 13px 48px 12px 14px; border: 1px solid #e2e4e5; border-radius: 9px; color: var(--ink); outline: none; background: #fbfbfb; font-size: 12px; line-height: 1.5; transition: border-color .2s, box-shadow .2s; }
.watermark-input-wrap textarea:focus { border-color: #ffb2a5; box-shadow: 0 0 0 3px rgba(255,101,77,.09); background: #fff; }
.char-count { position: absolute; top: 35px; right: 13px; color: var(--muted-light); font: 9px var(--mono); }
.logo-upload-panel { min-height: 72px; padding: 12px 13px; display: flex; align-items: center; gap: 11px; border: 1px dashed #cdd0d0; border-radius: 9px; background: #fbfbfb; }
.logo-upload-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: var(--coral); background: #fff0ec; font-size: 20px; }
.logo-upload-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.logo-upload-copy strong { font-size: 11px; }
.logo-upload-copy span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.logo-upload-panel input { display: none; }
.logo-preview { width: 34px; height: 34px; flex: 0 0 auto; padding: 3px; object-fit: contain; border: 1px solid #e2e4e5; border-radius: 7px; background: #e9ebec; }
.logo-upload-button { flex: 0 0 auto; height: 30px; padding: 0 11px; border: 0; border-radius: 7px; color: #fff; background: var(--ink); font-size: 10px; font-weight: 700; }
.logo-upload-button:hover { background: #3c3c3c; }
.logo-remove-button { width: 25px; height: 25px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 6px; color: #a3a5a6; background: transparent; font-size: 16px; }
.logo-remove-button:hover { color: var(--coral); background: #fff0ec; }
.settings-row { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 24px; padding-top: 22px; }
.bottom-settings-row { grid-template-columns: minmax(170px, .76fr) minmax(280px, 1.24fr); align-items: start; }
.tile-settings-row { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 17px; align-items: end; padding-top: 18px; }
.single-position-row { padding-top: 18px; }
.color-control { height: 35px; display: flex; align-items: center; gap: 9px; }
.color-control input { width: 29px; height: 29px; padding: 0; border: 2px solid #fff; border-radius: 50%; overflow: hidden; background: none; box-shadow: 0 0 0 1px #dfe1e2; cursor: pointer; }
.color-control input::-webkit-color-swatch-wrapper { padding: 0; }
.color-control input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.color-control span { color: var(--muted); font: 10px var(--mono); }
.label-with-value { display: flex; align-items: center; justify-content: space-between; }
.label-with-value label { margin-bottom: 0; }
.label-with-value output { color: var(--ink); font: 10px var(--mono); }
input[type="range"] { display: block; width: 100%; height: 3px; margin: 17px 0 0; border-radius: 4px; background: linear-gradient(to right, var(--coral) 0%, var(--coral) 50%, #e4e6e7 50%, #e4e6e7 100%); appearance: none; outline: none; }
input[type="range"]::-webkit-slider-thumb { width: 13px; height: 13px; border: 3px solid #fff; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 1px var(--coral), 0 2px 5px rgba(27,27,27,.18); appearance: none; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 3px solid #fff; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 1px var(--coral); }
.position-group { display: grid; grid-template-columns: 1fr auto; column-gap: 13px; align-items: end; }
.position-group > label { grid-column: 1 / -1; }
.position-picker { width: 94px; height: 55px; padding: 5px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border: 1px solid #e0e2e3; border-radius: 8px; background: #fafafa; }
.position-picker button { position: relative; border: 0; border-radius: 4px; background: transparent; }
.position-picker button::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #c8cccd; inset: 0; margin: auto; transition: background .2s, transform .2s; }
.position-picker button:hover::after { background: #ff9a88; transform: scale(1.35); }
.position-picker button.selected::after { width: 7px; height: 7px; background: var(--coral); box-shadow: 0 0 0 3px #ffe4de; }
.position-name { align-self: center; color: var(--muted); font-size: 10px; white-space: nowrap; }
.segmented-control { display: flex; width: max-content; padding: 3px; gap: 2px; border: 1px solid #e0e2e3; border-radius: 8px; background: #fafafa; }
.segmented-control button { min-width: 82px; height: 29px; padding: 0 10px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 10px; transition: background .2s, color .2s, box-shadow .2s; }
.segmented-control button:hover { color: var(--ink); }
.segmented-control button.selected { color: var(--ink); background: #fff; box-shadow: 0 2px 6px rgba(25, 27, 29, .08); font-weight: 700; }
.number-group input[type="number"] { width: 100%; height: 35px; padding: 0 11px; border: 1px solid #e0e2e3; border-radius: 8px; outline: none; color: var(--ink); background: #fbfbfb; font: 11px var(--mono); transition: border-color .2s, box-shadow .2s; }
.number-group input[type="number"]:focus { border-color: #ffb2a5; box-shadow: 0 0 0 3px rgba(255,101,77,.09); background: #fff; }
.number-group output { color: var(--muted); font: 10px var(--mono); }
.tile-settings-note { grid-column: 1 / -1; align-self: center; padding-top: 1px; color: var(--muted-light); font-size: 10px; }
.tile-settings-note strong { color: var(--ink); font-family: var(--mono); font-weight: 500; }

.action-row { display: flex; gap: 11px; justify-content: flex-end; }
.primary-button { min-height: 48px; padding: 0 19px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 800; transition: transform .2s, background .2s, box-shadow .2s; }
.primary-button { min-width: 188px; border: 1px solid var(--coral); background: var(--coral); color: #fff; box-shadow: 0 10px 20px rgba(255, 101, 77, .18); }
.primary-button:hover:not(:disabled) { background: var(--coral-dark); transform: translateY(-1px); box-shadow: 0 12px 24px rgba(255, 101, 77, .25); }
.primary-button svg { width: 17px; height: 17px; }
.button-icon { font-size: 16px; line-height: 1; }
button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }

.how-it-works { display: grid; grid-template-columns: minmax(250px, 1.7fr) repeat(3, 1fr); gap: 18px; align-items: center; margin-top: 33px; padding: 22px 23px; border-top: 1px solid #e2e4e5; }
.how-title { display: flex; flex-direction: column; gap: 4px; }
.how-title .eyebrow { margin: 0 0 2px; font-size: 9px; }
.how-title strong { font-size: 13px; }
.how-step { position: relative; padding-left: 39px; }
.how-step::before { content: ""; position: absolute; left: 17px; top: 4px; width: 1px; height: 33px; background: #dfe1e2; }
.how-step span { position: absolute; left: 0; top: 0; color: var(--coral); font: 10px var(--mono); }
.how-step p { margin: 0 0 5px; font-size: 11px; font-weight: 700; }
.how-step small { color: var(--muted); font-size: 10px; }
.footer { max-width: 1356px; margin: 0 auto; padding: 10px 42px 26px; display: flex; justify-content: space-between; color: #b0b2b4; font: 9px var(--mono); letter-spacing: .06em; }
.footer i { padding: 0 6px; font-style: normal; color: #d1d2d3; }
.footer-lock { font-size: 14px; vertical-align: -2px; }

.toast { position: fixed; z-index: 20; left: 50%; bottom: 29px; padding: 11px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); background: rgba(26,27,28,.92); color: #fff; font-size: 11px; box-shadow: 0 12px 25px rgba(0,0,0,.15); transition: opacity .25s, transform .25s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.progress-overlay { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; background: rgba(25, 27, 29, .24); backdrop-filter: blur(5px); }
.progress-card { width: min(330px, calc(100vw - 40px)); padding: 28px 28px 25px; display: flex; flex-direction: column; align-items: center; border-radius: 15px; background: #fff; box-shadow: 0 24px 60px rgba(23, 27, 31, .2); }
.progress-spinner { width: 26px; height: 26px; margin-bottom: 16px; border: 3px solid #ffe1da; border-top-color: var(--coral); border-radius: 50%; animation: spin .85s linear infinite; }
.progress-card strong { font-size: 13px; }
.progress-card > span { margin-top: 6px; color: var(--muted); font: 10px var(--mono); }
.progress-track { width: 100%; height: 4px; margin-top: 22px; overflow: hidden; border-radius: 3px; background: #f0f1f1; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--coral); transition: width .2s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .topbar { padding: 0 24px; }
  .top-nav { margin-left: 40px; }
  .workspace { padding: 30px 24px 30px; }
  .studio-grid { grid-template-columns: 1fr; }
  .queue-panel { min-height: 0; }
  .image-list { max-height: 280px; }
  .preview-stage { min-height: 300px; }
  .how-it-works { grid-template-columns: 1.5fr repeat(3, 1fr); }
  .footer { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 680px) {
  .topbar { height: 68px; padding: 0 17px; }
  .brand-copy small, .top-nav { display: none; }
  .privacy-badge { padding: 7px 9px; font-size: 9px; }
  .workspace { padding: 23px 16px 22px; }
  .intro-row { display: block; margin-bottom: 22px; }
  h1 { font-size: 32px; }
  .intro-copy { margin-top: 10px; font-size: 11px; }
  .intro-meta { margin-top: 15px; justify-content: flex-start; }
  .studio-grid { gap: 15px; }
  .queue-panel, .preview-panel, .settings-panel { padding: 19px 16px; }
  .dropzone { min-height: 210px; margin-top: 21px; }
  .settings-row, .bottom-settings-row { grid-template-columns: 1fr 1fr; gap: 17px; }
  .tile-settings-row { grid-template-columns: 1fr 1fr; gap: 17px; }
  .tile-settings-note { grid-column: 1 / -1; padding-bottom: 0; }
  .watermark-source { align-items: flex-start; flex-direction: column; gap: 8px; }
  .logo-upload-panel { align-items: flex-start; flex-wrap: wrap; }
  .logo-upload-copy { min-width: calc(100% - 48px); }
  .logo-upload-button { margin-left: 45px; }
  .color-group { grid-column: 1 / -1; }
  .bottom-settings-row { grid-template-columns: 1fr; }
  .position-group { justify-content: space-between; }
  .action-row { flex-direction: column-reverse; }
  .primary-button { width: 100%; }
  .how-it-works { grid-template-columns: 1fr 1fr; gap: 20px 12px; margin-top: 22px; padding: 20px 0; }
  .how-title { grid-column: 1 / -1; }
  .footer { padding: 10px 16px 22px; font-size: 8px; }
  .footer > span:last-child { display: none; }
}
