:root{
  --bg:#f5f4f0; --surface:#fbfbf9; --panel:#ffffff; --panel-soft:#f7f6f2;
  --ink:#1c1c1a; --ink-hover:#3a3935; --ink-2:#55534d; --sub:#7a776f; --muted:#8a877f;
  --line:#e3e1db; --line-2:#dcdad3; --line-3:#efeee9; --hover:#efeee9; --soft:#f3f2ee; --track:#ebe9e3;
  --accent:#a3245e; /* 낙관(도장) 버건디 */
  --accent-soft:#f8e6ee;
  --font:"IBM Plex Sans KR",sans-serif; --mono:"JetBrains Mono",monospace;
}
*{box-sizing:border-box}
[hidden]{display:none !important}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);-webkit-font-smoothing:antialiased}
button,input,select{font:inherit;color:inherit}
.mono-label{font-family:var(--mono);font-size:11px;letter-spacing:.12em;color:var(--muted)}
.app{min-height:100vh;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 28px;border-bottom:1px solid var(--line);background:var(--surface);flex-wrap:wrap}
.brand{display:flex;align-items:baseline;gap:14px;min-width:0;flex-wrap:wrap}
.brand-title{font-size:17px;font-weight:700;letter-spacing:-.01em}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.btn{height:36px;padding:0 14px;background:transparent;border:1px solid var(--line-2);border-radius:999px;font-size:13px;cursor:pointer;white-space:nowrap}
.btn:hover{background:var(--hover)}
.btn:disabled{opacity:.4;cursor:default}
.btn--solid{background:var(--ink);color:#fff;border:none;font-weight:500}
.btn--solid:hover{background:var(--ink-hover)}
.btn--small{height:32px;font-size:12px;padding:0 12px}
.text-input{height:40px;padding:0 10px;background:var(--surface);border:1px solid var(--line-2);border-radius:8px;font-size:14px;width:100%;min-width:0}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
input[type=range]{width:100%;accent-color:var(--accent)}
@media (max-width:640px){ .topbar{padding:14px 16px} }

.wm{flex:1;width:100%;max-width:1280px;margin:0 auto;padding:24px 28px 32px;display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:24px;align-items:start}
.view{display:flex;flex-direction:column;gap:10px;min-width:0;position:sticky;top:16px}
/* 사진 인화 대지 느낌: 회색 매트 + 낙관 */
.stage{position:relative;display:flex;justify-content:center;align-items:center;padding:44px 26px 26px;min-height:300px;border-radius:6px;background:#2b2a27;
  box-shadow:inset 0 0 0 10px #34332f,inset 0 0 0 11px #4a4843}
.stage canvas{display:block;max-width:100%;touch-action:none;cursor:move;box-shadow:0 18px 40px -16px rgba(0,0,0,.8)}
.stage-tag{position:absolute;left:22px;top:15px;color:#bcb9b0;background:rgba(0,0,0,.35);padding:3px 8px;border-radius:999px;max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stage::after{content:"印";position:absolute;right:18px;top:9px;width:26px;height:26px;display:grid;place-items:center;border-radius:6px;border:2px solid var(--accent);color:var(--accent);font-size:13px;font-weight:700;transform:rotate(-8deg);opacity:.85;background:rgba(163,36,94,.08)}
.strip-head{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.strip-tip{font-size:12px;color:var(--muted)}
.strip{display:flex;gap:8px;overflow-x:auto;padding:4px 2px 8px}
.th{position:relative;flex:0 0 auto}
.th-btn{display:block;width:72px;height:72px;border-radius:10px;overflow:hidden;border:none;padding:0;cursor:pointer;background:var(--soft);box-shadow:0 0 0 1px var(--line-2)}
.th-btn img{width:100%;height:100%;object-fit:cover;display:block}
.th-btn.is-sel{box-shadow:0 0 0 3px var(--accent)}
.th-del{position:absolute;right:3px;top:3px;width:20px;height:20px;border-radius:50%;border:none;background:rgba(0,0,0,.6);color:#fff;font-size:11px;line-height:1;cursor:pointer;padding:0}
.th-add{width:72px;height:72px;border-radius:10px;border:1.5px dashed var(--line-2);background:var(--panel);font-size:24px;color:var(--sub);cursor:pointer;flex:0 0 auto}

.panel{display:flex;flex-direction:column;gap:12px;min-width:0}
.card{display:flex;flex-direction:column;gap:12px;padding:16px;background:var(--panel);border:1px solid var(--line);border-radius:16px}
.card-title{margin:0;font-size:14px;font-weight:700}
.box{display:flex;flex-direction:column;gap:12px}
.seg{display:flex;background:var(--soft);border-radius:999px;padding:3px;gap:2px;border:1px solid var(--line)}
.seg-btn{flex:1;height:32px;border:none;background:transparent;border-radius:999px;font-size:13px;color:var(--sub);cursor:pointer}
.seg-btn.is-active{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12);font-weight:500}
.mini{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--ink-2);min-width:0}
.mini--check{align-items:flex-start}
.mini--check input{width:20px;height:20px;margin:9px 0 0;accent-color:var(--accent)}
.text-row{display:flex;gap:6px;align-items:center}
.text-row .btn{flex:0 0 auto;height:40px;width:40px;padding:0;font-size:16px}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.row3{display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:start}
input[type=color]{width:40px;height:40px;padding:0;border:1px solid var(--line-2);border-radius:10px;background:none;cursor:pointer}
input[type=color]::-webkit-color-swatch-wrapper{padding:3px}
input[type=color]::-webkit-color-swatch{border:none;border-radius:7px}
.check{display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer}
.check input{width:16px;height:16px;accent-color:var(--accent)}
.check--tile{padding:10px 12px;border-radius:10px;background:var(--accent-soft);color:#6f1640;font-weight:500}
.logo-pick{display:flex;gap:12px;align-items:center}
.logo-prev{width:64px;height:64px;flex:0 0 auto;border-radius:10px;border:1px solid var(--line-2);background:
  conic-gradient(#e6e4de 25%,#fff 0 50%,#e6e4de 0 75%,#fff 0) 0 0/12px 12px;background-size:12px 12px;background-position:center;position:relative;overflow:hidden}
.logo-prev img{position:absolute;inset:6px;width:calc(100% - 12px);height:calc(100% - 12px);object-fit:contain}
.pos{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;width:150px;padding:6px;border-radius:12px;background:var(--soft);border:1px solid var(--line);align-self:center}
.pos button{height:36px;border:1px solid var(--line-2);background:var(--panel);border-radius:7px;cursor:pointer;position:relative}
.pos button::after{content:"";position:absolute;left:50%;top:50%;width:8px;height:8px;margin:-4px 0 0 -4px;border-radius:2px;background:var(--line-2)}
.pos button:hover::after{background:var(--ink-2)}
.pos button.is-active{background:var(--accent);border-color:var(--accent)}
.pos button.is-active::after{background:#fff}
.pos.is-off{opacity:.4;pointer-events:none}
.field{display:flex;flex-direction:column;gap:6px}
.field-label{display:flex;justify-content:space-between;align-items:center;gap:6px;font-size:12.5px;color:var(--ink-2)}
.field-label small{flex:1;color:var(--muted);font-size:11px}
.field .tb-presets{margin-top:2px}
.card--save{background:var(--panel-soft)}
.btn--save{height:46px;font-size:14px;background:var(--accent)}
.btn--save:hover{background:#86184b}
.progress{height:6px;border-radius:999px;background:var(--track);overflow:hidden}
.progress span{display:block;height:100%;width:0;background:var(--accent);transition:width .15s}
.note{margin:0;font-size:12px;line-height:1.6;color:var(--muted)}
.dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--accent);margin-right:6px;vertical-align:1px}

.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,20px);background:var(--ink);color:#fff;padding:10px 18px;border-radius:999px;font-size:13px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:100;max-width:calc(100vw - 32px);text-align:center}
.toast.is-show{opacity:1;transform:translate(-50%,0)}

@media (max-width:900px){
  .wm{grid-template-columns:minmax(0,1fr)}
  .view{position:static}
}
@media (max-width:640px){
  .wm{padding:16px;gap:16px}
  .actions{width:100%}
  .actions .btn{flex:1}
  .stage{padding:40px 12px 12px;min-height:220px}
  .stage::after{display:none}
  .strip-tip{display:none}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none !important;transition:none !important}
}

/* 직접 입력칸: 단위(px·%·°)는 흐리게, 숫자는 본문색 */
.tb-num-wrap .tb-num{color:var(--ink)}

/* 다크 모드 (인쇄는 라이트 그대로) — 사진 미리보기(캔버스)는 원래 색 그대로 */
@media screen{
  :root[data-theme="dark"]{
    color-scheme:dark;
    --bg:#141318; --surface:#1a1920; --panel:#1f1e26; --panel-soft:#24232c;
    --ink:#ecebf0; --ink-hover:#ffffff; --ink-2:#c9c7d1; --sub:#a09eab; --muted:#8a8895;
    --line:#2e2d36; --line-2:#393843; --line-3:#26252d; --hover:#2a2932; --soft:#26252d; --track:#34333d;
    --accent:#e0679b; --accent-soft:rgba(224,103,155,.14);
  }
  :root[data-theme="dark"] .btn--solid,:root[data-theme="dark"] .toast,
  :root[data-theme="dark"] .tb-presets button[aria-pressed="true"]{color:var(--bg)}
  :root[data-theme="dark"] .btn--save{background:var(--accent)}
  :root[data-theme="dark"] .btn--save:hover{background:#d4558b}
  :root[data-theme="dark"] .stage{box-shadow:inset 0 0 0 10px #34332f,inset 0 0 0 11px #4a4843,0 0 0 1px var(--line)}
  :root[data-theme="dark"] .seg-btn.is-active{background:var(--line-2);box-shadow:0 1px 3px rgba(0,0,0,.4)}
  :root[data-theme="dark"] .check--tile{color:#f2a6c6}
  :root[data-theme="dark"] .logo-prev{background:conic-gradient(#2a2932 25%,#222129 0 50%,#2a2932 0 75%,#222129 0) 0 0/12px 12px;background-position:center}
  :root[data-theme="dark"] .pos button.is-active::after{background:var(--bg)}
}
