/* ============================================================================
   ro-cropper.css — 재사용 이미지 크롭/편집 위젯. 항상 어두운 스테이지(사진 집중).
   자체 테마(--rc-*) — 회원 페이지(--ro-* / data-theme)든 관리자 페이지
      (--admin-* / data-admin-theme)든 어디에 떠도 일관되게 보이게 한다.
      예전엔 --ro-* 를 직접 써서, 관리자 다크(data-admin-theme)에선 토큰이 안 바뀌어
      패널이 흰색·글자 안보임으로 깨졌다. 이제 두 다크 신호를 모두 받는다.
   ========================================================================== */
dialog.ro-crop {
    /* 라이트 기본값 */
    --rc-surface: #ffffff; --rc-border: #e5e9f0; --rc-text: #0f172a; --rc-sub: #64748b;
    --rc-muted: #94a3b8; --rc-surface2: rgba(127,127,127,.12);
    --rc-primary: #4e8fff; --rc-primary-600: #3f7ae0; --rc-primary-300: #9cc0ff;

    box-sizing: border-box; position: fixed; inset: 0; margin: auto;
    width: min(560px, calc(100vw - 24px)); height: fit-content;
    max-width: calc(100vw - 24px); max-height: calc(100vh - 24px);
    padding: 0; border: 0; background: transparent; color: var(--rc-text); overflow: visible;
}
/* 다크 — 회원(data-theme) · 관리자(data-admin-theme) 둘 다 */
html[data-theme="dark"] dialog.ro-crop,
html[data-admin-theme="dark"] dialog.ro-crop {
    --rc-surface: #171d25; --rc-border: #2a323d; --rc-text: #e5eaf0; --rc-sub: #93a1b0;
    --rc-muted: #7c8896; --rc-surface2: rgba(255,255,255,.08);
}
dialog.ro-crop::backdrop { background: rgba(6,9,14,.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
body.ro-crop-open { overflow: hidden; }
.ro-crop__panel { position: relative; width: 100%; max-height: calc(100vh - 24px); display: flex; flex-direction: column;
    background: var(--rc-surface); border: 1px solid var(--rc-border); border-radius: 18px; overflow: hidden;
    box-shadow: 0 24px 70px rgba(6,9,14,.5); animation: rocrop-pop .22s cubic-bezier(.22,1,.36,1) both; }
@keyframes rocrop-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.ro-crop__bar { display: flex; align-items: center; justify-content: space-between; padding: 13px 12px 13px 18px; border-bottom: 1px solid var(--rc-border); }
.ro-crop__bar b { font-size: 15px; font-weight: 800; color: var(--rc-text); }
.ro-crop__x { width: 34px; height: 34px; border: 0; background: transparent; color: var(--rc-sub); cursor: pointer; border-radius: 9px; display: grid; place-items: center; }
.ro-crop__x:hover { background: var(--rc-surface2); }
.ro-crop__x svg { width: 18px; height: 18px; }

.ro-crop__stage { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 54vh; background: #0b0e14; touch-action: none; overflow: hidden; }
.ro-crop__canvas { display: block; width: 100%; height: 100%; }
/* 크롭 프레임 테두리(격자) — 캔버스가 딤 처리, 여기선 라인만 */
.ro-crop__frame { position: absolute; pointer-events: none; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.ro-crop__frame::before, .ro-crop__frame::after { content: ''; position: absolute; background: rgba(255,255,255,.35); }
.ro-crop__frame::before { left: 33.33%; right: 33.33%; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,.35); border-right: 1px solid rgba(255,255,255,.35); background: transparent; }
.ro-crop__frame::after { top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-top: 1px solid rgba(255,255,255,.35); border-bottom: 1px solid rgba(255,255,255,.35); background: transparent; }

.ro-crop__tools { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.ro-crop__tbtn { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rc-border); background: var(--rc-surface); color: var(--rc-sub); cursor: pointer; display: grid; place-items: center; }
.ro-crop__tbtn:hover { border-color: var(--rc-primary-300); color: var(--rc-primary); }
.ro-crop__tbtn svg { width: 18px; height: 18px; }
.ro-crop__zoom { flex: 1; accent-color: var(--rc-primary); }

.ro-crop__actions { display: flex; gap: 8px; padding: 0 18px 18px; }
.ro-crop__cancel, .ro-crop__ok { flex: 1; padding: 13px; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; border: 0; }
.ro-crop__cancel { background: var(--rc-surface); border: 1px solid var(--rc-border); color: var(--rc-sub); }
.ro-crop__ok { background: var(--rc-primary); color: #fff; }
.ro-crop__ok:hover { filter: brightness(1.06); }

/* ── 오버레이 컨트롤(해시태그·색·로고) — opts.overlay 일 때만 노출 ── */
.ro-crop__ov { padding: 0 18px 4px; display: flex; flex-direction: column; gap: 10px; }
.ro-crop__ov[hidden] { display: none; }
.ro-crop__ov-text { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--rc-border); background: var(--rc-surface); color: var(--rc-text); font-size: 14px; font-weight: 700; }
.ro-crop__ov-colors { display: flex; gap: 7px; flex-wrap: wrap; }
.ro-crop__ov-color { width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
    border: 2px solid var(--rc-border); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.ro-crop__ov-color.is-on { border-color: var(--rc-primary); transform: scale(1.12); }
.ro-crop__ov-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ro-crop__ov-chk { font-size: 13px; font-weight: 700; color: var(--rc-sub); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ro-crop__ov-chk input { width: 16px; height: 16px; accent-color: var(--rc-primary); }
.ro-crop__ov-logo { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--rc-border);
    background: var(--rc-surface); color: var(--rc-text); font-size: 13px; font-weight: 700; }

/* 권장·출력 크기 안내 */
.ro-crop__size { margin-left: auto; margin-right: 10px; font-size: 11.5px; font-weight: 700; color: var(--rc-muted); font-variant-numeric: tabular-nums; }
