:root {
  --bg: #f2f3f5;
  --panel: rgba(255,255,255,.92);
  --text: #141414;
  --muted: #75787e;
  --line: #e4e5e8;
  --soft: #f7f7f8;
  --accent: #171717;
  --accent-contrast: #fff;
  --ok: #16803a;
  --shadow: 0 18px 45px rgba(0,0,0,.06);
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Pretendard", "Apple SD Gothic Neo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,.9), transparent 32%),
    var(--bg);
}
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { width: min(1600px, 100%); margin: 0 auto; padding: 36px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(28px, 3vw, 44px); letter-spacing: -.04em; }
.subtitle { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.privacy-badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.65); border-radius: 999px; padding: 9px 13px; color: #575a60; font-size: 12px; font-weight: 700; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #29a34a; box-shadow: 0 0 0 4px rgba(41,163,74,.1); }
.workspace { display: grid; grid-template-columns: 280px minmax(420px, 1fr) 330px; gap: 16px; align-items: stretch; }
.panel { background: var(--panel); border: 1px solid rgba(255,255,255,.8); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; backdrop-filter: blur(18px); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-heading > div:first-child { display: flex; align-items: center; gap: 9px; }
.step { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: #171717; color: #fff; font-size: 10px; font-weight: 800; }
h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.text-button { appearance: none; border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; padding: 6px; }
.drop-zone { min-height: 180px; border: 1.5px dashed #c9cbd0; border-radius: 18px; background: #fafafa; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center; cursor: pointer; transition: .18s ease; padding: 22px; }
.drop-zone:hover, .drop-zone.dragover { border-color: #171717; background: #f4f4f4; transform: translateY(-1px); }
.drop-zone strong { font-size: 14px; }
.drop-zone span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.drop-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 14px; background: #171717; color: #fff; font-size: 23px; margin-bottom: 4px; }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; max-height: 480px; overflow: auto; }
.file-item { display: grid; grid-template-columns: 42px minmax(0,1fr) 24px; gap: 10px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 8px; cursor: pointer; }
.file-item.active { border-color: #171717; box-shadow: 0 0 0 1px #171717 inset; }
.file-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 9px; background: #eee; }
.file-copy { min-width: 0; }
.file-name { display: block; font-size: 12px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.file-dim { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.file-remove { border: 0; background: transparent; color: #aaa; cursor: pointer; font-size: 18px; line-height: 1; }
.preview-panel { display: flex; min-width: 0; flex-direction: column; }
.meta-pill { padding: 7px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 11px; }
.canvas-stage { position: relative; flex: 1; min-height: 570px; display: grid; place-items: center; overflow: hidden; border-radius: 18px; background:
  linear-gradient(45deg, #e9eaec 25%, transparent 25%),
  linear-gradient(-45deg, #e9eaec 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #e9eaec 75%),
  linear-gradient(-45deg, transparent 75%, #e9eaec 75%),
  #f3f3f4;
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.canvas-stage.empty { background: #f7f7f8; }
#previewCanvas { display: block; max-width: calc(100% - 48px); max-height: calc(100% - 48px); box-shadow: 0 15px 45px rgba(0,0,0,.14); touch-action: none; cursor: grab; }
#previewCanvas.dragging { cursor: grabbing; }
.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #9b9da2; font-size: 13px; pointer-events: none; }
.empty-art { width: 66px; height: 84px; border-radius: 12px; border: 2px solid #d7d9dc; transform: rotate(-5deg); box-shadow: 12px 12px 0 -3px #ececee; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; }
.range-field { flex: 1; display: grid; grid-template-columns: 40px 1fr 52px; gap: 10px; align-items: center; font-size: 11px; color: var(--muted); }
.range-field input { width: 100%; accent-color: #171717; }
.range-field output { text-align: right; font-variant-numeric: tabular-nums; }
.toolbar-actions { display: flex; gap: 8px; }
.hint { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.field-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field-group > label, .field-label, .field-group:not(label) > span:first-child { font-size: 11px; color: var(--muted); font-weight: 700; }
select, input[type="number"], input[type="text"] { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 10px 11px; color: var(--text); outline: none; }
select:focus, input:focus { border-color: #a7a9ae; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.size-row { display: grid; grid-template-columns: 1fr 36px 1fr; gap: 8px; align-items: end; margin-bottom: 16px; }
.size-row label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.icon-button { height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 11px; cursor: pointer; }
.segmented { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; background: #f0f0f1; border-radius: 12px; padding: 4px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 8px 4px; border-radius: 9px; font-size: 11px; font-weight: 700; color: #777; cursor: pointer; }
.segmented input:checked + span { background: #fff; color: #171717; box-shadow: 0 1px 5px rgba(0,0,0,.08); }
.field-help { color: var(--muted); font-size: 10px; line-height: 1.5; margin: -2px 0 0; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-control { display: grid; grid-template-columns: 42px 1fr; gap: 7px; }
.color-control input[type="color"] { width: 42px; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 4px; cursor: pointer; }
#qualityRange { width: 100%; accent-color: #171717; }
.hidden { display: none !important; }
.validation-card { border: 1px solid var(--line); background: #fafafa; border-radius: 14px; padding: 12px; margin: 4px 0 14px; }
.validation-title { font-size: 11px; font-weight: 800; margin-bottom: 9px; }
.validation-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; color: var(--muted); font-size: 11px; }
.validation-row strong { color: #333; font-weight: 700; }
.validation-row .ok { color: var(--ok); }
.primary-button, .secondary-button { appearance: none; border-radius: 11px; border: 1px solid var(--line); padding: 10px 13px; font-weight: 750; font-size: 12px; cursor: pointer; transition: .16s ease; }
.primary-button { width: 100%; background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); padding: 13px 15px; }
.secondary-button { background: #fff; }
.secondary-button.wide { width: 100%; margin-top: 8px; }
button:disabled { opacity: .38; cursor: not-allowed; }
button:not(:disabled):active { transform: translateY(1px); }
.download-note { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; text-align: center; }
footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 16px; padding: 4px 6px; color: #8c8e93; font-size: 10px; }
@media (max-width: 1160px) {
  .workspace { grid-template-columns: 240px minmax(380px,1fr); }
  .settings-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
  .settings-panel .panel-heading, .settings-panel .validation-card, .settings-panel .primary-button, .settings-panel .wide, .settings-panel .download-note { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .app-shell { padding: 18px; }
  .topbar { flex-direction: column; }
  .workspace { grid-template-columns: 1fr; }
  .settings-panel { grid-column: auto; display: block; }
  .canvas-stage { min-height: 420px; }
  .preview-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions button { flex: 1; }
  footer { flex-direction: column; }
}
