/* =========================================================
   SSO'S HUB — 02 사진 편집실
   다크 블랙 베이스 · 핑크 포인트 · 작업실(랩) 레이아웃
   ========================================================= */

.page--wide { max-width: 1320px; }

/* 아이패드 가로·작은 노트북: 패널을 조금 줄여 무대를 넓게 */
@media (min-width: 941px) and (max-width: 1080px) {
  .work-body { grid-template-columns: minmax(0, 1fr) 300px; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── 머리말 보조 ─────────────────────────────────────── */
.subhead-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}
.subhead-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-4);
}
@media (max-width: 620px) {
  .subhead-side { align-items: flex-start; text-align: left; gap: 8px; }
  .subhead { padding-bottom: 16px; }
}

/* ── 모드 전환 ───────────────────────────────────────── */
.lab { margin-top: 22px; }

.modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.mode {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(30, 24, 38, .72), rgba(17, 14, 22, .72));
  color: var(--text-2);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.mode:hover { transform: translateY(-1px); border-color: var(--line); }
.mode.is-on {
  border-color: rgba(255, 77, 141, .48);
  background:
    radial-gradient(120% 140% at 0% -20%, rgba(255, 77, 141, .24), transparent 62%),
    linear-gradient(180deg, #241a2c, #171220);
  box-shadow: 0 18px 34px -30px #000, inset 0 1px 0 rgba(255, 255, 255, .06);
}
.mode-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 18px;
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.mode.is-on .mode-ico {
  background: linear-gradient(180deg, rgba(255, 117, 168, .3), rgba(255, 77, 141, .12));
  box-shadow: inset 0 0 0 1px rgba(255, 105, 165, .4);
}
.mode-txt { display: grid; gap: 2px; min-width: 0; }
.mode-txt b {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--text);
}
.mode-txt i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mode.is-on .mode-txt i { color: var(--pink-3); }
@media (max-width: 560px) {
  .modes { gap: 8px; }
  .mode { padding: 11px 12px; gap: 9px; border-radius: 15px; }
  .mode-ico { width: 32px; height: 32px; font-size: 15px; border-radius: 10px; }
  .mode-txt b { font-size: 13.5px; }
  .mode-txt i { font-size: 10.5px; }
}

/* ── 사진 담기 드롭존 ─────────────────────────────────── */
.drop--edit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 54px 26px;
  border: 1.5px dashed rgba(255, 105, 165, .34);
  border-radius: 24px;
  background:
    radial-gradient(90% 120% at 50% -20%, rgba(255, 77, 141, .12), transparent 64%),
    rgba(20, 16, 26, .6);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.drop--edit:hover,
.drop--edit.is-over {
  border-color: rgba(255, 77, 141, .72);
  background:
    radial-gradient(90% 120% at 50% -20%, rgba(255, 77, 141, .22), transparent 64%),
    rgba(28, 21, 34, .8);
  transform: translateY(-1px);
}
.drop-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 20px;
  font-size: 28px;
  background: linear-gradient(180deg, rgba(255, 77, 141, .22), rgba(255, 77, 141, .06));
  box-shadow: inset 0 0 0 1px rgba(255, 105, 165, .3), 0 18px 32px -24px var(--pink-glow);
}
.drop-text { display: grid; gap: 6px; }
.drop-text b { font-size: 15px; color: var(--text); font-weight: 600; letter-spacing: -.02em; }
.drop-text i { font-style: normal; font-size: 12.5px; line-height: 1.6; color: var(--text-4); }
.drop-pill {
  margin-top: 2px;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--pink-2), var(--pink));
  color: var(--on-pink);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 24px -16px var(--pink-glow);
}
@media (max-width: 560px) {
  .drop--edit { padding: 38px 18px; border-radius: 20px; }
  .drop-icon { width: 54px; height: 54px; font-size: 24px; border-radius: 17px; }
  .drop-text b { font-size: 14px; }
  .drop-text i { font-size: 11.5px; }
}

/* ── 작업 바 ─────────────────────────────────────────── */
.work-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(30, 24, 38, .8), rgba(17, 14, 22, .8));
}
.work-bar-left,
.work-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.work-file {
  max-width: 240px;
  padding-left: 4px;
  font-size: 12px;
  color: var(--text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn--sm {
  padding: 8px 13px;
  font-size: 12.5px;
  gap: 5px;
}
.btn--block { width: 100%; }
.work-bar .btn[disabled] { opacity: .38; pointer-events: none; }
@media (max-width: 620px) {
  .work-bar { padding: 8px; }
  .work-bar-right { width: 100%; }
  .work-bar-right .btn { flex: 1 1 auto; }
  .work-file { display: none; }
}

/* ── 작업 본문 ───────────────────────────────────────── */
.work-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 14px;
  margin-top: 12px;
  align-items: start;
}
@media (max-width: 940px) {
  .work-body { grid-template-columns: minmax(0, 1fr); }
}

.stage-col { min-width: 0; }

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background-color: #0a0810;
  /* 투명한 곳을 알려 주는 체크무늬 */
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .045) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, .045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .045) 75%);
  background-size: 22px 22px, 22px 22px;
  background-position: 0 0, 11px 11px;
  overflow: hidden;
  touch-action: none;
}
.stage.is-tool { cursor: crosshair; }
.stage.is-move { cursor: default; }

#stageCanvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(64vh, 620px);
  border-radius: 2px;
  box-shadow: 0 24px 50px -34px #000;
  pointer-events: none;
}

/* ── 자르기 상자 ─────────────────────────────────────── */
.crop {
  position: absolute;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 9999px rgba(6, 4, 9, .62);
  cursor: move;
  touch-action: none;
  transition: opacity .18s;
}
.crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .32) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .32) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
  background-position: -1px -1px;
  opacity: .8;
}
.crop-h {
  position: absolute;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(20, 16, 26, .85);
  cursor: nwse-resize;
  transform: translate(-50%, -50%);
}
.crop-h[data-h="nw"] { left: 0; top: 0; }
.crop-h[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.crop-h[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.crop-h[data-h="se"] { left: 100%; top: 100%; }
.crop-size {
  position: absolute;
  left: 50%;
  bottom: -32px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 8, 16, .88);
  border: 1px solid rgba(255, 255, 255, .16);
  font-size: 11px;
  color: #fff;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── 브러시 커서 ─────────────────────────────────────── */
.brush-ring {
  position: absolute;
  left: 0;
  top: 0;
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 77, 141, .75);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
}

/* ── 무대 아래 안내 ───────────────────────────────────── */
.stage-foot { margin-top: 10px; }
.stage-info {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: .01em;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}
.stage-tip {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: rgba(169, 154, 166, .8);
}
.crop-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 77, 141, .3);
  border-radius: 12px;
  background: rgba(255, 77, 141, .08);
}
.crop-bar-hint { flex: 1 1 auto; font-size: 11.5px; color: var(--pink-3); }

/* ── 도구 패널 ───────────────────────────────────────── */
.panel {
  position: sticky;
  top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(28, 22, 36, .92), rgba(15, 12, 20, .92));
  box-shadow: 0 28px 56px -46px #000;
  overflow: hidden;
}
/* 스크롤이 더 있다는 걸 알려 주는 아래쪽 페이드 */
.panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  background: linear-gradient(to top, rgba(15, 12, 20, .96), rgba(15, 12, 20, 0));
  pointer-events: none;
}
@media (max-width: 940px) {
  .panel { position: static; }
}

.panel-tabs {
  display: flex;
  gap: 2px;
  padding: 7px 7px 0;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  scrollbar-width: none;
}
.panel-tabs::-webkit-scrollbar { display: none; }
.ptab {
  flex: 1 0 auto;
  padding: 9px 10px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.ptab:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.ptab.is-on {
  color: var(--pink-2);
  border-bottom-color: var(--pink);
  background: linear-gradient(180deg, transparent, rgba(255, 77, 141, .1));
  font-weight: 600;
}

.panel-body {
  max-height: min(74vh, 700px);
  padding: 14px 14px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 940px) {
  .panel-body { max-height: none; }
}

.pane { display: grid; gap: 11px; }
.pane[hidden] { display: none; }

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pane-head h3 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.pane-badge {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 105, 165, .3);
  background: rgba(255, 77, 141, .1);
  font-size: 9.5px;
  letter-spacing: .06em;
  color: var(--pink-3);
}
.pane-rule {
  height: 1px;
  margin: 4px 0 2px;
  border: 0;
  background: var(--line-soft);
}
.pane-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-4);
}
.pane-hint b { color: var(--pink-3); font-weight: 600; }

.linkbtn {
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--pink-3);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 117, 168, .4);
}
.linkbtn:hover { color: var(--pink-2); text-decoration-color: var(--pink); }

/* ── 슬라이더 ─────────────────────────────────────────── */
.slider { display: grid; gap: 7px; }
.slider-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.slider-top b {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.slider-top i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--pink-3);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 77, 141, .55), rgba(255, 255, 255, .16));
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 77, 141, .55), rgba(255, 255, 255, .16));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5.5px;
  border: 2px solid #1a0711;
  border-radius: 50%;
  background: var(--pink-2);
  box-shadow: 0 0 0 2px rgba(255, 77, 141, .3);
  transition: transform .12s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.14); }
input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid #1a0711;
  border-radius: 50%;
  background: var(--pink-2);
}

/* ── 칩 · 버튼 줄 ────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips--col { display: grid; gap: 6px; }

.chip {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: var(--text-2);
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1.2;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s, transform .16s;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line); }
.chip.is-on {
  border-color: rgba(255, 77, 141, .55);
  background: rgba(255, 77, 141, .16);
  color: var(--pink-2);
  font-weight: 600;
}
.chips--col .chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 12px;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-row .btn { flex: 0 1 auto; }

/* ── 필드 ────────────────────────────────────────────── */
.field { display: grid; gap: 6px; }
.field-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-4);
}
.field-label em {
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-4);
}
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder { color: var(--text-4); }
.input:hover { border-color: rgba(255, 105, 165, .3); }
.input:focus {
  outline: none;
  border-color: rgba(255, 105, 165, .68);
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 3px rgba(255, 77, 141, .13);
}

/* ── 색 견본 ─────────────────────────────────────────── */
.swatches { display: flex; gap: 8px; }
.sw {
  position: relative;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  background: var(--sw, #fff);
  cursor: pointer;
  transition: transform .16s, box-shadow .16s;
}
.sw:hover { transform: scale(1.08); }
.sw.is-on {
  box-shadow: 0 0 0 2px rgba(255, 77, 141, .85), 0 0 0 4px rgba(255, 77, 141, .2);
}

/* ── 워터마크 위치 격자 ───────────────────────────────── */
.wm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 132px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}
.wm-grid button {
  display: grid;
  place-items: center;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-4);
  font-size: 12px;
  cursor: pointer;
  transition: .16s;
}
.wm-grid button:hover { color: var(--pink-3); background: rgba(255, 255, 255, .05); }
.wm-grid button.is-on {
  border-color: rgba(255, 77, 141, .5);
  background: rgba(255, 77, 141, .2);
  color: var(--pink-2);
}

/* ── AI 누끼 상자 ─────────────────────────────────────── */
.ai-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 105, 165, .22);
  border-radius: 14px;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255, 77, 141, .16), transparent 62%),
    rgba(255, 255, 255, .02);
}
.ai-note {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--text-4);
}
.ai-progress { display: grid; gap: 6px; }
.ai-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.ai-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink-2), var(--pink));
  transition: width .25s ease;
}
.ai-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-3);
}

/* ── 화질 개선 ───────────────────────────────────────── */
.hq {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(255, 105, 165, .24);
  border-radius: 14px;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255, 77, 141, .15), transparent 62%),
    rgba(255, 255, 255, .02);
}
.hq-lead {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-4);
}
.hq-lead b { color: var(--pink-3); font-weight: 600; }

.hq-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.hq-check:hover { border-color: var(--line); background: rgba(255, 255, 255, .05); }
.hq-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  opacity: 0;
  pointer-events: none;
}
.hq-box {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid rgba(255, 255, 255, .28);
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.hq-box::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-bottom: 1px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--on-pink);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .14s, transform .14s;
}
.hq-check input:checked + .hq-box {
  border-color: rgba(255, 105, 165, .9);
  background: linear-gradient(180deg, var(--pink-2), var(--pink));
}
.hq-check input:checked + .hq-box::after { opacity: 1; transform: none; }
.hq-check input:focus-visible + .hq-box {
  box-shadow: 0 0 0 3px rgba(255, 77, 141, .28);
  border-color: rgba(255, 105, 165, .9);
}
.hq-check input:disabled + .hq-box { opacity: .45; }
.hq-check:has(input:disabled) { cursor: default; opacity: .7; }
.hq-txt { display: grid; gap: 2px; min-width: 0; }
.hq-txt b { font-size: 12px; font-weight: 500; color: var(--text-2); }
.hq-txt i { font-style: normal; font-size: 10.5px; line-height: 1.4; color: var(--text-4); }

.hq-size {
  margin: 0;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .22);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.hq-size b { color: var(--pink-2); font-weight: 600; }
.hq-size.is-capped { color: var(--pink-3); }
.hq-cap {
  display: inline-block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--pink-3);
  opacity: .85;
}

.chips.is-busy { opacity: .5; pointer-events: none; }
.hq #btnHq[disabled] { opacity: .6; pointer-events: none; }

/* ── 필터 프리셋 ──────────────────────────────────────── */
.presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.preset {
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: var(--text-3);
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
  transition: border-color .16s, color .16s, transform .16s, background .16s;
}
.preset:hover { transform: translateY(-1px); color: var(--text); border-color: var(--line); }
.preset.is-on {
  border-color: rgba(255, 77, 141, .6);
  background: rgba(255, 77, 141, .14);
  color: var(--pink-2);
}
.preset-thumb {
  display: block;
  height: 34px;
  border-radius: 7px;
  background: linear-gradient(135deg, #6d2b46, #2a1730 55%, #120f19);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.preset[data-preset="mono"] .preset-thumb { background: linear-gradient(135deg, #cfcfcf, #4a4a4a 55%, #101010); }
.preset[data-preset="film"] .preset-thumb { background: linear-gradient(135deg, #c99a63, #6a4c39 55%, #1a1410); }
.preset[data-preset="pink"] .preset-thumb { background: linear-gradient(135deg, #ff9dc2, #a8386a 55%, #2a0d1c); }
.preset[data-preset="cool"] .preset-thumb { background: linear-gradient(135deg, #8fb6e8, #33507a 55%, #0d1420); }
.preset[data-preset="vintage"] .preset-thumb { background: linear-gradient(135deg, #e8d2a3, #8a7346 55%, #241d12); }
.preset[data-preset="none"] .preset-thumb { background: linear-gradient(135deg, #b06a86, #5b3350 55%, #14101a); }

/* ── 모달 ────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 4, 9, .74);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.modal-card {
  width: min(480px, 100%);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 105, 165, .3);
  border-radius: 22px;
  background:
    radial-gradient(120% 110% at 100% -10%, rgba(255, 77, 141, .18), transparent 56%),
    linear-gradient(164deg, #1b1424 0%, #14101a 58%, #0f0c14 100%);
  box-shadow: 0 44px 90px -46px #000, inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: hidden;
  animation: pop-in .22s cubic-bezier(.33, 1, .68, 1) both;
}
.modal-card--small { width: min(400px, 100%); }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(.975); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-4);
  font-size: 13px;
  cursor: pointer;
  transition: .16s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .05); }
.modal-body {
  display: grid;
  gap: 13px;
  padding: 16px 18px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, .18);
}
.grow { flex: 1 1 auto; }
.confirm-text {
  margin: 0;
  padding: 14px 18px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}
.ex-info {
  margin: 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-3);
}
@media (max-width: 520px) {
  .modal-foot .btn { flex: 1 1 auto; }
}

/* =========================================================
   용량 줄이기
   ========================================================= */
.cmp { display: grid; gap: 12px; margin-top: 12px; }

.cmp-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: start;
}
@media (max-width: 900px) {
  .cmp-top { grid-template-columns: minmax(0, 1fr); }
}

.cmp-preview { min-width: 0; }

.cmp-view {
  position: relative;
  display: block;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background-color: #0a0810;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .04) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, .04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .04) 75%);
  background-size: 20px 20px, 20px 20px;
  background-position: 0 0, 10px 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: min(62vh, 620px);
  user-select: none;
  /* 좌우로 끌면 비교, 세로로 쓸면 페이지 스크롤 */
  touch-action: pan-y;
  cursor: ew-resize;
}
.cmp-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cmp-img--after { clip-path: inset(0 0 0 50%); }
.cmp-tag {
  position: absolute;
  top: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(10, 8, 16, .78);
  border: 1px solid rgba(255, 255, 255, .16);
  font-size: 10px;
  letter-spacing: .04em;
  color: #fff;
  pointer-events: none;
}
.cmp-tag--l { left: 10px; }
.cmp-tag--r { right: 10px; color: var(--pink-3); border-color: rgba(255, 105, 165, .4); }
.cmp-div {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, .55);
  pointer-events: none;
}
.cmp-div::after {
  content: "⇄";
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  color: #1a0711;
  font-size: 14px;
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .8);
}
.cmp-view:focus-visible {
  outline: 2px solid var(--pink-2);
  outline-offset: 3px;
}
.cmp-cap {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}

.cmp-side {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(28, 22, 36, .9), rgba(15, 12, 20, .9));
}
.cmp-totals { display: grid; gap: 6px; }
.tot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  font-size: 11.5px;
  color: var(--text-3);
}
.tot b { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.tot--accent { background: rgba(255, 77, 141, .12); color: var(--pink-3); }
.tot--accent b { color: var(--pink-2); }
.cmp-status {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-4);
  min-height: 16px;
}

.cmp-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cmp-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, .028);
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.cmp-item:hover { border-color: var(--line-soft); background: rgba(255, 255, 255, .05); }
.cmp-item.is-on {
  border-color: rgba(255, 77, 141, .48);
  background: rgba(255, 77, 141, .1);
}
.cmp-thumb {
  width: 52px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: #0a0810;
}
.cmp-name {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.cmp-name b {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmp-name i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}
.cmp-ratio {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 77, 141, .14);
  border: 1px solid rgba(255, 77, 141, .32);
  font-size: 10.5px;
  color: var(--pink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cmp-del {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-4);
  font-size: 12px;
  cursor: pointer;
}
.cmp-del:hover { color: #ff8fa3; border-color: rgba(255, 80, 110, .4); background: rgba(255, 60, 90, .1); }
@media (max-width: 560px) {
  .cmp-item { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; }
  .cmp-thumb { width: 44px; height: 34px; }
  .cmp-del { display: none; }
  .cmp-view { aspect-ratio: 1 / 1; }
}

/* ── 접근성: 모션 최소화 ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .modal-card { animation: none; }
  .mode, .chip, .preset, .sw { transition: none; }
}

/* =========================================================
   기기별 UX
   ========================================================= */

/* ── 폰 (세로) : 손가락으로 누르기 편한 크기 ───────────── */
@media (max-width: 620px) {
  .chip {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 13px;
    font-size: 12px;
  }
  .chips--col .chip { min-height: 42px; }
  .btn--sm { min-height: 40px; padding: 10px 14px; font-size: 12.5px; }
  .btn { min-height: 42px; }
  .ptab { padding: 12px 11px 11px; font-size: 13px; }
  .sw { width: 32px; height: 32px; }
  .icon-btn { width: 40px; height: 40px; }
  .crop-h { width: 28px; height: 28px; }
  .wm-grid { width: 100%; max-width: 168px; }
  .wm-grid button { height: 36px; }
  .presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preset { padding: 7px 5px; font-size: 10px; }
  .preset-thumb { height: 30px; }
  .panel-tabs { gap: 0; }
  .stage { border-radius: 16px; padding: 10px; }
  .stage-tip { font-size: 10.5px; }
  .cmp-view { border-radius: 15px; }
  .cmp-cap { font-size: 10.5px; }
  .modal-card { border-radius: 18px; }
}

/* ── 폰·태블릿 공통: hover 없는 기기에서 숨김 없이 ────── */
@media (hover: none) {
  .mode:hover, .chip:hover, .preset:hover, .sw:hover, .btn:hover { transform: none; }
  }

/* ── 아주 좁은 폰 (320~380) : 도구 탭 6개가 스크롤 없이 ── */
@media (max-width: 380px) {
  .ptab { padding: 11px 8px 10px; font-size: 12px; }
  .hq { padding: 10px 9px; }
}

/* ── 태블릿 (아이패드 세로 768~940) : 무대·패널 세로 배치 ── */
@media (min-width: 700px) and (max-width: 940px) and (min-height: 561px) {
  .work-body { gap: 12px; }
  .panel-tabs { justify-content: space-around; }
  .ptab { flex: 1 1 0; }
  .panel-body { padding: 16px 16px 20px; }
  .pane { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  .pane > .pane-head,
  .pane > .pane-rule,
  .pane > .pane-hint,
  .pane > .ai-box,
  .pane > .hq,
  .pane > .chips--col,
  .pane > .presets { grid-column: 1 / -1; }
  .cmp-top { grid-template-columns: minmax(0, 1fr); }
}

/* ── 태블릿 가로·낮은 노트북 (높이 800px 이하) : 머리말 압축 ── */
@media (min-width: 700px) and (max-height: 800px) {
  .page--wide { padding-top: 14px; padding-bottom: 46px; }
  .subhead { padding: 0 4px 10px; }
  .backlink { margin-bottom: 6px; padding: 5px 11px; font-size: 11.5px; }
  .kicker { margin-bottom: 2px; font-size: 9.5px; }
  .subhead h1 { font-size: 24px; }
  .subhead .sub { margin-top: 4px; font-size: 15px; }
  .subhead-note { display: none; }
  .tabs { margin-top: 10px; }
  .tab { padding: 8px 11px; font-size: 12px; }
  .lab { margin-top: 12px; }
  .modes { margin-bottom: 10px; }
  .mode { padding: 9px 12px; }
  .mode-ico { width: 30px; height: 30px; font-size: 15px; }
  .mode-txt i { display: none; }
  .work-body { margin-top: 8px; }
  #stageCanvas { max-height: 46vh; }
}

/* ── 폰·태블릿 가로 (높이가 낮음) : 컴팩트 머리 + 좌우 배치 ── */
@media (max-height: 560px) and (orientation: landscape) {
  .page--wide { padding-top: 8px; padding-bottom: 30px; }
  .bookmark { display: none; }
  /* 머리말을 한 줄로 눌러 캔버스에 높이를 내준다 */
  .subhead {
    display: flex;
    align-items: center;
    padding: 0 2px 6px;
    gap: 8px 12px;
    border-bottom: 0;
  }
  .subhead-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .backlink { margin-bottom: 0; padding: 5px 11px; font-size: 11.5px; }
  .kicker { display: none; }
  .subhead h1 { font-size: 19px; letter-spacing: -.03em; }
  .subhead .sub { display: none; }
  .subhead-note { display: none; }
  .subhead-side { flex-direction: row; align-items: center; margin-left: auto; }
  .subhead .stamp { font-size: 11px; padding: 5px 10px; }
  .tabs { display: none; }
  .lab { margin-top: 4px; }
  .modes { margin-bottom: 7px; gap: 7px; }
  .mode { padding: 6px 10px; gap: 8px; border-radius: 11px; }
  .mode-ico { width: 24px; height: 24px; font-size: 12px; border-radius: 8px; }
  .mode-txt b { font-size: 12px; }
  .mode-txt i { display: none; }
  .work-bar { padding: 5px 8px; border-radius: 11px; }
  .btn--sm { padding: 7px 11px; font-size: 11.5px; }
  .work-file { display: none; }
  .work-body { grid-template-columns: minmax(0, 1fr) minmax(268px, 38%); gap: 9px; margin-top: 7px; }
  .stage { padding: 5px; border-radius: 12px; min-height: 120px; }
  #stageCanvas { max-height: 50vh; }
  .stage-foot { margin-top: 5px; }
  .stage-info { font-size: 10.5px; }
  .stage-tip { display: none; }
  .panel { position: static; border-radius: 13px; }
  .panel-tabs { padding: 4px 4px 0; }
  .ptab { padding: 7px 7px 8px; font-size: 11.5px; }
  .panel-body { max-height: min(58vh, 420px); padding: 9px 10px 12px; }
  .pane { gap: 7px; }
  .drop--edit { padding: 18px 14px; border-radius: 14px; gap: 8px; }
  .drop-icon { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }
  .drop-text i { display: none; }
  .cmp-view { aspect-ratio: 21 / 9; max-height: 46vh; }
  .cmp-top { grid-template-columns: minmax(0, 1fr) 280px; gap: 9px; }
  .cmp-side { padding: 9px; gap: 7px; }
  .cmp-item { padding: 6px 8px; }
  .foot { display: none; }
}
