/* Photo and signature resizer. Phone first; the stage shows exactly the crop. */
.pr-head .kicker a { color: inherit; }
:lang(hi) { --display: "Bricolage Grotesque", "Noto Sans Devanagari", "Kohinoor Devanagari", ui-sans-serif, system-ui, sans-serif; }
:lang(hi) h1, :lang(hi) h2 { letter-spacing: 0; line-height: 1.25; }

.pr-priv { display: flex; gap: 8px; align-items: center; margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--leaf-soft); color: var(--leaf-ink); font-size: 14px; font-weight: 600; }
.pr-priv svg { flex-shrink: 0; }

/* Landing: the form list */
.pr-group { margin-top: 26px; }
.pr-group h2 { font-size: 1.15rem; margin: 0 0 8px; }
.pr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.pr-preset { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: inherit; text-decoration: none; min-height: 44px; }
a.pr-preset:hover { border-color: var(--ink); }
.pr-preset small { color: var(--muted); font-size: 13px; }
.pr-none { background: var(--surface-2); border-style: dashed; }

/* Rules from the notice */
.pr-rules-wrap h2 { font-size: 1.15rem; margin: 0 0 8px; }
.pr-rules { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; font-size: 14px; }
.pr-rules th, .pr-rules td { text-align: left; padding: 9px 12px; vertical-align: top; }
.pr-rules thead th { font-size: 13px; color: var(--muted); background: var(--surface-2); }
.pr-rules tbody tr:not(.pr-note) { border-top: 1px solid var(--border); }
.pr-note td { padding-top: 0; color: var(--muted); font-size: 13px; }
.pr-src { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.pr-live-note { margin-top: 16px; }
.pr-live, .pr-decl, .pr-custom, #pr-sheet-opts { margin-top: 12px; }
.pr-live h2 { font-size: 1rem; margin: 0 0 6px; }
.pr-live ul, .pr-tips { margin: 0; padding-left: 20px; line-height: 1.6; }
.pr-tips { margin-top: 12px; color: var(--muted); font-size: 14px; }

/* The tool */
.pr-app { margin-top: 20px; display: grid; gap: 12px; }
.pr-items[hidden], .pr-decl[hidden], .pr-err[hidden], .pr-edit[hidden] { display: none; }
.pr-decl blockquote { margin: 8px 0 12px; padding: 12px 14px; background: #fff; color: #1c1917; border: 1px dashed var(--field); border-radius: 8px; font-family: Georgia, serif; line-height: 1.55; }
.pr-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pr-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr-pick .btn { position: relative; overflow: hidden; }
.pr-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pr-pick .btn:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.pr-app > .pr-priv { margin: 0; }
.pr-err { background: var(--chili-soft); }

.pr-edit { display: grid; gap: 12px; }
.pr-stage-wrap { background: #2A2A33; border-radius: var(--radius); padding: 10px; }
.pr-stage { position: relative; margin: 0 auto; width: 100%; display: flex; justify-content: center; touch-action: none; cursor: grab; user-select: none; }
.pr-stage:active { cursor: grabbing; }
.pr-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.pr-stage canvas { display: block; box-shadow: 0 0 0 1px rgb(255 255 255 / .6); }
/* Face guide: head from about 10% to 82% of the height. */
.pr-oval { position: absolute; top: 10%; bottom: 18%; left: 50%; aspect-ratio: 3 / 4; transform: translateX(-50%); border: 2px dashed var(--accent); border-radius: 50%; pointer-events: none; }
.pr-oval[hidden], .pr-face-hint[hidden] { display: none; }
.pr-hint { text-align: center; }
.pr-ctrls { display: grid; gap: 12px; }
.pr-ctrls input[type=range] { width: 100%; accent-color: var(--ink); min-height: 32px; }
.pr-rot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr-photo-adj { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr-ink-adj { display: none; gap: 8px; }
.is-ink .pr-ink-adj { display: grid; }
.is-ink .pr-photo-adj { display: none; }

.pr-out { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: start; padding: 16px; }
.pr-out img { max-width: 120px; max-height: 160px; border: 1px solid var(--border); background: #fff; }
.pr-out img:not([src]) { display: none; }
.pr-checks { margin: 0; display: grid; }
.pr-checks div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.pr-checks dt { color: var(--muted); }
.pr-checks dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.pr-checks .ok { color: var(--ok); }
.pr-checks .bad { color: var(--bad); }
.pr-fn, .pr-out > .hint, .pr-actions { grid-column: 1 / -1; margin: 0; }
.pr-fn { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.pr-actions { display: grid; gap: 8px; }
.pr-actions .btn[hidden] { display: none; }
.pr-actions .is-off { opacity: .5; pointer-events: none; }
.pr-switch { display: grid; gap: 6px; font-weight: 700; font-size: 15px; }
.pr-switch select { min-height: 46px; font: inherit; padding: 0 10px; border: 1px solid var(--field); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.pr-sheet-img { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--border); background: #fff; }
.pr-sheet-img:not([src]) { display: none; }
.pr-others { line-height: 1.9; }

@media (min-width: 760px) {
  .pr-edit { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
  .pr-stage-wrap, .pr-hint, .pr-ctrls { grid-column: 1; }
  .pr-out, .pr-switch { grid-column: 2; grid-row: 1 / span 2; }
  .pr-switch { grid-row: 3; }
}

/* Print only the sheet, at true size. */
@media print {
  @page { margin: 0; }
  body * { visibility: hidden; }
  .pr-sheet-img { display: block; visibility: visible; position: absolute; left: 0; top: 0; height: auto; }
}
