/* Shared photo crop controller — admin designer + public maker. */
body.pcx-open { overflow: hidden; }

.pcx { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.pcx[hidden] { display: none; }
.pcx-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .74); }
.pcx-box {
    position: relative; z-index: 1; background: #fff; border-radius: 14px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .45);
    max-width: 96vw; max-height: 94vh; overflow: auto; display: flex; flex-direction: column;
}
.pcx-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid #e5e7eb; }
.pcx-title { font-size: 15px; font-weight: 700; color: #0f172a; }
.pcx-x {
    margin-left: auto; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px;
    width: 30px; height: 30px; font-size: 18px; line-height: 1; color: #475569; cursor: pointer;
}
.pcx-x:hover { background: #e2e8f0; }

.pcx-stage {
    position: relative; overflow: hidden; margin: 0 auto;
    background: #eef2f7 repeating-conic-gradient(#e4e9f1 0% 25%, #f2f5fa 0% 50%) 0 / 18px 18px;
}
.pcx-pan { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.pcx-pan.is-dragging { cursor: grabbing; }
.pcx-pan img { position: absolute; max-width: none; display: block; user-select: none; -webkit-user-drag: none; }
.pcx-frame {
    position: absolute; pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55), 0 0 0 1px rgba(255, 255, 255, .9) inset;
    outline: 2px solid #fff; outline-offset: -1px;
}
/* Polygon frames can't cast the dimming ring, so mark the area with an outline only. */
.pcx-frame--clip { box-shadow: none; outline: none; background: rgba(255, 255, 255, .14); }
.pcx-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #64748b; background: #f8fafc; }
.pcx-loading[hidden] { display: none; }

.pcx-ctl { display: flex; align-items: center; gap: 12px; padding: 14px 18px 4px; }
.pcx-ctl-lbl { font-size: 12px; font-weight: 700; color: #64748b; width: 40px; flex: none; }
.pcx-zoom { flex: 1; min-width: 0; accent-color: #2563eb; }
.pcx-reset {
    background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 7px; padding: 6px 12px;
    font-size: 12px; font-weight: 600; color: #334155; cursor: pointer; flex: none;
}
.pcx-reset:hover { background: #e2e8f0; }
.pcx-hint { margin: 6px 18px 0; font-size: 12px; color: #94a3b8; text-align: center; }

.pcx-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px 18px; }
.pcx-btn { border-radius: 8px; padding: 9px 18px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.pcx-btn-ghost { background: #f1f5f9; border-color: #e2e8f0; color: #334155; }
.pcx-btn-ghost:hover { background: #e2e8f0; }
.pcx-btn-go { background: #2563eb; border-color: #2563eb; color: #fff; }
.pcx-btn-go:hover { background: #1d4ed8; }

/* Trigger button shared by both editors */
.pcx-open-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3;
    border-radius: 7px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.pcx-open-btn:hover { background: #e0e7ff; }
.pcx-open-btn[disabled] { opacity: .5; cursor: not-allowed; }
.mk-crop-btn { margin-top: 8px; width: 100%; justify-content: center; padding: 9px 12px; }

@media (max-width: 560px) {
    .pcx { padding: 8px; }
    .pcx-hint { font-size: 11px; }
}
