/* "Adjust photo" window (JS/PhotoFrame.js): a picture behind a fixed 4:5 frame. Colors come from the page's look
   (Calculator.css tokens), with fallbacks. */
html.pf-open { overflow: hidden; }
.pf-overlay { align-items: center; background: rgba(8, 16, 30, .55); display: flex; inset: 0; justify-content: center; padding: 16px; position: fixed; z-index: 1000; }
.pf-overlay[hidden] { display: none; }
.pf-dialog { background: var(--card, #fff); border: 1px solid var(--line, #dce3ee); border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); color: var(--ink, #13233a); max-height: calc(100vh - 32px); max-width: 100%; overflow: auto; padding: 18px 20px; }
.pf-dialog:focus { outline: none; }
.pf-title { font-size: 1.15rem; margin: 0 0 4px; }
.pf-hint { color: var(--muted, #5b6b82); font-size: .88rem; margin: 0 0 12px; max-width: 470px; }
.pf-body { align-items: flex-start; display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }

.pf-stage { background: #1d2633; border-radius: 10px; cursor: grab; overflow: hidden; position: relative; touch-action: none; user-select: none; }
.pf-stage:active { cursor: grabbing; }
.pf-stage:focus-visible { outline: 3px solid var(--brand, #0a5bd6); outline-offset: 2px; }
.pf-img { left: 0; max-width: none; pointer-events: none; position: absolute; top: 0; transform-origin: 0 0; }
/* The porthole: everything outside the frame is dimmed. */
.pf-frame { border: 2px solid #fff; border-radius: 6px; box-shadow: 0 0 0 9999px rgba(10, 18, 30, .62); box-sizing: border-box; pointer-events: none; position: absolute; }
/* A faint guide for where a face sits in a head-and-shoulders photo */
.pf-frame::after { border: 1.5px dashed rgba(255, 255, 255, .45); border-radius: 50%; content: ""; height: 50%; left: 22%; position: absolute; top: 11%; width: 56%; }

.pf-previews { display: flex; flex-direction: column; gap: 12px; }
.pf-previews figure { align-items: center; display: flex; flex-direction: column; gap: 4px; margin: 0; }
.pf-previews figcaption { color: var(--muted, #5b6b82); font-size: .78rem; }
.pf-previews img { background: #fff; border: 1px solid var(--line, #dce3ee); object-fit: cover; }
.pf-previews img:not([src]) { visibility: hidden; }
.pf-pv-rect { border-radius: 6px; height: 80px; width: 64px; }
.pf-pv-round { border-radius: 50%; height: 64px; width: 64px; }
@media (max-width: 520px) { .pf-previews { flex-direction: row; } }

.pf-zoom { align-items: center; display: flex; gap: 10px; margin: 14px auto 0; max-width: 340px; }
.pf-zoom input { accent-color: var(--brand, #0a5bd6); flex: 1; min-width: 0; }
.pf-zbtn { background: var(--brand-soft, #e8f0fd); border: 0; border-radius: 50%; color: var(--brand-dark, #07439f); cursor: pointer; flex: none; font: inherit; font-size: 1.2rem; font-weight: 700; height: 32px; line-height: 1; width: 32px; }

.pf-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.pf-btn { background: var(--field, #fff); border: 1px solid var(--btn-line, var(--line, #c3c9d2)); border-radius: 8px; color: var(--ink, #13233a); cursor: pointer; font: inherit; font-size: .95rem; min-height: 38px; padding: 6px 16px; }
.pf-btn:hover { border-color: var(--brand, #0a5bd6); }
.pf-btn.pf-primary { background: var(--brand, #0a5bd6); border-color: var(--brand, #0a5bd6); color: #fff; font-weight: 600; }
.pf-btn:disabled { cursor: default; opacity: .5; }
@media (max-width: 520px) { .pf-dialog { padding: 14px; } .pf-actions .pf-btn { flex: 1; } }
