/*
 * Stageticker Marketplace – Frontend
 *
 * Gestaltung angelehnt an /pressemitteilungen/ (Presseportal): halbtransparentes dunkles Panel,
 * helle Karten, Ghost-Buttons, Radius 5 px. Alle Werte sind als CSS-Variablen anpassbar, z. B.
 * im Child-Theme:  .stm { --stm-radius: 0; }
 *
 * Alle Regeln sind unter .stm gekapselt und beeinflussen das Theme nicht.
 */

.stm {
	/* Schrift */
	--stm-font: "Questrial", Arial, Helvetica, sans-serif;
	--stm-font-size: 15px;
	--stm-line-height: 1.6;

	/* Panel (dunkel, halbtransparent) */
	--stm-panel-max-width: 1120px;
	--stm-panel-bg: linear-gradient(180deg, rgba(0, 0, 0, 0.52) 0%, rgba(0, 0, 0, 0.44) 100%);
	--stm-panel-border: rgba(255, 255, 255, 0.1);
	--stm-panel-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
	--stm-radius: 5px;
	--stm-divider: rgba(255, 255, 255, 0.08);

	/* Text auf dunklem Grund */
	--stm-text: #eef3fb;
	--stm-text-muted: #c7d0dc;
	--stm-text-subtle: #aeb8c7;
	--stm-kicker: #d9e3f1;
	--stm-link: #ffffff;

	/* Linien, Buttons, Eingabefelder */
	--stm-line: rgba(255, 255, 255, 0.34);
	--stm-btn-height: 48px;
	--stm-btn-font-size: 13px;
	--stm-btn-hover-bg: #ffffff;
	--stm-btn-hover-text: #000000;
	--stm-input-bg: rgba(0, 0, 0, 0.18);
	--stm-placeholder: #8f9db0;
	--stm-focus: #ffffff;

	/* Helle Karten */
	--stm-card-bg: rgba(253, 253, 251, 0.96);
	--stm-card-border: rgba(22, 28, 37, 0.12);
	--stm-card-border-hover: rgba(22, 28, 37, 0.22);
	--stm-card-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
	--stm-card-title: #141a22;
	--stm-card-text: #2d3643;
	--stm-card-meta: #4f5a68;
	--stm-card-prefix: #6a7686;

	/* Flächen */
	--stm-surface: rgba(255, 255, 255, 0.03);

	/* Typ-Badges (Farben aus der Theme-Palette) */
	--stm-badge-sale: #2d3643;
	--stm-badge-rent: #2b32ff;
	--stm-badge-wanted: #c8103a;
	--stm-badge-free: #1f6b2f;

	/* Häuserübersicht: registrierte Häuser dezent grün, Zahlen der Angebote (grün) und Gesuche (rot) */
	--stm-house-registered-bg: rgba(56, 176, 96, 0.16);
	--stm-house-registered-border: rgba(98, 196, 128, 0.42);
	--stm-house-registered-text: #e3f7e8;
	--stm-count-offers: #1e7b3d;
	--stm-count-wanted: #c8103a;

	/* Hinweise */
	--stm-success-bg: rgba(7, 26, 14, 0.48);
	--stm-success-border: rgba(30, 74, 42, 0.88);
	--stm-success-text: #a9e0b4;
	--stm-error-bg: rgba(35, 11, 15, 0.5);
	--stm-error-border: rgba(90, 43, 48, 0.88);
	--stm-error-text: #f0b9bf;
	--stm-warning-bg: rgba(34, 25, 8, 0.52);
	--stm-warning-border: rgba(91, 74, 34, 0.88);
	--stm-warning-text: #f1d892;
	--stm-info-bg: rgba(255, 255, 255, 0.03);
	--stm-info-border: rgba(255, 255, 255, 0.1);
	--stm-info-text: #dbe4f1;

	--stm-transition: 0.18s ease;

	font-family: var(--stm-font);
	font-size: var(--stm-font-size);
	line-height: var(--stm-line-height);
	color: var(--stm-text);
}

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

/* ------------------------------------------------------------------ Hülle */

.stm-shell {
	padding: 14px 10px 26px;
}

.stm-shell--dark {
	background: #000;
}

.stm-panel {
	/* Layout richtet sich nach der Panelbreite, nicht nach dem Fenster (WPBakery-Spalten, Theme-Container). */
	container-type: inline-size;
	container-name: stm-panel;
	max-width: var(--stm-panel-max-width);
	margin: 0 auto;
	background: var(--stm-panel-bg);
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	box-shadow: var(--stm-panel-shadow);
	overflow: hidden;
}

.stm-head {
	padding: 26px 20px 20px;
	border-bottom: 1px solid var(--stm-divider);
}

.stm-kicker {
	margin: 0 0 12px;
	font-size: 22px;
	line-height: 1.2;
	letter-spacing: 0.01em;
	color: var(--stm-kicker);
}

/* Questrial hat nur einen Schnitt; das Fett wird synthetisiert – daher keine enge Laufweite. */
.stm .stm-headline {
	margin: 0;
	padding: 0;
	font-family: var(--stm-font);
	font-size: clamp(22px, 2.4vw, 30px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0;
	text-transform: none;
	color: #fff;
}

.stm-subline {
	max-width: 760px;
	margin: 12px 0 0;
	font-size: 15px;
	line-height: 1.65;
	color: var(--stm-text-muted);
}

.stm-body {
	padding: 22px 20px 30px;
}

/* ------------------------------------------------------------- Navigation */

/* Schmal: zwei Spalten, damit die Navigation nicht den halben Bildschirm füllt. */
.stm-nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 0 0 24px;
}

.stm-nav__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 40px;
	padding: 0 10px;
	text-align: center;
	border: 1px solid var(--stm-line);
	border-radius: var(--stm-radius);
	background: transparent;
	color: var(--stm-text);
	font-weight: 600;
	text-decoration: none;
	transition: background var(--stm-transition), color var(--stm-transition), border-color var(--stm-transition);
}

.stm .stm-nav__link:hover,
.stm .stm-nav__link.is-current {
	background: var(--stm-btn-hover-bg);
	border-color: var(--stm-btn-hover-bg);
	color: var(--stm-btn-hover-text);
}

/* ---------------------------------------------------------------- Buttons */

.stm-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 24px;
}

.stm .stm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: var(--stm-btn-height);
	padding: 0 22px;
	border: 1px solid var(--stm-line);
	border-radius: var(--stm-radius);
	background: transparent;
	color: var(--stm-text);
	font-family: var(--stm-font);
	font-size: var(--stm-btn-font-size);
	font-weight: 500;
	letter-spacing: 0.03em;
	line-height: 1.2;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background var(--stm-transition), color var(--stm-transition), border-color var(--stm-transition);
}

.stm .stm-btn:hover {
	background: var(--stm-btn-hover-bg);
	border-color: var(--stm-btn-hover-bg);
	color: var(--stm-btn-hover-text);
}

.stm .stm-btn--primary {
	background: var(--stm-btn-hover-bg);
	border-color: var(--stm-btn-hover-bg);
	color: var(--stm-btn-hover-text);
}

.stm .stm-btn--primary:hover {
	background: transparent;
	border-color: var(--stm-line);
	color: var(--stm-text);
}

.stm .stm-btn--danger {
	border-color: var(--stm-error-border);
	color: var(--stm-error-text);
}

.stm .stm-btn[disabled],
.stm .stm-btn[aria-disabled="true"] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ---------------------------------------------------------------- Formulare */

.stm-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px;
}

.stm-field {
	margin: 0;
}

.stm-label {
	display: block;
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 700;
	color: var(--stm-text);
}

.stm-required {
	color: var(--stm-warning-text);
}

.stm .stm-input,
.stm .stm-select,
.stm .stm-textarea {
	display: block;
	width: 100%;
	min-height: var(--stm-btn-height);
	margin: 0;
	padding: 10px 14px;
	border: 1px solid var(--stm-line);
	border-radius: var(--stm-radius);
	background: var(--stm-input-bg);
	color: #fff;
	font-family: var(--stm-font);
	font-size: 15px;
	line-height: 1.3;
	box-shadow: none;
}

.stm .stm-textarea {
	min-height: 160px;
	resize: vertical;
}

.stm .stm-select option {
	color: #000;
}

.stm .stm-input::placeholder,
.stm .stm-textarea::placeholder {
	color: var(--stm-placeholder);
	opacity: 1;
}

.stm .stm-input[aria-invalid="true"],
.stm .stm-select[aria-invalid="true"],
.stm .stm-textarea[aria-invalid="true"] {
	border-color: var(--stm-error-text);
}

.stm-help {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--stm-text-subtle);
}

.stm-field-error {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	color: var(--stm-error-text);
}

.stm-counter {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	text-align: right;
	color: var(--stm-text-subtle);
}

.stm-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	line-height: 1.5;
}

/* Mehrere Auswahlfelder untereinander: genug Abstand für Finger (WCAG 2.5.8). */
.stm-checkbox + .stm-checkbox {
	margin-top: 8px;
}

.stm .stm-checkbox input {
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	flex: 0 0 auto;
	accent-color: #fff;
}

/* Honeypot: für Menschen unsichtbar, für Screenreader ausgeblendet. */
.stm-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------------------------------------------------------------- Hinweise */

.stm-notice {
	margin: 0 0 18px;
	padding: 14px 16px;
	border: 1px solid var(--stm-info-border);
	border-radius: var(--stm-radius);
	background: var(--stm-info-bg);
	color: var(--stm-info-text);
	line-height: 1.55;
}

.stm-notice--success {
	border-color: var(--stm-success-border);
	background: var(--stm-success-bg);
	color: var(--stm-success-text);
}

.stm-notice--error {
	border-color: var(--stm-error-border);
	background: var(--stm-error-bg);
	color: var(--stm-error-text);
}

.stm-notice--warning {
	border-color: var(--stm-warning-border);
	background: var(--stm-warning-bg);
	color: var(--stm-warning-text);
}

.stm-empty {
	padding: 14px 16px;
	border: 1px solid var(--stm-info-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
	color: var(--stm-info-text);
}

.stm-empty p {
	margin: 0;
}

.stm-empty p + p {
	margin-top: 10px;
}

.stm-empty__debug {
	font-size: 13px;
	color: var(--stm-text-subtle);
}

/* ------------------------------------------------------- Suche & Ergebnisse */

.stm-filter-row {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 12px;
	margin: 0 0 14px;
}

.stm-filter-row .stm-input {
	flex: 1 1 360px;
}

.stm-filter-row .stm-btn {
	width: 100%;
}

.stm-results-bar {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	margin: 0 0 14px;
	padding: 12px 14px;
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
	color: var(--stm-text);
}

.stm-results-count {
	font-weight: 700;
}

/* ------------------------------------------------------------------ Karten */

.stm-list {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.stm-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 18px 20px;
	border: 1px solid var(--stm-card-border);
	border-radius: var(--stm-radius);
	background: var(--stm-card-bg);
	box-shadow: var(--stm-card-shadow);
	color: var(--stm-card-text);
	transition: border-color var(--stm-transition), transform var(--stm-transition);
}

.stm-card:hover,
.stm-card:focus-within {
	border-color: var(--stm-card-border-hover);
	transform: translateY(-1px);
}

.stm-card__media {
	flex: 0 0 auto;
	overflow: hidden;
	border-radius: var(--stm-radius);
	background: #e9ecf1;
	aspect-ratio: 4 / 3;
}

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

.stm .stm-card__title {
	margin: 0 0 9px;
	font-family: var(--stm-font);
	font-size: 19px;
	font-weight: 700;
	line-height: 1.24;
	letter-spacing: 0;
	text-transform: none;
	color: var(--stm-card-title);
}

.stm .stm-card__link {
	color: inherit;
	text-decoration: none;
}

/* Gesamte Karte klickbar, ohne verschachtelte Links. */
.stm .stm-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.stm-card__meta {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--stm-card-meta);
}

.stm-card__prefix {
	color: var(--stm-card-prefix);
}

.stm-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border: 1px solid currentcolor;
	border-radius: var(--stm-radius);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--stm-badge-sale);
}

.stm-badge--verleih { color: var(--stm-badge-rent); }
.stm-badge--gesuch { color: var(--stm-badge-wanted); }
.stm-badge--verschenken { color: var(--stm-badge-free); }

/* -------------------------------------------------------------- Pagination */

.stm-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 24px;
}

.stm .stm-pagination a,
.stm .stm-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--stm-line);
	border-radius: var(--stm-radius);
	color: var(--stm-text);
	text-decoration: none;
}

.stm .stm-pagination a:hover,
.stm .stm-pagination .is-current {
	background: var(--stm-btn-hover-bg);
	border-color: var(--stm-btn-hover-bg);
	color: var(--stm-btn-hover-text);
}

/* ---------------------------------------------------------------- Landing */

.stm-landing__intro {
	max-width: 760px;
	font-size: 16px;
	line-height: 1.65;
	color: var(--stm-text-muted);
}

.stm-landing__intro p {
	margin: 0 0 14px;
}

.stm-landing__intro p:first-child {
	font-size: 18px;
	color: var(--stm-text);
}

.stm .stm-landing__actions {
	margin-top: 18px;
}

.stm-landing__figures {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	margin: 30px 0 0;
}

/* Zahl über der Beschriftung, in der Reihenfolge des Quelltexts bleibt die Beschriftung vorn. */
.stm-landing__figure {
	display: flex;
	flex-direction: column-reverse;
	gap: 2px;
	padding: 16px 18px;
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
}

.stm-landing__figure dt {
	font-size: 14px;
	color: var(--stm-text-muted);
}

.stm-landing__figure dd {
	margin: 0;
	font-size: 30px;
	font-weight: 700;
	line-height: 1.15;
	color: #fff;
}

.stm-landing__section {
	margin-top: 34px;
}

.stm-landing__features,
.stm-landing__steps {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.stm-landing__features li {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px;
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
}

.stm-landing__icon {
	margin-bottom: 4px;
	color: var(--stm-kicker);
}

.stm-landing__features strong,
.stm-landing__steps strong {
	display: block;
	color: #fff;
}

.stm-landing__features span,
.stm-landing__steps span {
	font-size: 14px;
	color: var(--stm-text-muted);
}

.stm-landing__steps {
	counter-reset: stm-step;
}

.stm-landing__steps li {
	position: relative;
	min-height: 40px;
	padding: 6px 0 0 54px;
	counter-increment: stm-step;
}

/* Die Nummer liest ein Screenreader schon aus der Liste vor; „/ ''“ verbirgt die Kopie. */
.stm-landing__steps li::before {
	content: counter(stm-step);
	content: counter(stm-step) / "";
	position: absolute;
	top: 0;
	left: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--stm-line);
	border-radius: 50%;
	font-weight: 700;
	color: #fff;
}

.stm-landing__cta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	margin-top: 34px;
	padding: 22px;
	border: 1px solid var(--stm-line);
	border-radius: var(--stm-radius);
	background: rgba(255, 255, 255, 0.04);
}

.stm-landing__cta p {
	margin: 0;
}

.stm .stm-landing__cta-title {
	font-size: 20px;
	font-weight: 700;
	color: #fff;
}

.stm .stm-landing__cta-text {
	margin-top: 6px;
	color: var(--stm-text-muted);
}

/* Teilen-Buttons (z. B. Shariff) nur auf der Landingpage. */
.stm-closed-area .shariff {
	display: none !important;
}

/* ---------------------------------------------------------- Barrierefreiheit */

.stm a:focus-visible,
.stm button:focus-visible,
.stm input:focus-visible,
.stm select:focus-visible,
.stm textarea:focus-visible,
.stm [tabindex]:focus-visible {
	outline: 2px solid var(--stm-focus);
	outline-offset: 2px;
}

.stm .stm-card__link:focus-visible {
	outline: none;
}

.stm .stm-card__link:focus-visible::after {
	outline: 2px solid var(--stm-card-title);
	outline-offset: 2px;
	border-radius: var(--stm-radius);
}

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

@media (prefers-reduced-motion: reduce) {
	.stm *,
	.stm *::before,
	.stm *::after {
		transition: none !important;
		animation: none !important;
	}

	.stm-card:hover,
	.stm-card:focus-within {
		transform: none;
	}
}

/* ------------------------------------------------- Größere Bildschirme */

/* Außenabstand der Hülle hängt vom Fenster ab … */
@media (min-width: 641px) {
	.stm-shell {
		padding: 28px 16px 40px;
	}
}

/* … alles im Panel von dessen Breite (Container Queries). */
@container stm-panel (min-width: 560px) {
	.stm-kicker {
		font-size: 24px;
	}

	.stm-nav {
		display: flex;
		flex-wrap: wrap;
		gap: 10px;
	}

	.stm-nav__link {
		width: auto;
		padding: 0 16px;
	}

	.stm-filter-row .stm-btn {
		width: auto;
		min-width: 180px;
	}

	.stm-results-bar {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.stm .stm-card__title {
		font-size: 24px;
	}
}

@container stm-panel (min-width: 760px) {
	.stm-head {
		padding: 34px 36px 26px;
	}

	.stm-body {
		padding: 28px 36px 36px;
	}

	.stm-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.stm-grid .stm-field--full {
		grid-column: 1 / -1;
	}

	.stm-card {
		flex-direction: row;
		align-items: flex-start;
	}

	.stm-card__media {
		width: 220px;
	}

	.stm-card__body {
		flex: 1 1 auto;
		min-width: 0;
	}

	.stm-landing__steps {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.stm-landing__steps li {
		padding: 52px 0 0;
	}
}

/* ======================================================= Phase 2: Konten */

.stm-form {
	margin: 0;
}

.stm-form--narrow {
	max-width: 560px;
}

.stm-form--secondary {
	margin-top: 28px;
	padding-top: 22px;
	border-top: 1px solid var(--stm-divider);
}

.stm-form__intro,
.stm-form__outro {
	margin: 0 0 20px;
	color: var(--stm-text-muted);
}

.stm-form__outro {
	margin: 24px 0 0;
}

.stm .stm-form a:not(.stm-btn),
.stm .stm-notice a,
.stm .stm-section p a,
.stm .stm-form__outro a {
	color: var(--stm-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.stm-notice__action {
	margin: 10px 0 0;
}

.stm-fieldset {
	margin: 0 0 26px;
	padding: 0;
	border: 0;
}

.stm-legend {
	display: block;
	width: 100%;
	margin: 0 0 14px;
	padding: 0 0 8px;
	border-bottom: 1px solid var(--stm-divider);
	font-size: 18px;
	font-weight: 700;
	color: #fff;
}

.stm-grid--single {
	grid-template-columns: 1fr !important;
}

.stm .stm-input--file {
	padding: 11px 14px;
	cursor: pointer;
}

.stm-static {
	display: flex;
	align-items: center;
	min-height: var(--stm-btn-height);
	padding: 10px 14px;
	border: 1px dashed var(--stm-line);
	border-radius: var(--stm-radius);
	color: var(--stm-text-muted);
	word-break: break-all;
}

.stm-field.has-error .stm-checkbox {
	color: var(--stm-error-text);
}

.stm-captcha {
	min-height: 70px;
}

.stm-lead {
	margin: 0 0 18px;
	font-size: 18px;
	color: #fff;
}

.stm-muted {
	color: var(--stm-text-subtle);
	font-weight: 400;
}

.stm .stm-btn--small {
	min-height: 36px;
	padding: 0 14px;
	font-size: 12px;
}

.stm .stm-btn--danger:hover {
	background: var(--stm-error-bg);
	border-color: var(--stm-error-text);
	color: #fff;
}

/* Abschnitte im Dashboard */

.stm-section {
	margin: 0 0 30px;
	padding: 0 0 26px;
	border-bottom: 1px solid var(--stm-divider);
}

.stm-section:last-child {
	margin-bottom: 0;
	border-bottom: 0;
}

.stm .stm-section-title {
	margin: 0 0 16px;
	font-family: var(--stm-font);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: #fff;
}

.stm .stm-subsection-title {
	margin: 24px 0 12px;
	font-family: var(--stm-font);
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	color: var(--stm-text);
}

.stm-section--danger .stm-section-title {
	color: var(--stm-error-text);
}

.stm-details > summary {
	cursor: pointer;
	list-style: revert;
}

.stm-details[open] > summary {
	margin-bottom: 18px;
}

/* Reiter in „Mein Bereich“ */

.stm-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 22px;
	margin: 0 0 24px;
	border-bottom: 1px solid var(--stm-divider);
}

.stm .stm-tabs__link {
	display: inline-block;
	margin-bottom: -1px;
	padding: 8px 0 10px;
	border-bottom: 2px solid transparent;
	color: var(--stm-text-muted);
	font-weight: 600;
	text-decoration: none;
}

.stm .stm-tabs__link:hover,
.stm .stm-tabs__link.is-current {
	border-bottom-color: #fff;
	color: #fff;
}

/* Haus-Karte */

.stm-card--house {
	margin-bottom: 20px;
}

.stm-card--house:hover,
.stm-card--house:focus-within {
	transform: none;
}

.stm-card__logo {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 120px;
	height: 90px;
	padding: 8px;
	border-radius: var(--stm-radius);
	background: #fff;
}

.stm-card__logo img,
.stm-logo-preview img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.stm-logo-preview {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}

.stm-logo-preview img {
	max-width: 180px;
	max-height: 120px;
	padding: 8px;
	border-radius: var(--stm-radius);
	background: #fff;
}

.stm-empty--spaced {
	margin-top: 24px;
}

/* Personen (Benutzer, Einladungen) */

.stm-people {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.stm-person {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
}

.stm-person__main {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.stm-person__name {
	color: #fff;
}

.stm-person__meta {
	font-size: 14px;
	color: var(--stm-text-muted);
	word-break: break-word;
}

.stm-person__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.stm-person__badges:empty {
	display: none;
}

.stm-person__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.stm-person__actions form {
	margin: 0;
}

.stm-chip {
	display: inline-flex;
	align-items: center;
	padding: 2px 10px;
	border: 1px solid var(--stm-line);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	color: var(--stm-text);
}

.stm-chip--warning {
	border-color: var(--stm-warning-border);
	color: var(--stm-warning-text);
}

.stm-inline-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

/* Status und Rückfragen */

.stm-facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 8px 18px;
	margin: 0 0 26px;
}

.stm-facts dt {
	font-weight: 700;
	color: var(--stm-text-muted);
}

.stm-facts dd {
	margin: 0;
	color: #fff;
}

.stm-thread {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.stm-thread__item {
	padding: 12px 14px;
	border: 1px solid var(--stm-panel-border);
	border-left: 3px solid var(--stm-badge-rent);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
}

.stm-thread__item--answer {
	border-left-color: var(--stm-success-text);
}

.stm-thread__meta {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	color: var(--stm-text-subtle);
}

@container stm-panel (min-width: 560px) {
	.stm-person {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.stm-person__actions {
		flex: 0 0 auto;
		justify-content: flex-end;
	}
}

/* ======================================================= Phase 3: Anzeigen */

/* Bedingte Felder: hidden gewinnt immer (das Skript setzt es). */
.stm [hidden] {
	display: none !important;
}

.stm-field-group {
	display: contents;
}

.stm-js .stm-when-hint {
	display: none;
}

.stm-when-hint {
	font-weight: 400;
	color: var(--stm-text-subtle);
}

/* Auswahl als Kacheln (Anzeigentyp, Übergabe) */

.stm-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.stm-choice {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 8px 16px;
	border: 1px solid var(--stm-line);
	border-radius: var(--stm-radius);
	background: var(--stm-input-bg);
	cursor: pointer;
}

.stm .stm-choice input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: #fff;
}

.stm-choice:has(input:checked) {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.1);
}

.stm-choice:has(input:focus-visible) {
	outline: 2px solid var(--stm-focus);
	outline-offset: 2px;
}

.stm-subfieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.stm-counter.is-over {
	color: var(--stm-error-text);
	font-weight: 700;
}

/* Editor: TinyMCE bringt eine helle Oberfläche mit. */

.stm-editor .wp-editor-container {
	border: 1px solid var(--stm-line);
	border-radius: var(--stm-radius);
	overflow: hidden;
}

.stm-editor .mce-tinymce,
.stm-editor .mce-panel {
	border: 0;
}

/* Bilder */

.stm-uploader__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
}

.stm-uploader__list:empty {
	display: none;
}

.stm-uploader__item {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 8px;
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
}

.stm-uploader__item[draggable="true"] {
	cursor: grab;
}

.stm-uploader__item.is-dragging {
	opacity: 0.5;
}

.stm-uploader__item.is-failed {
	border-color: var(--stm-error-border);
}

.stm-uploader__thumb {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--stm-radius);
	background: rgba(255, 255, 255, 0.06);
}

.stm-uploader__cover {
	position: absolute;
	top: 14px;
	left: 14px;
	display: none;
	padding: 2px 8px;
	border-radius: var(--stm-radius);
	background: #fff;
	color: #000;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}

.stm-uploader__item:first-child .stm-uploader__cover {
	display: inline-block;
}

.stm-uploader__name {
	font-size: 13px;
	word-break: break-all;
	color: var(--stm-text-muted);
}

.stm-uploader__progress {
	width: 100%;
	height: 6px;
}

.stm .stm-uploader__alt .stm-input {
	min-height: 36px;
	padding: 6px 10px;
	font-size: 13px;
}

.stm-uploader__tools {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.stm-uploader.stm-js .stm-uploader__remove-nojs {
	display: none;
}

.stm-uploader__drop {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	padding: 18px;
	border: 1px dashed var(--stm-line);
	border-radius: var(--stm-radius);
	background: var(--stm-input-bg);
}

.stm-uploader__drop .stm-label {
	margin: 0;
}

.stm-uploader__drop.is-over {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.08);
}

.stm-uploader__drop-hint {
	display: none;
	color: var(--stm-text-subtle);
}

.stm-uploader.stm-js .stm-uploader__drop-hint {
	display: inline;
}

.stm-uploader__status:empty {
	display: none;
}

/* Meine Anzeigen */

.stm-filter-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
}

.stm .stm-filter-links__link {
	color: var(--stm-text-muted);
	font-weight: 600;
	text-decoration: none;
}

.stm .stm-filter-links__link.is-current,
.stm .stm-filter-links__link:hover {
	color: #fff;
	text-decoration: underline;
}

.stm-my-listing {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
}

.stm-my-listing__media {
	display: block;
	flex: 0 0 auto;
	width: 120px;
	overflow: hidden;
	border-radius: var(--stm-radius);
	background: rgba(255, 255, 255, 0.06);
	aspect-ratio: 4 / 3;
}

.stm-my-listing__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.stm-my-listing__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-size: 12px;
	color: var(--stm-text-subtle);
}

.stm-my-listing__body {
	flex: 1 1 auto;
	min-width: 0;
}

.stm-my-listing__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 8px;
}

.stm .stm-my-listing__title {
	margin: 0 0 6px;
	font-family: var(--stm-font);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
}

.stm .stm-my-listing__title a {
	color: #fff;
	text-decoration: none;
}

.stm .stm-my-listing__title a:hover {
	text-decoration: underline;
}

.stm-my-listing__meta {
	margin: 0 0 4px;
	font-size: 14px;
	color: var(--stm-text-muted);
}

.stm-warning-text {
	color: var(--stm-warning-text);
	font-weight: 700;
}

.stm-my-listing .stm-badge,
.stm-listing-view .stm-badge {
	background: var(--stm-card-bg);
}

/* Status-Chips */

.stm-status {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border: 1px solid var(--stm-line);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	color: var(--stm-text);
}

.stm-status--stm_active,
.stm-status--stm_reserved {
	border-color: var(--stm-success-border);
	background: var(--stm-success-bg);
	color: var(--stm-success-text);
}

.stm-status--stm_review,
.stm-status--stm_payment,
.stm-status--stm_paused {
	border-color: var(--stm-warning-border);
	background: var(--stm-warning-bg);
	color: var(--stm-warning-text);
}

.stm-status--stm_rejected,
.stm-status--stm_suspended {
	border-color: var(--stm-error-border);
	background: var(--stm-error-bg);
	color: var(--stm-error-text);
}

.stm-status--stm_expired,
.stm-status--stm_done,
.stm-status--stm_archived {
	color: var(--stm-text-subtle);
}

/* Aktionen */

.stm-listing-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 8px;
	margin-top: 12px;
}

.stm-listing-actions__form {
	margin: 0;
}

.stm-listing-actions__more > summary {
	list-style: none;
}

.stm-listing-actions__more > summary::-webkit-details-marker {
	display: none;
}

.stm-listing-actions__more[open] {
	flex-basis: 100%;
}

.stm-listing-actions__more[open] > summary {
	margin-bottom: 10px;
}

.stm-listing-actions__more .stm-inline-form {
	justify-content: flex-start;
	padding: 12px;
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
}

.stm .stm-listing-actions__more .stm-select {
	width: auto;
	min-height: 36px;
	padding: 4px 10px;
}

.stm-extend-prompt form {
	margin: 10px 0 0;
}

/* Vorschau einer Anzeige */

.stm .stm-back-link {
	color: var(--stm-text-muted);
	text-decoration: none;
}

.stm .stm-back-link:hover {
	color: #fff;
}

.stm-listing-view {
	margin: 0 0 18px;
}

.stm-listing-view__head {
	margin: 0 0 18px;
}

.stm .stm-listing-view__title {
	margin: 0 0 6px;
	font-family: var(--stm-font);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0;
	text-transform: none;
	color: #fff;
}

.stm-listing-view__price {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
}

.stm-listing-view__text {
	margin: 0 0 22px;
}

.stm-listing-view__text ul,
.stm-listing-view__text ol {
	padding-left: 1.4em;
}

.stm-gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
}

.stm-gallery__item--cover {
	grid-column: 1 / -1;
}

.stm-gallery__item a {
	display: block;
	overflow: hidden;
	border-radius: var(--stm-radius);
	background: rgba(255, 255, 255, 0.06);
}

.stm-gallery__item img {
	display: block;
	width: 100%;
	height: auto;
}

.stm-gallery__item:not(.stm-gallery__item--cover) img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* Kennzahlen in der Übersicht */

.stm-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 22px 0 0;
}

.stm-stats__item {
	padding: 12px 14px;
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
}

.stm-stats dt {
	font-size: 13px;
	color: var(--stm-text-muted);
}

.stm-stats dd {
	margin: 2px 0 0;
	font-size: 24px;
	font-weight: 700;
	color: #fff;
}

@container stm-panel (min-width: 560px) {
	.stm-my-listing {
		flex-direction: row;
		align-items: flex-start;
	}

	.stm-stats {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.stm-gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.stm-gallery__item--cover img {
	max-height: 560px;
	object-fit: contain;
	background: rgba(0, 0, 0, 0.35);
}

/* ======================================================= Phase 4a: Pinnwand */

/* Suche und Filter */

.stm-search {
	margin: 0 0 18px;
}

.stm-search__filters {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px 14px;
	margin: 0 0 14px;
}

.stm .stm-search__filters .stm-label {
	margin-bottom: 6px;
	font-size: 13px;
}

.stm-results-count {
	margin: 0;
}

.stm .stm-results-reset {
	margin-left: 12px;
	font-weight: 400;
	color: var(--stm-text-muted);
}

.stm-sort {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.stm-sort__label {
	font-size: 14px;
	color: var(--stm-text-muted);
}

.stm .stm-select--small {
	width: auto;
	min-height: 38px;
	padding: 6px 10px;
	font-size: 14px;
}

/* Karten der Ergebnisliste */

.stm-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-size: 13px;
	color: var(--stm-card-meta);
}

.stm-card__picture,
.stm-card__picture img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.stm-card__badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin: 0 0 10px;
}

.stm-badge--reserved {
	color: #8a5a00;
}

.stm-badge--own {
	color: var(--stm-card-meta);
	border-style: dashed;
}

.stm-card__category {
	font-size: 13px;
	color: var(--stm-card-prefix);
}

.stm-card__price {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
	color: var(--stm-card-title);
}

.stm-card__date {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--stm-card-prefix);
}

/* Die Merken-Schaltfläche liegt über dem Link der Karte. */
.stm-card__actions {
	position: relative;
	z-index: 1;
	flex: 0 0 auto;
}

/* Merken */

.stm-favorite {
	margin: 0;
}

.stm .stm-favorite__button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 0 12px;
	border: 1px solid currentcolor;
	border-radius: var(--stm-radius);
	background: transparent;
	color: inherit;
	font-family: var(--stm-font);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
	transition: opacity var(--stm-transition), color var(--stm-transition);
}

.stm .stm-favorite__button:hover,
.stm .stm-favorite__button:focus-visible {
	opacity: 1;
}

.stm .stm-favorite__button[disabled] {
	opacity: 0.5;
	cursor: progress;
}

.stm-favorite__icon {
	fill: none;
	stroke: currentcolor;
	stroke-width: 2;
}

.stm-favorite.is-active .stm-favorite__button {
	color: #ff8aa0;
	opacity: 1;
}

.stm-favorite.is-active .stm-favorite__icon {
	fill: currentcolor;
}

.stm-card .stm-favorite__button {
	color: var(--stm-card-meta);
}

.stm-card .stm-favorite.is-active .stm-favorite__button {
	color: var(--stm-badge-wanted);
}

/* In Karten nur das Herz; der Text bleibt für Screenreader erhalten. */
.stm .stm-card .stm-favorite__button {
	width: 40px;
	min-height: 40px;
	padding: 0;
	justify-content: center;
}

.stm-card .stm-favorite__label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.stm-card .stm-favorite__icon {
	width: 20px;
	height: 20px;
}

/* Merkliste: nicht mehr verfügbare Anzeigen */

.stm-favorite-gone {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border: 1px dashed var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
}

.stm-favorite-gone__title {
	margin: 0;
	font-weight: 700;
	color: #fff;
}

.stm-favorite-gone .stm-help {
	margin: 4px 0 0;
}

/* Einzelansicht */

.stm-detail {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "media" "buy" "content" "more";
	gap: 18px 28px;
}

.stm-detail__media { grid-area: media; }
.stm-detail__buy { grid-area: buy; }
.stm-detail__content { grid-area: content; }
.stm-detail__more { grid-area: more; }

.stm .stm-detail__content > .stm-detail__heading:first-child {
	margin-top: 0;
}

.stm .stm-detail__heading {
	margin: 26px 0 12px;
	padding: 0;
	font-family: var(--stm-font);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: #fff;
}

.stm-detail__media > .stm-card__badges .stm-badge {
	background: var(--stm-card-bg);
}

.stm .stm-detail__media a.stm-chip {
	text-decoration: none;
}

.stm .stm-detail__media a.stm-chip:hover {
	background: var(--stm-btn-hover-bg);
	color: var(--stm-btn-hover-text);
}

.stm-detail__meta {
	margin: 18px 0 0;
	font-size: 13px;
	color: var(--stm-text-subtle);
}

.stm-gallery--detail {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-top: 12px;
}

.stm-gallery--detail a {
	cursor: zoom-in;
}

.stm-gallery__picture,
.stm-gallery__picture img {
	display: block;
	width: 100%;
}

.stm-notice--with-action {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.stm-moderation-link {
	margin: 0 0 14px;
}

.stm-preview-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

/* Kästen in der Seitenleiste */

.stm-box {
	margin: 0 0 14px;
	padding: 16px 18px;
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
}

.stm .stm-box__title {
	margin: 0 0 10px;
	padding: 0;
	font-family: var(--stm-font);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--stm-text-subtle);
}

.stm-box p {
	margin: 0;
}

.stm .stm-box .stm-box__footer {
	margin-top: 14px;
}

.stm-price-box__price {
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}

.stm .stm-price-box__location {
	margin-top: 4px;
	color: var(--stm-text-muted);
}

.stm-price-box .stm-favorite {
	margin-top: 14px;
}

.stm-contact-box__name {
	font-weight: 700;
	color: #fff;
}

.stm-contact-box__position {
	color: var(--stm-text-muted);
}

.stm-contact-box__channels {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.stm .stm-contact-box__channels a,
.stm .stm-house-box a:not(.stm-btn) {
	color: #fff;
	word-break: break-word;
}

.stm-house-box__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.stm-house-box__logo {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	padding: 4px;
	border-radius: var(--stm-radius);
	background: #fff;
	object-fit: contain;
}

.stm-house-box__name {
	font-weight: 700;
	color: #fff;
}

.stm-house-box__meta {
	font-size: 14px;
	color: var(--stm-text-muted);
}

.stm-facts--compact {
	gap: 4px 12px;
	margin: 12px 0 0;
	font-size: 14px;
}

/* Melden */

.stm-report {
	margin-top: 4px;
}

.stm .stm-report > summary {
	font-size: 14px;
	color: var(--stm-text-muted);
	cursor: pointer;
}

.stm-report__form {
	margin-top: 12px;
}

.stm-report__form .stm-field {
	margin-bottom: 12px;
}

/* Anbieterseite */

.stm-provider {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px;
}

.stm .stm-provider__listings > .stm-detail__heading:first-child {
	margin-top: 0;
}

/* Seitenzahlen */

.stm .stm-pagination .stm-pagination__gap {
	border-color: transparent;
}

/* Lightbox */

/* Der Dialog trägt selbst die Klasse .stm; .stm * erfasst ihn nicht. */
.stm-lightbox {
	box-sizing: border-box;
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 52px 8px 16px;
	border: 0;
	background: rgba(0, 0, 0, 0.94);
	color: #fff;
}

.stm-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.6);
}

.stm-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 100%;
	margin: 0;
}

.stm-lightbox__image {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(100% - 36px);
	object-fit: contain;
}

.stm-lightbox__counter {
	font-size: 14px;
	color: var(--stm-text-muted);
}

.stm .stm-lightbox__close,
.stm .stm-lightbox__nav {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: var(--stm-radius);
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.stm .stm-lightbox__close:hover,
.stm .stm-lightbox__nav:hover {
	background: #fff;
	color: #000;
}

.stm .stm-lightbox__close {
	top: 6px;
	right: 8px;
}

.stm .stm-lightbox__nav {
	top: 50%;
	height: 64px;
	transform: translateY(-50%);
	font-size: 36px;
}

.stm .stm-lightbox__nav--prev {
	left: 8px;
}

.stm .stm-lightbox__nav--next {
	right: 8px;
}

.stm .stm-lightbox__nav[hidden] {
	display: none;
}

@media (min-width: 641px) {
	.stm-lightbox {
		padding: 56px 72px 20px;
	}

	.stm .stm-lightbox__nav--prev {
		left: 14px;
	}

	.stm .stm-lightbox__nav--next {
		right: 14px;
	}
}

/* Ab mittlerer Panelbreite stehen Bild und Text der Karten nebeneinander. */
@container stm-panel (min-width: 440px) {
	.stm-listing-card {
		flex-direction: row;
		align-items: flex-start;
	}

	.stm-listing-card .stm-card__media {
		width: 150px;
	}

	.stm-listing-card .stm-card__body {
		flex: 1 1 auto;
		min-width: 0;
	}
}

@container stm-panel (min-width: 560px) {
	.stm-search__filters {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.stm-gallery--detail {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@container stm-panel (min-width: 760px) {
	.stm-search__filters {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	/* Rechte Spalte: Preis und Kontakt neben den Bildern, darunter das Haus. */
	.stm-detail {
		grid-template-columns: minmax(0, 1fr) 300px;
		grid-template-rows: auto auto 1fr;
		grid-template-areas: "media buy" "media more" "content more";
		align-items: start;
	}

	.stm-provider {
		grid-template-columns: 280px minmax(0, 1fr);
		align-items: start;
	}

	.stm-listing-card .stm-card__media {
		width: 200px;
	}

	.stm-provider .stm-card__media {
		width: 170px;
	}
}


.stm-results-count + .stm-results {
	margin-top: 12px;
}

/* Seite hinter der geöffneten Lightbox nicht scrollen. */
html.stm-lightbox-open {
	overflow: hidden;
}

/* ======================================================= Phase 4b: Nachrichten */

/* Zähler ungelesener Unterhaltungen in der Navigation */
.stm-nav__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	margin-left: 8px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--stm-badge-wanted);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}

/* Postfach */
.stm-conversations {
	gap: 10px;
	margin-bottom: 28px;
}

.stm-conversation-item {
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
	transition: border-color var(--stm-transition);
}

.stm-conversation-item:hover,
.stm-conversation-item:focus-within {
	border-color: var(--stm-line);
}

.stm-conversation-item.is-unread {
	border-color: var(--stm-line);
	background: rgba(255, 255, 255, 0.07);
}

.stm .stm-conversation-item__link {
	display: block;
	padding: 14px 16px;
	color: var(--stm-text);
	text-decoration: none;
}

.stm-conversation-item__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.stm-conversation-item__title {
	font-weight: 700;
	color: #fff;
}

.stm-conversation-item.is-unread .stm-conversation-item__title {
	font-size: 16px;
}

.stm-conversation-item__date {
	flex: 0 0 auto;
	font-size: 13px;
	color: var(--stm-text-subtle);
}

.stm-conversation-item__meta,
.stm-conversation-item__excerpt {
	display: block;
	margin-top: 4px;
	font-size: 14px;
	color: var(--stm-text-muted);
}

.stm-conversation-item__excerpt {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.stm-conversation-item__you {
	color: var(--stm-text-subtle);
}

.stm-unread-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-right: 8px;
	border-radius: 50%;
	background: var(--stm-badge-wanted);
	vertical-align: middle;
}

/* Unterhaltung */
.stm-thread-head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 16px;
}

.stm-thread-head__media {
	flex: 0 0 auto;
	width: 96px;
	overflow: hidden;
	border-radius: var(--stm-radius);
	aspect-ratio: 4 / 3;
	background: rgba(255, 255, 255, 0.06);
}

.stm-thread-head__picture,
.stm-thread-head__picture img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.stm-thread-head__role {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--stm-text-subtle);
}

.stm .stm-thread-head__title {
	margin: 2px 0 4px;
	padding: 0;
	font-family: var(--stm-font);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: #fff;
}

.stm .stm-thread-head__title a,
.stm .stm-thread-head__meta a {
	color: #fff;
}

.stm-thread-head__meta {
	margin: 0;
	font-size: 14px;
	color: var(--stm-text-muted);
}

.stm-messages {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-height: 60vh;
	margin: 0 0 18px;
	padding: 14px;
	overflow-y: auto;
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: rgba(0, 0, 0, 0.2);
	list-style: none;
	overscroll-behavior: contain;
}

.stm-message {
	align-self: flex-start;
	max-width: 88%;
	padding: 10px 14px;
	border-radius: var(--stm-radius);
	background: var(--stm-card-bg);
	color: var(--stm-card-text);
}

.stm-message--own {
	align-self: flex-end;
	background: rgba(255, 255, 255, 0.12);
	color: var(--stm-text);
}

.stm-message__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 8px;
	margin: 0 0 4px;
	font-size: 12px;
	color: var(--stm-card-meta);
}

.stm-message--own .stm-message__meta {
	color: var(--stm-text-subtle);
}

.stm-message__body p {
	margin: 0 0 8px;
}

.stm-message__body p:last-child {
	margin-bottom: 0;
}

.stm .stm-message__body a {
	color: inherit;
	text-decoration: underline;
	word-break: break-word;
}

.stm-reply .stm-field {
	margin-bottom: 10px;
}

.stm-thread-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 10px 14px;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--stm-divider);
}

.stm-thread-actions .stm-report {
	flex: 1 1 100%;
}

.stm-thread-actions .stm-inline-form {
	justify-content: flex-start;
}

/* „Nachricht senden“ in der Einzelansicht */
.stm-message-box .stm-field {
	margin-bottom: 10px;
}

.stm-message-box__existing {
	margin-bottom: 12px !important;
	font-size: 14px;
}

.stm .stm-message-box__existing a {
	color: #fff;
}

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

@container stm-panel (min-width: 560px) {
	.stm-message {
		max-width: 75%;
	}

	.stm-thread-actions .stm-report {
		flex: 1 1 auto;
	}
}

/* ============================================ 0.4.2: Zugelassene Häuser */

.stm-houses-head {
	margin: 0 0 20px;
}

.stm-houses-head__summary {
	margin: 0 0 8px;
	font-weight: 600;
}

.stm-houses-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0 0 6px;
	padding: 0;
	list-style: none;
	font-size: 14px;
	color: var(--stm-text-muted);
}

.stm-houses-legend li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.stm-houses-legend__swatch {
	display: inline-block;
	width: 26px;
	height: 16px;
	border: 1px solid var(--stm-house-registered-border);
	border-radius: 3px;
	background: var(--stm-house-registered-bg);
}

/* Spalten von oben nach unten – wie in einem Verzeichnis. */
.stm-houses {
	margin: 0;
	padding: 0;
	list-style: none;
	columns: 1;
	column-gap: 28px;
}

.stm-house-entry {
	display: grid;
	grid-template-columns: 1.4em minmax(0, 1fr);
	align-items: center;
	gap: 6px;
	margin: 0 0 2px;
	break-inside: avoid;
}

.stm-house-entry.is-first:not(:first-child) {
	margin-top: 10px;
}

.stm-house-entry__letter {
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	color: var(--stm-kicker);
}

.stm-house-entry__body {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 30px;
	padding: 3px 8px;
	border: 1px solid transparent;
	border-radius: var(--stm-radius);
}

.stm-house-entry.is-registered .stm-house-entry__body {
	border-color: var(--stm-house-registered-border);
	background: var(--stm-house-registered-bg);
	color: var(--stm-house-registered-text);
}

.stm-house-entry__name {
	min-width: 0;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.stm .stm-house-entry__name a {
	color: inherit;
	text-decoration: none;
}

.stm .stm-house-entry__name a:hover {
	text-decoration: underline;
}

.stm-house-entry__own {
	font-size: 13px;
	color: var(--stm-text-muted);
	white-space: nowrap;
}

.stm-house-entry__numbers {
	display: inline-flex;
	flex: 0 0 auto;
	gap: 4px;
}

.stm .stm-house-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--stm-count-offers);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
}

.stm .stm-house-count--gesuche {
	background: var(--stm-count-wanted);
}

.stm a.stm-house-count:hover {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
}

.stm-provider__filter {
	margin: -6px 0 14px;
}

@container stm-panel (min-width: 560px) {
	.stm-houses {
		columns: 2;
	}
}

@container stm-panel (min-width: 900px) {
	.stm-houses {
		columns: 3;
	}
}

@container stm-panel (min-width: 560px) {
	.stm-landing__features {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.stm-landing__cta {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

@container stm-panel (min-width: 1000px) {
	.stm-landing__features {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Bezahlen und Rechnungen (Phase 5a) */

.stm-status--open {
	border-color: var(--stm-warning-border);
	background: var(--stm-warning-bg);
	color: var(--stm-warning-text);
}

.stm-status--paid {
	border-color: var(--stm-success-border);
	background: var(--stm-success-bg);
	color: var(--stm-success-text);
}

.stm-pay__listing {
	margin: 0 0 18px;
	font-size: 17px;
}

.stm-pay__type {
	color: var(--stm-text-muted);
}

.stm-pay__amounts dd {
	font-variant-numeric: tabular-nums;
}

.stm .stm-pay__total {
	font-size: 20px;
	font-weight: 700;
}

.stm-pay__address {
	margin: 0 0 6px;
	line-height: 1.5;
}

.stm-pay__methods {
	display: grid;
	gap: 10px;
}

.stm .stm-pay__method {
	display: flex;
	align-items: flex-start;
	padding: 12px 16px;
}

.stm .stm-pay__method input {
	margin-top: 3px;
}

.stm-pay__method > span {
	display: grid;
	gap: 2px;
}

.stm-pay__abort {
	margin-top: 26px;
	padding-top: 18px;
	border-top: 1px solid var(--stm-divider);
}

.stm-invoices {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.stm-invoice {
	display: grid;
	gap: 8px 16px;
	padding: 14px 16px;
	border: 1px solid var(--stm-panel-border);
	border-radius: var(--stm-radius);
	background: var(--stm-surface);
}

.stm-invoice__title,
.stm-invoice__meta,
.stm-invoice__amount {
	margin: 0;
}

.stm-invoice__title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
}

.stm-invoice__meta {
	color: var(--stm-text-muted);
	font-size: 14px;
}

.stm-invoice__amount {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.stm-invoice__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.stm-invoice--cancelled .stm-invoice__amount,
.stm-invoice--final .stm-invoice__amount {
	color: var(--stm-text-muted);
}

@container stm-panel (min-width: 700px) {
	.stm-invoice {
		grid-template-columns: 1fr auto auto;
		align-items: center;
	}
}
