/*
 * Foto Vote Pro: "Modern" vote / share popup.
 *
 * Loaded only when Settings > Sharing > Popup style = Modern. Everything is scoped to
 * `#modal-widget.fotov-modal--modern`, so Classic never sees these rules. Phones (<= 600px) get a bottom sheet.
 *
 * Tokens: accent comes from `--fv-accent` (Design Studio), then `--fv-d-accent`, then the plugin default.
 * Dark variant: add the `fotov-modal--dark` class to the dialog.
 * Corner radius: `--fv-modal-radius` (+ `--fv-modal-radius-in` for inner blocks).
 */
#modal-widget.fotov-modal--modern {
	--fvm-accent: var(--fv-accent, var(--fv-d-accent, #6366f1));
	--fvm-accent-ink: var(--fv-accent-ink, #fff);
	--fvm-bg: #fff;
	--fvm-ink: #16181d;
	--fvm-muted: #6b7080;
	--fvm-line: #e9eaf0;
	--fvm-soft: #f4f5f8;
	--fvm-ok: #16a36a;
	--fvm-warn: #e08a00;
	--fvm-err: #e5484d;
	--fvm-r: var(--fv-modal-radius, 22px);
	--fvm-r-in: var(--fv-modal-radius-in, 14px);
}
#modal-widget.fotov-modal--modern.fotov-modal--dark {
	--fvm-bg: #1b1d24;
	--fvm-ink: #f2f3f7;
	--fvm-muted: #9aa0b2;
	--fvm-line: #2c2f39;
	--fvm-soft: #242731;
}

/* ---------- backdrop ---------- */
body.fv-modal-modern .b-modal {
	background: rgba(14, 16, 22, .5) !important;
	opacity: 1 !important;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	animation: fvm-fade .25s ease-out;
}
@keyframes fvm-fade { from { opacity: 0; } }

/* ---------- dialog shell ---------- */
#modal-widget.fotov-modal--modern {
	position: fixed !important;
	inset: 0 !important;
	margin: auto !important;
	width: min(400px, calc(100vw - 32px)) !important;
	min-width: 0 !important;
	max-width: none;
	height: max-content;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-x: hidden;
	overflow-y: auto;
	box-sizing: border-box;
	background: var(--fvm-bg);
	color: var(--fvm-ink);
	border-radius: var(--fvm-r);
	box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .04);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	text-align: left;
	animation: fvm-in .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes fvm-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fvm-up { from { opacity: .4; transform: translateY(40%); } }
#modal-widget.fotov-modal--modern *,
#modal-widget.fotov-modal--modern *::before,
#modal-widget.fotov-modal--modern *::after { box-sizing: border-box; }
#modal-widget.fotov-modal--modern::before { display: none; }
#modal-widget.fotov-modal--modern [hidden] { display: none !important; }

/* Empty helper blocks stay hidden, as in Classic */
#modal-widget.fotov-modal--modern .fvm-meta:empty,
#modal-widget.fotov-modal--modern .fvm-tiles:empty,
#modal-widget.fotov-modal--modern .fvm-badge:empty { display: none; }

/* ---------- grab handle (phone only) ---------- */
#modal-widget.fotov-modal--modern .fvm-grab {
	display: none;
	width: 40px;
	height: 5px;
	margin: 8px auto 0;
	border-radius: 3px;
	background: var(--fvm-line);
}

/* ---------- close button ---------- */
#modal-widget.fotov-modal--modern .modal-widget-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 34px;
	height: 34px;
	padding: 0;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--fvm-soft);
	color: var(--fvm-ink);
	font-size: 13px;
	line-height: 1;
	opacity: 1;
	cursor: pointer;
	transition: background .15s;
}
#modal-widget.fotov-modal--modern .modal-widget-close:hover { background: var(--fvm-line); }
#modal-widget.fotov-modal--modern[data-fvm-hasmedia="1"] .modal-widget-close {
	background: rgba(20, 22, 28, .45);
	color: #fff;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}
#modal-widget.fotov-modal--modern[data-fvm-hasmedia="1"] .modal-widget-close:hover { background: rgba(20, 22, 28, .65); }

/* ---------- photo header ---------- */
#modal-widget.fotov-modal--modern .fvm-media {
	position: relative;
	margin: 10px 10px 0;
	aspect-ratio: 2 / 1;
}
#modal-widget.fotov-modal--modern .fvm-photo {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	object-fit: cover;
	border-radius: var(--fvm-r-in);
	background: var(--fvm-soft);
	transition: filter .3s;
}
#modal-widget.fotov-modal--modern[data-fvm-phase="vote"] .fvm-photo { filter: brightness(.55) saturate(.8); }
#modal-widget.fotov-modal--modern[data-fvm-multi="1"] .fvm-photo { display: none; }

#modal-widget.fotov-modal--modern .fvm-tiles {
	position: absolute;
	inset: 0;
	display: none;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}
#modal-widget.fotov-modal--modern[data-fvm-multi="1"] .fvm-tiles { display: grid; }
#modal-widget.fotov-modal--modern .fvm-tile { position: relative; display: block; min-width: 0; overflow: hidden; border-radius: var(--fvm-r-in); background: var(--fvm-soft); }
#modal-widget.fotov-modal--modern .fvm-tile img { display: block; width: 100%; height: 100%; margin: 0; padding: 0; object-fit: cover; }
#modal-widget.fotov-modal--modern .fvm-more {
	position: absolute;
	right: 8px;
	bottom: 8px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(20, 22, 28, .7);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

#modal-widget.fotov-modal--modern .fvm-spin {
	position: absolute;
	inset: 0;
	display: none;
	place-items: center;
	pointer-events: none;
}
#modal-widget.fotov-modal--modern[data-fvm-phase="vote"] .fvm-spin { display: grid; }
#modal-widget.fotov-modal--modern .fvm-spin span {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 4px solid rgba(255, 255, 255, .3);
	border-top-color: #fff;
	animation: fvm-spin .9s linear infinite;
}
@keyframes fvm-spin { to { transform: rotate(360deg); } }

#modal-widget.fotov-modal--modern .fvm-badge {
	position: absolute;
	left: 16px;
	bottom: -22px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	color: #fff;
	box-shadow: 0 0 0 5px var(--fvm-bg);
}
#modal-widget.fotov-modal--modern .fvm-badge svg { width: 26px; height: 26px; }
#modal-widget.fotov-modal--modern .fvm-badge.ok { background: var(--fvm-ok); }
#modal-widget.fotov-modal--modern .fvm-badge.warn { background: var(--fvm-warn); }
#modal-widget.fotov-modal--modern .fvm-badge.err { background: var(--fvm-err); }
#modal-widget.fotov-modal--modern .fvm-badge.ok path {
	stroke-dasharray: 30;
	stroke-dashoffset: 30;
	animation: fvm-draw .5s .15s ease-out forwards;
}
@keyframes fvm-draw { to { stroke-dashoffset: 0; } }

/* ---------- title ---------- */
#modal-widget.fotov-modal--modern > h2 {
	height: auto;
	margin: 0;
	padding: 22px 56px 4px 22px;
	border-radius: 0;
	background: none;
	color: var(--fvm-ink);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.01em;
	overflow: visible;
}
#modal-widget.fotov-modal--modern[data-fvm-hasmedia="1"] > h2 { padding: 16px 22px 4px; }
#modal-widget.fotov-modal--modern[data-fvm-hasmedia="1"][data-fvm-badge="1"] > h2 { padding-top: 32px; }

/* ---------- message under the title ---------- */
#modal-widget.fotov-modal--modern .sw-message-box {
	margin: 0 !important;
	padding: 0 22px;
	border: 0 !important;
	border-radius: 0 !important;
	background: none;
	color: var(--fvm-muted);
	text-align: left;
	overflow: visible;
}
#modal-widget.fotov-modal--modern .sw-message-box.success,
#modal-widget.fotov-modal--modern .sw-message-box.error,
#modal-widget.fotov-modal--modern .sw-message-box.info,
#modal-widget.fotov-modal--modern .sw-message-box.warning { background: none; }
#modal-widget.fotov-modal--modern .sw-message-box .sw-message-title,
#modal-widget.fotov-modal--modern .sw-message-box .sw-message-text {
	display: block;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.45;
	white-space: normal;
	overflow: visible;
	text-overflow: clip;
}
#modal-widget.fotov-modal--modern .sw-message-box .icon,
#modal-widget.fotov-modal--modern .sw-message-box .sw-message-title > [class*="fvicon-"] { display: none; }

/* Form screens: the message is a tinted note */
#modal-widget.fotov-modal--modern[data-fvm-phase="form"] .sw-message-box {
	margin: 14px 22px 0 !important;
	padding: 11px 12px;
	border-radius: 12px !important;
	background: color-mix(in srgb, var(--fvm-accent) 10%, var(--fvm-bg));
	color: var(--fvm-ink);
}
#modal-widget.fotov-modal--modern[data-fvm-phase="form"] .sw-message-box.warning,
#modal-widget.fotov-modal--modern[data-fvm-phase="form"] .sw-message-box.error { background: color-mix(in srgb, var(--fvm-warn) 13%, var(--fvm-bg)); }
#modal-widget.fotov-modal--modern[data-fvm-phase="form"] .sw-message-box.error { background: color-mix(in srgb, var(--fvm-err) 12%, var(--fvm-bg)); }

/* ---------- chips ---------- */
#modal-widget.fotov-modal--modern .fvm-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 12px 22px 0;
}
#modal-widget.fotov-modal--modern .fvm-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	max-width: 100%;
	padding: 5px 10px;
	border-radius: 999px;
	background: var(--fvm-soft);
	color: var(--fvm-muted);
	font-size: 13px;
	line-height: 1.3;
}
#modal-widget.fotov-modal--modern .fvm-chip b { color: var(--fvm-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#modal-widget.fotov-modal--modern .fvm-chip .plus { color: var(--fvm-ok); font-weight: 700; }

/* ---------- body ---------- */
#modal-widget.fotov-modal--modern .sw-body {
	padding: 0 22px 22px;
	border-radius: 0;
	background: none;
	overflow: visible;
}
#modal-widget.fotov-modal--modern .sw-body > * { margin-top: 18px; }
#modal-widget.fotov-modal--modern .sw-body > .sw-share { margin-top: 0; }
#modal-widget.fotov-modal--modern[data-fvm-phase="form"] .sw-body > * { margin-top: 0; }
#modal-widget.fotov-modal--modern .sw-body > .sw-empty,
#modal-widget.fotov-modal--modern .sw-body > .sw-vote-recaptcha,
#modal-widget.fotov-modal--modern .sw-body > .sw-vote-math-captcha,
#modal-widget.fotov-modal--modern .sw-body > .sw-privacy,
#modal-widget.fotov-modal--modern .sw-body > .sw-report,
#modal-widget.fotov-modal--modern .sw-body > .sw-fb-vote,
#modal-widget.fotov-modal--modern .sw-body > .sw-social-authorization { margin-top: 0; padding: 0; width: auto; }

/* Label above the share icons */
#modal-widget.fotov-modal--modern .slogan {
	margin: 18px 0 0;
	padding: 0;
	color: var(--fvm-muted);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .06em;
	text-align: left;
	text-transform: uppercase;
	overflow: visible;
}
#modal-widget.fotov-modal--modern .sw-share { word-break: normal; }

/* ---------- share / provider icon grid ---------- */
#modal-widget.fotov-modal--modern ul.sw-options {
	position: static;
	height: auto;
	margin: 18px 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
	gap: 8px;
	justify-content: stretch;
	align-items: start;
	white-space: normal;
	font-size: 12px;
	overflow: visible;
	list-style: none;
}
#modal-widget.fotov-modal--modern .slogan:not(:empty) + ul.sw-options { margin-top: 10px; }
#modal-widget.fotov-modal--modern .sw-options li {
	position: relative;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	min-width: 0;
	height: auto;
	margin: 0 !important;
	padding: 4px 0;
	border-radius: 12px;
	color: var(--fvm-muted);
	font-size: 12px;
	line-height: 1.3;
	text-align: center;
	cursor: pointer;
	overflow: visible !important;
}
#modal-widget.fotov-modal--modern .sw-options li::after { content: attr(data-fvm-label); }
#modal-widget.fotov-modal--modern .sw-options .sw-action { display: none !important; }
#modal-widget.fotov-modal--modern .sw-options li:focus-visible,
#modal-widget.fotov-modal--modern .modal-widget-close:focus-visible,
#modal-widget.fotov-modal--modern .fvm-copy:focus-visible,
#modal-widget.fotov-modal--modern .fvm-btn:focus-visible,
#modal-widget.fotov-modal--modern .fv-modal-btn:focus-visible,
#modal-widget.fotov-modal--modern a:focus-visible {
	outline: 2px solid var(--fvm-accent);
	outline-offset: 2px;
}
#modal-widget.fotov-modal--modern .sw-share-button {
	position: static;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	box-shadow: none;
	transition: transform .15s;
}
#modal-widget.fotov-modal--modern .sw-options li:hover .sw-share-button { transform: translateY(-2px); box-shadow: none; }
#modal-widget.fotov-modal--modern .sw-share-button::before {
	position: static;
	width: auto;
	height: auto;
	font-size: 22px;
	line-height: 1;
	color: #fff;
}
#modal-widget.fotov-modal--modern .sw-whatsapp .sw-share-button::before { top: auto !important; }
#modal-widget.fotov-modal--modern .sw-facebook .sw-share-button { background-color: #1877f2; }
#modal-widget.fotov-modal--modern .sw-twitter .sw-share-button { background-color: #111; }
#modal-widget.fotov-modal--modern .sw-pinterest .sw-share-button { background-color: #e60023; }
#modal-widget.fotov-modal--modern .sw-whatsapp .sw-share-button { background-color: #25d366; }
#modal-widget.fotov-modal--modern .sw-vk .sw-share-button { background-color: #0077ff; }
#modal-widget.fotov-modal--modern .sw-ok .sw-share-button { background-color: #f7931e; line-height: 1; font-size: 15px; }
#modal-widget.fotov-modal--modern .sw-native-share .sw-share-button { background: var(--fvm-soft); color: var(--fvm-ink); }
#modal-widget.fotov-modal--modern .sw-twitter .sw-share-button::before { display: none; }
#modal-widget.fotov-modal--modern .fvm-x { width: 20px; height: 20px; fill: #fff; }
#modal-widget.fotov-modal--modern .fvm-up { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- copy link ---------- */
#modal-widget.fotov-modal--modern .sw-link {
	display: flex;
	align-items: center;
	gap: 6px;
	max-width: none;
	margin: 12px 0 0;
	padding: 5px 5px 5px 12px;
	border-radius: 12px;
	background: var(--fvm-soft);
}
#modal-widget.fotov-modal--modern .sw-link:focus-within { box-shadow: 0 0 0 2px var(--fvm-accent); }
#modal-widget.fotov-modal--modern .sw-link input {
	flex: 1;
	width: auto;
	min-width: 0 !important;
	max-width: none !important;
	margin: 0;
	padding: 8px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--fvm-muted);
	font-size: 13px;
	line-height: 1.4;
	outline: none;
	text-overflow: ellipsis;
}
#modal-widget.fotov-modal--modern .sw-copy-share-link { display: none; }
#modal-widget.fotov-modal--modern .fvm-copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex: none;
	padding: 9px 14px;
	border: 0;
	border-radius: 10px;
	background: var(--fvm-accent);
	color: var(--fvm-accent-ink);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background .15s, filter .15s;
}
#modal-widget.fotov-modal--modern .fvm-copy:hover { filter: brightness(1.08); }
#modal-widget.fotov-modal--modern .sw-link .fvm-copy span { padding: 0; font-size: inherit; text-decoration: none; }
#modal-widget.fotov-modal--modern .fvm-copy-ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
#modal-widget.fotov-modal--modern .fvm-copy-done { display: none; }
#modal-widget.fotov-modal--modern .fvm-copy.--is-copied { background: var(--fvm-ok); color: #fff; }
#modal-widget.fotov-modal--modern .fvm-copy.--is-copied .fvm-copy-label { display: none; }
#modal-widget.fotov-modal--modern .fvm-copy.--is-copied .fvm-copy-done { display: inline; }
#modal-widget.fotov-modal--modern .fvm-copy.--is-copied .fvm-copy-ico { display: none; }
#modal-widget.fotov-modal--modern .fvm-copy.--is-copied .fvm-copy-done::before { content: "\2713\00a0"; }

/* ---------- buttons ---------- */
#modal-widget.fotov-modal--modern .fv-modal-btn,
#modal-widget.fotov-modal--modern .fvm-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 13px 16px !important;
	border: 0;
	border-radius: 12px;
	background: var(--fvm-accent);
	color: var(--fvm-accent-ink);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: filter .15s;
	-webkit-appearance: none;
	appearance: none;
}
#modal-widget.fotov-modal--modern .fv-modal-btn:hover,
#modal-widget.fotov-modal--modern .fvm-btn:hover { background: var(--fvm-accent); filter: brightness(1.08); }
#modal-widget.fotov-modal--modern .fv-modal-btn::after { display: none; }
#modal-widget.fotov-modal--modern .sw-report .fv-modal-btn { background: var(--fvm-err); color: #fff; }

/* ---------- form rows and fields ---------- */
#modal-widget.fotov-modal--modern .frm-row { margin-top: 14px; }
#modal-widget.fotov-modal--modern .frm-row.text-center { text-align: center; }
#modal-widget.fotov-modal--modern .sw-body > *:first-child .frm-row:first-child { margin-top: 0; }
#modal-widget.fotov-modal--modern .sw-privacy-form,
#modal-widget.fotov-modal--modern .sw-report-form { padding: 0; }
#modal-widget.fotov-modal--modern .sw-privacy .sw-privacy-text,
#modal-widget.fotov-modal--modern .sw-privacy-text p { margin: 0; color: var(--fvm-muted); font-size: 14px; line-height: 1.45; }
#modal-widget.fotov-modal--modern .sw-privacy-text a,
#modal-widget.fotov-modal--modern .frm-field-label a { color: var(--fvm-accent); }
#modal-widget.fotov-modal--modern .frm-field-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	overflow: visible;
	color: var(--fvm-ink);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.45;
	cursor: pointer;
}
#modal-widget.fotov-modal--modern .fv-checkbox-placeholder { display: none; }
#modal-widget.fotov-modal--modern .fv-modal-checkbox {
	position: static;
	display: grid;
	place-items: center;
	flex: none;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	padding: 0;
	border: 2px solid var(--fvm-line);
	border-radius: 6px;
	background: transparent;
	font-size: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
#modal-widget.fotov-modal--modern .fv-modal-checkbox:checked { background: var(--fvm-accent); border-color: var(--fvm-accent); }
#modal-widget.fotov-modal--modern .fv-modal-checkbox:checked::after {
	content: "";
	width: 9px;
	height: 5px;
	border: 2px solid #fff;
	border-top: 0;
	border-right: 0;
	transform: rotate(-45deg) translate(1px, -1px);
}
#modal-widget.fotov-modal--modern .fv-modal-checkbox:focus-visible { outline: 2px solid var(--fvm-accent); outline-offset: 2px; }
#modal-widget.fotov-modal--modern em.frm-error-text { display: block; color: var(--fvm-err); font-size: 12px; line-height: 1.4; }
#modal-widget.fotov-modal--modern em.frm-error-text:empty { display: none; }

#modal-widget.fotov-modal--modern .sw-report-form input[type="text"],
#modal-widget.fotov-modal--modern .frm-input input,
#modal-widget.fotov-modal--modern .math-captcha-wrap input[type="text"],
#modal-widget.fotov-modal--modern .math-captcha-wrap input[type="number"] {
	width: 100%;
	max-width: 100%;
	margin: 0 !important;
	padding: 11px 12px;
	border: 1px solid var(--fvm-line);
	border-radius: 12px;
	background: var(--fvm-bg);
	box-shadow: none;
	color: var(--fvm-ink);
	font: inherit;
	font-size: 15px !important;
	line-height: 1.4;
	outline: none;
}
#modal-widget.fotov-modal--modern .sw-report-form input.fv-report-url { background: var(--fvm-soft); color: var(--fvm-muted); font-size: 13px !important; }
#modal-widget.fotov-modal--modern .sw-report-form input[type="text"]:focus,
#modal-widget.fotov-modal--modern .frm-input input:focus,
#modal-widget.fotov-modal--modern .math-captcha-wrap input:focus {
	border-color: var(--fvm-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--fvm-accent) 22%, transparent);
}
#modal-widget.fotov-modal--modern .frm-input input:invalid { box-shadow: none !important; }

/* ---------- Math captcha ---------- */
#modal-widget.fotov-modal--modern .math-captcha-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 16px;
	padding: 12px;
	border-radius: 12px;
	background: var(--fvm-soft);
	font-size: 22px;
	font-weight: 700;
	letter-spacing: .08em;
}
#modal-widget.fotov-modal--modern .math-captcha-wrap label { display: inline; font: inherit; }
#modal-widget.fotov-modal--modern .math-captcha-wrap input[type="text"],
#modal-widget.fotov-modal--modern .math-captcha-wrap input[type="number"] { width: 90px; text-align: center; font-size: 20px !important; font-weight: 700; letter-spacing: 0; }
#modal-widget.fotov-modal--modern .math-captcha-wrap img { margin: 0; }
#modal-widget.fotov-modal--modern .sw-vote-math-captcha .frm-row { margin-top: 16px; }

/* ---------- reCAPTCHA ---------- */
#modal-widget.fotov-modal--modern .sw-vote-recaptcha { padding: 0; }
#modal-widget.fotov-modal--modern #sw-vote-g-recaptcha { display: flex; justify-content: center; width: auto; margin: 16px auto 0; }

/* ---------- sign in / Facebook share-to-vote ---------- */
#modal-widget.fotov-modal--modern .sw-social-authorization ul.sw-options { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 16px; gap: 12px; }
#modal-widget.fotov-modal--modern .sw-social-authorization .sw-options li { width: 48px; padding: 0; }
#modal-widget.fotov-modal--modern .sw-social-authorization .sw-options li::after { content: none; }
#modal-widget.fotov-modal--modern .sw-social-authorization .sw-share-button { width: 48px; height: 48px; }
#modal-widget.fotov-modal--modern .sw-social-authorization .sw-share-button::before { top: auto; left: auto; }
#modal-widget.fotov-modal--modern .sw-fb-vote ul.sw-options { display: flex; flex-direction: column; margin-top: 16px; gap: 8px; }
#modal-widget.fotov-modal--modern .sw-fb-vote .sw-options li {
	flex-direction: row;
	justify-content: flex-start;
	width: 100%;
	margin: 0 !important;
	padding: 10px 12px;
	gap: 12px;
	border-radius: 12px;
	box-shadow: inset 0 0 0 1px var(--fvm-line);
	color: var(--fvm-ink);
	font-size: 15px;
	font-weight: 600;
}
#modal-widget.fotov-modal--modern .sw-fb-vote .sw-options li::after { content: none; }
#modal-widget.fotov-modal--modern .sw-fb-vote .sw-share-button { width: 32px; height: 32px; }
#modal-widget.fotov-modal--modern .sw-fb-vote .sw-share-button::before { font-size: 16px; }
#modal-widget.fotov-modal--modern .sw-fb-vote .sw-options .sw-action {
	position: static;
	display: inline !important;
	color: inherit;
	font-size: 15px;
	line-height: 1.2;
}

/* ---------- notice screens (OK button) ---------- */
#modal-widget.fotov-modal--modern .fvm-row { display: flex; gap: 8px; margin-top: 16px; }
#modal-widget.fotov-modal--modern .fvm-row .fvm-btn { flex: 1; }

/* ---------- phones: bottom sheet ---------- */
@media (max-width: 600px) {
	#modal-widget.fotov-modal--modern {
		inset: auto 0 0 0 !important;
		width: auto !important;
		min-width: 0 !important;
		margin: 0 !important;
		max-height: 88vh;
		max-height: 88dvh;
		padding-bottom: env(safe-area-inset-bottom, 0);
		border-radius: var(--fvm-r) var(--fvm-r) 0 0;
		animation: fvm-up .3s cubic-bezier(.2, .8, .2, 1);
	}
	#modal-widget.fotov-modal--modern .fvm-grab { display: block; }
	#modal-widget.fotov-modal--modern .sw-options li { padding: 4px 0; }
}

/* ---------- focus ring colour for dark / reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	#modal-widget.fotov-modal--modern,
	body.fv-modal-modern .b-modal,
	#modal-widget.fotov-modal--modern .fvm-badge.ok path,
	#modal-widget.fotov-modal--modern .fvm-spin span { animation: none !important; }
	#modal-widget.fotov-modal--modern .fvm-badge.ok path { stroke-dashoffset: 0; }
	#modal-widget.fotov-modal--modern *,
	#modal-widget.fotov-modal--modern *::before { transition: none !important; }
}

/* ---------- rating (stars) ----------
 * One row for 5-10 stars: the cell is the body width / number of stars (max 38px) and the glyph scales with it.
 * The radios stay in the tab order (visually hidden) so the keyboard can pick a value; the focused star gets a ring.
 */
#modal-widget.fotov-modal--modern .sw-body { container-type: inline-size; }
#modal-widget.fotov-modal--modern .sw-rating { padding: 0; }
#modal-widget.fotov-modal--modern .fv-rating-set {
	--fvm-n: 5;
	--fvm-cell: min(38px, calc(100cqw / var(--fvm-n)));
	display: flex;
	/* The radios are in descending order (10 ... 1). rtl makes ArrowRight raise and ArrowLeft lower the rating, and
	   `row` in rtl still puts the first radio (the highest) on the right, so the picture is unchanged. */
	direction: rtl;
	flex-direction: row;
	justify-content: center;
	width: auto;
	max-width: 100%;
	margin: 0 auto;
	padding: 0;
	min-width: 0;
}
#modal-widget.fotov-modal--modern .fv-rating-set--6 { --fvm-n: 6; }
#modal-widget.fotov-modal--modern .fv-rating-set--7 { --fvm-n: 7; }
#modal-widget.fotov-modal--modern .fv-rating-set--8 { --fvm-n: 8; }
#modal-widget.fotov-modal--modern .fv-rating-set--9 { --fvm-n: 9; }
#modal-widget.fotov-modal--modern .fv-rating-set--10 { --fvm-n: 10; }
#modal-widget.fotov-modal--modern .fv-rating-set > input {
	display: block;
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}
#modal-widget.fotov-modal--modern .fv-rating-set > label { float: none; flex: 0 0 auto; cursor: pointer; }
#modal-widget.fotov-modal--modern .fv-rating-set > label.full { width: var(--fvm-cell); }
/* One SVG star drives every state. The full star and the half star are the same box with the same mask; the
   half star is that box clipped to its left half, so the two can never differ by a pixel (the icon font used a
   separate, larger half glyph). Color comes from `color`, so the hover/checked rules keep working. */
#modal-widget.fotov-modal--modern .fv-rating-set > label::before {
	content: "";
	display: block;
	width: calc(var(--fvm-cell) * .86);
	height: calc(var(--fvm-cell) * .86);
	margin: 0 0 0 calc(var(--fvm-cell) * .07);
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3.2 6.6 7.2 1-5.2 5.1 1.2 7.2L12 18.3l-6.4 3.4 1.2-7.2L1.6 9.4l7.2-1z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l3.2 6.6 7.2 1-5.2 5.1 1.2 7.2L12 18.3l-6.4 3.4 1.2-7.2L1.6 9.4l7.2-1z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
#modal-widget.fotov-modal--modern .fv-rating-set > label.half { position: relative; align-self: stretch; }
#modal-widget.fotov-modal--modern .fv-rating-set > label.half::before {
	position: absolute;
	top: 0;
	left: 0;
	clip-path: inset(0 50% 0 0);
}
/* Keyboard focus: one ring around the whole row (a ring on a single glyph is cut by the half-star clip). */
#modal-widget.fotov-modal--modern .fv-rating-set:has(> input:focus-visible) {
	outline: 2px solid var(--fvm-accent);
	outline-offset: 4px;
	border-radius: 8px;
}
/* Stars are icons, not text: no selection / tap highlight box over them. */
#modal-widget.fotov-modal--modern .fv-rating-set > label {
	direction: ltr;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}
#modal-widget.fotov-modal--modern .rating-counter {
	margin: 14px 0 16px;
	color: var(--fvm-muted);
	font-size: 14px;
}
#modal-widget.fotov-modal--modern .rating-counter-selected { color: var(--fvm-ink); font-weight: 700; }
/* Hover over an already rated star used to "lighten" it to pale yellow, which next to a gold half star looked like
   two stars stacked. Keep one gold tone for every state. */
#modal-widget.fotov-modal--modern .fv-rating-set > input:checked + label:hover,
#modal-widget.fotov-modal--modern .fv-rating-set > input:checked ~ label:hover,
#modal-widget.fotov-modal--modern .fv-rating-set > label:hover ~ input:checked ~ label,
#modal-widget.fotov-modal--modern .fv-rating-set > input:checked ~ label:hover ~ label { color: #FFD700; }
