/* News Photocard Pro — photocard page (white / red editor). */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.npcp-page {
	--red: #d00000;
	--text: #1c1c1e;
	--muted: #6b6b70;
	--line: #d0d0d4;
	--track: #e4e4e7;
	min-height: 100vh;
	background: #ffffff;
	color: var(--text);
	font: 17px/1.5 "NPCP-UI", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
	-webkit-text-size-adjust: 100%;
}

.npcp-app { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.npcp-i { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: middle; }

/* Header. */
.npcp-top { display: flex; align-items: center; gap: 12px; padding: 14px 0 12px; }
.npcp-top-back {
	flex: none; width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
	color: var(--text); text-decoration: none; border: 1.5px solid var(--line); background: #fff;
}
.npcp-top-back .npcp-i { width: 22px; height: 22px; }
.npcp-top-back:hover, .npcp-top-back:focus-visible { border-color: var(--red); color: var(--red); outline: none; }
.npcp-top-title { min-width: 0; display: flex; flex-direction: column; }
.npcp-top-title strong { color: var(--red); font-size: 19px; font-weight: 600; line-height: 1.2; }
.npcp-top-title span { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.npcp-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }

/* Preview. */
.npcp-preview { position: sticky; top: 12px; }
.npcp-frame {
	position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden;
	background: #eceef1; box-shadow: 0 8px 30px rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .05);
}
.npcp-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.npcp-frame img:not([src]) { visibility: hidden; }
.npcp-spinner {
	position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, .6); border-top-color: var(--red); opacity: 0; transition: opacity .15s;
	animation: npcp-spin .8s linear infinite;
}
.npcp-spinner.is-on { opacity: 1; }
@keyframes npcp-spin { to { transform: rotate(360deg); } }
.npcp-status { min-height: 1.4em; margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 14px; }

/* Controls. */
.npcp-panel { background: #fff; padding: 4px 0 0; }

.npcp-h { display: flex; align-items: center; gap: 14px; margin: 4px 0 6px; color: var(--text); font-size: 22px; font-weight: 600; }
.npcp-h .npcp-i { color: var(--red); width: 30px; height: 30px; }
.npcp-l, .npcp-slider label { display: block; margin: 22px 0 10px; color: var(--text); font-size: 20px; font-weight: 600; line-height: 1.35; }
.npcp-l small { color: var(--muted); font-size: 14.5px; font-weight: 500; }
.npcp-rule { border: 0; border-top: 1px solid #ececef; margin: 26px 0 22px; }
.npcp-note { color: var(--muted); font-size: 15px; }

/* Range sliders: red fill, light track, white pill thumb. */
.npcp-slider input[type=range] {
	-webkit-appearance: none; appearance: none; display: block; width: 100%; height: 30px; margin: 0; background: transparent; cursor: pointer;
	accent-color: var(--red);
}
.npcp-slider input[type=range]::-webkit-slider-runnable-track {
	height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--red) var(--p, 50%), var(--track) var(--p, 50%));
}
.npcp-slider input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none; width: 36px; height: 24px; margin-top: -9px; border-radius: 12px; background: #fff;
	border: 1px solid #e3e3e6; box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.npcp-slider input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--track); }
.npcp-slider input[type=range]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--red); }
.npcp-slider input[type=range]::-moz-range-thumb { width: 36px; height: 24px; border-radius: 12px; background: #fff; border: 1px solid #e3e3e6; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.npcp-slider input[type=range]:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 8px; }
.npcp-slider-sub label { margin-top: 18px; color: #4a4a4f; font-size: 17px; font-weight: 500; }

/* Text fields. */
.npcp-panel textarea, .npcp-panel input[type=text] {
	width: 100%; margin: 0; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff;
	color: var(--text); font: 600 19px/1.5 "NPCP-UI", "Hind Siliguri", system-ui, sans-serif; outline: none; resize: vertical;
}
.npcp-panel textarea { min-height: 128px; }
.npcp-panel textarea:focus, .npcp-panel input[type=text]:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(208, 0, 0, .12); }

.npcp-date-row { position: relative; display: flex; gap: 12px; }
.npcp-date-row input[type=text] { flex: 1; min-width: 0; }
.npcp-cal {
	flex: none; width: 58px; border-radius: 14px; border: 2px solid var(--red); background: #fff; color: var(--red); cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.npcp-cal .npcp-i { width: 30px; height: 30px; }
.npcp-cal:hover, .npcp-cal:focus-visible { background: rgba(208, 0, 0, .06); outline: none; }
.npcp-date-pick { position: absolute; right: 0; bottom: 0; width: 58px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* Buttons. */
.npcp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 10px 14px; margin: 0;
	border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--text); cursor: pointer; text-decoration: none;
	font: 600 18px/1.2 "NPCP-UI", "Hind Siliguri", system-ui, sans-serif; -webkit-tap-highlight-color: transparent;
	transition: background .12s, opacity .12s, transform .08s;
}
.npcp-btn:active { transform: translateY(1px); }
.npcp-btn:focus-visible { outline: 3px solid rgba(208, 0, 0, .35); outline-offset: 2px; }
.npcp-outline { border-color: var(--red); color: var(--red); }
.npcp-outline:hover { background: rgba(208, 0, 0, .05); }
.npcp-btn[disabled] { opacity: .4; cursor: default; }
.npcp-photo-row { display: grid; grid-template-columns: 1.65fr 1fr; gap: 14px; }

/* Bottom bar: stays at the bottom of the screen. */
.npcp-actions {
	position: sticky; bottom: 0; z-index: 10; display: grid; grid-template-columns: 0.9fr 1fr; gap: 14px;
	margin: 26px 0 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: #fff;
	box-shadow: 0 -14px 14px -14px rgba(0, 0, 0, .28);
}
.npcp-actions .npcp-btn { min-height: 58px; font-size: 19px; border-radius: 16px; }
.npcp-back { border-color: var(--line); }
.npcp-dl { border: 0; background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(208, 0, 0, .25); }
.npcp-dl:hover { filter: brightness(1.06); }
.npcp-dl[disabled] { opacity: .65; cursor: progress; }

/* Small message above the bottom bar. */
.npcp-toast {
	position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30; max-width: min(92vw, 520px);
	transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
	background: #1c1c1e; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 15px; text-align: center;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.npcp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* "Save to gallery" sheet (iPhone / in-app browsers). */
.npcp-sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .55); }
.npcp-sheet[hidden] { display: none; }
.npcp-sheet-box {
	width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto; background: #fff; border-radius: 20px 20px 0 0;
	padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.npcp-sheet-box img { display: block; width: 100%; height: auto; border-radius: 12px; -webkit-touch-callout: default; user-select: auto; }
.npcp-sheet-tip { margin: 12px 2px; color: var(--text); font-size: 16px; text-align: center; }
.npcp-sheet-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
@media (min-width: 700px) { .npcp-sheet { align-items: center; } .npcp-sheet-box { border-radius: 20px; } }

@media (max-width: 860px) {
	.npcp-main { grid-template-columns: minmax(0, 1fr); gap: 18px; }
	.npcp-preview { position: static; max-width: 560px; margin: 0 auto; width: 100%; }
}
@media (max-width: 420px) {
	.npcp-app { padding: 0 16px; }
	.npcp-l, .npcp-slider label { font-size: 19px; }
	.npcp-l small { font-size: 13.5px; }
	.npcp-btn { font-size: 16.5px; gap: 8px; padding: 10px 10px; }
	.npcp-actions .npcp-btn { font-size: 17.5px; }
	.npcp-photo-row { grid-template-columns: 1.6fr 1fr; gap: 10px; }
}
