/*
 * Northy Voting – frontend.
 *
 * Allt är avgränsat under .nvs så att temat inte påverkas.
 *
 * Utseendet styrs av CSS-variabler i tre lager:
 * 1. Temat kan ange --nvs-theme-* (färger, typsnitt, hörn, skuggor) så att
 *    tävlingen ser ut som resten av webbplatsen ("Följ webbplatsens tema").
 * 2. Egna val under Northy Voting → Design skrivs som inline-stil och vinner.
 * 3. Annars gäller den neutrala standarden nedan.
 */

.nvs {
	--nvs-primary: var(--nvs-theme-primary, #1f2937);
	--nvs-primary-contrast: var(--nvs-theme-primary-contrast, #ffffff);
	--nvs-primary-hover: var(--nvs-theme-primary-hover, var(--nvs-primary));
	--nvs-accent: var(--nvs-theme-accent, #b45309);
	--nvs-accent-contrast: var(--nvs-theme-accent-contrast, #ffffff);
	--nvs-radius: var(--nvs-theme-radius, 16px);
	--nvs-radius-button: var(--nvs-theme-radius-button, 999px);
	--nvs-aspect: 4 / 3;

	--nvs-font-heading: var(--nvs-theme-font-heading, inherit);
	--nvs-heading-weight: var(--nvs-theme-heading-weight, 700);
	--nvs-heading-scale: var(--nvs-theme-heading-scale, 1);
	--nvs-font-button: var(--nvs-theme-font-button, inherit);
	--nvs-button-weight: var(--nvs-theme-button-weight, 600);
	--nvs-button-tracking: var(--nvs-theme-button-tracking, 0);

	--nvs-bg: transparent;
	--nvs-surface: #ffffff;
	--nvs-surface-2: var(--nvs-theme-surface-2, #f6f5f2);
	--nvs-text: var(--nvs-theme-text, #1c1c1e);
	--nvs-muted: var(--nvs-theme-muted, #5f6368);
	--nvs-border: var(--nvs-theme-border, rgba(0, 0, 0, 0.09));
	--nvs-shadow: var(--nvs-theme-shadow, 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06));
	--nvs-shadow-hover: var(--nvs-theme-shadow-hover, 0 2px 4px rgba(0, 0, 0, 0.05), 0 16px 40px rgba(0, 0, 0, 0.1));
	--nvs-success: #15803d;
	--nvs-success-bg: #e8f6ec;
	--nvs-error: #b42318;
	--nvs-error-bg: #fdecea;
	--nvs-test: #5b21b6;
	--nvs-test-bg: #ede9fe;
	--nvs-gold: #b8860b;
	--nvs-gap: clamp(16px, 2.5vw, 28px);
	--nvs-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	position: relative;
	display: block;
	max-width: 1200px;
	margin: 0 auto clamp(32px, 6vw, 64px);
	color: var(--nvs-text);
	background: var(--nvs-bg);
	font-size: 1rem;
	line-height: 1.6;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}

.nvs--dark {
	--nvs-surface: #1d1f23;
	--nvs-surface-2: #26292e;
	--nvs-text: #f3f4f6;
	--nvs-muted: #a7adb5;
	--nvs-border: rgba(255, 255, 255, 0.1);
	--nvs-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
	--nvs-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.45);
	--nvs-success-bg: rgba(21, 128, 61, 0.2);
	--nvs-success: #6ee7a0;
	--nvs-error-bg: rgba(180, 35, 24, 0.22);
	--nvs-error: #fca5a5;
	--nvs-bg: #141518;
	padding: clamp(16px, 3vw, 32px);
	border-radius: var(--nvs-radius);
}

@media (prefers-color-scheme: dark) {
	.nvs--auto {
		--nvs-surface: #1d1f23;
		--nvs-surface-2: #26292e;
		--nvs-text: #f3f4f6;
		--nvs-muted: #a7adb5;
		--nvs-border: rgba(255, 255, 255, 0.1);
		--nvs-success-bg: rgba(21, 128, 61, 0.2);
		--nvs-success: #6ee7a0;
		--nvs-error-bg: rgba(180, 35, 24, 0.22);
		--nvs-error: #fca5a5;
	}
}

/* --- Avgränsad grundstil (skydd mot temats regler) ----------------------- */

.nvs *,
.nvs *::before,
.nvs *::after {
	box-sizing: border-box;
}

.nvs img {
	max-width: 100%;
	height: auto;
	border: 0;
	box-shadow: none;
}

.nvs h2,
.nvs h3,
.nvs h4,
.nvs p,
.nvs ul,
.nvs ol,
.nvs figure,
.nvs dl,
.nvs dd {
	margin: 0;
	padding: 0;
}

.nvs h2,
.nvs h3,
.nvs h4 {
	color: inherit;
	font-family: var(--nvs-font-heading);
	letter-spacing: normal;
	text-transform: none;
	border: 0;
	background: none;
}

.nvs button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: inherit;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
}

.nvs a {
	color: inherit;
}

.nvs [hidden] {
	display: none !important;
}

.nvs :focus-visible {
	outline: 3px solid var(--nvs-accent);
	outline-offset: 3px;
}

.nvs .nvs-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- Knappar ------------------------------------------------------------- */

.nvs .nvs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 24px;
	border-radius: var(--nvs-radius-button);
	background: var(--nvs-primary);
	color: var(--nvs-primary-contrast);
	font-family: var(--nvs-font-button);
	font-weight: var(--nvs-button-weight);
	font-size: 1rem;
	letter-spacing: var(--nvs-button-tracking);
	line-height: 1.2;
	text-decoration: none;
	text-align: center;
	transition: transform 0.18s var(--nvs-ease), box-shadow 0.18s var(--nvs-ease), background-color 0.18s, opacity 0.18s;
}

.nvs .nvs-btn:hover {
	transform: translateY(-1px);
	background: var(--nvs-primary-hover);
	box-shadow: 0 8px 22px color-mix(in srgb, var(--nvs-primary) 30%, transparent);
}

.nvs .nvs-btn:active {
	transform: translateY(0);
}

.nvs .nvs-btn[disabled],
.nvs .nvs-btn[aria-disabled="true"] {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.nvs .nvs-btn--block {
	width: 100%;
}

.nvs .nvs-btn--ghost {
	background: transparent;
	color: var(--nvs-text);
	box-shadow: inset 0 0 0 1.5px var(--nvs-border);
}

.nvs .nvs-btn--ghost:hover {
	box-shadow: inset 0 0 0 1.5px var(--nvs-text);
}

.nvs .nvs-link {
	padding: 0;
	color: var(--nvs-text);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

/* --- Banderoll (test/förhandsgranskning) --------------------------------- */

.nvs-banner {
	margin: 0 0 16px;
	padding: 10px 16px;
	border-radius: 10px;
	background: var(--nvs-test-bg);
	color: var(--nvs-test);
	font-size: 0.9rem;
	font-weight: 600;
	text-align: center;
}

/* --- Hero ---------------------------------------------------------------- */

.nvs-hero {
	position: relative;
	overflow: hidden;
	margin: 0 0 var(--nvs-gap);
	border-radius: var(--nvs-radius);
	background: var(--nvs-surface-2);
}

.nvs-hero__content {
	position: relative;
	padding: clamp(28px, 6vw, 72px) clamp(20px, 5vw, 64px);
	max-width: 780px;
}

.nvs-hero--image {
	display: grid;
	min-height: clamp(300px, 42vw, 480px);
	color: #fff;
	background: #111;
}

.nvs-hero--image > * {
	grid-area: 1 / 1;
}

.nvs-hero__media {
	position: relative;
	min-height: 100%;
}

.nvs .nvs-hero--image .nvs-hero__img {
	position: absolute;
	inset: 0;
}

.nvs-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.78) 100%);
}

.nvs .nvs-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nvs-hero--image .nvs-hero__content {
	align-self: end;
}

.nvs .nvs-hero__title {
	margin: 0 0 12px;
	font-size: calc(clamp(1.9rem, 4.6vw, 3.2rem) * var(--nvs-heading-scale));
	line-height: 1.1;
	font-weight: var(--nvs-heading-weight);
	letter-spacing: -0.015em;
}

.nvs-hero__text {
	font-size: clamp(1rem, 1.6vw, 1.15rem);
	max-width: 62ch;
	opacity: 0.92;
}

.nvs-hero__text p + p {
	margin-top: 0.8em;
}

/* Period/status */
.nvs-period {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-top: 20px;
	min-height: 36px;
}

.nvs-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--nvs-surface);
	color: var(--nvs-text);
	font-size: 0.9rem;
	font-weight: 600;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.nvs-pill__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--nvs-muted);
}

.nvs-pill--active .nvs-pill__dot {
	background: #16a34a;
	box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
	animation: nvs-pulse 2s infinite;
}

.nvs-pill--ended .nvs-pill__dot {
	background: var(--nvs-gold);
}

.nvs-period__text {
	font-size: 0.95rem;
}

.nvs-countdown {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

@keyframes nvs-pulse {
	0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
	70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
	100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* --- Laddning och fel ---------------------------------------------------- */

.nvs-loading,
.nvs-error-box,
.nvs-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 48px 16px;
	color: var(--nvs-muted);
	text-align: center;
}

.nvs-error-box {
	flex-direction: column;
	color: var(--nvs-text);
}

.nvs-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid var(--nvs-border);
	border-top-color: var(--nvs-primary);
	border-radius: 50%;
	animation: nvs-spin 0.8s linear infinite;
}

@keyframes nvs-spin {
	to { transform: rotate(360deg); }
}

/* --- Kategoriflikar ------------------------------------------------------ */

.nvs-tabs {
	display: flex;
	gap: 8px;
	margin: 0 0 var(--nvs-gap);
	padding: 6px;
	overflow-x: auto;
	scrollbar-width: none;
	border-radius: 999px;
	background: var(--nvs-surface-2);
	-webkit-overflow-scrolling: touch;
}

.nvs-tabs::-webkit-scrollbar {
	display: none;
}

.nvs .nvs-tab {
	flex: 1 0 auto;
	min-height: 44px;
	padding: 10px 20px;
	border-radius: 999px;
	color: var(--nvs-muted);
	font-weight: 600;
	white-space: nowrap;
	transition: background-color 0.2s var(--nvs-ease), color 0.2s;
}

.nvs .nvs-tab:hover {
	color: var(--nvs-text);
}

.nvs .nvs-tab[aria-selected="true"] {
	background: var(--nvs-surface);
	color: var(--nvs-text);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nvs-tab__check {
	display: inline-block;
	margin-left: 6px;
	color: var(--nvs-success);
}

.nvs-panel__head {
	margin: 0 0 var(--nvs-gap);
}

.nvs .nvs-panel__title {
	font-size: calc(clamp(1.35rem, 2.6vw, 1.75rem) * var(--nvs-heading-scale));
	line-height: 1.2;
	font-weight: var(--nvs-heading-weight);
}

.nvs-panel__desc {
	margin-top: 6px;
	color: var(--nvs-muted);
	max-width: 65ch;
}

.nvs-notice {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 var(--nvs-gap);
	padding: 12px 16px;
	border-radius: 12px;
	background: var(--nvs-success-bg);
	color: var(--nvs-success);
	font-weight: 600;
}

/* --- Deltagarkort -------------------------------------------------------- */

.nvs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: var(--nvs-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.nvs-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--nvs-radius);
	background: var(--nvs-surface);
	box-shadow: var(--nvs-shadow);
	transition: transform 0.25s var(--nvs-ease), box-shadow 0.25s var(--nvs-ease);
	animation: nvs-rise 0.45s var(--nvs-ease) both;
	animation-delay: calc(var(--nvs-i, 0) * 50ms);
}

.nvs-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--nvs-shadow-hover);
}

.nvs-card.is-chosen {
	box-shadow: 0 0 0 3px var(--nvs-accent), var(--nvs-shadow);
}

@keyframes nvs-rise {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

.nvs .nvs-card__media {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: var(--nvs-aspect);
	overflow: hidden;
	background: var(--nvs-surface-2);
	cursor: zoom-in;
}

.nvs .nvs-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s var(--nvs-ease);
}

.nvs-card:hover .nvs-card__img {
	transform: scale(1.035);
}

.nvs-card__zoom {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #111;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	opacity: 0.9;
}

.nvs-card__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	color: var(--nvs-muted);
	font-size: 2.5rem;
	font-weight: var(--nvs-heading-weight);
	font-family: var(--nvs-font-heading);
}

.nvs-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	padding: 20px 22px 22px;
}

.nvs-card__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.nvs .nvs-card__logo {
	flex: none;
	width: 44px;
	height: 44px;
	object-fit: contain;
	border-radius: 8px;
	background: #fff;
	padding: 4px;
	box-shadow: inset 0 0 0 1px var(--nvs-border);
}

.nvs .nvs-card__name {
	font-size: calc(1.2rem * var(--nvs-heading-scale));
	line-height: 1.3;
	font-weight: var(--nvs-heading-weight);
}

.nvs-card__excerpt {
	color: var(--nvs-muted);
	font-size: 0.97rem;
}

.nvs-card__links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	font-size: 0.92rem;
}

.nvs-card__actions {
	margin-top: auto;
	padding-top: 8px;
}

/* --- Dialoger ------------------------------------------------------------ */

.nvs-dialog,
.nvs-lightbox {
	padding: 0;
	border: 0;
	color: var(--nvs-text);
}

.nvs .nvs-dialog {
	/* Explicit marginal – många teman nollställer marginaler globalt, vilket
	   annars placerar dialogen i övre vänstra hörnet. */
	margin: auto;
	width: min(520px, calc(100vw - 24px));
	max-height: calc(100vh - 24px);
	border-radius: var(--nvs-radius);
	background: var(--nvs-surface);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.nvs-dialog::backdrop {
	/* Ingen backdrop-filter: blur ger renderingsfel (genomskinlig dialog) i vissa webbläsare. */
	background: rgba(17, 17, 17, 0.6);
}

.nvs-dialog[open] {
	animation: nvs-pop 0.25s var(--nvs-ease);
}

@keyframes nvs-pop {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to { opacity: 1; transform: none; }
}

.nvs-dialog__inner {
	position: relative;
	padding: 28px;
}

.nvs .nvs-dialog__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--nvs-muted);
}

.nvs .nvs-dialog__close:hover {
	background: var(--nvs-surface-2);
	color: var(--nvs-text);
}

.nvs-dialog__entry {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 18px;
	padding-right: 36px;
}

.nvs .nvs-dialog__thumb {
	flex: none;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 12px;
}

.nvs .nvs-dialog__title {
	margin: 0 0 4px;
	font-size: calc(1.35rem * var(--nvs-heading-scale));
	line-height: 1.25;
	font-weight: var(--nvs-heading-weight);
}

.nvs-dialog__text {
	color: var(--nvs-muted);
}

.nvs-dialog__long {
	margin: 16px 0 0;
}

.nvs-dialog__long p + p {
	margin-top: 0.8em;
}

.nvs-form {
	display: grid;
	gap: 14px;
}

.nvs-field__label {
	display: block;
	margin: 0 0 6px;
	font-weight: 600;
}

.nvs .nvs-input {
	display: block;
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 12px 16px;
	border: 1.5px solid var(--nvs-border);
	border-radius: 12px;
	background: var(--nvs-surface);
	color: var(--nvs-text);
	font: inherit;
	font-size: 1rem;
	box-shadow: none;
	transition: border-color 0.15s;
}

.nvs .nvs-input:focus {
	border-color: var(--nvs-primary);
	outline: 3px solid color-mix(in srgb, var(--nvs-accent) 35%, transparent);
	outline-offset: 0;
}

.nvs .nvs-input[aria-invalid="true"] {
	border-color: var(--nvs-error);
}

.nvs-help {
	margin-top: 6px;
	color: var(--nvs-muted);
	font-size: 0.9rem;
}

.nvs-privacy-note {
	padding: 12px 14px;
	border-radius: 10px;
	background: var(--nvs-surface-2);
	color: var(--nvs-muted);
	font-size: 0.85rem;
	line-height: 1.5;
}

.nvs-privacy-note a {
	color: var(--nvs-text);
}

.nvs-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.nvs-msg {
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 0.95rem;
}

.nvs-msg--error {
	background: var(--nvs-error-bg);
	color: var(--nvs-error);
}

.nvs-result {
	text-align: center;
	padding: 8px 0 0;
}

.nvs-result__icon {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: var(--nvs-success-bg);
	color: var(--nvs-success);
}

.nvs-result__icon svg {
	width: 30px;
	height: 30px;
}

.nvs-result p {
	margin-top: 8px;
}

.nvs-result .nvs-help {
	margin-top: 12px;
}

.nvs-result__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 22px;
}

/* --- Lightbox ------------------------------------------------------------ */

.nvs-lightbox {
	width: 100vw;
	max-width: 100vw;
	height: 100vh;
	max-height: 100vh;
	margin: 0;
	inset: 0;
	/* Ogenomskinlig: halvgenomskinlig bakgrund i top layer gav mörklagd bild i vissa webbläsare. */
	background: #0b0b0d;
}

.nvs-lightbox::backdrop {
	background: rgba(8, 8, 10, 0.6);
}

.nvs-lightbox__inner {
	display: grid;
	grid-template-rows: 1fr auto;
	width: 100%;
	height: 100%;
	padding: 56px 16px 20px;
}

.nvs-lightbox__figure {
	display: grid;
	place-items: center;
	min-height: 0;
}

.nvs .nvs-lightbox__img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 6px;
	animation: nvs-fade 0.25s ease;
}

.nvs-lightbox__caption {
	padding: 14px 0 0;
	color: #fff;
	text-align: center;
	font-weight: 600;
}

.nvs .nvs-lightbox__btn {
	position: fixed;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	transition: background-color 0.15s;
}

.nvs .nvs-lightbox__btn:hover {
	background: rgba(255, 255, 255, 0.26);
}

.nvs .nvs-lightbox__btn--close { top: 12px; right: 12px; }
.nvs .nvs-lightbox__btn--prev { left: 12px; top: 50%; transform: translateY(-50%); }
.nvs .nvs-lightbox__btn--next { right: 12px; top: 50%; transform: translateY(-50%); }

.nvs svg {
	flex: none;
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@keyframes nvs-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* --- Info längst ned ----------------------------------------------------- */

.nvs-info {
	display: grid;
	gap: 10px;
	margin-top: clamp(32px, 5vw, 56px);
}

.nvs-details {
	border-radius: 12px;
	background: var(--nvs-surface-2);
}

.nvs-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 52px;
	padding: 14px 18px;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}

.nvs-details > summary::-webkit-details-marker {
	display: none;
}

.nvs-details > summary::after {
	content: "+";
	font-size: 1.3rem;
	line-height: 1;
	color: var(--nvs-muted);
	transition: transform 0.2s;
}

.nvs-details[open] > summary::after {
	transform: rotate(45deg);
}

.nvs-details__body {
	padding: 0 18px 18px;
	color: var(--nvs-muted);
	font-size: 0.95rem;
}

.nvs-details__body p + p {
	margin-top: 0.8em;
}

.nvs-branding {
	margin-top: 8px;
	color: var(--nvs-muted);
	font-size: 0.8rem;
	text-align: center;
}

.nvs-noscript {
	padding: 24px;
	border-radius: var(--nvs-radius);
	background: var(--nvs-surface-2);
}

.nvs-noscript h3 {
	margin: 16px 0 6px;
}

.nvs-admin-notice {
	padding: 12px 16px;
	border-left: 4px solid #d97706;
	background: #fffbeb;
	color: #78350f;
}

/* --- Mobil ---------------------------------------------------------------- */

@media (max-width: 600px) {
	.nvs-hero {
		border-radius: calc(var(--nvs-radius) * 0.75);
	}
	.nvs-tabs {
		border-radius: 14px;
	}
	.nvs .nvs-tab {
		flex: 1 1 0;
		white-space: normal;
		line-height: 1.25;
		padding: 10px 12px;
		border-radius: 10px;
	}
	.nvs-dialog {
		width: 100vw;
		max-width: 100vw;
		margin: auto 0 0;
		border-radius: var(--nvs-radius) var(--nvs-radius) 0 0;
	}
	.nvs-dialog__inner {
		padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
	}
	.nvs .nvs-lightbox__btn--prev,
	.nvs .nvs-lightbox__btn--next {
		top: auto;
		bottom: 16px;
		transform: none;
	}
}

/* --- Resultat ------------------------------------------------------------ */

.nvs-results {
	display: grid;
	gap: calc(var(--nvs-gap) * 1.5);
}

.nvs-notice--example {
	background: var(--nvs-test-bg);
	color: var(--nvs-test);
	margin: 0;
}

.nvs-results__category {
	display: grid;
	gap: 16px;
}

.nvs-winners {
	display: grid;
	gap: var(--nvs-gap);
}

.nvs-winners--shared {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.nvs-winner {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	overflow: hidden;
	border: 1px solid var(--nvs-border);
	border-radius: var(--nvs-radius);
	background: var(--nvs-surface);
	box-shadow: var(--nvs-shadow);
}

.nvs-winners--shared .nvs-winner {
	grid-template-columns: 1fr;
}

.nvs .nvs-winner__media {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--nvs-surface-2);
	aspect-ratio: var(--nvs-aspect);
	cursor: zoom-in;
	overflow: hidden;
}

.nvs-winner__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nvs-winner__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	padding: clamp(20px, 3vw, 36px);
}

.nvs-winner__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	align-self: flex-start;
	padding: 6px 12px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--nvs-gold) 16%, transparent);
	color: var(--nvs-gold);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.nvs .nvs-winner__badge svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.nvs .nvs-winner__name {
	margin: 0;
	font-size: calc(clamp(1.4rem, 3vw, 2rem) * var(--nvs-heading-scale));
	line-height: 1.15;
	font-weight: var(--nvs-heading-weight);
}

.nvs-winner__votes {
	margin: 0;
	color: var(--nvs-muted);
	font-weight: 600;
}

.nvs .nvs-standings {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nvs-standing {
	display: grid;
	grid-template-columns: 2.25rem minmax(0, 1fr) auto;
	align-items: center;
	gap: 6px 14px;
	padding: 12px 16px;
	border: 1px solid var(--nvs-border);
	border-radius: 12px;
	background: var(--nvs-surface);
}

.nvs-standing.is-winner {
	border-color: color-mix(in srgb, var(--nvs-gold) 45%, transparent);
}

.nvs-standing__place {
	display: inline-grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--nvs-surface-2);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.nvs-standing.is-winner .nvs-standing__place {
	background: var(--nvs-gold);
	color: #fff;
}

/* Utlottningen i röstdialogen. */
.nvs .nvs-draw {
	display: grid;
	gap: 6px;
	padding: 12px 14px;
	border: 1px solid var(--nvs-border);
	border-radius: 12px;
	background: var(--nvs-surface-2);
}

.nvs .nvs-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-weight: 500;
	cursor: pointer;
}

.nvs .nvs-check input {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	margin: 0.15rem 0 0;
	accent-color: var(--nvs-accent);
}

.nvs .nvs-draw .nvs-help {
	margin: 0;
	padding-left: calc(1.15rem + 10px);
}

.nvs .nvs-draw__name {
	display: grid;
	gap: 4px;
	margin-top: 6px;
	padding-left: calc(1.15rem + 10px);
}

.nvs .nvs-draw__name[hidden] {
	display: none;
}

.nvs-draw__prize {
	display: block;
	margin-top: 2px;
}

/* Topp 3: silver och brons för andra och tredje plats. */
.nvs-standings--top3 .nvs-standing[data-place="2"] .nvs-standing__place {
	background: #66717d;
	color: #fff;
}

.nvs-standings--top3 .nvs-standing[data-place="3"] .nvs-standing__place {
	background: #8a5528;
	color: #fff;
}

.nvs .nvs-standings__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
}

.nvs-standing__name {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.nvs-standing__value {
	color: var(--nvs-muted);
	font-size: 0.92rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.nvs-standing__bar {
	grid-column: 2 / -1;
	height: 6px;
	border-radius: 999px;
	background: var(--nvs-surface-2);
	overflow: hidden;
}

.nvs-standing__bar > span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--nvs-accent);
}

.nvs-standings__total {
	margin: 0;
	color: var(--nvs-muted);
	font-size: 0.92rem;
}

@media (max-width: 700px) {
	.nvs-winner {
		grid-template-columns: 1fr;
	}
}

/* --- Förhandsgranskningsfält (utanför .nvs) ------------------------------ */

.nvs-preview-main {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px clamp(16px, 4vw, 40px) 64px;
}

.nvs-preview-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin: 0 0 24px;
	padding: 12px 16px;
	border-radius: 12px;
	background: #1f2937;
	color: #fff;
	font: 600 0.9rem/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.nvs-preview-bar__phases {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.nvs-preview-bar a {
	color: #fff;
	text-decoration: none;
}

.nvs-preview-bar__phase {
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
}

.nvs-preview-bar__phase:hover,
.nvs-preview-bar__phase:focus-visible {
	background: rgba(255, 255, 255, 0.24);
}

.nvs-preview-bar__phase.is-current {
	background: #fff;
	color: #1f2937 !important;
}

.nvs-preview-bar__draft {
	padding: 4px 10px;
	border-radius: 999px;
	background: #b45309;
}

.nvs-preview-bar__back {
	margin-left: auto;
	text-decoration: underline !important;
}

/* --- Rörelse ------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.nvs *,
	.nvs *::before,
	.nvs *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
	.nvs-card:hover,
	.nvs .nvs-btn:hover {
		transform: none;
	}
}

/* --- Intro under temats hero (page_hero) ---------------------------------- */

.nvs-hero--intro {
	overflow: visible;
	background: none;
	border-radius: 0;
	text-align: center;
}

.nvs-hero--intro .nvs-hero__content {
	max-width: 720px;
	margin: 0 auto;
	padding: 0 0 clamp(8px, 2vw, 16px);
}

.nvs-hero--intro .nvs-hero__text {
	color: var(--nvs-muted);
	font-size: clamp(1.05rem, 1.6vw, 1.2rem);
	line-height: 1.7;
	opacity: 1;
}

.nvs-hero--intro .nvs-hero__text p {
	margin: 0 auto;
	max-width: 60ch;
}

.nvs-hero--intro .nvs-period {
	justify-content: center;
}

.nvs-hero--intro .nvs-pill {
	background: var(--nvs-surface-2);
	box-shadow: none;
}

/* --- Kategoriflikar i temats stil ----------------------------------------- */

.nvs .nvs-tab {
	font-family: var(--nvs-font-button);
	letter-spacing: var(--nvs-button-tracking);
}

.nvs .nvs-tab[aria-selected="true"] {
	background: var(--nvs-primary);
	color: var(--nvs-primary-contrast);
	box-shadow: 0 4px 14px color-mix(in srgb, var(--nvs-primary) 28%, transparent);
}

.nvs .nvs-tab[aria-selected="true"] .nvs-tab__check {
	color: inherit;
}

.nvs-card__placeholder {
	background:
		radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--nvs-primary) 14%, transparent), transparent 60%),
		var(--nvs-surface-2);
	color: color-mix(in srgb, var(--nvs-primary) 55%, var(--nvs-muted));
}

.nvs-details > summary {
	font-family: var(--nvs-font-button);
	letter-spacing: var(--nvs-button-tracking);
}

/* Ankare för "Se deltagarna" i temats hero (hamnar under den fasta menyn) */
.nvs-anchor {
	scroll-margin-top: 140px;
}

/* --- Röstning via QR-kod ---------------------------------------------------- */

.nvs-notice--warn {
	background: #fff7e6;
	color: #8a4b00;
}

.nvs-qr-howto {
	display: flex;
	gap: clamp(16px, 3vw, 24px);
	align-items: flex-start;
	margin: 0 0 var(--nvs-gap);
	padding: clamp(20px, 3.5vw, 32px);
	border-radius: var(--nvs-radius);
	background:
		radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--nvs-primary) 12%, transparent), transparent 60%),
		var(--nvs-surface-2);
}

.nvs-qr-howto__icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 16px;
	background: var(--nvs-primary);
	color: var(--nvs-primary-contrast);
}

.nvs .nvs-qr-howto__icon svg {
	width: 30px;
	height: 30px;
}

.nvs .nvs-qr-howto__title {
	margin: 0 0 6px;
	font-size: calc(1.35rem * var(--nvs-heading-scale));
	font-weight: var(--nvs-heading-weight);
	line-height: 1.2;
}

.nvs-qr-howto p {
	max-width: 60ch;
	color: var(--nvs-muted);
}

.nvs .nvs-qr-howto__prize {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 12px;
	color: var(--nvs-text);
	font-weight: 600;
}

.nvs .nvs-qr-howto__prize svg,
.nvs .nvs-draw__all svg {
	flex: none;
	width: 20px;
	height: 20px;
	color: var(--nvs-primary);
}

.nvs-participants {
	padding: clamp(20px, 3.5vw, 32px);
	border-radius: var(--nvs-radius);
	background: var(--nvs-surface);
	box-shadow: var(--nvs-shadow);
}

.nvs .nvs-participants__title {
	display: flex;
	gap: 10px;
	align-items: center;
	margin: 0 0 16px;
	font-size: calc(1.35rem * var(--nvs-heading-scale));
	font-weight: var(--nvs-heading-weight);
	line-height: 1.2;
}

.nvs-participants__count {
	display: inline-grid;
	place-items: center;
	min-width: 28px;
	height: 28px;
	padding: 0 8px;
	border-radius: 999px;
	background: var(--nvs-surface-2);
	color: var(--nvs-primary);
	font-family: var(--nvs-font-button);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0;
}

.nvs .nvs-participants__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
	gap: 0 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nvs .nvs-participants__list li {
	position: relative;
	margin: 0;
	padding: 10px 0 10px 22px;
	border-bottom: 1px solid var(--nvs-border);
	font-weight: 500;
}

.nvs .nvs-participants__list li::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 2px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--nvs-primary);
	transform: translateY(-50%);
}

.nvs-focus {
	scroll-margin-top: 130px;
	max-width: 460px;
	margin: 0 auto var(--nvs-gap);
}

.nvs .nvs-focus__eyebrow {
	margin: 0 0 12px;
	color: var(--nvs-primary);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-align: center;
	text-transform: uppercase;
}

.nvs .nvs-grid--single {
	grid-template-columns: 1fr;
}

.nvs-grid--single .nvs-card__name {
	font-size: calc(1.6rem * var(--nvs-heading-scale));
}

.nvs-grid--single .nvs-btn {
	min-height: 54px;
	font-size: 1.1rem;
}

.nvs .nvs-draw__all {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 0;
	font-weight: 500;
}
