@font-face { font-family: 'Pretendard'; src: url('fonts/Pretendard-Light.woff2') format('woff2'); font-style: normal; font-weight: 300; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('fonts/Pretendard-Regular.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('fonts/Pretendard-Bold.woff2') format('woff2'); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: 'Pretendard'; src: url('fonts/Pretendard-ExtraBold.woff2') format('woff2'); font-style: normal; font-weight: 800 900; font-display: swap; }

:root {
  --bg: #0d0e10;
  --panel: #17181b;
  --raise: #1c1d21;
  --sunk: #101114;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --fg: #ececed;
  --fg-dim: #9b9ca3;
  --fg-mute: #75767e;
  --accent: #FFD75B;
  --accent-ink: #1d1703;
  --mono: 'Pretendard', ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #ffe38f; }

button, input, textarea { font-family: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.spacer { flex: 1; }

/* ---------- top bar ---------- */
.topbar {
  position: relative;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 25px; height: 25px; flex: 0 0 25px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #FFE082, #FFC93C);
}
.brand-mark svg { display: block; width: 17px; height: 17px; fill: #17181b; }
.brand-name { display: inline-flex; align-items: baseline; gap: .08em; color: var(--fg); font-family: 'Pretendard', sans-serif; font-size: 15px; line-height: 1; letter-spacing: -.025em; white-space: nowrap; }
.badge {
  font-family: var(--mono); font-size: 11px; color: #83848c;
  padding: 3px 7px; border-radius: 6px; background: #212328;
}
.mode-badge, .m-mode-badge {
  border: 1px solid rgba(255,255,255,.14); border-radius: 999px;
  background: #0f1012; color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: .04em; line-height: 1; padding: 6px 9px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.mode-badge { cursor: pointer; }
.mode-badge:hover { border-color: rgba(255,215,91,.55); }
/* [2026-09-15] 모델 선택 배지 — 빠른(플래시)/정밀(프로), 프로는 옐로 테두리·필 */
.model-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: #17181d; border: 1px solid #34363e; flex: 0 0 auto; }
.model-chip .model-opt { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: #9a9ba3; font: inherit; font-size: 12.5px; font-weight: 700; line-height: 1; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }  /* [2026-09-15 사장님 "버튼 좀만 키워"] */
.model-chip .model-opt svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; flex: 0 0 11px; }
.model-chip .model-opt .model-opt-cost { font-size: 11.5px; font-weight: 600; opacity: .85; }
.model-chip .model-opt:hover { color: #e4e4e9; }
.model-chip .model-opt.is-on { background: #FFD75B; color: #211b0c; }
.model-chip .model-opt.is-on svg { fill: rgba(33,27,12,.25); }
.model-chip .model-opt:active { transform: translateY(1px); }
.memo-foot .model-chip { margin-left: auto; }
.card-head .model-chip { margin-left: auto; flex: 0 0 auto; }
.card-head:has(.model-chip) > strong { white-space: nowrap; }  /* [2026-09-15 사장님 "글씨 틀어짐"] 제목 줄바꿈 금지 */
.card-head:has(.model-chip) .ai-tag { display: none; }  /* 칩이 25/32를 보여주므로 중복 태그 숨김 */
body.is-mobile .memo-foot { flex-wrap: wrap; }
body.is-mobile .memo-foot .model-chip { margin-left: 0; }
.m-ask .m-ask-model { margin-left: auto; }
.m-ask .m-ask-model .model-opt { padding: 6px 10px; font-size: 12px; }
.m-ask .m-ask-del { margin-left: 0; }
.model-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; flex: 0 0 12px; color: #9a9ba3; }
.model-badge.is-pro { border-color: rgba(255,215,91,.75); background: linear-gradient(180deg, #1c1912, #0f1012); }
.model-badge.is-pro svg { color: #FFD75B; fill: rgba(255,215,91,.25); }
.model-badge:active { transform: translateY(1px); }
.mode-badge i, .m-mode-badge i {
  width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px;
  background: #FFD75B; box-shadow: 0 0 0 3px rgba(255,215,91,.1);
}
.divider { width: 1px; height: 20px; background: var(--line-strong); }
.filemeta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.filename {
  font-size: 13px; font-weight: 500; max-width: 260px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filesub { font-family: var(--mono); font-size: 11px; color: #83848c; }

.top-history {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 3px; padding: 3px;
  border: 1px solid var(--line-strong); border-radius: 11px; background: rgba(13,14,16,.82);
  box-shadow: 0 5px 16px rgba(0,0,0,.22); z-index: 3;
}
.top-hist-btn {
  min-width: 68px; height: 34px; padding: 0 8px; border: 0; border-radius: 8px;
  background: transparent; color: #c6c7cd; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 10.5px; white-space: nowrap;
}
.top-hist-btn:hover:not(:disabled) { color: #fff; background: #25272d; }
.top-hist-btn:disabled { opacity: .34; cursor: default; }
.top-hist-btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
/* 히스토리 단계 안내 라벨 (노션② "1~6번 히스토리 어디서 보나요" — 되돌릴 단계 수를 상시 표기, 2026-08-26) */
.top-hist-label {
  padding: 0 10px 0 9px; margin-left: 2px; border-left: 1px solid var(--line-strong);
  color: #8e909a; font-size: 10.5px; white-space: nowrap; letter-spacing: .01em;
}
@media (max-width: 1500px) {
  .top-history { position: static; transform: none; margin-left: auto; }
  .top-hist-btn { min-width: 36px; }
  .top-hist-btn span { display: none; }
}

.segment { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: #212328; }
.seg-btn {
  border: none; cursor: pointer; padding: 7px 14px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500; background: transparent; color: var(--fg-dim);
}
.seg-btn:hover { color: var(--fg); }
.seg-btn.is-on { background: var(--panel); color: var(--fg); box-shadow: 0 1px 5px rgba(0,0,0,.35); }

.btn {
  cursor: pointer; border-radius: 9px; font-size: 12.5px; font-weight: 500;
  padding: 8px 14px; border: 1px solid transparent; background: transparent;
}
.btn.ghost { border-color: var(--line-strong); color: #d6d7db; }
.btn.ghost:hover { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.04); }
.btn.primary { background: linear-gradient(140deg, #FFE082, #FFC93C); color: var(--accent-ink); font-weight: 700; font-size: 13px; padding: 9px 18px; }
.btn.primary:hover { background: #f5849b; }
.btn.wide { width: 100%; padding: 11px 0; border-radius: 11px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 사진첩 백그라운드 저장은 전송률과 서버 처리 완료를 구분한다. 숫자 100% 대신
   서버 응답을 기다리는 단계임을 명시하고, 고객이 현재 대기 요청을 취소할 수 있게 한다. */
.upload-status {
  position: fixed; top: 62px; left: 50%; z-index: 92; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px);
  padding: 8px 10px; border: 1px solid rgba(255,215,91,.3); border-radius: 11px;
  background: rgba(17,18,22,.96); color: #d7d8dd; box-shadow: 0 8px 28px rgba(0,0,0,.34);
  font-size: 11.5px; white-space: nowrap;
}
.upload-status[hidden] { display: none !important; }
.upload-status-spin { width: 10px; height: 10px; flex: 0 0 10px; border: 2px solid rgba(255,255,255,.18); border-top-color: #ffd75b; border-radius: 50%; animation: uploadSpin .8s linear infinite; }
.upload-status button { border: 0; border-radius: 7px; padding: 4px 8px; background: #303138; color: #fff; font-size: 11px; cursor: pointer; }
.upload-status button:hover { background: #3a3b43; }
@keyframes uploadSpin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.workspace { height: calc(100vh - 58px); display: flex; min-height: 0; }

.toolrail {
  width: 68px; flex: none; padding: 14px 0;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  overflow-y: auto; scrollbar-width: none;
}
.toolrail::-webkit-scrollbar { display: none; }
.tool {
  width: 44px; height: 44px; border-radius: 12px; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--fg-dim);
}
.tool:hover { background: #212328; color: var(--fg); }
.tool.is-on { background: var(--accent); color: var(--accent-ink); }
.tool.is-off { color: #55565d; }
.tool svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail-duo { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.tool.rail-mini { width: 36px; height: 32px; border-radius: 9px; }
.tool.rail-mini svg { width: 16px; height: 16px; }

.rail-rule { width: 28px; height: 1px; background: var(--line-strong); margin: 6px 0; }
.rail-label { font-family: var(--mono); font-size: 9.5px; color: #5f6068; letter-spacing: .1em; }
.swatches, .sizes { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.swatch {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent;
}
.swatch.is-on { border-color: #fff; }
#penColor {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border: none; padding: 0; background: transparent; cursor: pointer;
}
#penColor::-webkit-color-swatch-wrapper { padding: 0; }
#penColor::-webkit-color-swatch { border: 2px solid rgba(255,255,255,.18); border-radius: 8px; }

.size-btn {
  width: 32px; height: 32px; border-radius: 10px; border: none; cursor: pointer;
  background: transparent; display: flex; align-items: center; justify-content: center;
}
.size-btn:hover { background: #212328; }
.size-btn.is-on { background: #2a2c32; }
.size-dot { display: block; border-radius: 50%; background: #d7d8dc; }

/* ---------- stage ---------- */
.stage {
  flex: 1; min-width: 0; position: relative; padding: 30px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 0%, #151619, var(--bg) 70%);
}
.dropzone {
  width: min(620px, 100%); padding: 56px 40px; text-align: center; cursor: pointer;
  border: 1.5px dashed rgba(255,255,255,.16); border-radius: 18px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.022) 0 8px, transparent 8px 16px);
  transition: border-color .15s, background-color .15s;
}
.dropzone.is-over { border-color: var(--accent); background-color: rgba(255,215,91,.06); }
.drop-icon {
  width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 14px; background: #212328;
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.drop-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dropzone h2 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.dropzone p { margin: 0; font-size: 13px; color: var(--fg-dim); line-height: 1.7; }
.drop-note { display: block; margin-top: 22px; font-family: var(--mono); font-size: 11px; color: #606169; letter-spacing: .06em; }

.canvas-wrap {
  position: relative; line-height: 0; border-radius: 4px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  /* 투명(누끼) 영역 표시용 체커보드 — 불투명 사진은 전부 덮으므로 평소엔 안 보임 (사장님 2026-08-05) */
  background: conic-gradient(#26272c 0 25%, #1b1c20 0 50%, #26272c 0 75%, #1b1c20 0) 0 0/22px 22px;
}
.canvas-wrap canvas { display: block; }
#baseCanvas { max-width: 100%; max-height: calc(100vh - 178px); }
#drawCanvas, #origCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#drawCanvas { touch-action: none; cursor: crosshair; }
/* 줌인 상태 = 손바닥 팬 (사장님 2026-08-04: 마우스 올리면 손모양으로 잡고 이동) */
.canvas-wrap.is-pan #drawCanvas { cursor: grab; }
.canvas-wrap.is-pan.is-grabbing #drawCanvas { cursor: grabbing; }
/* 숨김=마커만 visibility로 완전 은닉 (투명 버튼 hover/클릭 가로채기 방지, 사장님 2026-08-05).
 * ⚠️ #drawCanvas는 숨기면 안 됨 — 패치 올가미·텍스트 핸들이 이 캔버스에 그려지고 포인터 이벤트도 받음.
 * 펜 획 숨김은 renderStrokes()가 데이터 단계에서 스킵 (2026-08-05 격자 간헐 미표시 근본픽스) */
.canvas-wrap.is-hidden-marks .markers { opacity: 0; visibility: hidden; }
.markers { transition: opacity .15s ease; }
.canvas-wrap.is-stroking .markers { opacity: 0; }   /* 브러시 칠하는 동안 번호 마커 숨김 (2026-08-24) */
/* AILAB(메모) 탭 밖에선 번호 마커가 포인터를 가로채지 않게 — 마커 클릭(focusRegion)은 메모 탭에서만 의미 있음 */
.canvas-wrap:not(.is-tab-memo) .marker { pointer-events: none; }
.canvas-wrap.is-compare #drawCanvas, .canvas-wrap.is-compare .markers { display: none; }

.markers { position: absolute; inset: 0; pointer-events: none; }
.marker {
  position: absolute; transform: translate(-50%, -50%) scale(var(--mk-inv, 1));
  /* --mk-inv = 1/줌배율: 확대해도 뱃지는 화면상 크기 고정 (사장님 2026-08-24) */
  border-radius: 50%; border: 2px solid rgba(255,255,255,.92); cursor: pointer;
  color: #fff; font-family: var(--mono); font-size: 12px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto; animation: pop .18s ease-out;
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.marker.is-on { box-shadow: 0 0 0 4px rgba(255,255,255,.22), 0 2px 10px rgba(0,0,0,.5); }
.marker.is-applied::after {
  content: ""; position: absolute; right: -3px; bottom: -3px;
  width: 9px; height: 9px; border-radius: 50%; background: #6ee7a8; border: 2px solid #14151a;
}

.compare { position: absolute; inset: 0; }
#origCanvas { clip-path: inset(0 50% 0 0); }
.handle {
  position: absolute; top: 0; bottom: 0; width: 28px; margin-left: -14px; left: 50%;
  cursor: ew-resize; touch-action: none;
  display: flex; align-items: center; justify-content: center;
}
.handle-line { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.9); }
.handle-knob {
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #1a1b1e;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.handle-knob svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tag {
  position: absolute; top: 14px; padding: 5px 10px; border-radius: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; line-height: 1;
}
.tag.left { left: 14px; background: rgba(13,14,16,.72); }
.tag.right { right: 14px; background: rgba(255,215,91,.92); color: var(--accent-ink); font-weight: 500; }

.working {
  position: absolute; inset: 0; z-index: 8; /* 스테이지 소속 — 줌 배율 무관 고정 크기 */
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,14,16,.42); backdrop-filter: blur(1px);
}
/* [2026-09-15] FEEL AI 처리 모션 — 소개 페이지 시연(prl-live-scan/processing)과 같은 룩, 실제 요청 상태에만 연결 */
.working.is-ai { background: rgba(13,14,16,.18); backdrop-filter: none; }
.ai-scan-frame { position: absolute; overflow: hidden; pointer-events: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,215,91,.45), 0 0 24px rgba(255,215,91,.12) inset; }
.ai-scan-frame[hidden] { display: none; }
.ai-scan-band { position: absolute; left: 0; top: 0; width: 100%; height: 20%; opacity: .95; background: linear-gradient(transparent, rgba(255,216,102,.28)); border-bottom: 1px solid rgba(255,216,102,.7); animation: ai-scan 1.1s ease-in-out infinite; }
.working.is-ai .working-inner { background: rgba(24,27,32,.92); border-color: rgba(255,215,91,.35); color: #ffdc60; font-weight: 700; box-shadow: 0 6px 22px rgba(0,0,0,.35); max-width: 94vw; white-space: nowrap; line-height: 1; font-size: 12.5px; align-items: center; gap: 9px; }  /* [2026-09-15 사장님] 한 줄·글자 정렬 */
.working.is-ai #workingText { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1; }
.working.is-ai .working-brand { font-size: 12.5px; line-height: 1; display: inline-flex; align-items: center; }
.working.is-ai .spinner { flex: 0 0 15px; }
.working-brand { display: none; letter-spacing: .06em; font-size: 11px; color: #fff; }
.working-brand b { color: var(--accent); margin-right: 2px; }
.working.is-ai .working-brand { display: inline; }
#baseCanvas.is-result-in { animation: ai-result-in .65s ease both; }
@keyframes ai-scan { from { top: 0; } to { top: 80%; } }
@keyframes ai-result-in { from { opacity: .35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ai-scan-band { animation: none; opacity: .5; } #baseCanvas.is-result-in { animation: none; } }
.working-inner {
  display: flex; align-items: center; gap: 11px; padding: 12px 18px; border-radius: 12px;
  background: rgba(23,24,27,.94); border: 1px solid var(--line-strong);
  font-size: 13px; line-height: 1;
}
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}

.hint {
  position: absolute; left: 24px; bottom: 20px;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 13px; border-radius: 10px;
  background: rgba(23,24,27,.86); border: 1px solid var(--line);
  font-size: 12px; color: #a9aab1;
}
.hint .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- panel ---------- */
.panel {
  width: 384px; flex: none; min-height: 0;
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
}
/* 탭 = 3열 그리드 2줄 (사장님 2026-08-05 "너무 타이트, 2줄로 딱딱 칸 맞춰서" — 탭 늘어나면 자동 줄바꿈) */
.panel-tabs {
  flex: none; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 5px; padding: 12px 14px 0;
}
.ptab {
  border: 1px solid rgba(255,255,255,.06); cursor: pointer; padding: 9px 2px; border-radius: 9px;
  font-size: 12.5px; font-weight: 500; background: var(--sunk); color: var(--fg-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .12s, border-color .12s, background .12s;
}
.ptab:hover { color: var(--fg); border-color: rgba(255,255,255,.16); }
.ptab.is-on { background: var(--raise); color: var(--fg); border-color: rgba(255,215,91,.5); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 14px; }

.empty {
  padding: 38px 20px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: 14px;
}
.empty strong { display: block; font-size: 14px; font-weight: 500; margin-bottom: 7px; }
.empty span { font-size: 12.5px; color: #8a8b93; line-height: 1.65; }

.memo-list { display: flex; flex-direction: column; gap: 10px; }
.memo {
  border-radius: 13px; padding: 12px 13px; background: var(--raise);
  border: 1px solid transparent; animation: fadeup .2s ease-out; cursor: pointer;
}
.memo.is-on { border-color: rgba(255,215,91,.45); background: #23202280; background-color: #221f23; }
.memo-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.memo-num {
  width: 22px; height: 22px; flex: none; border-radius: 50%; color: #fff;
  font-family: var(--mono); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.memo-title { font-size: 12px; color: var(--fg-dim); }
.memo-del {
  border: none; background: transparent; color: var(--fg-mute); cursor: pointer;
  font-size: 11px; padding: 3px 5px; border-radius: 6px;
}
.memo-del:hover { color: #ffd75b; background: rgba(255,215,91,.1); }
.memo textarea {
  width: 100%; resize: vertical; min-height: 62px;
  border-radius: 9px; border: 1px solid rgba(255,255,255,.09);
  background: var(--sunk); font-size: 13px; line-height: 1.6; padding: 9px 10px;
}
.memo textarea::placeholder { color: #6d6e75; }
.memo textarea:focus { outline: none; border-color: rgba(255,215,91,.55); }
.memo-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.qchip {
  border: 1px solid rgba(255,255,255,.1); background: #1e1f23; color: #b9bac1;
  cursor: pointer; font-size: 11.5px; padding: 5px 9px; border-radius: 20px;
}
.qchip:hover { border-color: rgba(255,255,255,.24); color: #fff; }
.qchip.is-on { background: rgba(255,215,91,.16); border-color: rgba(255,215,91,.5); color: #ffe9a8; }
.memo-foot { display: flex; align-items: center; gap: 8px; }
.memo-apply {
  flex: 1; border: none; cursor: pointer; border-radius: 9px; padding: 9px 0;
  font-size: 12.5px; font-weight: 700; background: var(--accent); color: var(--accent-ink);
}
.memo-apply:hover { background: #f5849b; }
.memo-apply.is-applied { background: #24352b; color: #8ce0af; }
.memo-strength { display: flex; align-items: center; gap: 7px; width: 128px; min-width: 0; }
.memo-strength input { flex: 1; min-width: 0; }

.card { border-radius: 14px; background: var(--raise); padding: 14px; margin-bottom: 12px; }
.card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.card-head strong { font-size: 13.5px; }
.card-head .mono { font-size: 10.5px; color: var(--fg-mute); }
.card-sub { margin: 0 0 12px; font-size: 12px; color: #8a8b93; line-height: 1.6; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  cursor: pointer; font-size: 12.5px; font-weight: 500; padding: 8px 13px; border-radius: 22px;
  background: #22242a; color: #c3c4cb; border: 1px solid rgba(255,255,255,.08);
}
.chip:hover { border-color: rgba(255,255,255,.22); color: #fff; }
.chip.is-on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* PC 필터도 모바일과 같은 현재 사진 기반 썸네일 스트립으로 표시한다. */
#filterChips {
  flex-wrap: nowrap; overflow-x: auto; gap: 10px; padding: 2px 1px 9px;
  -webkit-overflow-scrolling: touch;
}
#filterChips .filter-chip {
  flex: 0 0 auto; width: 62px; padding: 0; border: 0; border-radius: 0;
  background: none; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
#filterChips .filter-chip:hover, #filterChips .filter-chip.is-on {
  background: none; color: var(--fg); border-color: transparent;
}
.filter-chip-im {
  width: 62px; height: 62px; border-radius: 12px; overflow: hidden;
  border: 2px solid transparent; background: #17181b;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.filter-chip:hover .filter-chip-im { transform: translateY(-1px); border-color: rgba(255,255,255,.28); }
.filter-chip.is-on .filter-chip-im { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(255,215,91,.18); }
.filter-chip-im img { width: 100%; height: 100%; object-fit: cover; display: block; }
.filter-chip-label {
  max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--fg-mute); font-size: 10.5px; font-weight: 600;
}
.filter-chip.is-on .filter-chip-label { color: var(--accent); }

.tones { display: flex; gap: 10px; }
.tone { flex: 1; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.tone-swatch { width: 100%; height: 44px; border-radius: 10px; border: 2px solid transparent; }
.tone span { font-size: 11.5px; color: #8a8b93; }
.tone.is-on .tone-swatch { border-color: #fff; }
.tone.is-on span { color: var(--fg); }

.slider-stack { display: flex; flex-direction: column; gap: 10px; }
.slider-row { display: flex; align-items: center; gap: 11px; margin-top: 14px; }
.slider-stack .slider-row { margin-top: 0; }
/* 라벨 고정폭 42px에 kbd 뱃지가 넘쳐 슬라이더가 패널 밖으로 밀리던 문제 — 내용폭+줄바꿈 금지로 픽스 (사장님 2026-08-05) */
.slider-label { font-size: 12px; color: var(--fg-dim); min-width: 42px; flex: none; white-space: nowrap; }
.slider-row input[type="range"] { min-width: 0; }
.slider-val { font-size: 11.5px; color: #c8c9cf; width: 36px; text-align: right; flex: none; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 22px; background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: #34363b; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%;
  background: #f2f2f4; border: none; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.panel-foot {
  flex: none; padding: 13px 14px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 9px;
}
.foot-meta { display: flex; justify-content: space-between; font-size: 12px; color: #8a8b93; }
.foot-meta .mono { font-size: 11px; }

.toast {
  /* 기본값 — 사진 있으면 JS가 사진첩 기준으로 실측 배치 (사장님 지시 2026-08-12) */
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast-item {
  padding: 12px 20px; border-radius: 12px; background: #f4f4f6; color: #16171a;
  font-size: 13px; font-weight: 500; box-shadow: 0 12px 34px rgba(0,0,0,.5);
  animation: fadeup .2s ease-out; cursor: pointer; pointer-events: auto;
  max-width: 88vw; text-align: center;
}

/* ── 커스텀 스크롤바 (사장님 지시 2026-08-05: 기본 스크롤 노출 금지) ──
 * 주의: scrollbar-width/scrollbar-color가 걸린 요소는 크롬 121+에서
 * ::-webkit-scrollbar 커스텀이 통째로 무효화됨 → 이 파일에서 둘 다 쓰지 말 것 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #34363e; border-radius: 999px;
  border: 3px solid transparent; background-clip: padding-box;
  min-height: 32px;
}
::-webkit-scrollbar-thumb:hover { background: #4a4d58; background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: #ffd75b; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* 사진 스트립(하단 필름) — 얇은 필 형태, 트랙도 라운드로 살짝만 */
.photo-strip::-webkit-scrollbar { height: 8px; }
.photo-strip::-webkit-scrollbar-track {
  background: rgba(255,255,255,.05); border-radius: 999px; margin: 0 12px;
}
.photo-strip::-webkit-scrollbar-thumb {
  background: #43464f; border: 2px solid transparent; background-clip: padding-box;
  min-width: 36px;
}
.photo-strip::-webkit-scrollbar-thumb:hover { background: #5a5e6a; background-clip: padding-box; }
.photo-strip::-webkit-scrollbar-thumb:active { background: #ffd75b; background-clip: padding-box; }

@keyframes pop { from { transform: translate(-50%,-50%) scale(.4); opacity: 0 } to { transform: translate(-50%,-50%) scale(1); opacity: 1 } }
@keyframes fadeup { from { transform: translateY(6px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---- AI 전체 보정 탭 (실 API 연동, 2026-08-04) ---- */
.gtext {
  width: 100%; resize: vertical; min-height: 74px;
  border-radius: 9px; border: 1px solid rgba(255,255,255,.09);
  background: var(--sunk); font-size: 13px; line-height: 1.6; padding: 9px 10px;
}
.gtext::placeholder { color: #6d6e75; }
.gtext:focus { outline: none; border-color: rgba(255,215,91,.55); }
.hist-label { font-size: 11.5px; color: #8a8b93; }
.hist-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.hist-row .btn { flex: 1; }

/* ── 업로드 사진 리스트 스트립 (2026-08-04) ── */
.photo-strip {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  max-width: calc(100% - 320px); z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: rgba(20,21,26,.92); border: 1px solid #2a2c33; border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 8px 22px rgba(0,0,0,.42);
}
.strip-add {
  flex: 0 0 auto; width: 44px; height: 56px; border-radius: 9px;
  background: transparent; border: 1.5px dashed #3a3c44; color: #8a8b93; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s, transform .15s;
}
.strip-add:hover { border-color: #ffd75b; color: #ffd75b; transform: translateY(-1px); }
.strip-add svg { width: 18px; height: 18px; }
.strip-list { display: flex; align-items: center; gap: 8px; }
.strip-item {
  position: relative; flex: 0 0 auto; width: 44px; height: 56px;
  padding: 0; border-radius: 9px; overflow: hidden; cursor: pointer;
  border: 2px solid #2e3038; background: #17181d;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.strip-item:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.strip-item.is-on { border-color: #ffd75b; }
.strip-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-badge {
  position: absolute; left: 3px; bottom: 3px;
  padding: 1px 5px; border-radius: 6px; font-size: 9px; font-weight: 700; letter-spacing: .02em;
  background: rgba(10,10,12,.85); color: #fff;
}

/* ── 스페이스 원본 보기 뱃지 ── */
.orig-badge {
  /* 캔버스 밖(스테이지)에 두어 줌 배율 무관 고정 크기 (사장님 지적 2026-08-04) */
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 7;
  padding: 5px 12px; border-radius: 8px; font-size: 11.5px; font-weight: 700;
  background: rgba(10,10,12,.85); color: #fff; pointer-events: none;
}

/* ── 포토샵식 히스토리 패널 (2026-08-04) ── */
.hist-panel {
  flex: 0 0 auto; margin: 0 14px 8px; padding: 10px 10px 8px;
  background: rgba(20,21,26,.92); border: 1px solid #2a2c33; border-radius: 12px;
}
.hist-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: #c9cad1; margin-bottom: 7px;
}
.hist-head svg { width: 14px; height: 14px; color: #8a8b93; }
.hist-head .mono { margin-left: auto; font-size: 10.5px; color: #8a8b93; }
.hist-list { max-height: 168px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.hist-entry { display: flex; align-items: center; gap: 3px; min-width: 0; }
.hist-step {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0;
  padding: 6px 8px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: #b9bac1; font-size: 11.5px; text-align: left; cursor: pointer;
  transition: background .12s, border-color .12s, transform .12s;
}
.hist-step:hover { background: rgba(255,255,255,.05); transform: translateY(-1px); }
.hist-step.is-on { background: rgba(255,215,91,.10); border-color: rgba(255,215,91,.45); color: #fff; }
.hist-step.is-ahead { opacity: .38; } /* 현재보다 뒤 단계 = 흐리게 (포토샵처럼 다시 갈 수 있음) */
.hist-num {
  flex: 0 0 auto; min-width: 18px; height: 18px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(10,10,12,.7); color: #ffd75b; font-size: 10px; font-weight: 700;
}
.hist-lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-delete {
  width: 28px; height: 28px; flex: 0 0 28px; padding: 0; border: 1px solid transparent;
  border-radius: 8px; background: transparent; color: #72747d; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; opacity: .35;
}
.hist-delete svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hist-entry:hover .hist-delete, .hist-delete:focus-visible { opacity: 1; }
.hist-delete:hover { color: #ff8899; border-color: rgba(255,111,133,.28); background: rgba(255,111,133,.08); }

/* ---------- portrait / liquify 탭 (2026-08-04) ---------- */
.free-tag {
  font-size: 10px !important; color: #7fd8a0 !important;
  border: 1px solid rgba(127,216,160,.35); border-radius: 6px; padding: 2px 6px;
}
/* 프리셋 가격 뱃지 (서버 preset_cost>0일 때만 JS가 부착 — 유료화 스위치 대비, 2026-08-05) */
.cost-tag {
  font-size: 10px !important; color: #ffd75b !important;
  border: 1px solid rgba(255,215,91,.4); border-radius: 6px; padding: 2px 6px;
}
.check-row {
  display: flex; align-items: center; gap: 9px; margin-top: 14px;
  font-size: 12.5px; color: var(--fg-dim); cursor: pointer; user-select: none;
}
.check-row input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.check-row:hover span { color: var(--fg); }

.lq-modes { display: flex; gap: 7px; margin-bottom: 4px; }
.lq-mode {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px 9px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--sunk); color: var(--fg-dim);
  font-size: 12px; font-weight: 500;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.lq-mode svg { width: 20px; height: 20px; }
.lq-mode:hover { color: var(--fg); border-color: rgba(255,255,255,.22); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.lq-mode:active { transform: translateY(0); }
.lq-mode.is-on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ---------- 단축키 뱃지 (사장님 2026-08-04 "전부 단축키 버튼 옆에 아주 작게") ---------- */
.kb {
  display: inline-block; font-family: var(--mono); font-size: 9px; line-height: 1;
  padding: 2.5px 4px; margin-left: 3px; border-radius: 4px; vertical-align: 1px;
  border: 1px solid var(--line-strong); color: var(--fg-mute); background: var(--sunk);
}
.btn .kb, .lq-mode .kb { opacity: .85; }
.kb-hint { margin: 12px 0 0 !important; font-family: var(--mono); font-size: 10.5px; color: var(--fg-mute); }
.tool { position: relative; }
.kb-corner {
  position: absolute; right: 3px; bottom: 2px; font-family: var(--mono);
  font-size: 8px; color: currentColor; opacity: .55; pointer-events: none;
}

/* ---------- 패치 탭 (포토샵 J키 패치 툴, 사장님 지시 2026-08-04) ---------- */
.pa-steps { display: flex; flex-direction: column; gap: 7px; margin-top: 11px; }
.pa-step {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--sunk);
  font-size: 12.5px; color: var(--fg-dim);
}
.pa-step svg { width: 19px; height: 19px; flex: none; color: var(--fg-dim); }
.pa-num {
  flex: none; width: 19px; height: 19px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
}

/* ---------- 브러시 원 커서: GPU 합성 DOM 오버레이 (사장님 2026-08-04 "마우스 즉각 반응") ---------- */
.brush-cur {
  position: absolute; left: 0; top: 0; z-index: 30; pointer-events: none;
  border-radius: 50%; border: 1.6px solid rgba(255,255,255,.92);
  box-shadow: 0 0 0 1.4px rgba(0,0,0,.5), inset 0 0 0 1.4px rgba(0,0,0,.35);
  will-change: transform;
}
.brush-cur.is-erase { border-color: rgba(255,120,120,.95); }

/* ---------- 탭 명칭 개편: AILAB AI 아이콘 (사장님 2026-08-04) ---------- */
.ptab-ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; display: inline-block; }
.ptab { white-space: nowrap; }

/* ---------- AI 보정 프리셋 (2026-08-05, 픽셀 잠금 인페인트) ---------- */
.pr-preset-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; border-radius: 11px; margin-top: 8px;
  border: 1px solid var(--line-strong); background: var(--sunk);
}
.pr-preset-name { font-size: 13px; font-weight: 500; color: var(--fg); }
.pr-preset-name .free-tag, .pr-preset-name .ai-tag, .pr-preset-name .cost-tag { margin-left: 6px; }
.ai-tag {
  display: inline-block; font-size: 9.5px; padding: 2.5px 6px; border-radius: 5px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.pr-lv { display: flex; gap: 5px; }
.pr-lv button {
  min-width: 34px; padding: 6px 0; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--fg-dim);
  font-size: 12px; font-weight: 600;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.pr-lv button:hover { color: var(--fg); border-color: rgba(255,255,255,.24); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.pr-lv button:active { transform: translateY(0); background: var(--raise); }

/* 사진 복원 칩 (사장님 2026-08-11) — 아이콘+텍스트 행, 반응형·오와열 유지 */
.rs-grid { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.rs-chip {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--sunk); color: var(--fg);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.rs-chip:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.24); box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.rs-chip:active { transform: translateY(0); background: var(--raise); }
.rs-chip:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.rs-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rs-ic {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--raise); border: 1px solid var(--line-strong);
}
.rs-ic svg { width: 16px; height: 16px; color: var(--accent); }
.rs-tx { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.rs-t { font-size: 12.5px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-d { font-size: 10.5px; color: #8a8b93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.is-mobile .rs-chip { padding: 11px 12px; }
body.is-mobile .rs-t { font-size: 13.5px; }
body.is-mobile .rs-d { font-size: 11px; }

/* 히스토리 취소 흔적 (필터 교체, 사장님 2026-08-05) */
.hist-step.is-ghost { opacity: .42; pointer-events: none; }
.hist-step.is-ghost .hist-lb { text-decoration: line-through; }

/* 토큰 지갑 칩 (2026-08-05, ai_intro 공유) */
.token-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--sunk); color: var(--fg);
}
.token-chip svg { width: 15px; height: 15px; color: var(--accent); }

/* 사진첩 (서버 보관) 스트립 아이템 (2026-08-05 DB화 2단계) */
.strip-item.strip-cloud { opacity: .88; }
.strip-badge-cloud { display: inline-flex; align-items: center; justify-content: center; }
.strip-badge-cloud svg { width: 11px; height: 11px; }

/* ---------- 토큰 사용내역 모달 (2026-08-05) ---------- */
.tk-modal {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(8,9,11,.62); backdrop-filter: blur(3px);
}
/* 추출 확인(과금 고지) 모달은 사진첩 모달 위에서 열림 — DOM 순서상 pgModal에 가려지는 문제 방지 */
#exModal { z-index: 210; }
#decisionModal { z-index: 230; }

/* 고배율 줌 = 픽셀 또렷하게 (사장님 2026-08-05 "픽셀 단위까지") */
.canvas-wrap.is-pixelzoom canvas { image-rendering: pixelated; }

/* 로그인 세션 풀림 안내 배너 (부트 API 403 재시도 소진 시) */
.sess-banner {
  position: fixed; top: 66px; left: 50%; transform: translateX(-50%); z-index: 300;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 10px; font-size: 12.5px;
  background: #2a2118; border: 1px solid rgba(255,215,91,.45); color: #ffe9ad;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.sess-banner button {
  border: none; border-radius: 7px; padding: 5px 10px; cursor: pointer;
  background: linear-gradient(140deg, #FFE082, #FFC93C); color: var(--accent-ink); font-weight: 700; font-size: 12px;
}

/* 텍스트 프리뷰 더블클릭 인라인 편집 (사장님 2026-08-05) */
.tx-inline {
  position: fixed; z-index: 260; min-height: 40px; resize: none;
  padding: 8px 10px; border-radius: 10px; font-size: 14px; line-height: 1.4;
  background: rgba(20,21,25,.96); color: var(--fg);
  border: 1.5px solid var(--accent); outline: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}

/* 이미지 좌표 뱃지 */
.coord-badge {
  position: absolute; right: 18px; bottom: 18px; z-index: 30;
  padding: 5px 9px; border-radius: 8px; font-size: 11px; color: #c8c9cf;
  background: rgba(23,24,27,.85); border: 1px solid var(--line);
  pointer-events: none;
}

/* 선택 영역 액션바 (크롭/투명 지우기) */
.sel-bar {
  position: absolute; bottom: 86px; left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; gap: 8px; padding: 8px 10px; border-radius: 12px;
  background: rgba(23,24,27,.94); border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.sel-bar button {
  border: 1px solid var(--line-strong); border-radius: 9px; cursor: pointer;
  background: var(--raise); color: var(--fg); font-size: 12.5px; padding: 7px 12px;
}
.sel-bar button:hover { border-color: rgba(255,215,91,.55); }
.sel-bar #selCropBtn { background: linear-gradient(140deg, #FFE082, #FFC93C); color: var(--accent-ink); font-weight: 700; border: none; }

/* 텍스트 효과 프리셋 칩 */
.tx-fx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.tx-fx button {
  border: 1px solid var(--line-strong); border-radius: 9px; background: var(--raise);
  color: var(--fg); font-size: 12px; padding: 8px 0; cursor: pointer;
  transition: transform .1s, border-color .1s;
}
.tx-fx button:hover { transform: translateY(-1px); border-color: rgba(255,215,91,.55); }
.tx-fx button:active { transform: translateY(0); }
.tk-sheet {
  width: min(440px, calc(100vw - 32px)); max-height: 78vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 16px; padding: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}

/* 사진별 2K/4K 생성 모드 선택 */
#modeModal { z-index: 240; }
.pr-mode-sheet { width: min(720px, calc(100vw - 32px)); max-height: min(88vh, 720px); padding: 22px; }
.pr-mode-head { align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.pr-mode-head > div { display: flex; flex-direction: column; gap: 5px; }
.pr-mode-head strong { font-size: 20px; letter-spacing: -.025em; }
.pr-mode-kicker { color: #FFD75B; font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .13em; }
.pr-mode-desc { margin: 0 0 18px; color: var(--fg-dim); font-size: 13px; line-height: 1.55; }
.pr-mode-limit {
  margin: -7px 0 16px; padding: 10px 12px 10px 34px; border-radius: 10px;
  border: 1px solid rgba(255,215,91,.34); background: rgba(255,215,91,.08); color: #ffe7a1;
  font-size: 12px; line-height: 1.55; position: relative; word-break: keep-all;
}
.pr-mode-limit::before { content: '!'; position: absolute; left: 12px; top: 10px; font-weight: 900; color: #FFD75B; }
.pr-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pr-mode-card {
  position: relative; min-width: 0; padding: 20px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  border: 1px solid var(--line-strong); border-radius: 16px;
  background: linear-gradient(155deg, #1d1e22, #141519); color: var(--fg);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.pr-mode-card:hover { transform: translateY(-1px); border-color: rgba(255,215,91,.65); box-shadow: 0 15px 34px rgba(0,0,0,.34); }
.pr-mode-card:active { transform: translateY(0) scale(.99); }
.pr-mode-card:focus-visible { outline: 2px solid #FFD75B; outline-offset: 3px; }
.pr-mode-card.is-selected { border-color: #FFD75B; box-shadow: 0 0 0 1px #FFD75B, 0 15px 34px rgba(0,0,0,.36); transform: scale(.99); }
.pr-mode-card:disabled { cursor: wait; opacity: .55; }
.pr-mode-card.is-selected:disabled { opacity: 1; }
.pr-mode-check {
  position: absolute; top: 14px; right: 14px; width: 24px; height: 24px;
  border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, #FFE082, #FFC93C); color: var(--accent-ink);
  opacity: 0; transform: scale(.65); transition: opacity .15s, transform .15s;
}
.pr-mode-card.is-selected .pr-mode-check { opacity: 1; transform: scale(1); }
.pr-mode-check svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pr-mode-icon {
  width: 43px; height: 43px; border-radius: 13px; display: grid; place-items: center;
  background: #25262b; color: #d7d8dc; border: 1px solid rgba(255,255,255,.08);
}
.pr-mode-card:hover .pr-mode-icon, .pr-mode-card.is-selected .pr-mode-icon { color: #FFD75B; border-color: rgba(255,215,91,.22); }
.pr-mode-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pr-mode-name { margin-top: 3px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.pr-mode-name strong { font-size: 22px; font-weight: 800; margin-right: 3px; }
.pr-mode-sub { color: #b7b8be; font-size: 12.5px; }
.pr-mode-points { width: 100%; margin-top: 5px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; }
.pr-mode-points > span { position: relative; padding-left: 14px; color: #91929a; font-size: 11.5px; }
.pr-mode-points > span::before { content: ''; position: absolute; left: 1px; top: .52em; width: 5px; height: 5px; border-radius: 50%; background: #FFD75B; }
.pr-mode-status {
  min-height: 36px; margin-top: 14px; border-radius: 10px; padding: 10px 12px;
  background: #111216; color: #8f9097; border: 1px solid var(--line); font-size: 11.5px; text-align: center;
}
.pr-mode-status.is-loading { color: #ffe7a1; border-color: rgba(255,215,91,.25); background: linear-gradient(100deg, #17181c 20%, #252218 42%, #17181c 64%); background-size: 220% 100%; animation: prModeShimmer 1.2s linear infinite; }
@keyframes prModeShimmer { to { background-position: -220% 0; } }
@media (max-width: 600px) {
  #modeModal { align-items: flex-end; }
  .pr-mode-sheet { width: 100%; max-height: min(92dvh, 760px); padding: 18px 16px max(18px, env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; overflow-y: auto; }
  .pr-mode-head strong { font-size: 18px; }
  .pr-mode-desc { margin-bottom: 13px; }
  .pr-mode-grid { grid-template-columns: 1fr; gap: 9px; }
  .pr-mode-card { padding: 15px 16px; gap: 5px; }
  .pr-mode-icon { width: 37px; height: 37px; }
  .pr-mode-name { position: absolute; left: 65px; top: 16px; }
  .pr-mode-sub { position: absolute; left: 65px; top: 47px; }
  .pr-mode-points { margin-top: 7px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .pr-mode-points > span { padding-left: 10px; font-size: 10px; line-height: 1.35; word-break: keep-all; }
  .pr-mode-points > span::before { left: 0; width: 4px; height: 4px; }
}
.tk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tk-head strong { font-size: 15px; }
.tk-head .mono { margin-left: auto; color: var(--accent); font-weight: 600; }
.tk-close { border: none; background: transparent; color: var(--fg-dim); cursor: pointer; padding: 4px; }
.tk-close svg { width: 16px; height: 16px; }
.tk-close:hover { color: var(--fg); }
.tk-list { flex: 1; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.tk-row {
  border-radius: 10px; border: 1px solid var(--line); background: var(--sunk);
  animation: tkin .28s cubic-bezier(.2,.8,.3,1) backwards;
  transition: border-color .18s ease;
}
@keyframes tkin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.tk-row .tk-main {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tk-row .tk-chev { width: 14px; height: 14px; flex: none; color: var(--fg-mute); transition: transform .22s cubic-bezier(.2,.8,.3,1); }
.tk-row.open { border-color: rgba(255,215,91,.35); }
.tk-row.open .tk-chev { transform: rotate(90deg); }
.tk-detail { padding: 2px 11px 11px; animation: tkin .2s ease-out; }
.tk-detail dl { margin: 0; border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.tk-detail dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tk-detail dt { font-size: 11px; color: var(--fg-mute); flex: none; }
.tk-detail dd { margin: 0; font-size: 11.5px; text-align: right; word-break: break-all; }
.tk-detail dd.plus { color: #8affc1; }
.tk-detail dd.minus { color: #ff8f9f; }
.tk-more {
  margin-top: 4px; padding: 11px; border-radius: 10px; cursor: pointer;
  border: 1px dashed var(--line-strong); background: transparent;
  color: var(--accent); font-size: 12.5px; font-weight: 700;
  transition: transform .15s ease, border-color .18s ease;
}
.tk-more:hover { border-color: rgba(255,215,91,.5); }
.tk-more:active { transform: scale(.98); }
.tk-more:disabled { opacity: .5; cursor: default; }
.tk-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tk-label { font-size: 12.5px; font-weight: 500; }
.tk-src { font-size: 9.5px; color: var(--fg-mute); border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 4px; margin-left: 4px; }
.tk-date { font-size: 10px; color: var(--fg-mute); }
.tk-amt { font-size: 13px; font-weight: 700; text-align: right; }
.tk-amt.plus { color: #8affc1; }
.tk-amt.minus { color: #ff8f9f; }
.tk-after { display: block; font-size: 10px; font-weight: 400; color: var(--fg-mute); }
.tk-empty { padding: 30px 0; text-align: center; color: var(--fg-mute); font-size: 12.5px; }

/* 토큰 차감 확인 모달 (2026-08-05) */
.tk-confirm-sheet { width: min(360px, calc(100vw - 32px)); }
.tkc-ic { width: 18px; height: 18px; color: var(--accent); }
.tkc-text { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; }
.tkc-text b { color: var(--accent); }
.tkc-sub { margin: 6px 0 0; font-size: 11px; color: var(--fg-mute); }
.tkc-skip { margin-top: 12px; font-size: 12px; color: var(--fg-dim); }
.decision-ic { width: 18px; height: 18px; color: #ff8899; }
.decision-text { white-space: pre-line; color: #d6d7dc; }
.decision-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.decision-actions .btn { min-width: 76px; }
.btn.decision-danger { border: 1px solid rgba(255,111,133,.45); background: rgba(255,111,133,.14); color: #ffacb8; font-weight: 700; }
.btn.decision-danger:hover { background: #ff6f85; border-color: #ff6f85; color: #19080b; }

/* 내 사진첩 모달 (2026-08-05) */
.pg-sheet { width: min(560px, calc(100vw - 32px)); }
/* [2026-09-15 사장님] 사진첩 50장 + 더보기 버튼 (그리드 전체 폭 한 줄) */
.pg-grid .pg-more { grid-column: 1 / -1; padding: 6px 0 10px; }
.pg-grid .pg-more-btn { min-height: 42px; border: 1px solid rgba(255,215,91,.45); background: rgba(255,215,91,.06); color: #ffd75b; font-weight: 700; }
.pg-grid .pg-more-btn:hover:not(:disabled) { background: rgba(255,215,91,.14); transform: translateY(-1px); }
.pg-grid .pg-more-btn:disabled { opacity: .55; }
.pg-grid {
  flex: 1; min-height: 140px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px;
  grid-auto-rows: max-content;   /* 행 붕괴 방지 — aspect-ratio img 높이가 auto 행 크기에 미반영(22px 띠 사고 2026-08-10) */
}
.pg-item {
  position: relative;
  border: 1px solid var(--line-strong); border-radius: 11px; background: var(--sunk);
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  animation: pgin .32s cubic-bezier(.2,.8,.3,1) backwards;   /* 스태거 등장 (JS가 delay 지정) */
}
@keyframes pgin { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.pg-item:hover { transform: translateY(-1px); border-color: rgba(255,215,91,.5); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.pg-open { width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; color: inherit; display: flex; flex-direction: column; overflow: hidden; }
.pg-item img { width: 100%; height: auto; aspect-ratio: 1/1; object-fit: cover; display: block; background: #17181b; }
.pg-delete {
  position: absolute; top: 6px; right: 6px; z-index: 3; width: 29px; height: 29px; padding: 0;
  border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: rgba(9,10,12,.82); color: #d7d8dd;
  cursor: pointer; display: grid; place-items: center; opacity: .78; backdrop-filter: blur(6px);
}
.pg-delete:hover { opacity: 1; color: #fff; border-color: rgba(255,111,133,.7); background: rgba(92,22,35,.9); }
.pg-delete svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pg-name {
  font-size: 10.5px; color: var(--fg-dim); padding: 6px 8px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
}
.pg-px {
  font-size: 9.5px; color: rgba(255,215,91,.75); padding: 1px 8px 6px;
  text-align: left; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
/* 여러 장 추출 (2026-08-05) */
.pg-foot { display: flex; gap: 8px; justify-content: flex-end; padding-top: 10px; }
.pg-foot .btn { display: inline-flex; align-items: center; gap: 6px; }
.pg-foot .btn svg { width: 15px; height: 15px; }
.pg-foot .btn:disabled { opacity: .45; cursor: default; }
#pgMulti.on { border-color: rgba(255,215,91,.6); color: #FFD75B; }
.pg-item.sel {
  border-color: #FFD75B; box-shadow: 0 0 0 2px rgba(255,215,91,.55), 0 4px 14px rgba(0,0,0,.35);
  position: relative;
}
.pg-item.sel::after {
  content: ''; position: absolute; top: 6px; left: 6px; width: 20px; height: 20px;
  border-radius: 50%; background: #FFD75B;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4 10-10'/%3E%3C/svg%3E");
  background-size: 12px; background-repeat: no-repeat; background-position: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

/* ===== 텍스트 레이어 (포스터, 2026-08-05) ===== */
.btn.wide { display: inline-flex; align-items: center; justify-content: center; }
.tx-layers { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.tx-layer { display: flex; align-items: center; gap: 4px; padding: 7px 9px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--sunk); cursor: pointer; transition: border-color .12s; }
.tx-layer.on { border-color: #FFD75B; box-shadow: 0 0 0 1px rgba(255,215,91,.4); }
.tx-layer-nm { flex: 1; font-size: 12px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-lb { width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 6px; background: transparent;
  color: var(--fg-dim); font-size: 9px; cursor: pointer; padding: 0; }
.tx-lb:hover { color: #FFD75B; border-color: rgba(255,215,91,.5); }
/* PC 드래그 순서변경 (2026-08-10) — is-mobile에선 draggable 자체를 안 붙임 */
body:not(.is-mobile) .tx-layer { cursor: grab; }
body:not(.is-mobile) .tx-layer:active { cursor: grabbing; }
.tx-layer.tx-dragging { opacity: .45; border-color: #FFD75B; box-shadow: 0 0 0 1px rgba(255,215,91,.4); }
.tx-props .card { margin-bottom: 10px; }
.tx-ta { width: 100%; resize: vertical; min-height: 40px; margin-bottom: 8px; padding: 8px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--sunk); color: var(--fg); font: inherit; font-size: 13px; }
.tx-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 12px; color: var(--fg-dim); }
.tx-row > span:first-child { flex: 0 0 46px; }
.tx-row input[type=range] { flex: 1; }
.tx-row input[type=color] { width: 34px; height: 26px; border: 1px solid var(--line-strong); border-radius: 6px; background: none; padding: 1px; cursor: pointer; }
.tx-sel { flex: 1; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--sunk); color: var(--fg); font-size: 12px; }
.tx-num { flex: 0 0 40px; text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); font-size: 11px; }
.tx-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.tx-seg button { padding: 5px 9px; background: transparent; border: none; border-right: 1px solid var(--line-strong);
  color: var(--fg-dim); cursor: pointer; font-size: 12px; display: inline-flex; align-items: center; }
.tx-seg button:last-child { border-right: none; }
.tx-seg button svg { width: 15px; height: 15px; }
.tx-seg button.on { background: rgba(255,215,91,.16); color: #FFD75B; }
.tx-seg.tx-mini button { padding: 3px 8px; font-size: 10.5px; }
.tx-switch { margin-left: auto; position: relative; display: inline-block; width: 36px; height: 20px; }
.tx-switch input { opacity: 0; width: 0; height: 0; }
.tx-switch span { position: absolute; inset: 0; background: var(--sunk); border: 1px solid var(--line-strong); border-radius: 20px; transition: .15s; }
.tx-switch span::before { content: ''; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; border-radius: 50%; background: var(--fg-dim); transition: .15s; }
.tx-switch input:checked + span { background: rgba(255,215,91,.25); border-color: #FFD75B; }
.tx-switch input:checked + span::before { transform: translateX(16px); background: #FFD75B; }
.tx-actions { display: flex; gap: 8px; }
.tx-actions .btn { flex: 1; justify-content: center; }

/* ===== 단축키 가이드 모달 (2026-08-05) ===== */
.kbd-sheet { width: min(500px, calc(100vw - 32px)); }
.kbd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kbd-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--sunk); }
.kbd-keys { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; min-width: 62px; }
.kbd-desc { font-size: 12px; color: var(--fg-dim); line-height: 1.35; }
kbd { display: inline-block; min-width: 20px; padding: 3px 6px; text-align: center;
  font-family: var(--mono); font-size: 11px; color: var(--fg);
  background: #23252b; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; }
.kbd-hold, .kbd-scroll { font-size: 10px; color: var(--accent); font-weight: 600; margin-left: 2px; }
.kbd-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.kbd-dontshow { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--fg-dim); cursor: pointer; }
.kbd-dontshow input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
@media (max-width: 520px) { .kbd-grid { grid-template-columns: 1fr; } }

/* ── 통합 레이어 패널 (사장님 B안 2026-08-05) ── */
.layer-panel { flex: 0 0 auto; margin: 0 14px 8px; padding: 10px 10px 8px; background: rgba(20,21,26,.92); border: 1px solid #2a2c33; border-radius: 12px; }
.layer-list { max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
/* 레이어 인라인 가이드 카드 (사장님 B안 확정 2026-08-10) */
.ly-guide { margin: 0 0 8px; border: 1px solid rgba(255,215,91,.35); border-radius: 10px; background: linear-gradient(160deg, rgba(255,215,91,.08), rgba(255,215,91,.02)); padding: 9px 10px; }
.ly-guide-hd { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; color: #ece9e2; }
.ly-guide-hd svg { width: 14px; height: 14px; stroke: #ffd75b; flex: 0 0 auto; }
.ly-guide-hd strong { font-weight: 800; }
.ly-guide-tg { margin-left: auto; background: none; border: none; color: #8b8880; font-size: 10.5px; cursor: pointer; padding: 2px 4px; transition: color .12s; }
.ly-guide-tg:hover { color: #c9c6be; }
.ly-guide-bd { font-size: 11px; line-height: 1.6; color: #c9c6be; }
.ly-guide-bd b { color: #ffd75b; font-weight: 700; }
.ly-guide-li { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.ly-guide-li svg { width: 11px; height: 11px; stroke: currentColor; flex: 0 0 auto; }
.ly-row { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-size: 11.5px; color: #b9bac1; transition: background .12s, border-color .12s; }
.ly-row:hover { background: rgba(255,255,255,.04); }
.ly-row.on { border-color: rgba(255,215,91,.5); background: rgba(255,215,91,.05); color: #fff; }
.ly-th { width: 24px; height: 24px; border-radius: 6px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.ly-th.txt { background: #101116; color: #ffd75b; }
.ly-th.ai { background: linear-gradient(135deg, #2a2308, #1a1408); color: #ffd75b; font-size: 9.5px; letter-spacing: .3px; border: 1px solid rgba(255,215,91,.25); }
.ly-row.is-hid .ly-th.ai { opacity: .45; }
.ly-th.img { background: linear-gradient(135deg, #4a6a8a, #c9a888); }
.ly-nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ly-sub { font-size: 9.5px; color: #8a8b93; }
.ly-row.is-hid .ly-nm { color: #5d5e66; text-decoration: line-through; }
.ly-act { display: flex; gap: 3px; }
.ly-act button { width: 22px; height: 22px; border: none; border-radius: 6px; background: transparent; color: #8a8b93; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.ly-act button:hover:not(:disabled) { background: #24262d; color: #fff; }
.ly-act button:disabled { cursor: default; color: #4a4c55; }
.ly-act button.off { color: #4a4c55; }
.ly-act svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* AI 레이어 순서변경 (2026-08-11) — PC 드래그(grab), 모바일 ▲▼만 노출 */
body:not(.is-mobile) .ly-row.ly-drag { cursor: grab; }
body:not(.is-mobile) .ly-row.ly-drag:active { cursor: grabbing; }
.ly-row.ly-dragging { opacity: .45; border-color: #FFD75B; box-shadow: 0 0 0 1px rgba(255,215,91,.4); }
body:not(.is-mobile) .ly-act button.ly-ud { display: none; }

/* 넓은 PC: 사진 오른쪽에 실제 여백이 있을 때 레이어·히스토리를 그 공간에 고정한다.
 * JS가 캔버스 우측 여백을 실측하므로 작은 화면·가로 사진·확대 상태에서는 기존 우측 패널로 안전 복귀한다. */
.stage-dock { flex: 0 0 auto; min-height: 0; }
.stage-dock-tabs {
  margin: 0 14px 8px; padding: 3px; border: 1px solid #2a2c33; border-radius: 10px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: rgba(20,21,26,.92);
}
.stage-dock-tabs button {
  height: 29px; border: 0; border-radius: 7px; background: transparent; color: #858790;
  font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.stage-dock-tabs button:hover { color: #d9dae0; background: rgba(255,255,255,.04); }
.stage-dock-tabs button.is-on { color: #17130a; background: #ffd75b; }
body.pc-inspector-fixed .panel { position: relative; }
/* [2026-08-23] 독(320+18 여백)이 캔버스 오른쪽에 고정될 때 그 자리를 스테이지에서 미리 빼서 캔버스가 왼쪽 공간에 맞춰지게 (겹침 방지, 가로 1200+) */
body.pc-inspector-fixed .stage { padding-right: 368px; }
/* 독 고정 시 스테이지 오버레이(사진첩 스트립·줌·좌표·힌트)도 캔버스 영역(스테이지-338px) 안으로 — 독 밑에 깔리거나 위에 떠서 겹치던 것 정리 */
body.pc-inspector-fixed .photo-strip { left: calc((100% - 338px) / 2); max-width: calc(100% - 338px - 48px); }
body.pc-inspector-fixed .zoom-ctl { right: 356px; bottom: auto; top: 16px; }      /* 하단은 스트립 차지 → 줌·좌표는 캔버스 영역 우상단으로 */
body.pc-inspector-fixed .coord-badge { right: 356px; bottom: auto; top: 64px; }
body.pc-inspector-fixed .hint { bottom: auto; top: 16px; max-width: calc(100% - 338px - 196px); }   /* 우상단 줌 컨트롤(≈140px)과 안 겹치게, 넘치면 말줄임 */
body.pc-inspector-fixed .hint #hintText { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.pc-inspector-fixed .stage-dock {
  position: absolute; top: 14px; bottom: 14px; right: calc(100% + 18px); width: 320px;
  z-index: 12; display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
body.pc-inspector-fixed .stage-dock > .stage-dock-tabs {
  margin: 0; pointer-events: auto; flex: 0 0 auto;
  box-shadow: 0 10px 24px rgba(0,0,0,.28); backdrop-filter: blur(10px);
}
body.pc-inspector-fixed .stage-dock > section {
  margin: 0; min-height: 0; pointer-events: auto;
  box-shadow: 0 14px 34px rgba(0,0,0,.34); backdrop-filter: blur(10px);
}
body.pc-inspector-fixed .stage-dock > .layer-panel,
body.pc-inspector-fixed .stage-dock > .hist-panel { flex: 1 1 auto; display: flex; flex-direction: column; }
body.pc-inspector-fixed .stage-dock .layer-list,
body.pc-inspector-fixed .stage-dock .hist-list { flex: 1 1 auto; min-height: 0; max-height: none; }

/* ── 좌측 레일 커스텀 툴팁 (B안: 기본 title 대신 사이트 톤, 2026-08-05) ── */
.tool[data-tip] { position: relative; }
.tool[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: #0c0d10; border: 1px solid #3a3c44; color: #fff; font-size: 11.5px; font-weight: 500;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; z-index: 40;
  box-shadow: 0 6px 16px rgba(0,0,0,.5); pointer-events: none;
}
.tool[data-tip]:hover::before {
  content: ''; position: absolute; left: calc(100% + 6px); top: 50%;
  transform: translateY(-50%) rotate(45deg); width: 8px; height: 8px;
  background: #0c0d10; border-left: 1px solid #3a3c44; border-bottom: 1px solid #3a3c44;
  z-index: 41; pointer-events: none;
}
.toolrail.is-switching { pointer-events: none; }
.toolrail.is-switching .tool { opacity: .58; }

/* ═══════════════════════════════════════════════════════════════════
   모바일 셸 (사장님 시안 v1 승인 2026-08-05) — body.is-mobile 스코프.
   mobile.js가 coarse pointer+좁은 화면에서만 클래스를 달아줌 → PC 무영향 ═══ */
body.is-mobile { overflow: hidden; }
body.is-mobile .topbar, body.is-mobile .toolrail { display: none; }
body.is-mobile .workspace { height: 100dvh; display: block; }
body.is-mobile .stage {
  position: fixed; inset: 0; z-index: 1;
  padding: calc(64px + env(safe-area-inset-top)) 8px calc(186px + env(safe-area-inset-bottom));
}
body.is-mobile #baseCanvas { max-height: calc(100dvh - 258px); }
body.is-mobile .stage, body.is-mobile #drawCanvas { touch-action: none; }
body.is-mobile button,
body.is-mobile [role="button"],
body.is-mobile .token-chip { touch-action: manipulation; }
body.is-mobile .upload-status { top: calc(56px + env(safe-area-inset-top)); max-width: calc(100vw - 20px); }
body.is-mobile .dropzone { width: min(480px, 92vw); padding: 38px 20px; }
body.is-mobile .hint, body.is-mobile #coordBadge, body.is-mobile #kbdModal { display: none !important; }

/* ── 상단 오버레이 바 ── */
.mtop {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: linear-gradient(180deg, rgba(13,14,16,.94), rgba(13,14,16,.55) 72%, transparent);
}
.mtop .mtbtn {
  width: 34px; height: 34px; flex: none; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.13); background: rgba(23,24,27,.78);
  backdrop-filter: blur(6px); color: var(--fg);
  display: flex; align-items: center; justify-content: center;
}
.mtop .mtbtn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mtop .mtbtn:active { transform: scale(.94); }
.mtop .mspacer { flex: 1; }
.mtop .msave {
  height: 34px; padding: 0 13px; border-radius: 12px; border: 0; cursor: pointer;
  background: linear-gradient(140deg, #FFE082, #FFC93C); color: #1d1703;
  font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 5px;
}
.mtop .msave svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mtop .msave:active { transform: scale(.96); }
.mtop .mcharge {
  height: 31px; flex: none; padding: 0 10px; border-radius: 11px; cursor: pointer;
  border: 1px solid rgba(255,211,92,.72); background: rgba(255,201,60,.14);
  color: #ffe28a; font-weight: 800; font-size: 12px;
}
.mtop .mcharge:active { transform: scale(.94); }
body.is-mobile .token-chip { height: 31px; font-size: 12px; border-radius: 12px; background: rgba(23,24,27,.78); backdrop-filter: blur(6px); }

@media (max-width: 420px) {
  .mtop { gap: 5px; padding-left: 8px; padding-right: 8px; }
  .mtop .mtbtn { width: 31px; height: 31px; }
  .mtop .mcharge { padding: 0 7px; }
  .mtop .msave { padding: 0 9px; }
  body.is-mobile .token-chip { padding-left: 7px; padding-right: 7px; }
}

/* ── 하단 독: 기존 우측 패널을 통째로 재배치 (ctx 위 · 탭바 아래) ── */
body.is-mobile .panel {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; z-index: 70;
  border-left: 0; max-height: 64dvh;
  background: linear-gradient(0deg, rgba(16,17,20,.98) 72%, rgba(16,17,20,.88) 88%, rgba(16,17,20,.35));
  padding-bottom: env(safe-area-inset-bottom);
}
body.is-mobile .panel-body { order: 1; flex: none; max-height: 25dvh; padding: 8px 11px 3px; }
body.is-mobile .panel-tabs {
  order: 2; display: flex; gap: 3px; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-inline: contain; touch-action: pan-x; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding: 5px 6px 6px; border-top: 1px solid rgba(255,255,255,.07);
}
body.is-mobile .panel-tabs::-webkit-scrollbar { display: none; }
body.is-mobile .ptab {
  flex: 0 0 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 5px 1px 4px; font-size: 9.5px; font-weight: 600; letter-spacing: -.01em;
  background: transparent; border-color: transparent; border-radius: 12px;
}
body.is-mobile .ptab .ptab-ic { width: 18px; height: 18px; margin: 0; }
body.is-mobile .ptab.is-on { background: rgba(255,215,91,.09); border-color: rgba(255,215,91,.25); color: var(--accent); }
body.is-mobile .stage-dock-tabs, body.is-mobile .layer-panel, body.is-mobile .hist-panel, body.is-mobile .panel-foot { display: none; }
body.is-mobile .pg-delete { opacity: 1; width: 44px; height: 44px; }
body.is-mobile .decision-actions .btn { min-height: 44px; flex: 1 1 0; }

/* 독 카드 압축: 설명문·단축키 숨김 (상태 라벨 .mono는 유지) */
body.is-mobile .card { padding: 8px 10px; margin-bottom: 6px; border-radius: 11px; }
body.is-mobile .card-head { margin-bottom: 2px; }
body.is-mobile .card-head strong { font-size: 12.5px; }
body.is-mobile .panel .btn { padding: 8px 10px; font-size: 12.5px; border-radius: 10px; }
body.is-mobile .lq-mode { padding: 6px 3px; font-size: 10.5px; gap: 3px; border-radius: 10px; }
body.is-mobile .lq-mode svg { width: 15px; height: 15px; }
body.is-mobile .slider-row { margin: 5px 0; gap: 8px; }
body.is-mobile .slider-label { font-size: 11.5px; }
body.is-mobile .pr-lv button { padding: 5px 10px; font-size: 11.5px; }
body.is-mobile .check-row { font-size: 11.5px; }
body.is-mobile .hist-row { gap: 6px; }
body.is-mobile .memo { padding: 9px 10px; border-radius: 11px; }
body.is-mobile .chips .chip { padding: 6px 10px; font-size: 11.5px; }
body.is-mobile .card-sub { display: none; }
body.is-mobile .card-sub.mono { display: block; }
body.is-mobile .kb, body.is-mobile .kb-hint { display: none !important; }
body.is-mobile .empty { padding: 11px 10px; }
body.is-mobile .empty strong { font-size: 12.5px; margin-bottom: 4px; }
body.is-mobile .empty span { font-size: 11px; }
/* 배경·색감 탭: 모바일은 필터 우선 배치 (누끼·AI는 아래로) */
body.is-mobile #tabAdjust { display: flex; flex-direction: column; }
body.is-mobile #tabAdjust .card:nth-of-type(1) { order: 2; }
body.is-mobile #tabAdjust .card:nth-of-type(2) { order: 1; }
body.is-mobile #tabAdjust .card:nth-of-type(3) { order: 3; }
body.is-mobile #tabAdjust .card:nth-of-type(4) { order: 4; }

/* 사진 스트립: 상단바 아래로 */
body.is-mobile .photo-strip {
  top: calc(54px + env(safe-area-inset-top)); bottom: auto; padding: 5px 7px;
  max-width: calc(100% - 20px); z-index: 60;
}
/* 선택 액션바: 독 위로 */
body.is-mobile .sel-bar { position: fixed; bottom: calc(38dvh + 12px); top: auto; z-index: 75; }
/* 원본 뱃지: 상단바 아래 */
body.is-mobile .orig-badge { top: calc(58px + env(safe-area-inset-top)); z-index: 66; }
body.is-mobile .working { z-index: 90; }
body.is-mobile .toast { bottom: auto; top: calc(148px + env(safe-area-inset-top)); z-index: 95; max-width: 88vw; text-align: center; }
body.is-mobile .sess-banner { top: calc(60px + env(safe-area-inset-top)); }

/* ── 좌측 세로 브러시 크기 슬라이더 (피부·몸매 탭) ── */
.mvs {
  position: fixed; left: 8px; top: 42%; transform: translateY(-50%); z-index: 65;
  width: 33px; height: 172px; border-radius: 13px;
  background: rgba(23,24,27,.75); border: 1px solid rgba(255,255,255,.13);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.mvs .mvs-track { width: 4px; height: 134px; border-radius: 4px; background: #2a2b31; position: relative; }
.mvs .mvs-fill { position: absolute; bottom: 0; left: 0; width: 100%; border-radius: 4px; background: linear-gradient(0deg, #FFE082, #FFC93C); }
.mvs .mvs-knob {
  position: absolute; left: 50%; transform: translate(-50%, 50%);
  width: 17px; height: 17px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
/* 슬라이더 조작 중 실굵기 원 미리보기 (사장님 2026-08-24) */
.mvs-preview {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none; z-index: 60; opacity: 0; transition: opacity .16s ease;
}
.mvs-preview.on { opacity: 1; }
.mvs-preview i {
  display: block; border-radius: 50%; box-sizing: border-box;
  border: 2px solid rgba(255,255,255,.95); background: rgba(77,156,255,.28);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.35);
  transition: width .06s linear, height .06s linear;
}
.mvs-preview b {
  font-family: var(--mono); font-size: 11px; font-weight: 500; color: #fff;
  background: rgba(10,11,14,.72); border: 1px solid rgba(255,255,255,.18);
  padding: 2px 8px; border-radius: 999px; backdrop-filter: blur(4px);
}

/* 포토샵식 사진 하단 반투명 입력바 (사장님 2026-08-24) — 모바일 전용 */
body:not(.is-mobile) .m-ask { display: none !important; }
.m-ask {
  position: fixed; left: 10px; right: 10px; bottom: 268px; z-index: 80;
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(14,15,18,.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  padding: 8px 10px; box-shadow: 0 8px 28px rgba(0,0,0,.4);
  transition: opacity .15s ease, bottom .12s ease;
}
.m-ask.is-away { opacity: 0; pointer-events: none; }
.m-ask-row { display: flex; gap: 8px; align-items: flex-end; }
.m-ask-num {
  flex: none; width: 24px; height: 24px; margin-bottom: 6px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9); color: #fff;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.m-ask-ta {
  flex: 1; resize: none; min-height: 36px; max-height: 76px; box-sizing: border-box;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  color: #fff; font-size: 13px; line-height: 1.35; padding: 8px 10px; font-family: inherit;
}
.m-ask-ta::placeholder { color: #9a9ca3; }
.m-ask-ta:focus { outline: none; border-color: rgba(255,215,91,.55); }
.m-ask-send {
  flex: none; min-height: 36px; border: 0; border-radius: 10px; padding: 9px 12px;
  background: linear-gradient(135deg, #FFE082, #FFC93C); color: #1a1b1e;
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}
.m-ask-send:active { transform: translateY(1px); }
.m-ask-sub { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.m-ask-stl { flex: none; font-size: 11px; color: #c8c9cf; }
.m-ask-st { flex: 1; min-width: 0; }
.m-ask-del { flex: none; background: transparent; border: 0; color: #8b8d94; font-size: 11.5px; padding: 4px 6px; cursor: pointer; }
.m-ask-del:active { color: #ff8b9d; }

/* 얼굴 성형 — 인물 감지 칩 (사장님 2026-08-24) */
.fl-faces { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.fl-face {
  display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--sunk);
  color: #c8c9cf; font-size: 11.5px; cursor: pointer;
  transition: transform .1s ease, border-color .12s ease, box-shadow .12s ease;
}
.fl-face:hover { transform: translateY(-1px); border-color: rgba(255,215,91,.5); }
.fl-face img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #17181b; }
.fl-face.is-on { border-color: rgba(255,215,91,.65); color: var(--accent); background: rgba(255,215,91,.09); }
.fl-face.is-on::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.fl-faces .fl-face-state { flex-basis: 100%; font-size: 11px; color: #8b8d94; }
.fl-pick-hint {
  margin-top: 9px; padding: 10px 11px; border: 1px solid rgba(255,215,91,.48); border-radius: 10px;
  background: rgba(255,215,91,.08); color: #e8e8ea; font-size: 11.5px; line-height: 1.45;
}
.fl-pick-hint b, .fl-pick-hint span { display: block; }
.fl-pick-hint b { color: var(--accent); margin-bottom: 2px; }
.fl-faces.is-picking .fl-face { border-color: rgba(255,215,91,.36); }
.fl-faces.is-picking .fl-face:not(.is-on) { color: #e3e3e5; }
.fl-power-row { margin-top: 8px; }
.fl-eye-controls { margin-top: 12px; min-width: 0; }
.fl-eye-controls[hidden], .fl-power-row[hidden], .fl-eye-group[hidden] { display: none !important; }
.fl-eye-targets { display: flex; gap: 5px; }
.fl-eye-targets button {
  flex: 1; min-width: 0; padding: 9px 3px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: var(--sunk); color: var(--fg-dim); font-size: 12px; cursor: pointer;
}
.fl-eye-targets button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: rgba(255,215,91,.08); }
.fl-eye-controls button:focus-visible, .fl-eye-controls input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fl-eye-note { font-size: 11px; line-height: 1.5; color: var(--fg-dim); margin: 8px 0; }
.fl-eye-group { border: 1px solid var(--line-strong); border-radius: 9px; margin: 10px 0; padding: 8px 10px 10px; min-width: 0; }
.fl-eye-group legend { padding: 0 4px; font-size: 12px; color: #9dd9ff; }
.fl-eye-group[data-eye-group="right"] legend { color: #ffbecb; }
.fl-eye-group .slider-row { gap: 8px; margin: 2px 0; }
.fl-eye-group input[type="range"] { width: 0; min-width: 32px; }
.fl-eye-group .slider-val { width: 25px; }
.fl-eye-group:disabled { opacity: .5; }
.fl-eye-group:focus-within { border-color: var(--accent); }
.fl-eye-reset-one { display: block; margin: 7px 0 0 auto; padding: 4px 6px; border: 0; border-radius: 4px; background: transparent; color: var(--fg-dim); font: inherit; font-size: 11px; cursor: pointer; }
.fl-eye-reset-one:hover { color: var(--accent); background: var(--sunk); }
@media (max-width: 320px) {
  .fl-eye-group { padding: 6px; }
  .fl-eye-group .slider-row { gap: 5px; }
  .fl-eye-group .slider-label { font-size: 11px; }
  .fl-eye-targets button { font-size: 11px; }
}
.body-person-notice {
  display: flex; flex-direction: column; gap: 3px; margin: 8px 0 5px; padding: 9px 10px;
  border-left: 3px solid var(--accent); border-radius: 8px; background: rgba(255,215,91,.075);
  color: #c8c9cf; font-size: 11.5px; line-height: 1.48;
}
.body-person-notice b { color: var(--accent); }

/* 커브 (사장님 2026-08-24) */
.cv-chs { display: flex; gap: 5px; margin-bottom: 8px; }
.cv-chs button {
  flex: 1; padding: 6px 0; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--sunk); color: #c8c9cf; font-size: 12px; cursor: pointer;
  transition: transform .1s ease, border-color .12s ease;
}
.cv-chs button:hover { transform: translateY(-1px); }
.cv-chs button.is-on { border-color: rgba(255,215,91,.6); color: var(--accent); background: rgba(255,215,91,.09); }
.cv-chs button[data-ch="r"].is-on { border-color: rgba(255,107,107,.65); color: #ff6b6b; background: rgba(255,107,107,.08); }
.cv-chs button[data-ch="g"].is-on { border-color: rgba(81,207,102,.65); color: #51cf66; background: rgba(81,207,102,.08); }
.cv-chs button[data-ch="b"].is-on { border-color: rgba(77,156,255,.65); color: #4d9cff; background: rgba(77,156,255,.08); }
#cvCurve {
  width: 100%; height: auto; display: block; border-radius: 10px;
  border: 1px solid var(--line-strong); background: #101114;
  touch-action: none; cursor: crosshair;
}
.cv-foot { display: flex; gap: 7px; margin-top: 9px; }
.cv-foot .btn { flex: 1; }

/* F5 자체 저장 알럿창 (사장님 2026-08-24) */
.rl-sheet { width: min(430px, calc(100vw - 32px)); }
.rl-list { margin: 4px 0 0; padding: 0 0 0 4px; list-style: none; }
.rl-list li {
  position: relative; padding: 5px 0 5px 20px; font-size: 13px; color: #e8e9ec;
}
.rl-list li::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 7px; height: 7px; border-radius: 50%; background: #FFD75B;
}
.rl-actions { display: flex; gap: 7px; }
.rl-actions .btn { flex: 1; white-space: nowrap; }
body.is-mobile .rl-actions { flex-direction: column; }

/* GPT식 선택 브러시 상태: 선택 전 안내 → 첫 마스크 획 뒤 완료 상태 */
.m-mask-state {
  position: fixed; left: 50%; top: calc(116px + env(safe-area-inset-top)); transform: translateX(-50%);
  z-index: 66; padding: 7px 13px; border-radius: 999px; pointer-events: none;
  background: rgba(20,22,27,.82); border: 1px solid rgba(255,255,255,.15);
  color: #d9dce4; font-size: 12px; font-weight: 700; backdrop-filter: blur(8px);
  box-shadow: 0 5px 16px rgba(0,0,0,.3);
}
.m-mask-state.has-selection { color: #cfe3ff; border-color: rgba(77,156,255,.55); background: rgba(24,50,84,.84); }

/* ── GPU 경로 뱃지 (몸매 탭) — 폴백 시 CPU 표시 ── */
.mgl {
  position: fixed; right: 10px; top: calc(58px + env(safe-area-inset-top)); z-index: 65;
  display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 9px;
  background: rgba(23,24,27,.8); border: 1px solid rgba(255,255,255,.13);
  font-family: var(--mono); font-size: 10.5px; color: #8fd18f;
}
.mgl i { width: 6px; height: 6px; border-radius: 50%; background: #8fd18f; }
.mgl.is-cpu { color: #d9b45b; }
.mgl.is-cpu i { background: #d9b45b; }

/* ── 필터 썸네일 스트립 (스노우식 — 내 사진 미리보기) ── */
.mfthumbs { display: none; }
body.is-mobile #filterChips { display: none; }
body.is-mobile .mfthumbs {
  display: flex; gap: 9px; overflow-x: auto; padding: 2px 0 8px;
  -webkit-overflow-scrolling: touch;
}
.mfthumbs .mft { flex: 0 0 auto; width: 56px; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 5px; align-items: center; }
.mfthumbs .mft .im { width: 56px; height: 56px; border-radius: 12px; border: 2px solid transparent; overflow: hidden; background: #17181b; }
.mfthumbs .mft .im img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mfthumbs .mft span { font-size: 10.5px; color: var(--fg-mute); font-weight: 600; white-space: nowrap; }
.mfthumbs .mft.is-on .im { border-color: var(--accent); }
.mfthumbs .mft.is-on span { color: var(--accent); }

/* ── 모달 전부 바텀시트화 ── */
body.is-mobile .tk-modal { align-items: flex-end; }
body.is-mobile .tk-sheet {
  width: 100%; max-width: none; margin: 0; border-radius: 22px 22px 0 0;
  border-left: 0; border-right: 0; border-bottom: 0;
  max-height: 82dvh; padding-bottom: calc(18px + env(safe-area-inset-bottom));
  animation: msheetup .22s ease-out;
}
@keyframes msheetup { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ── 제스처 힌트 필 ── */
.mhint {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(108px + env(safe-area-inset-top)); z-index: 66;
  display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px;
  background: rgba(13,14,16,.85); border: 1px solid rgba(255,255,255,.13);
  backdrop-filter: blur(6px); font-size: 12px; color: var(--fg-dim);
  white-space: nowrap; opacity: 0; transition: opacity .3s; pointer-events: none;
}
.mhint.is-show { opacity: 1; }
.mhint b { color: var(--fg); }

/* ── 사진 스트립 [+N] 사진첩 타일 (사장님 2026-08-06 "기본 10개, 나머지 사진첩으로") ── */
.strip-more {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #1d1f25; border: 1.5px dashed #3a3c44; cursor: pointer;
}
.strip-more:hover { border-color: #ffd75b; }
.strip-more .strip-more-n { font-family: var(--mono); font-size: 12px; font-weight: 700; color: #ffd75b; }
.strip-more .strip-more-t { font-size: 9px; color: #8a8b93; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════
   세션 만료/미로그인 풀스크린 안내 (app.js _loginGate, 2026-08-06)
   — 사장님 폰 사진첩 먹통: 오류 무음이라 원인 몰랐던 것 방지 ═══ */
#loginGate {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,11,13,.82); backdrop-filter: blur(8px);
  animation: lgfade .25s ease-out;
}
@keyframes lgfade { from { opacity: 0; } to { opacity: 1; } }
#loginGate .lg-card {
  width: min(340px, 86vw); padding: 30px 26px 24px; border-radius: 20px;
  background: #17181c; border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 18px 50px rgba(0,0,0,.55); text-align: center;
  animation: lgup .3s cubic-bezier(.2,.9,.3,1.15);
}
@keyframes lgup { from { transform: translateY(26px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
#loginGate .lg-ico {
  width: 40px; height: 40px; color: #ffd75b; margin-bottom: 12px;
  stroke-linecap: round; stroke-linejoin: round;
}
#loginGate .lg-title { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
#loginGate .lg-desc { font-size: 12.5px; line-height: 1.65; color: #9a9ba3; margin-bottom: 18px; }
#loginGate .lg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; width: 100%; border-radius: 13px; text-decoration: none;
  background: linear-gradient(140deg, #FFE082, #FFC93C); color: #1d1703;
  font-weight: 800; font-size: 14px;
  transition: transform .15s ease, box-shadow .2s ease;
}
#loginGate .lg-btn:active { transform: scale(.97); }

/* ═══════════════════════════════════════════════════════════════════
   모바일 인터랙션 부드러움 (사장님 2026-08-06 "존나 뻣뻣해") — is-mobile 스코프.
   원칙: transform/opacity만(GPU 합성, 캔버스·제스처 무간섭), 캔버스/스테이지엔 트랜지션 금지 ═══ */
body.is-mobile { -webkit-tap-highlight-color: transparent; }

/* 1) 누르는 것 전부 — 눌림 스프링 피드백 */
body.is-mobile .mtop .mtbtn, body.is-mobile .mtop .msave, body.is-mobile .mtop .mcharge,
body.is-mobile .ptab, body.is-mobile .panel .btn,
body.is-mobile .chips .chip, body.is-mobile .lq-mode,
body.is-mobile .pr-lv button, body.is-mobile .mfthumbs .mft,
body.is-mobile .strip-item, body.is-mobile .strip-add, body.is-mobile .strip-more,
body.is-mobile .pg-item, body.is-mobile .token-chip {
  transition: transform .16s cubic-bezier(.2,.9,.3,1.4), background .18s ease,
              border-color .18s ease, color .18s ease, opacity .18s ease;
}
body.is-mobile .ptab:active, body.is-mobile .panel .btn:active,
body.is-mobile .chips .chip:active, body.is-mobile .lq-mode:active,
body.is-mobile .pr-lv button:active { transform: scale(.95); }
body.is-mobile .mfthumbs .mft:active, body.is-mobile .pg-item:active,
body.is-mobile .strip-item:active, body.is-mobile .strip-add:active,
body.is-mobile .strip-more:active { transform: scale(.93); }
body.is-mobile .mtop .mtbtn:active { transform: scale(.9); }
body.is-mobile .mtop .msave:active { transform: scale(.95); }
body.is-mobile .m-mode-badge { padding: 6px 8px; font-size: 10.5px; }
body.is-mobile .mvs .mvs-knob { transition: transform .12s ease; }

/* 2) 탭 전환 — 새 패널이 아래에서 사르르 */
body.is-mobile .panel-body:not([hidden]) { animation: mtabin .22s cubic-bezier(.2,.8,.3,1); }
@keyframes mtabin { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
body.is-mobile .ptab.is-on .ptab-ic { animation: mtabpop .28s cubic-bezier(.2,.9,.3,1.5); }
@keyframes mtabpop { 45% { transform: scale(1.18); } }

/* 3) 모달·바텀시트 — 배경 페이드 + 시트 스프링 상승 (기존 msheetup 강화) */
body.is-mobile .tk-modal:not([hidden]) { animation: lgfade .22s ease-out; }
body.is-mobile .tk-sheet { animation: msheetup .3s cubic-bezier(.2,.9,.3,1.08); }

/* 4) 토스트·작업중 — 팝 등장 */
body.is-mobile .toast-item { animation: mtoast .28s cubic-bezier(.2,.9,.3,1.3); }
@keyframes mtoast { from { transform: translateY(-8px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
body.is-mobile .working:not([hidden]) { animation: lgfade .2s ease-out; }
body.is-mobile .sel-bar:not([hidden]) { animation: mtoast .24s cubic-bezier(.2,.9,.3,1.2); }
body.is-mobile .photo-strip:not([hidden]) { animation: lgfade .25s ease-out; }
body.is-mobile .mgl { transition: opacity .25s ease; }
body.is-mobile .orig-badge:not([hidden]) { animation: lgfade .18s ease-out; }

/* 5) 접근성 — 시스템 "동작 줄이기" 켠 사용자는 전부 즉시 표시 */
@media (prefers-reduced-motion: reduce) {
  body.is-mobile * { animation-duration: .01s !important; transition-duration: .01s !important; }
}

/* 서버 썸네일 페이드인 (r69 — URL+lazy 로드) */
.thumb-fade { opacity: 0; transition: opacity .3s ease; }
.thumb-fade.ld { opacity: 1; }

/* px 배지 — 레이어 패널 (사장님 ④ 2026-08-10, 사진첩 .pg-px 동일 톤) */
.ly-px {
  margin-left: 6px; font-size: 9.5px; color: rgba(255,215,91,.78);
  letter-spacing: .02em; font-variant-numeric: tabular-nums; font-weight: 500;
}
.ly-px.dim { color: #8a8b93; }

/* ── 줌 컨트롤 (실무팀 QA ②, 2026-08-11) — 좌표 뱃지 위, 모바일은 핀치가 있어 숨김 ── */
.zoom-ctl {
  position: absolute; right: 18px; bottom: 52px; z-index: 40;
  display: flex; gap: 6px; padding: 6px 7px; border-radius: 12px;
  background: rgba(23,24,27,.94); border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.zoom-ctl button {
  border: 1px solid var(--line-strong); border-radius: 9px; cursor: pointer;
  background: var(--raise); color: var(--fg);
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  transition: transform .1s, border-color .1s;
}
.zoom-ctl button svg { width: 15px; height: 15px; }
.zoom-ctl button:hover { border-color: rgba(255,215,91,.55); transform: translateY(-1px); }
.zoom-ctl button:active { transform: translateY(0); }
.zoom-ctl #zoomReset { width: auto; padding: 0 9px; font-size: 11.5px; color: #c8c9cf; }
body.is-mobile .zoom-ctl { display: none !important; }

/* ── 패치 선택 도형 (실무팀 QA ⑤, 2026-08-11) ── */
.pa-shapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.pa-shapes button {
  border: 1px solid var(--line-strong); border-radius: 9px; background: var(--raise);
  color: var(--fg); font-size: 12px; padding: 8px 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: transform .1s, border-color .1s;
}
.pa-shapes button svg { width: 14px; height: 14px; }
.pa-shapes button:hover { transform: translateY(-1px); border-color: rgba(255,215,91,.55); }
.pa-shapes button.is-on { background: linear-gradient(140deg, #FFE082, #FFC93C); color: var(--accent-ink); font-weight: 700; border: none; }
.pa-feather-row { margin-top: 13px; }

/* ── 얼굴 성형 프리셋 (사장님 2026-08-11) ── */
.fl-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.fl-btns button {
  border: 1px solid var(--line-strong); border-radius: 9px; background: var(--raise);
  color: var(--fg); font-size: 12px; padding: 9px 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  transition: transform .1s, border-color .1s;
}
.fl-btns button svg { width: 17px; height: 17px; }
.fl-btns button:hover { transform: translateY(-1px); border-color: rgba(255,215,91,.55); }
.fl-btns button:active { transform: translateY(0) scale(.97); }
.fl-btns button.is-on {
  border-color: #FFD75B; background: linear-gradient(140deg, #FFE082, #FFC93C);
  color: var(--accent-ink); font-weight: 750; box-shadow: 0 0 0 1px rgba(255,215,91,.18), 0 5px 14px rgba(255,201,60,.12);
}
.fl-btns button.is-picking { outline: 2px solid rgba(255,215,91,.34); outline-offset: 2px; }

/* 기능별 ? 사용 가이드 (실무팀 피드백 반영, 2026-08-12) */
.tool-help { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #3a3b40; background: transparent; color: #9a9ba3; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex: 0 0 auto; align-self: center; transition: border-color .15s, color .15s, transform .15s; }
.tool-help:hover { border-color: #ffd75b; color: #ffd75b; transform: translateY(-1px); }
.tool-help svg { width: 13px; height: 13px; }
.tool-guide { margin: 2px 0 10px; }
.tool-guide .ly-guide-bd b { color: #ffd75b; font-weight: 700; }

/* ── 충전 레이어 팝업 (사장님 2026-08-12 "새창 대신 ai_intro처럼 레이어") ── */
.charge-layer {
  position: fixed; inset: 0; z-index: 320; display: flex; align-items: center; justify-content: center;
  background: rgba(8,9,11,.62); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .18s ease;
}
.charge-layer.show { opacity: 1; }
.charge-sheet {
  position: relative; width: min(480px, calc(100vw - 24px)); height: min(760px, calc(100dvh - 40px));
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  transform: translateY(10px); transition: transform .18s cubic-bezier(.2,.8,.3,1);
}
.charge-layer.show .charge-sheet { transform: none; }
.charge-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; cursor: pointer;
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: rgba(23,24,27,.85); color: var(--fg-dim); border: 1px solid var(--line);
}
.charge-close:hover { color: var(--fg); }
.charge-close svg { width: 14px; height: 14px; }
.charge-sheet iframe { width: 100%; height: 100%; border: 0; display: block; }
body.is-mobile .charge-layer { align-items: flex-end; }
body.is-mobile .charge-sheet { width: 100vw; height: min(88dvh, 760px); border-radius: 16px 16px 0 0; }

/* FEELAI 로고 — FEEL 굵게, AI 얇게 붙여쓰기 */
.brand-name strong { font-weight: 800; }
.brand-name span { font-weight: 300; }

/* Photo filter categories and colour protection. Also used by the mobile sheet. */
.filter-groups { display:flex; gap:5px; flex-wrap:wrap; margin:0 0 12px; }
.filter-groups button { border:1px solid #ffffff20; border-radius:16px; padding:6px 10px; font:inherit; font-size:12px; background:#22242a; color:var(--fg-mute); cursor:pointer; }
.filter-groups button.is-on { background:var(--accent); color:var(--accent-ink); border-color:transparent; }
#filterChips .filter-chip[hidden] { display:none; }
.filter-options { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; font-size:11px; margin-top:10px; color:var(--fg-mute); }
.filter-options label { display:flex; align-items:center; gap:6px; color:var(--fg); cursor:pointer; }
.filter-options input { accent-color:var(--accent); }
