/* 4. 사진 편집하기 */
.ph-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.ph-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ph-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }

#tool-photo .panel h2 { font-size: 15px; margin-bottom: 8px; }
#tool-photo .new-row { margin-top: 4px; }
.ph-find-status { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--brand-deep); }
.ph-find-status.is-error, .ph-bar-note.is-error, .ph-save-status.is-error { color: var(--danger); }
#tool-photo #ph-find-remind { color: var(--text); background: var(--hint-fill); border-radius: 8px; padding: 6px 10px; margin: 0 0 8px; }
.ph-save-status { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.ph-save-status:empty { display: none; }

.ph-seg { display: flex; width: 100%; }
.ph-seg button { flex: 1 1 0; padding: 7px 4px; }
.ph-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ph-lbl { flex: none; width: 44px; line-height: 1.25; font-size: 13px; color: var(--muted); }
.ph-row .seg { flex: 1; }
.ph-select { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.ph-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.ph-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.ph-range { display: block; margin-top: 12px; font-size: 13px; color: var(--muted); }
.ph-range output { color: var(--brand-deep); font-weight: 700; margin-left: 4px; }
.ph-range input { display: block; width: 100%; margin: 6px 0 0; accent-color: var(--brand); }
#ph-add.is-on, #ph-compare.is-on, #ph-auto.is-on, #ph-crop.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }

.ph-stickers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 12px 0 8px; }
.ph-st-wrap { position: relative; }
.ph-st { width: 100%; aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 8px; background: var(--bg); font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.ph-st:hover { border-color: var(--line); }
.ph-st.is-on { border-color: var(--brand); background: var(--brand-soft); }
.ph-st img { width: 80%; height: 80%; object-fit: contain; }
.ph-st-x { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--danger); font-size: 10px; line-height: 1; cursor: pointer; }

.ph-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 32px; }
.ph-bar-note { font-size: 13px; color: var(--muted); }
.ph-compare, #ph-compare { touch-action: none; user-select: none; -webkit-user-select: none; }

.ph-stagewrap { position: relative; background: var(--desk); border-radius: 12px; padding: 12px; min-height: 260px; display: grid; place-items: center; }
#tool-photo.is-dropping .ph-stagewrap { outline: 3px dashed var(--brand); outline-offset: -3px; background: var(--brand-soft); }
.ph-empty { text-align: center; padding: 40px 12px; }
.ph-empty-big { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.ph-stage { position: relative; max-width: 100%; box-shadow: var(--shadow); line-height: 0; }
.ph-stage canvas { display: block; width: 100%; height: 100%; background: #fff; }
.ph-overlay { position: absolute; inset: 0; }
.ph-overlay.is-adding { cursor: crosshair; touch-action: none; outline: 3px solid var(--brand); outline-offset: -3px; }
.ph-overlay.is-hidden { visibility: hidden; }
.ph-box { position: absolute; border: 2px dashed #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 55%), inset 0 0 0 1px rgb(0 0 0 / 35%); cursor: move; touch-action: none; min-width: 6px; min-height: 6px; }
.ph-box.is-round { border-radius: 50%; }
.ph-box.is-off { border-color: rgb(255 255 255 / 70%); border-style: dotted; opacity: .6; }
.ph-box.is-sel { border: 2px solid #19e0c9; box-shadow: 0 0 0 2px rgb(0 0 0 / 70%); z-index: 2; }
.ph-draft { border-color: #19e0c9; pointer-events: none; }
.ph-h { display: none; position: absolute; width: 16px; height: 16px; background: #19e0c9; border: 2px solid #0b3b36; border-radius: 4px; touch-action: none; }
.ph-box.is-only .ph-h, .ph-crop .ph-h { display: block; }
.ph-h-nw { left: -9px; top: -9px; cursor: nwse-resize; }
.ph-h-ne { right: -9px; top: -9px; cursor: nesw-resize; }
.ph-h-sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.ph-h-se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.ph-del { display: none; position: absolute; left: 50%; top: 4px; transform: translateX(-50%); width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: #b23a3a; color: #fff; font-size: 12px; line-height: 24px; cursor: pointer; }
.ph-box.is-only .ph-del { display: block; }
@media (pointer: coarse) {
  .ph-h { width: 24px; height: 24px; }
  .ph-h-nw { left: -13px; top: -13px; } .ph-h-ne { right: -13px; top: -13px; }
  .ph-h-sw { left: -13px; bottom: -13px; } .ph-h-se { right: -13px; bottom: -13px; }
  .ph-del { width: 32px; height: 32px; line-height: 32px; font-size: 14px; }
}

.ph-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; }
.ph-strip[hidden] { display: none; }
.ph-thumb { position: relative; flex: none; width: 84px; }
.ph-thumb-btn { display: block; width: 100%; padding: 3px; border: 2px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.ph-thumb.is-cur .ph-thumb-btn { border-color: var(--brand); background: var(--brand-soft); }
.ph-thumb-btn img { display: block; width: 100%; height: 60px; object-fit: cover; border-radius: 5px; }
.ph-thumb-n { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); text-align: center; }
.ph-thumb-x { position: absolute; top: -5px; right: -5px; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--danger); font-size: 11px; cursor: pointer; }

@media (max-width: 900px) {
  .ph-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ph-side { display: contents; }
  .ph-p-open { order: 1; }
  .ph-main { order: 2; position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 4px 0; }
  .ph-p-find { order: 3; } .ph-p-fx { order: 4; } .ph-p-face { order: 5; } .ph-p-adj { order: 6; } .ph-p-save { order: 7; }
  .ph-stagewrap { padding: 6px; min-height: 160px; }
  .ph-strip { padding-bottom: 2px; }
  .ph-thumb { width: 64px; }
  .ph-thumb-btn img { height: 44px; }
}

/* several chosen boxes, the selection rectangle, cropping */
.ph-marq { position: absolute; border: 1px dashed #19e0c9; background: rgb(25 224 201 / 15%); pointer-events: none; }
.ph-overlay.is-cropping { overflow: hidden; touch-action: none; }
.ph-crop {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 60%), 0 0 0 9999px rgb(0 0 0 / 50%);
  cursor: move;
  touch-action: none;
  background:
    linear-gradient(to right, transparent calc(33.33% - .5px), rgb(255 255 255 / 55%) calc(33.33% - .5px), rgb(255 255 255 / 55%) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.67% - .5px), rgb(255 255 255 / 55%) calc(66.67% - .5px), rgb(255 255 255 / 55%) calc(66.67% + .5px), transparent calc(66.67% + .5px)),
    linear-gradient(to bottom, transparent calc(33.33% - .5px), rgb(255 255 255 / 55%) calc(33.33% - .5px), rgb(255 255 255 / 55%) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.67% - .5px), rgb(255 255 255 / 55%) calc(66.67% - .5px), rgb(255 255 255 / 55%) calc(66.67% + .5px), transparent calc(66.67% + .5px));
}
.ph-crop-wrap { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--hint-fill); }
.ph-crop-wrap .hint { margin: 8px 0 4px; }
#ph-ratio button { padding: 6px 2px; font-size: 12px; }
.ph-level-hint { margin: 6px 0 4px; }
#ph-level button { font-size: 12.5px; }

/* 5. 한글 문서 용량 줄이기 (shrink.js) */
.sh-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.sh-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#tool-shrink .panel h2 { font-size: 15px; margin-bottom: 8px; }
.sh-note { margin: 10px 0 6px; padding: 8px 10px; border-radius: 8px; background: var(--hint-fill); color: var(--text); font-size: 13px; }
.sh-level-hint { margin: 8px 0 4px; }
.sh-check { align-items: flex-start; margin-top: 8px; font-size: 13px; font-weight: 500; }
.sh-main { min-width: 0; }
.sh-empty { display: grid; place-items: center; align-content: center; min-height: 260px; padding: 24px; border: 2px dashed var(--line); border-radius: 12px; background: var(--surface); text-align: center; }
#tool-shrink.is-dropping .sh-empty, #tool-shrink.is-dropping .sh-list { outline: 3px dashed var(--brand); outline-offset: 4px; }
.sh-list { display: flex; flex-direction: column; gap: 10px; }
.sh-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sh-card.is-done { border-color: var(--brand); }
.sh-card.is-error { border-color: var(--danger); }
.sh-top { display: flex; align-items: center; gap: 10px; }
.sh-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.sh-kind { display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; font-weight: 700; }
.sh-size { flex: none; font-size: 14px; color: var(--muted); text-align: right; }
.sh-size b { color: var(--text); }
.sh-pct { display: block; font-size: 12px; color: var(--brand-deep); font-weight: 700; }
.sh-x { flex: none; width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--danger); cursor: pointer; }
.sh-msg { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.sh-card.is-error .sh-msg { color: var(--danger); }
.sh-card details { margin-top: 8px; font-size: 13px; }
.sh-card summary { cursor: pointer; color: var(--brand-deep); }
.sh-table { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 12.5px; }
.sh-table th, .sh-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.sh-table th { color: var(--muted); font-weight: 500; }
@media (max-width: 900px) {
  .sh-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
