/* Noble Pixel photo & form tools (.ph-*). Mobile first; uses the theme's colour variables with fallbacks. */
.ph { --ph-line: var(--line, #e2e8f0); --ph-surface: var(--surface, #f5f8fc); --ph-ink: var(--ink, #17222f); --ph-muted: var(--muted, #66768a); --ph-blue: var(--blue, #1f7cec); }
.ph [hidden] { display: none !important; }
.ph input[type="number"], .ph input[type="date"] {
	width: 100%; font: inherit; color: var(--ph-ink); background: #fff; border: 1.5px solid var(--ph-line); border-radius: 12px; padding: 11px 12px; min-height: 46px; transition: border-color .15s, box-shadow .15s; }
.ph input[type="number"]:focus, .ph input[type="date"]:focus { outline: none; border-color: var(--ph-blue); box-shadow: 0 0 0 4px rgba(31,124,236,.14); }
.ph input[type="range"] { accent-color: var(--ph-blue); width: 100%; min-width: 0; }
.ph input[type="checkbox"] { accent-color: var(--ph-blue); width: 18px; height: 18px; flex: 0 0 auto; }
.ph small { color: var(--ph-muted); font-weight: 500; }
.ph .btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ph-go .btn { min-height: 48px; }
.ph-sm { padding: 8px 14px !important; font-size: .9rem !important; min-height: 40px; }

.ph-drop { padding: 28px 18px; }
.ph-msg { margin-top: 12px; }
.ph-note { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: #fff8e6; border: 1px solid #ffe3a3; color: #5c4400; font-size: .92rem; line-height: 1.5; }
.ph-privacy { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px 0 0; color: var(--ph-muted); font-size: .86rem; text-align: center; }
.ph-privacy svg { color: #12a150; flex: 0 0 auto; }
.ph-work { margin-top: 18px; }
.ph-foot { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--ph-line); display: flex; justify-content: flex-end; }

/* options */
.ph-opts { display: grid; grid-template-columns: 1fr; gap: 4px 22px; margin-top: 16px; }
.ph-pair { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.ph-pair > label, .ph-pair > select, .ph-pair > input { flex: 1 1 130px; min-width: 0; }
.ph-pair > label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--ph-ink); }
.ph-check { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: .95rem; cursor: pointer; line-height: 1.35; }
.ph-range { display: grid; grid-template-columns: 92px 1fr 52px; align-items: center; gap: 10px; margin: 10px 0 0; font-weight: 600; font-size: .92rem; color: var(--ph-ink); }
.ph-range output { text-align: right; font-variant-numeric: tabular-nums; color: var(--ph-muted); font-weight: 600; }
.ph-range--wide { margin-top: 14px; }
.ph-range:not(:has(output)) { grid-template-columns: 92px 1fr; }
.ph-scale { display: flex; justify-content: space-between; margin: 2px 0 0 102px; font-size: .8rem; }
.ph-more { margin-top: 16px; border: 1px solid var(--ph-line); border-radius: 12px; padding: 0 14px; background: #fff; }
.ph-more summary { cursor: pointer; font-weight: 700; color: var(--ph-ink); padding: 12px 0; list-style-position: inside; }
.ph-more[open] { padding-bottom: 14px; }
.ph-box { border: 1px solid var(--ph-line); border-radius: 14px; padding: 12px 14px 14px; margin: 20px 0 0; background: var(--ph-surface); min-width: 0; }
.ph-box legend { font-weight: 800; color: var(--ph-ink); padding: 0 6px; }
.ph-box .btn { margin-top: 10px; }
.ph-link { background: none; border: 0; padding: 6px 0; margin-top: 4px; color: var(--ph-blue); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: underline; }

/* cropper */
.ph-cropper { min-width: 0; }
.ph-crop { display: flex; justify-content: center; background: repeating-conic-gradient(#eef2f7 0% 25%, #fff 0% 50%) 50% / 18px 18px; border-radius: 14px; padding: 12px; }
.ph-crop canvas { display: block; max-width: 100%; touch-action: none; cursor: grab; border-radius: 4px; box-shadow: 0 0 0 1px rgba(17,28,41,.15), 0 8px 22px -10px rgba(17,28,41,.35); background: #fff; }
.ph-crop canvas:active { cursor: grabbing; }
.ph-crop canvas:focus-visible { outline: 3px solid var(--ph-blue); outline-offset: 3px; }
.ph-center { text-align: center; margin: 8px 0 0; font-size: .85rem; }
.ph-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ph-btns .btn { flex: 1 1 auto; justify-content: center; }

/* result card */
.ph-card { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 14px; border: 1px solid var(--ph-line); border-radius: 16px; background: #fff; box-shadow: 0 6px 20px -14px rgba(17,28,41,.35); }
.ph-card__img { display: grid; place-items: center; background: repeating-conic-gradient(#eef2f7 0% 25%, #fff 0% 50%) 50% / 16px 16px; border-radius: 12px; padding: 12px; min-height: 120px; }
.ph-card__img img { max-width: 100%; max-height: 300px; width: auto; height: auto; box-shadow: 0 0 0 1px rgba(17,28,41,.15); background: #fff; }
.ph-card__img--wide img { max-height: 180px; }
.ph-card__body { min-width: 0; }
.ph-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-badges .tb { font-size: .8rem; padding: 4px 10px; }
.ph-dl { margin: 12px 0 0; display: grid; gap: 6px; font-size: .92rem; }
.ph-dl div { display: flex; flex-wrap: wrap; gap: 4px 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--ph-line); }
.ph-dl dt { font-weight: 700; color: var(--ph-muted); min-width: 64px; }
.ph-dl dd { margin: 0; color: var(--ph-ink); word-break: break-word; }
.ph-cnote { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--ph-surface); font-size: .9rem; line-height: 1.5; color: var(--text, #3d4b5c); }
.ph-card .btn-row .btn { flex: 1 1 auto; justify-content: center; }
.ph-ok { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #e3f7ec; color: #0c5a2e; }
.ph-ok p { margin: 0 0 10px; }

/* file lists */
.ph-row { display: grid; grid-template-columns: 48px 1fr; gap: 10px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--ph-line); font-size: .92rem; }
.ph-row > .btn { grid-column: 1 / -1; justify-content: center; }
.ph-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; background: var(--ph-surface); display: block; }
.ph-row__name { min-width: 0; font-weight: 600; word-break: break-all; color: var(--ph-ink); }
.ph-row__name small { display: block; margin-top: 2px; word-break: normal; }
.ph-row__name .tb { margin: 4px 4px 0 0; white-space: normal; }
.ph-spin { display: inline-block; width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; }

/* age calculator */
.ph-age { padding: 18px; border-radius: 16px; background: var(--navy-900, #111c29); color: #fff; margin-bottom: 4px; }
.ph-age small { display: block; color: #9fb3cb; font-weight: 600; margin-bottom: 4px; }
.ph-age b { font-size: clamp(1.35rem, 5vw, 2rem); line-height: 1.25; }
.ph-elig { margin-top: 12px; padding: 16px; border-radius: 14px; line-height: 1.5; }
.ph-elig b { font-size: 1.1rem; }
.ph-elig span { display: block; margin-top: 6px; }
.ph-elig small { display: block; margin-top: 10px; color: inherit; opacity: .85; }
.ph-elig--ok { background: #e3f7ec; color: #0c5a2e; }
.ph-elig--bad { background: #ffe8e3; color: #8a2412; }

@media (min-width: 640px) {
	.ph-opts { grid-template-columns: 1fr 1fr; }
	.ph-card { grid-template-columns: minmax(180px, 280px) 1fr; align-items: start; }
	.ph-card .btn-row .btn { flex: 0 0 auto; }
	.ph-row { grid-template-columns: 56px 1fr auto; }
	.ph-row > .btn { grid-column: auto; }
	.ph-thumb { width: 56px; height: 56px; }
}
@media (max-width: 380px) {
	.ph-range { grid-template-columns: 78px 1fr 46px; gap: 8px; }
	.ph-range:not(:has(output)) { grid-template-columns: 78px 1fr; }
	.ph-scale { margin-left: 86px; }
}

/* ---------- photo studio (passport photo, photo with name and date) ---------- */
.ph-steps { list-style: none; counter-reset: phs; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 18px; padding: 0; }
.ph-steps li { counter-increment: phs; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--muted, #66768a); text-align: center; line-height: 1.2; position: relative; }
.ph-steps li::before { content: counter(phs); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #eef2f7; color: var(--muted, #66768a); font-size: .9rem; position: relative; z-index: 1; transition: background .2s, color .2s; }
.ph-steps li + li::after { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: #e6ebf2; }
.ph-steps li.is-on { color: var(--ink, #17222f); }
.ph-steps li.is-on::before { background: var(--blue, #1f7cec); color: #fff; box-shadow: 0 6px 14px -6px rgba(31,124,236,.7); }
.ph-steps li.is-on + li.is-on::after { background: var(--blue, #1f7cec); }
.ph-step { padding: 16px; border: 1px solid var(--line, #e2e8f0); border-radius: 18px; background: #fff; margin-top: 14px; }
.ph-step:first-child { margin-top: 0; }
.ph-step--upload { border: 0; padding: 0; }
.ph-h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 1.05rem; color: var(--ink, #17222f); }
.ph-h small { font-weight: 500; }
.ph-num { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--blue-50, #ebf3fe); color: var(--blue, #1f7cec); font-size: .9rem; font-weight: 800; }
.ph-studio { display: grid; grid-template-columns: 1fr; gap: 16px; }
.ph-studio__view { min-width: 0; padding: 14px; border-radius: 18px; background: var(--surface, #f5f8fc); }
.ph-studio__side { min-width: 0; }
.ph-studio__view .ph-crop { background-color: #fff; }
.ph-face { min-height: 1.4em; margin: 10px 0 0; font-size: .88rem; font-weight: 600; text-align: center; color: var(--muted, #66768a); }
.ph-face:empty { display: none; }
.ph-face--ok { color: #0c7a3d; } .ph-face--warn { color: #8a5a00; } .ph-face--busy { color: var(--blue, #1f7cec); }
.ph-bgbtn { width: 100%; justify-content: center; min-height: 52px; font-size: 1.02rem; margin-top: 4px; }
.ph-mode { margin-top: 12px; flex-wrap: wrap; }
.ph-mode label { min-height: 40px; }
.ph-bgstat { margin: 10px 0 0; font-size: .9rem; color: var(--text, #3d4b5c); line-height: 1.45; }
.ph-bgstat:empty { display: none; }
.ph-bgpanel { margin-top: 12px; }
.ph-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph-sw { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 1.5px solid var(--line, #e2e8f0); border-radius: 14px; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink, #17222f); background: #fff; transition: border-color .15s, box-shadow .15s; min-height: 76px; justify-content: center; }
.ph-sw > input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.ph-sw:has(> input:checked) { border-color: var(--blue, #1f7cec); box-shadow: 0 0 0 3px rgba(31,124,236,.15); }
.ph-sw:has(> input:focus-visible) { outline: 2px solid var(--blue, #1f7cec); outline-offset: 2px; }
.ph-sw__dot { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(17,28,41,.18); display: block; position: relative; overflow: hidden; }
.ph-sw__dot--orig { background: linear-gradient(135deg, #8aa4bf 0 50%, #d8c3a5 50% 100%); }
.ph-sw__dot--pick { background: conic-gradient(#f35538, #f7b733, #18c3b1, #1f7cec, #a855f7, #f35538); }
.ph-sw__dot--pick input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.ph-cmp { margin-top: 12px; width: 100%; justify-content: center; }
.ph-cmp[aria-pressed="true"] { background: var(--navy, #243547) !important; color: #fff !important; border-color: var(--navy, #243547) !important; }
.ph-small { font-size: .8rem; margin-top: 12px; }
.ph-note--soft { background: var(--surface, #f5f8fc); border-color: var(--line, #e2e8f0); color: var(--text, #3d4b5c); }
.ph-live { margin-top: 14px; }
.ph-live .ph-card { box-shadow: 0 14px 34px -18px rgba(17,28,41,.45); }
@media (min-width: 960px) {
	.ph-studio { grid-template-columns: minmax(300px, 380px) 1fr; align-items: start; gap: 22px; }
	.ph-studio__view { position: sticky; top: 90px; }
	.ph-swatches { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 640px) and (max-width: 959px) { .ph-swatches { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 380px) { .ph-steps li { font-size: .7rem; } .ph-step { padding: 14px 12px; } }
