html, body {
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root {
	--stift-panel-height: 132px;
	--handlings-top-gap: 135px;
	--uppdrag-max-height: 76vh;

	--panel-glass: rgba(236, 236, 238, 0.34);
	--panel-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);

	--gold-border: #b89a57;
	--gold-bg-top: rgba(255,248,232,0.96);
	--gold-bg-bottom: rgba(236,224,191,0.92);
	--gold-bg-top-hover: rgba(255,250,239,0.98);
	--gold-bg-bottom-hover: rgba(232,217,176,0.95);
	--gold-text: #2b2418;

	--z-map: 1;
	--z-leaflet: 800;
	--z-map-buttons: 901;
	--z-uppdrag: 904;
	--z-news-button: 905;
	--z-mobile-backdrop: 920;
	--z-handlingsfalt: 940;
	--z-stift-panel: 941;
	--z-logo: 950;

	--z-diocese-modal: 959;
	--z-stift-info-modal: 960;
	--z-menu-modal: 961;
	--z-news-modal: 962;
	--z-vicar-modal: 963;
	--z-church-meeting-modal: 964;
	--z-confirm-modal: 970;
	--z-help-modal: 971;
	--z-map-modes-modal: 972;
	--z-invitation-modal: 980;
	--z-admin-modal: 981;
	--z-article-modal: 990;
	--z-fly-token: 992;
	--z-ripple: 998;
	--z-fake-cursor: 999;
	--z-toast: 2000;
}

/* =========================================================
   Cursor
========================================================= */

body.fake-cursor-enabled,
body.fake-cursor-enabled * {
	cursor: none !important;
}
body.fake-cursor-enabled #handlingsfalt,
body.fake-cursor-enabled #uppdrag_panel,
body.fake-cursor-enabled #stift_panel,
body.fake-cursor-enabled .uppdrag-list,
body.fake-cursor-enabled .korstag-handlingsfalt {
	cursor: none !important;
}

body.fake-cursor-enabled #handlingsfalt::-webkit-scrollbar,
body.fake-cursor-enabled #uppdrag_panel::-webkit-scrollbar,
body.fake-cursor-enabled #stift_panel::-webkit-scrollbar,
body.fake-cursor-enabled .uppdrag-list::-webkit-scrollbar,
body.fake-cursor-enabled .korstag-handlingsfalt::-webkit-scrollbar {
	cursor: none !important;
}

body.fake-cursor-enabled #handlingsfalt::-webkit-scrollbar-thumb,
body.fake-cursor-enabled #uppdrag_panel::-webkit-scrollbar-thumb,
body.fake-cursor-enabled #stift_panel::-webkit-scrollbar-thumb,
body.fake-cursor-enabled .uppdrag-list::-webkit-scrollbar-thumb,
body.fake-cursor-enabled .korstag-handlingsfalt::-webkit-scrollbar-thumb {
	cursor: none !important;
}

body.fake-cursor-enabled #handlingsfalt::-webkit-scrollbar-track,
body.fake-cursor-enabled #uppdrag_panel::-webkit-scrollbar-track,
body.fake-cursor-enabled #stift_panel::-webkit-scrollbar-track,
body.fake-cursor-enabled .uppdrag-list::-webkit-scrollbar-track,
body.fake-cursor-enabled .korstag-handlingsfalt::-webkit-scrollbar-track {
	cursor: none !important;
}

/* Cursor Uppdragspanel */

.uppdrag-list::-webkit-scrollbar {
	width: 10px;
}

.uppdrag-list::-webkit-scrollbar-track {
	background: rgba(255,255,255,0.08);
}

.uppdrag-list::-webkit-scrollbar-thumb {
	background: rgba(90,90,96,0.38);
	border-radius: 999px;
}

.uppdrag-list::-webkit-scrollbar-thumb:hover {
	background: rgba(90,90,96,0.54);
}

.uppdrag-list {
	scrollbar-width: thin;
	scrollbar-color: rgba(90,90,96,0.38) rgba(255,255,255,0.08);
}

/* ==========================================
   Custom scrollbar containers
========================================== */

#handlingsfalt,
.uppdrag-list {
	scrollbar-width: none;
	-ms-overflow-style: none;
	position: relative;
}

#handlingsfalt::-webkit-scrollbar,
.uppdrag-list::-webkit-scrollbar {
	width: 0;
	height: 0;
}

/* ==========================================
   Custom scrollbar
========================================== */
/* Dölj native scrollbar bara på de riktiga scrollelementen */
#handlingsfalt,
.uppdrag-list {
	scrollbar-width: none;
	-ms-overflow-style: none;
}

#handlingsfalt::-webkit-scrollbar,
.uppdrag-list::-webkit-scrollbar {
	width: 0;
	height: 0;
	display: none;
}

/* Viktigt: panelen ska inte ha egen custom scrollbar */
#uppdrag_panel::-webkit-scrollbar {
	width: 0;
	height: 0;
}

.custom-scrollbar {
	position: absolute;
	width: 6px;
	border-radius: 999px;
	background: rgba(255,255,255,0.06);
	z-index: 986;
	pointer-events: auto;
	opacity: 0;
	transition:
		opacity 0.18s ease,
		background-color 0.18s ease;
}

.custom-scrollbar-thumb {
	position: absolute;
	left: 0;
	width: 100%;
	border-radius: 999px;
	background: rgba(90,90,96,0.38);
	cursor: none !important;
	transition:
		background-color 0.15s ease,
		box-shadow 0.15s ease,
		opacity 0.15s ease;
}

.custom-scrollbar-thumb:hover,
.custom-scrollbar.is-hovered .custom-scrollbar-thumb {
	background: rgba(146, 124, 83, 0.72);
	box-shadow:
		0 0 0 1px rgba(184, 154, 87, 0.42),
		0 0 14px rgba(184, 154, 87, 0.30),
		0 0 24px rgba(184, 154, 87, 0.12);
}

#handlingsfalt:hover + .custom-scrollbar,
#handlingsfalt:focus-within + .custom-scrollbar,
#handlingsfalt.is-scroll-active + .custom-scrollbar,
.uppdrag-list:hover + .custom-scrollbar,
.uppdrag-list:focus-within + .custom-scrollbar,
.uppdrag-list.is-scroll-active + .custom-scrollbar,
.custom-scrollbar:hover,
.custom-scrollbar.is-hovered {
	opacity: 1;
}

#handlingsfalt,
.uppdrag-list {
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

body.fake-cursor-enabled .custom-scrollbar,
body.fake-cursor-enabled .custom-scrollbar-thumb {
	cursor: none !important;
}
/* Handlingsfältets custom scrollbar ska ligga till vänster */
#handlingsfalt + .custom-scrollbar,
.custom-scrollbar[data-side="left"] {
	left: 4px;
	right: auto;
}




body:not(.fake-cursor-enabled),
body:not(.fake-cursor-enabled) * {
	cursor: auto;
}

body:not(.fake-cursor-enabled) #fake-cursor {
	display: none !important;
}

#fake-cursor {
	position: fixed;
	left: 0;
	top: 0;
	width: 48px;
	height: 48px;
	pointer-events: none;
	z-index: var(--z-fake-cursor);
	overflow: visible;
	transition: opacity 0.08s ease;
}

#fake-cursor-img {
	position: absolute;
	width: 48px;
	height: 48px;
	object-fit: contain;
	left: -6px;
	top: -48px;
	transform-origin: 6px 48px;
	will-change: transform;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}

/* =========================================================
   Map / Leaflet
========================================================= */

#map {
	position: absolute;
	inset: 0;
	z-index: 1;
	cursor: move;
}

#map * {
	cursor: move;
}

.leaflet-control,
.leaflet-control-zoom,
.leaflet-right,
.leaflet-top {
	z-index: 800 !important;
}

.leaflet-tooltip-pane,
.leaflet-tooltip {
	z-index: 1200 !important;
}

.leaflet-control-attribution {
	display: none !important;
}

.click-ripple {
	position: fixed;
	left: 0;
	top: 0;
	width: 12px;
	height: 12px;
	margin-left: -6px;
	margin-top: -6px;
	border: 2px solid rgba(255, 215, 120, 0.8);
	border-radius: 50%;
	pointer-events: none;
	z-index: var(--z-ripple);
	animation: click-ripple 0.45s ease-out forwards;
}

@keyframes click-ripple {
	from {
		transform: scale(0.4);
		opacity: 0.9;
	}
	to {
		transform: scale(3.2);
		opacity: 0;
	}
}

/* =========================================================
   Shared hidden when logged out
========================================================= */

body.logged-out #stift_panel,
body.logged-out #uppdrag_panel,
body.logged-out #news_button {
	display: none !important;
}

/* =========================================================
   Logo
========================================================= */

#logo_panel {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 950;
	pointer-events: none;
}

#logo_panel img {
	display: block;
	width: 300px;
	max-width: 28vw;
	height: auto;
	padding-left: 10px;
}

/* =========================================================
   Handlingsfält
========================================================= */

#handlingsfalt {
	position: absolute;
	left: 0;
	top: var(--handlings-top-gap);
	bottom: var(--stift-panel-height);
	width: 330px;
	padding: 14px;
	box-sizing: border-box;
	overflow-y: auto;
	z-index: 940;
	background: var(--panel-glass);
	backdrop-filter: blur(4px);
	box-shadow: 2px 0 14px rgba(0, 0, 0, 0.10);
	border-top: 1px solid rgba(255,255,255,0.45);
	border-right: 1px solid rgba(120,120,126,0.32);
	border-bottom: 1px solid rgba(120,120,126,0.22);
	border-top-right-radius: 18px;
	direction: rtl;
}

body.logged-out #handlingsfalt {
	bottom: auto;
	height: auto;
	max-height: none;
	overflow: visible;
	border-bottom-right-radius: 18px;
}

body.logged-in #handlingsfalt {
	border-bottom-right-radius: 0;
}

.korstag-handlingsfalt > * {
	direction: ltr;
}

.korstag-handlingsfalt::-webkit-scrollbar {
	width: 10px;
}

.korstag-handlingsfalt::-webkit-scrollbar-track {
	background: rgba(255,255,255,0.08);
}

.korstag-handlingsfalt::-webkit-scrollbar-thumb {
	background: rgba(90,90,96,0.38);
	border-radius: 999px;
}

.korstag-handlingsfalt::-webkit-scrollbar-thumb:hover {
	background: rgba(90,90,96,0.54);
}

/* =========================================================
   Login
========================================================= */

#login_form input {
	height: 28px;
	border-radius: 10px;
	background: rgba(255,255,255,0.2);
	margin: 5px 0;
}

#login_form button {
	width: 100%;
	margin: 10px 0;
}

/* =========================================================
   Kartknappar
========================================================= */

.korstag-kartknappar {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: flex;
	gap: 8px;
	z-index: 901;
}

.korstag-kartknappar button {
	width: 42px;
	height: 42px;
	border-radius: 10px;
	border: 1px solid #888;
	background: rgba(255, 255, 255, 0.94);
	font-size: 18px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.korstag-kartknappar button.active-mode {
	background: rgba(80, 80, 80, 0.96) !important;
	color: #fff;
	border-color: #3a3a3a !important;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* =========================================================
   Stiftspanel
========================================================= */

#stift_panel {
	position: fixed;
	left: 0;
	bottom: 0;
	width: 430px;
	height: var(--stift-panel-height);
	min-height: var(--stift-panel-height);
	max-height: var(--stift-panel-height);
	border-radius: 0 18px 0 0;
	padding: 14px 16px 12px;
	box-sizing: border-box;
	overflow: hidden;
	z-index: 941;
	box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.22);
	color: #fff;
}

.stift-panel-title-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.stift-panel-title-wrap {
	min-width: 0;
	flex: 1 1 auto;
}

.stift-panel-title {
	font-size: 1.15rem;
	font-weight: 700;
	margin-bottom: 2px;
	line-height: 1.2;
	display: flex;
	align-items: baseline;
	gap: 6px;
	min-width: 0;
}

.stift-panel-subtitle {
	font-size: 0.72em;
	font-weight: 500;
	opacity: 0.88;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
	max-width: 100%;
	display: inline-block;
	vertical-align: baseline;
}

.stift-panel-stats {
	font-size: 0.96rem;
	line-height: 1.35;
	opacity: 0.96;
	margin-top: 2px;
}

.stift-panel-actions {
	margin-top: 10px;
	display: flex;
	gap: 8px;
	flex-wrap: nowrap;
	align-items: center;
}

/* =========================================================
   Uppdragspanel
========================================================= */

#uppdrag_panel {
	position: fixed;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 58px;
	min-height: 116px;
	max-height: var(--uppdrag-max-height);
	padding: 10px 0 10px 10px;
	box-sizing: border-box;
	overflow: hidden;
	border-radius: 18px 0 0 18px;
	background: var(--panel-glass);
	backdrop-filter: blur(4px);
	box-shadow: var(--panel-shadow);
	z-index: 904;
	transition: width 0.22s ease;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

#uppdrag_panel.expanded {
	width: 330px;
}

#uppdrag_panel_inner {
	min-width: 304px;
	display: flex;
	flex-direction: column;
}

.uppdrag-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}

.uppdrag-title {
	font-size: 1rem;
	font-weight: 700;
}

.uppdrag-summary {
	margin-top: 10px;
	font-size: 0.92rem;
	line-height: 1.4;
	display: inline-flex;
	gap: 10px;
}

.uppdrag-list {
	margin-top: 10px;
	padding-right: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	overflow-y: auto;
	max-height: calc(var(--uppdrag-max-height) - 130px);
}

.uppdrag-footer {
	margin-top: 10px;
	padding-right: 22px;
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: flex-end;
}

#uppdrag-toggle-btn {
	margin-right: auto;
	min-width: 34px;
	width: 34px;
	height: 34px;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
}

/* =========================================================
   Cards / sections
========================================================= */

.parish-card {
	margin-top: 10px;
	padding: 12px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(35, 35, 35, 0.32);
	color: #fff;
}

.parish-card.own-parish {
	border: 2px solid #222;
}

.parish-card h2 {
	margin: 0 0 6px;
	font-size: 1.1rem;
}

.parish-meta {
	line-height: 1.45;
	font-size: 0.95rem;
}

.stift-line {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.visitation-block {
	margin-top: 8px;
}

.rorelse {
	border: 1px solid;
	border-radius: 10px;
	padding: 0 5px;
	background: rgba(255,255,255,0.1);
}

.action-group {
	margin-top: 10px;
	padding: 10px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(35, 35, 35, 0.24);
	color: #fff;
}

.action-group h4 {
	margin: 0 0 8px;
	font-size: 0.95rem;
}

.action-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.action-item {
	display: flex;
	align-items: center;
	gap: 6px;
}

.action-item > button:not(.help-btn),
.action-item > select {
	flex: 1 1 auto;
}

/* =========================================================
   Invitations / orders
========================================================= */

.invitation-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.invitation-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	background: rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	padding: 8px;
}

.invitation-title {
	line-height: 1.25;
	font-size: 0.92rem;
	width: calc(100% - 110px);
}

.invitation-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	position: static;
	right: auto;
}

.pending-item {
	position: relative;
	background: rgba(255, 255, 255, 0.98);
	color: #111;
	border: 1px solid #d4d4d4;
	border-radius: 9px;
	padding: 7px 28px 6px 9px;
	min-height: 40px;
}

.pending-item strong {
	display: block;
	font-size: 0.92rem;
	line-height: 1.12;
}

.pending-item .meta {
	font-size: 0.82rem;
	color: #555;
	margin-top: 2px;
	line-height: 1.1;
}

.pending-item .remove-order-btn {
	position: absolute;
	top: 4px;
	right: 5px;
	border: none;
	background: transparent;
	color: #922;
	font-size: 15px;
	line-height: 1;
	padding: 2px 4px;
}

/* =========================================================
   Pills / muted
========================================================= */

.stat-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border-radius: 999px;
	padding: 4px 8px;
	border: 1px solid rgba(255,255,255,0.18);
	font-size: 0.88rem;
	line-height: 1;
	white-space: nowrap;
	color: #f3ead2;
	background: rgba(255,255,255,0.08);
	box-shadow:
		inset 0 1px 0 rgba(255,255,255,0.05),
		0 1px 2px rgba(0,0,0,0.22);
}

.stat-pill-group {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.stat-pill::before {
	content: "";
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

.stat-pill--folk::before {
  background-image: url('/img/ikoner/folk.png');
}

.stat-pill--from::before {
  background-image: url('/img/ikoner/from.png');
}

.stat-pill--lit::before {
  background-image: url('/img/ikoner/lit.png');
}

.stat-pill--stabilitet::before {
  background-image: url('/img/ikoner/stab.png');
}

.stat-pill--forsamlingar::before {
  background-image: url('/img/ikoner/forsamling.png');
}

.stat-pill--praster::before {
  background-image: url('/img/ikoner/pr.png');
}

.stat-pill--kyrkor::before {
  background-image: url('/img/ikoner/ky.png');
}

.stat-pill--tillhoriga::before {
  background-image: url('/img/ikoner/me.png');
}
/* Använd prästikonen, men med plustecken som genereras efteråt */
.adjunkt-pill::before {
  background-image: url('/img/ikoner/pr.png');
}

.stat-pill--folk::before,
.stat-pill--from::before,
.stat-pill--lit::before,
.stat-pill--stabilitet::before,
.stat-pill--kyrkor::before,
.stat-pill--praster::before,
.stat-pill--tillhoriga::before,
.stat-pill--forsamlingar::before,
.stat-pill--adjunkter::before {
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.08));
}

.stat-pill--folk {
  background-color: rgba(78, 124, 78, 0.26);
  border-color: rgba(124, 176, 124, 0.34);
}

.stat-pill--from {
  background-color: rgba(132, 62, 62, 0.26);
  border-color: rgba(182, 96, 96, 0.34);
}

.stat-pill--lit {
  background-color: rgba(148, 122, 52, 0.26);
  border-color: rgba(205, 172, 78, 0.34);
}

.stat-pill--stabilitet {
  background-color: rgba(66, 92, 132, 0.26);
  border-color: rgba(100, 132, 186, 0.34);
}

.stat-pill--kyrkor {
  background-color: rgba(82, 108, 86, 0.26);
  border-color: rgba(118, 150, 122, 0.34);
}

.stat-pill--praster {
  background-color: rgba(88, 98, 114, 0.26);
  border-color: rgba(130, 142, 164, 0.34);
}

.stat-pill--tillhoriga,
.stat-pill--medlemmar {
  background-color: rgba(136, 98, 62, 0.26);
  border-color: rgba(181, 132, 84, 0.34);
}

.stat-pill--forsamlingar {
  background-color: rgba(110, 96, 78, 0.20);
  border-color: rgba(154, 136, 110, 0.34);
}

.stat-pill--adjunkter {
  background-color: rgba(120, 110, 84, 0.26);
  border-color: rgba(178, 160, 118, 0.34);
}

.adjunkt-pill.prominent {
	font-weight: 700;
	background: rgba(255,255,255,0.24);
	border: 1px solid rgba(255,255,255,0.5);
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}

.adjunkt-pill.prominent.flash-plus {
	box-shadow: 0 0 0 3px rgba(100,255,140,0.75), 0 0 18px rgba(100,255,140,0.6);
	background: rgba(120,255,150,0.32);
	transform: scale(1.1);
}

.adjunkt-pill.prominent.flash-minus {
	box-shadow: 0 0 0 3px rgba(255,120,120,0.75), 0 0 18px rgba(255,120,120,0.6);
	background: rgba(255,120,120,0.28);
	transform: scale(1.1);
}

.muted {
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.86rem;
}

.uppdrag-empty {
	color: #666;
}

/* =========================================================
   Toasts
========================================================= */

#toast_container {
	position: fixed;
	top: 14px;
	right: 14px;
	z-index: var(--z-toast);
	display: flex;
	flex-direction: column;
	gap: 8px;
	pointer-events: none;
}

.toast {
	min-width: 240px;
	max-width: 360px;
	padding: 10px 12px;
	border-radius: 10px;
	color: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
	opacity: 1;
	transform: translateY(0);
}

.toast.info {
	background: rgba(45, 91, 177, 0.95);
}

.toast.error {
	background: rgba(170, 45, 45, 0.96);
}

.toast.warn {
	background: rgba(186, 120, 24, 0.96);
}

.toast.fade-out {
	opacity: 0;
	transform: translateY(-6px);
}

/* =========================================================
   Buttons / inputs
========================================================= */

button, button *, .stat-pill, a {
	cursor: pointer !important;
}

button[aria-disabled="true"],
.is-soft-locked {
	opacity: .55;
	cursor: not-allowed;
	filter: grayscale(.2);
}

button[aria-disabled="true"]:hover,
.is-soft-locked:hover {
	transform: none;
}

button,
select,
textarea {
	transition:
		background-color 0.15s ease,
		border-color 0.15s ease,
		transform 0.06s ease,
		box-shadow 0.15s ease,
		opacity 0.15s ease;
}

button:not(.help-btn):not(.news-sort-btn):not(.news-diocese-link),
select {
	border-radius: 9px;
	border: 1px solid var(--gold-border);
	background: linear-gradient(to bottom, var(--gold-bg-top), var(--gold-bg-bottom));
	color: var(--gold-text);
	padding: 7px 10px;
	font: inherit;
	line-height: 1.2;
	box-shadow:
		inset 0 1px 0 rgba(255,255,255,0.7),
		0 1px 2px rgba(0,0,0,0.08);
}

button:not(.help-btn):not(.news-sort-btn):not(.news-diocese-link):hover,
select:hover {
	border-color: #9f7f38;
	background: linear-gradient(to bottom, var(--gold-bg-top-hover), var(--gold-bg-bottom-hover));
}

button:not(.help-btn):not(.news-sort-btn):not(.news-diocese-link):active {
	transform: translateY(1px);
}

button:disabled,
select:disabled {
	opacity: 0.45;
	filter: grayscale(0.15);
}

textarea {
	border-radius: 10px;
	border: 1px solid #bbb;
	background: #fff;
	color: #222;
	font: inherit;
	padding: 8px 10px;
	box-sizing: border-box;
}

/* =========================================================
   Help / links / menu
========================================================= */

.help-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	min-width: 20px;
	padding: 0;
	margin-left: 2px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.38);
	background: rgba(255, 255, 255, 0.14);
	color: rgba(255, 255, 255, 0.92);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	box-shadow: none;
	vertical-align: middle;
}

.help-btn:hover {
	background: rgba(255, 255, 255, 0.24);
	border-color: rgba(255, 255, 255, 0.52);
}

.help-btn:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(255,255,255,0.22);
}

.stift-link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.menu-btn {
	width: 80px;
	height: 34px;
	min-width: 34px;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
}

/* =========================================================
   Modals
========================================================= */

#diocese_modal,
#help_modal,
#vicar_modal,
#church_meeting_modal,
#confirm_modal,
#news_modal,
#stift_info_modal,
#menu_modal {
	position: fixed;
	inset: 0;
	display: none !important;
	pointer-events: none !important;
	visibility: hidden;
}

#diocese_modal.open,
#help_modal.open,
#vicar_modal.open,
#church_meeting_modal.open,
#confirm_modal.open,
#news_modal.open,
#stift_info_modal.open,
#menu_modal.open {
	display: block !important;
	pointer-events: auto !important;
	visibility: visible;
}

#diocese_modal { z-index: var(--z-diocese-modal); }
#stift_info_modal { z-index: var(--z-stift-info-modal); }
#menu_modal { z-index: var(--z-menu-modal); }
#news_modal { z-index: var(--z-news-modal); }
#vicar_modal { z-index: var(--z-vicar-modal); }
#church_meeting_modal { z-index: var(--z-church-meeting-modal); }
#confirm_modal { z-index: var(--z-confirm-modal); }
#help_modal { z-index: var(--z-help-modal); }

.diocese-modal-backdrop,
.help-modal-backdrop,
.vicar-modal-backdrop,
.church-meeting-modal-backdrop,
.news-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	pointer-events: auto;
}

.diocese-modal-card,
.help-modal-card,
.vicar-modal-card,
.church-meeting-modal-card,
.news-modal-card {
	position: absolute;
	left: 50%;
	background: rgba(248, 248, 250, 0.97);
	border-radius: 18px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
	overflow: hidden;
}

.diocese-modal-card,
.help-modal-card,
.vicar-modal-card,
.church-meeting-modal-card {
	top: 50%;
	transform: translate(-50%, -50%);
}

.news-modal-card {
	top: 10%;
	bottom: 10%;
	transform: translateX(-50%);
	width: min(900px, calc(100vw - 40px));
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
	background: rgba(249, 247, 240, 0.98);
}

.diocese-modal-card {
	width: min(760px, calc(100vw - 40px));
	max-height: calc(100vh - 60px);
}

.help-modal-card,
.vicar-modal-card,
.church-meeting-modal-card {
	width: min(520px, calc(100vw - 40px));
}

.diocese-modal-header,
.help-modal-header,
.vicar-modal-header,
.church-meeting-modal-header,
.news-modal-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	border-bottom: 1px solid #d6d6d6;
}

.news-modal-header {
	border-bottom: 1px solid #d6c9a9;
	justify-content: space-between;
}

.diocese-modal-header h2,
.help-modal-header h2,
.vicar-modal-header h2,
.church-meeting-modal-header h2,
.news-modal-header h2 {
	margin: 0;
	font-size: 1.15rem;
}

.diocese-modal-header button,
.help-modal-header button,
.vicar-modal-header button,
.church-meeting-modal-header button,
.news-modal-header button {
	border: 1px solid #999;
	background: #fff;
	border-radius: 8px;
	padding: 6px 10px;
	font: inherit;
}

.diocese-modal-body,
.news-modal-body {
	padding: 16px 18px 18px;
	overflow-y: auto;
}

.diocese-modal-body {
	max-height: calc(100vh - 140px);
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.help-modal-body,
.vicar-modal-body,
.church-meeting-modal-body {
	padding: 18px;
	line-height: 1.5;
	color: #333;
}

.news-modal-body {
	max-height: calc(100vh - 140px);
	font-family: Georgia, serif;
	font-size: 1.05rem;
	line-height: 1.55;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    scroll-padding-bottom: 48px;
}

.close-btn {
	position: absolute;
	right: 10px;
}
/* =========================================================
	Invitation modal
========================================================= */
#invitation_modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: var(--z-invitation-modal);
}

#invitation_modal.open {
	display: block;
}

.invitation-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(24, 18, 10, .46);
	backdrop-filter: blur(2px);
}

.invitation-modal-card {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(620px, calc(100vw - 28px));
	max-height: min(86vh, 760px);
	overflow: auto;
	background: #fffaf0;
	border: 1px solid rgba(90, 70, 35, .35);
	border-radius: 22px;
	padding: 18px;
	box-shadow: 0 28px 80px rgba(0,0,0,.32);
	color: #2c2418;
}

.invitation-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.invitation-modal-body {
	white-space: pre-wrap;
	font-family: Georgia, serif;
	font-size: 1.02rem;
	line-height: 1.55;
}

.invitation-modal-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 16px;
}

/* =========================================================
   Diocese / vicar / meeting modal content
========================================================= */

.diocese-action-card {
	background: #fff;
	border: 1px solid #d8d8d8;
	border-radius: 12px;
	padding: 12px;
	overflow: visible;
}

.diocese-action-card h3 {
	margin: 0 0 8px;
	font-size: 1rem;
}

.diocese-inline-help {
	margin: 0 0 10px;
	font-size: 0.9rem;
	line-height: 1.4;
	color: #555;
}

.diocese-action-card p {
	margin: 0 0 10px;
	font-size: 0.92rem;
	line-height: 1.35;
	color: #444;
}

.diocese-action-card select {
	width: 100%;
	margin-top: 8px;
}

.diocese-action-card-actions {
	display: inline-block;
	direction: rtl;
	align-items: center;
}

.diocese-action-card .custom-dropdown {
	width: 97%;
	display: inline-block;
}

.diocese-action-card .field {
	width: 80%;
	display: inline-block;
}

#rename-diocese-input {
	width: 100%;
	height: 27px;
	border-radius: 10px;
}

.vicar-choice-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.vicar-choice-item {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	align-items: center;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 10px;
	background: #fff;
}

.vicar-choice-item.candidate-taken {
	opacity: 0.6;
}

.vicar-choice-text span {
	color: #555;
	font-size: 0.92rem;
}

.church-meeting-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.church-meeting-form label {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.church-meeting-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

/* =========================================================
   KT Nyheter knapp 
========================================================= */

.news-button {
	position: fixed;
	left: 446px;
	bottom: 12px;
	z-index: var(--z-news-button);
	display: block;
	width: 100px;
	height: 100px;
	padding: 0 !important;
	border-radius: 20px !important;
	border: 1px solid var(--gold-border);
	background: linear-gradient(to bottom, var(--gold-bg-top), var(--gold-bg-bottom));
	color: var(--gold-text);
	box-shadow:
		inset 0 1px 0 rgba(255,255,255,0.7),
		0 2px 6px rgba(0,0,0,0.12);
}

.news-button-icon {
	position: relative;
	transform: translateY(-50%) translateX(-50%);
	width: 100px;
	height: 100px;
	top: 50%;
	left: 50%;
	background-repeat: no-repeat;
	background-size: 100px 100px;
	background-image: url('/img/ikoner/KT.png');
}

/* =========================================================
   Nyhetsmodal huvudfönstret
========================================================= */

#news_modal {
	z-index: var(--z-news-modal);
}

.news-modal-card {
	top: 10%;
	bottom: 10%;
	transform: translateX(-50%);
	width: min(900px, calc(100vw - 40px));
	max-height: calc(100vh - 60px);
	background: rgba(249, 247, 240, 0.98);
}

.news-modal-header {
	border-bottom: 1px solid #d6c9a9;
	justify-content: space-between;
}

.news-modal-body {
	padding: 16px 18px 18px;
	overflow-y: auto;
	max-height: calc(100vh - 140px);
	font-family: Georgia, serif;
	font-size: 1.05rem;
	line-height: 1.55;
}

#close-news-modal-btn {
	top: 15px;
}

/* =========================================================
   Nyheter tabs
========================================================= */

.news-tabs {
	display: flex;
	gap: 8px;
	align-items: center;
	flex: 1 1 auto;
	justify-content: center;
	margin: 0 50px;
}

.news-tab-btn {
	border-radius: 10px 10px 0 0;
	padding: 8px 12px;
}

.news-tab-btn.active {
	background: rgba(255,255,255,0.92) !important;
	border-bottom-color: transparent !important;
}

/* =========================================================
   issue layout
========================================================= */

.news-issue {
	margin-bottom: 26px;
}

.news-issue-masthead {
	margin: 18px 0 14px;
	padding: 12px 10px;
	text-align: center;
	border-top: 3px double rgba(70, 50, 25, .45);
	border-bottom: 3px double rgba(70, 50, 25, .45);
	background: rgba(255, 250, 239, .72);
}

.news-issue-kicker {
	font-family: Georgia, serif;
	text-transform: uppercase;
	letter-spacing: .18em;
	font-size: .72rem;
	opacity: .72;
}

.news-issue-masthead h2 {
	margin: 2px 0 0;
	font-family: Georgia, serif;
	font-size: 1.55rem;
}

/* =========================================================
   Nyhetskort
========================================================= */

.news-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 12px;
}

.news-card {
	min-height: 132px;
	border-radius: 14px;
	background: rgba(255, 253, 246, .94);
	border: 1px solid rgba(90, 70, 35, .18);
	box-shadow: 0 8px 22px rgba(0,0,0,.08);
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease;
	color: #2b2418;
	overflow: hidden;
	padding: 0;
}
.news-card-content {
	padding: 0.95rem 1rem 1.05rem;
}
.news-card-image {
	width: 100%;
	height: 118px;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	border-bottom: 1px solid rgba(120, 90, 40, 0.18);
	position: relative;
}
.news-card.featured .news-card-image {
	height: 170px;
}

.news-card-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(
			to bottom,
			rgba(255, 255, 255, 0.02),
			rgba(0, 0, 0, 0.16)
		);
	pointer-events: none;
}

.news-card-image.has-real-image {
	background: none;
}

.news-card-image.has-real-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.news-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(0,0,0,.14);
}

.news-card.featured {
	grid-column: span 2;
	min-height: 190px;
}

.news-card::before {
	content: "";
	display: block;
	height: 70px;
	margin-bottom: 8px;
	border-radius: 10px;
	background:
		linear-gradient(135deg, rgba(120,95,55,.25), rgba(255,245,210,.8)),
		radial-gradient(circle at 30% 40%, rgba(80,60,35,.25), transparent 45%);
}

.news-card:nth-child(3n)::before {
	background:
		linear-gradient(135deg, rgba(80,95,110,.25), rgba(255,245,210,.8)),
		radial-gradient(circle at 70% 30%, rgba(90,70,35,.28), transparent 40%);
}

.news-card-kicker {
	font-size: .72rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	opacity: .65;
	margin-bottom: 6px;
}

.news-card h3 {
	font-family: Georgia, serif;
	font-size: 1.08rem;
	line-height: 1.1;
	margin: 0 0 8px;
}

.news-card.featured h3 {
	font-size: 1.45rem;
}

.news-card-preview {
	margin: 0;
	font-size: .88rem;
	line-height: 1.35;
	max-height: 4.1em;
	overflow: hidden;
	color: rgba(42, 32, 20, .82);
}

/* =========================================================
   enskilda nyheter popup
========================================================= */

.news-article-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: var(--z-article-modal);
}

.news-article-modal.open {
	display: block;
}

.news-article-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(24, 18, 10, .38);
	backdrop-filter: blur(2px);
}

.news-article-modal-card {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(620px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
	overflow: auto;
	background: #fffaf0;
	border: 1px solid rgba(90, 70, 35, .38);
	border-radius: 20px;
	padding: 18px 20px 22px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
	box-shadow: 0 26px 75px rgba(0,0,0,.32);
	color: #2c2418;
}

.news-article-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	border: 0;
	background: transparent;
	font-size: 1.35rem;
	cursor: pointer;
	z-index: 2;
}

.news-article-modal-meta {
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	opacity: .62;
	margin-bottom: 8px;
}

.news-article-modal-card h2 {
	font-family: Georgia, serif;
	font-size: 1.7rem;
	line-height: 1.1;
	margin: 0 32px 12px 0;
}

.news-article-modal-body {
	font-family: Georgia, serif;
	font-size: 1.04rem;
	line-height: 1.58;
	white-space: pre-wrap;
}

.news-article-modal-image {
	height: 300px;
	border-radius: 14px;
	margin: 0 0 14px;
	border: 1px solid rgba(90, 70, 35, .2);
	background-size: cover;
	background-position: center;
}

.news-img-meeting {
	background:
		linear-gradient(135deg, rgba(78,55,31,.55), rgba(245,224,165,.45)),
		radial-gradient(circle at 30% 45%, rgba(255,250,220,.75), transparent 20%),
		linear-gradient(90deg, rgba(70,50,30,.35), rgba(130,90,45,.25));
}

.news-img-map {
	background:
		linear-gradient(135deg, rgba(70,92,74,.45), rgba(236,220,170,.52)),
		radial-gradient(circle at 25% 45%, rgba(80,120,80,.55), transparent 20%),
		radial-gradient(circle at 70% 35%, rgba(140,100,55,.45), transparent 18%);
}

.news-img-pilgrim {
	background:
		linear-gradient(135deg, rgba(82,75,55,.5), rgba(245,235,190,.5)),
		linear-gradient(25deg, transparent 45%, rgba(80,55,35,.45) 46%, transparent 49%);
}

.news-img-media {
	background:
		linear-gradient(135deg, rgba(45,55,75,.55), rgba(240,225,180,.45)),
		repeating-linear-gradient(0deg, rgba(255,255,255,.18) 0 2px, transparent 2px 7px);
}

.news-img-church {
	background:
		linear-gradient(135deg, rgba(90,70,45,.55), rgba(250,235,190,.55)),
		radial-gradient(circle at 50% 20%, rgba(255,255,230,.8), transparent 16%);
}

.news-img-clergy {
	background:
		linear-gradient(135deg, rgba(60,63,68,.58), rgba(240,226,190,.45)),
		radial-gradient(circle at 50% 35%, rgba(255,255,245,.75), transparent 17%);
}

.news-img-letter {
	background:
		linear-gradient(135deg, rgba(126,96,54,.52), rgba(255,242,200,.5)),
		repeating-linear-gradient(135deg, rgba(255,255,255,.28) 0 3px, transparent 3px 11px);
}

/* ===============================================
   nyhetsbilder
================================================*/

.news-img-media {
    background-image: url('/img/nyheter/media_1.png');
}

.news-img-letter {
    background-image: url('/img/news/biskopsbrev.png');
}

.news-img-church {
    background-image: url('/img/news/kyrkbygge_1.png');
}

.news-img-clergy {
    background-image: url('/img/nyheter/adjunkter_1.png');
}

.news-img-meeting {
    background-image: url('/img/nyheter/kyrkomote_1.png');
}

.news-img-revival {
    background-image: url('/img/nyheter/vackelse_1.png');
}

.news-img-fire {
    background-image: url('/img/nyheter/brand_1.png');
}

.news-img-pilgrim {
    background-image: url('/img/nyheter/pilgrimsvandring_1.png');
}

/* =========================================================
   stiftsbilagan
========================================================= */

.news-diocese-table-wrap {
	overflow-x: auto;
}

.news-diocese-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.94rem;
}

.news-diocese-table th,
.news-diocese-table td {
	padding: 8px 10px;
	border-bottom: 1px solid #ddd2b5;
	text-align: left;
	vertical-align: top;
}

.news-sort-btn,
.news-diocese-link {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	font: inherit;
	cursor: pointer;
	text-align: left;
}

.news-sort-btn {
	color: inherit !important;
	font-weight: 700;
}

.news-diocese-link {
	color: #2b2418 !important;
	text-decoration: underline;
	font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

@media (max-width: 760px) {
	.news-card.featured {
		grid-column: span 1;
	}

	.news-card.featured h3 {
		font-size: 1.08rem;
	}

	.news-article-modal-card {
		width: calc(100vw - 24px);
		max-height: 86vh;
	}
}

/* =========================================================
   Fly token
========================================================= */

.fly-token {
	position: fixed;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #fff7da 0%, #d8b96e 70%, #9f7f38 100%);
	box-shadow: 0 0 10px rgba(184, 154, 87, 0.45);
	pointer-events: none;
	z-index: var(--z-fly-token);
}

/* =========================================================
   Custom dropdown
========================================================= */

.custom-dropdown {
	position: relative;
	width: 100%;
	margin-top: 8px;
}

.custom-dropdown-trigger {
	width: 100%;
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	text-align: left;
}

.custom-dropdown-label {
	min-width: 0;
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.custom-dropdown-label.is-placeholder {
	color: #7a6b4c;
	opacity: 0.9;
}

.custom-dropdown-arrow {
	flex: 0 0 auto;
	font-size: 0.9rem;
	line-height: 1;
}

.custom-dropdown-menu {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 4px);
	display: none;
	max-height: 220px;
	overflow-y: auto;
	z-index: 980;
	background: rgba(248, 248, 250, 0.98);
	border: 1px solid #cdb57a;
	border-radius: 10px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
	padding: 4px;
}

.custom-dropdown.open .custom-dropdown-menu {
	display: block;
}

.custom-dropdown.open .custom-dropdown-arrow {
	transform: rotate(180deg);
}

.custom-dropdown-option {
	display: block;
	width: 100%;
	border: 0;
	background: transparent;
	color: #2b2418;
	text-align: left;
	padding: 8px 10px;
	border-radius: 8px;
	font: inherit;
	line-height: 1.25;
	cursor: pointer;
}

.custom-dropdown-option:hover,
.custom-dropdown-option:focus {
	background: rgba(184, 154, 87, 0.16);
	outline: none;
}

.custom-dropdown-option.is-selected {
	background: rgba(184, 154, 87, 0.24);
	font-weight: 600;
}

/* =========================================================
   Mobil - gömt
========================================================= */

#mobile_panel_backdrop,
#mobile_handlingsfalt_toggle,
#mobile_stift_toggle,
#mobile_login_toggle,
.mobile-panel-close {
	display: none;
}

/* =========================================================
   Mobil
========================================================= */

#mobile_map_modes_toggle,
#mobile_map_modes_overlay {
	display: none;
}

@media (max-width: 900px) {
	#stift_panel {
		width: min(360px, calc(100vw - 20px));
	}
	.korstag-handlingsfalt {
		width: min(360px, calc(100vw - 20px));
	}
	.diocese-modal-body {
		grid-template-columns: 1fr;
	}
	.news-modal-header {
		flex-wrap: wrap;
		justify-content: flex-start;
	}
	.news-tabs {
		order: 3;
		width: 100%;
		justify-content: flex-start;
		margin-top: 4px;
	}
	/* ---- Backdrop ---- */
	#mobile_panel_backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,0.28);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.2s ease;
		z-index: 920;
	}

	body.mobile-any-panel-open #mobile_panel_backdrop {
		opacity: 1;
		pointer-events: auto;
	}

	/* ---- Toggle buttons ---- */

	body.logged-in #mobile_handlingsfalt_toggle,
	body.logged-in #mobile_stift_toggle,
	body.logged-out #mobile_login_toggle {
		display: flex;
	}

	.mobile-panel-toggle {
		position: fixed;
		background: rgba(32, 40, 58, 0.92);
		color: #fff;
		border: none;
		box-shadow: 0 6px 18px rgba(0,0,0,0.25);
		cursor: pointer;
		z-index: 915;
	}

	#mobile_handlingsfalt_toggle {
		left: 0;
		top: 50%;
		transform: translateY(-50%);
		width: 34px;
		height: 170px;
		border-radius: 0 16px 16px 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 8px;
	}

	#mobile_handlingsfalt_toggle .mobile-toggle-label {
		writing-mode: vertical-rl;
		transform: rotate(180deg);
		font-size: 11px;
		line-height: 1;
		opacity: 0.95;
	}

	#mobile_handlingsfalt_toggle .mobile-toggle-arrow {
		font-size: 18px;
		line-height: 1;
	}

	#mobile_stift_toggle {
		left: 0;
		bottom: 0;
		width: 55px;
		height: 55px;
		border-radius: 0 25px 0 0;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-end;
		padding: 8px 8px 10px 10px;
		z-index: 705;
	}

	#mobile_stift_toggle .mobile-toggle-arrow {
		font-size: 15px;
		line-height: 1;
        margin: 0 0 0px 16px;
	}

	#mobile_stift_toggle .mobile-toggle-corner-label {
		font-size: 10px;
		line-height: 1;
        margin: 0 0 10px 0;
	}

	#mobile_login_show {
		left: 0px;
		top: 40%;
		transform: translateY(-50%);
		width: 30px;
		height: 118px;
		border-radius: 0 14px 14px 0;
		align-items: center;
		justify-content: center;
		z-index: 917;
	}
	#mobile_login_hide {
		left: 300px;
		top: var(--handlings-top-gap);
		width: 30px;
		height: 80px;
		border-radius: 0 14px 0 14px;
		align-items: center;
		justify-content: center;
		z-index: 945;
	}
	body.mobile-login-collapsed #mobile_login_hide, body:not(.mobile-login-collapsed) #mobile_login_show, body.logged-in #mobile_login_hide {
		display: none;
	}
	body:not(.logged-in):not(.mobile-login-collapsed) #mobile_login_hide, body.mobile-login-collapsed #mobile_login_show {
		display: flex;
	}
	#mobile_login_toggle .mobile-toggle-arrow {
		font-size: 18px;
		line-height: 1;
	}

	/* ---- Close buttons inside panels ---- */

	.mobile-panel-close {
		position: absolute;
		top: 10px;
		right: 10px;
		width: 34px;
		height: 34px;
		border: none;
		border-radius: 999px;
		background: rgba(0,0,0,0.18);
		color: #fff;
		align-items: center;
		justify-content: center;
		z-index: 2;
		cursor: pointer;
	}

	body.logged-in.mobile-handlingsfalt-open #handlingsfalt > .mobile-panel-close,
	body.logged-in.mobile-stift-open #stift_panel > .mobile-panel-close,
	body.logged-out #handlingsfalt > .mobile-panel-close {
		display: inline-flex;
	}

	/* ---- Utloggad - loginpanelen ---- */

	body.logged-out #mobile_handlingsfalt_toggle,
	body.logged-out #mobile_stift_toggle {
		display: none !important;
	}

	body.logged-out #handlingsfalt {
		position: fixed;
		left: 0;
		bottom: auto;
		max-height: calc(100vh - 24px);
		transform: translateX(0);
		transition: transform 0.22s ease;
	}

	body.logged-out.mobile-login-collapsed #handlingsfalt {
		transform: translateX(-102%);
	}

	/* ---- Inloggad: handlingsfält ---- */

	body.logged-in #handlingsfalt {
		position: fixed;
		left: 0;
		bottom: 0;
		width: min(86vw, 420px);
		max-width: 420px;
		transform: translateX(-102%);
		transition: transform 0.22s ease;
		overflow-y: auto;
/*		padding-top: 52px; /* Plats för X-knapp överst */
	}

	body.logged-in.mobile-handlingsfalt-open #handlingsfalt {
		transform: translateX(0);
	}

	body.logged-in.mobile-handlingsfalt-open #mobile_handlingsfalt_toggle {
		display: none !important;
	}

	/* ---- Inloggad: stiftpanel ---- */

	body.logged-in #stift_panel {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		width: auto;
		height: auto;
		min-height: 0;
		max-height: 62vh;
		transform: translateY(102%);
		transition: transform 0.22s ease;
		overflow-y: auto;
		padding: 18px 16px 16px;
		border-radius: 18px 18px 0 0;
		z-index: 942;
	}

	body.mobile-stift-open #stift_panel {
		transform: translateY(0);
	}

	body.mobile-stift-open #news_button,
	body.mobile-stift-open #kartknappar {
		opacity: 0;
		pointer-events: none;
	}

	/* ---- Uppdragspanel mobil ---- */

	#uppdrag_panel {
		top: auto;
		bottom: 120px;
		right: 0;
		transform: none;
		max-height: 62vh;
		min-height: 76px;
		z-index: 930;
	}

	#uppdrag_panel.expanded {
		width: min(88vw, 340px);
	}

	#uppdrag_panel_inner {
		min-width: 260px;
	}

	.uppdrag-list {
		max-height: calc(62vh - 130px);
	}
	
	#toggle-uppdrag-btn{
		margin-right:135px;
	}

	/* ---- En panel öppnas, övriga stängs ---- */

	body.mobile-uppdrag-open #handlingsfalt {
		transform: translateX(-102%);
	}

	body.mobile-uppdrag-open #stift_panel {
		transform: translateY(102%);
	}

	body.mobile-stift-open #mobile_handlingsfalt_toggle {
		opacity: 0;
		pointer-events: none;
	}

	/* stiftknappen ska hamna under handlingsfältet om handlingsfältet är öppet */
	body.mobile-handlingsfalt-open #mobile_stift_toggle {
		z-index: 931;
	}

	/* ---- KT knapp position i mobilläge ---- */
	.news-button {
		left: 70px;
		right: auto;
		bottom: -45px;
		top: auto;
		z-index: 660;
	}

	body.mobile-stift-open #news_button {
		opacity: 0;
		pointer-events: none;
	}
/* =========================================================
   Mobil: kartlägesknapp + overlay
========================================================= */

	/* Dölj vanliga kartknappar på mobil */
	#kartknappar {
		display: none !important;
	}

	/* En enda knapp nere till höger */
	#mobile_map_modes_toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		position: fixed;
		right: 12px;
		bottom: 12px;
		width: 52px;
		height: 52px;
		border-radius: 14px;
		border: none;
		background: rgba(32, 40, 58, 0.92);
		color: #fff;
		box-shadow: 0 6px 18px rgba(0,0,0,0.25);
		cursor: pointer;
		z-index: 710;
		font-size: 22px;
		line-height: 1;
	}

	/* Om stiftspanelen är framme kan även denna döljas */
	body.mobile-stift-open #mobile_map_modes_toggle {
		opacity: 0;
		pointer-events: none;
	}

	#mobile_map_modes_overlay {
		position: fixed;
		inset: 0;
		z-index: var(--z-map-modes-modal);
	}

	body.mobile-map-modes-open #mobile_map_modes_overlay {
		display: block;
	}

	.mobile-map-modes-backdrop {
		position: absolute;
		inset: 0;
		background: rgba(0,0,0,0.38);
		backdrop-filter: blur(2px);
	}

	.mobile-map-modes-card {
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		width: min(320px, calc(100vw - 28px));
		background: rgba(248,248,250,0.98);
		border-radius: 18px;
		box-shadow: 0 12px 32px rgba(0,0,0,0.28);
		padding: 14px;
	}

	.mobile-map-modes-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
		margin-bottom: 12px;
	}

	.mobile-map-modes-header h3 {
		margin: 0;
		font-size: 1.05rem;
		color: #222;
	}

	#mobile_map_modes_close {
		border: 1px solid #999;
		background: #fff;
		border-radius: 8px;
		padding: 6px 10px;
		font: inherit;
	}

	.mobile-map-modes-grid {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	.mobile-map-mode-btn {
		min-height: 48px;
		border-radius: 12px;
		font-size: 0.95rem;
		font-weight: 600;
	}

	.mobile-map-mode-btn.active-mode {
		background: rgba(80, 80, 80, 0.96) !important;
		color: #fff;
		border-color: #3a3a3a !important;
	}
}


/* Knappar ikoner */
#kartknappar button div, .mobile-map-modes-grid button div{
	position: relative;
    transform: translateY(-50%) translateX(-50%);
    width: 30px;
    height: 30px;
    top: 50%;
    left: 50%;
    background-repeat: no-repeat;
    background-size: 30px 30px;
}
#st-btn div, .st-btn div { background-image:url('/img/ikoner/mi.png'); }
#sc-btn div, .sc-btn div { background-image:url('/img/ikoner/av.png'); }
#pr-btn div, .pr-btn div { background-image:url('/img/ikoner/pr.png'); }
#kb-btn div, .kb-btn div { background-image:url('/img/ikoner/ky.png'); }
#me-btn div, .me-btn div { background-image:url('/img/ikoner/me.png'); }
#ti-btn div, .ti-btn div { background-image:url('/img/ikoner/an.png'); }


/* admin */
#admin_modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-admin-modal);
}

#admin_modal.open {
    display: block;
}

#admin_modal .help-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 18, 10, .42);
    backdrop-filter: blur(2px);
}

#admin_modal .help-modal-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(980px, calc(100vw - 32px));
    max-height: min(88vh, 860px);
    overflow: auto;
    background: rgba(255, 250, 239, .97);
    border: 1px solid rgba(139, 119, 80, .65);
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 24px 70px rgba(0,0,0,.28);
    color: #2c2418;
}
#admin_modal form label{
	display: inline-block;
}

/* Dölj/visa-knappar – lite mörkare/gråare än vanliga knappar */

#mobile_handlingsfalt_toggle,
#mobile_stift_toggle,
#mobile_login_toggle,
.uppdrag-corner-toggle,
.mobile-panel-close,
#mobile_map_modes_toggle {
	background: linear-gradient(
		to bottom,
		rgba(220,220,222,0.96),
		rgba(176,176,180,0.94)
	) !important;

	color: #2b2418 !important;
	border: 1px solid rgba(120,120,126,0.55) !important;

	box-shadow:
		inset 0 1px 0 rgba(255,255,255,0.55),
		0 2px 6px rgba(0,0,0,0.18);
}

/* Hover */
#mobile_handlingsfalt_toggle:hover,
#mobile_stift_toggle:hover,
#mobile_login_toggle:hover,
.uppdrag-corner-toggle:hover,
.mobile-panel-close:hover,
#mobile_map_modes_toggle:hover {
	background: linear-gradient(
		to bottom,
		rgba(232,232,234,0.98),
		rgba(188,188,192,0.96)
	) !important;
}

/* Aktivt klick */
#mobile_handlingsfalt_toggle:active,
#mobile_stift_toggle:active,
#mobile_login_toggle:active,
.uppdrag-corner-toggle:active,
.mobile-panel-close:active,
#mobile_map_modes_toggle:active {
	background: linear-gradient(
		to bottom,
		rgba(170,170,174,0.96),
		rgba(150,150,154,0.94)
	) !important;
}

/* =========================================================
   Stiftsbilaga – svag stiftsbakgrund utan panelkant
========================================================= */

.news-feed--stift {
    background:
        linear-gradient(
            180deg,
            var(--stift-tint),
            rgba(255,255,255,0.50)
        );
    border: 0;
    border-radius: 0;
    padding: 12px;
}

.news-feed--stift .news-issue {
    background: transparent;
}

.news-feed--stift .news-card {
    background: rgba(255,255,255,0.76);
    border-left: 4px solid color-mix(in srgb, var(--stift-color) 45%, transparent);
}

/* =========================================================
   Stiftssidor – stiftstabell
========================================================= */

.news-diocese-row {
    background:
        linear-gradient(
            90deg,
            var(--stift-tint),
            rgba(255,255,255,0.02) 58%
        );
}

.news-diocese-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.diocese-color-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    background: var(--stift-color);
    border: 1px solid var(--stift-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.20);
    flex: 0 0 auto;
}

.news-diocese-table tfoot td {
    border-top: 2px solid rgba(0,0,0,0.22);
    background: rgba(255,255,255,0.72);
    font-weight: 700;
}

/* =========================================================
   Stiftssidor – detaljvy
========================================================= */

.news-diocese-detail-view {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.news-diocese-detail-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 2px;
}

.news-diocese-info-card {
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

.news-diocese-info-card--themed {
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--stift-tint) 100%, rgba(255,255,255,0.70)),
            rgba(255,255,255,0.86)
        );
    border-top: 7px solid var(--stift-border);
    box-shadow:
        0 6px 18px rgba(0,0,0,0.10),
        inset 0 0 0 1px color-mix(in srgb, var(--stift-color) 22%, transparent);
}

.news-diocese-info-card .news-card-kicker {
    color: var(--stift-border);
    font-weight: 700;
}

.news-diocese-info-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.news-diocese-info-heading h3 {
    margin: 0;
    line-height: 1.15;
}

.news-diocese-heading-pills {
    justify-content: flex-end;
    max-width: 420px;
    margin: 0;
}

.news-diocese-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 7px 18px;
    margin: 10px 0 0;
}

.news-diocese-info-grid p {
    margin: 0.2rem 0;
}

.diocese-empty-news {
    opacity: 0.75;
    margin: 0.5rem 0 0;
}

@media (max-width: 900px) {
    .news-diocese-info-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 620px) {
    .news-diocese-info-heading {
        display: block;
    }

    .news-diocese-heading-pills {
        justify-content: flex-start;
        max-width: none;
        margin-top: 10px;
    }

    .news-diocese-info-grid {
        grid-template-columns: 1fr;
    }
}


/* Detaljvyn för valt stift använder det valda stiftets färg,
   inte spelarens eget stift. Tabellvyn neutral. */
.news-diocese-body--themed {
    background:
        linear-gradient(
            180deg,
            var(--stift-tint),
            rgba(255,255,255,0.50)
        );
}

.diocese-news-slot--themed .news-card {
    background: rgba(255,255,255,0.78);
    border-left: 4px solid color-mix(in srgb, var(--stift-color) 50%, transparent);
}

.diocese-news-slot--themed .news-card-kicker {
    color: var(--stift-border);
}


