/* THG-Manager – Frontend. Nutzt die Design-Tokens des Themes (theme.json) mit Fallbacks. */

.thgm {
	--thgm-primary: var(--wp--preset--color--primary, #0D5C4A);
	--thgm-primary-dark: var(--wp--preset--color--primary-dark, #083F33);
	--thgm-accent: var(--wp--preset--color--accent, #C8F04F);
	--thgm-ink: var(--wp--preset--color--ink, #0E1A16);
	--thgm-muted: var(--wp--preset--color--muted, #56675F);
	--thgm-surface: var(--wp--preset--color--surface, #F5F8F4);
	--thgm-surface-alt: var(--wp--preset--color--surface-alt, #E7F0EA);
	--thgm-white: var(--wp--preset--color--white, #FFFFFF);
	--thgm-line: var(--wp--preset--color--line, #D3DFD7);
	--thgm-success: var(--wp--preset--color--success, #1E7D47);
	--thgm-warning: var(--wp--preset--color--warning, #9A6A12);
	--thgm-danger: var(--wp--preset--color--danger, #B3392A);
	--thgm-radius: 14px;
	--thgm-font: var(--wp--preset--font-family--body, "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif);
	--thgm-display: var(--wp--preset--font-family--display, var(--thgm-font));
	font-family: var(--thgm-font);
	color: var(--thgm-ink);
	line-height: 1.55;
	max-width: 100%;
}

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

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

/* ---------- Karten, Hinweise ---------- */

.thgm-card {
	background: var(--thgm-white);
	border: 1px solid var(--thgm-line);
	border-radius: var(--thgm-radius);
	padding: clamp(1.25rem, 3vw, 2rem);
	box-shadow: 0 1px 2px rgba(14, 26, 22, .04), 0 12px 32px -18px rgba(14, 26, 22, .18);
}

.thgm-card h2,
.thgm-card h3 { font-family: var(--thgm-display); margin: 0 0 .5rem; line-height: 1.2; }

.thgm-alert {
	border-radius: 10px;
	padding: .9rem 1.1rem;
	margin: 1rem 0;
	font-weight: 600;
	border: 1px solid transparent;
}
.thgm-alert--error { background: #FBEDEA; color: #7E2117; border-color: #F0C9C2; }
.thgm-alert--ok { background: #E8F5EC; color: #145A33; border-color: #BFE3CB; }

.thgm-note {
	background: var(--thgm-surface-alt);
	border-left: 4px solid var(--thgm-accent);
	border-radius: 10px;
	padding: 1rem 1.1rem;
	margin: 1.25rem 0;
	font-size: .95rem;
}

.thgm-small, .thgm-help { font-size: .875rem; color: var(--thgm-muted); margin: .35rem 0 0; }
.thgm-optional { font-weight: 400; color: var(--thgm-muted); font-size: .85em; }
.thgm-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--thgm-muted); margin: 0 0 .2rem; }
.thgm-lead { font-size: 1.05rem; color: var(--thgm-muted); margin: 0 0 1.25rem; }
.thgm-mt { margin-top: 2.5rem !important; }

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

.thgm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-height: 46px;
	padding: .7rem 1.35rem;
	border-radius: 999px;
	border: 2px solid transparent;
	font: 700 1rem/1.1 var(--thgm-font);
	cursor: pointer;
	text-decoration: none;
	transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
	-webkit-tap-highlight-color: transparent;
}
.thgm-btn:focus-visible { outline: 3px solid var(--thgm-accent); outline-offset: 2px; }
.thgm-btn--primary { background: var(--thgm-primary); color: #fff; box-shadow: 0 8px 20px -10px rgba(13, 92, 74, .7); }
.thgm-btn--primary:hover { background: var(--thgm-primary-dark); color: #fff; transform: translateY(-1px); }
.thgm-btn--ghost { background: var(--thgm-white); color: var(--thgm-primary); border-color: var(--thgm-line); }
.thgm-btn--ghost:hover { border-color: var(--thgm-primary); color: var(--thgm-primary-dark); }
.thgm-btn--danger { background: var(--thgm-danger); color: #fff; }
.thgm-btn--danger:hover { background: #8F2C20; color: #fff; }
.thgm-btn--sm { min-height: 38px; padding: .45rem 1rem; font-size: .9rem; }
.thgm-btn--lg { min-height: 54px; padding: .9rem 1.8rem; font-size: 1.05rem; }
.thgm-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.thgm-btn.is-busy { position: relative; color: transparent !important; }
.thgm-btn.is-busy::after {
	content: "";
	position: absolute;
	width: 18px; height: 18px;
	border: 2px solid rgba(255, 255, 255, .5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: thgm-spin .7s linear infinite;
}
.thgm-btn--ghost.is-busy::after { border-color: rgba(13, 92, 74, .3); border-top-color: var(--thgm-primary); }
@keyframes thgm-spin { to { transform: rotate(360deg); } }

.thgm-link {
	background: none;
	border: 0;
	padding: 0;
	color: var(--thgm-primary);
	font: 600 .95rem var(--thgm-font);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

/* ---------- Schritte ---------- */

.thgm-steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: .5rem;
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	counter-reset: none;
}
.thgm-steps li {
	display: flex;
	align-items: center;
	gap: .5rem;
	font-size: .85rem;
	font-weight: 700;
	color: var(--thgm-muted);
	padding-bottom: .6rem;
	border-bottom: 3px solid var(--thgm-line);
	margin: 0;
}
.thgm-steps li span {
	display: inline-grid;
	place-items: center;
	width: 26px; height: 26px;
	border-radius: 50%;
	background: var(--thgm-surface-alt);
	color: var(--thgm-muted);
	font-size: .8rem;
	flex: none;
}
.thgm-steps li.is-active { color: var(--thgm-ink); border-color: var(--thgm-primary); }
.thgm-steps li.is-active span { background: var(--thgm-primary); color: #fff; }
.thgm-steps li.is-done { color: var(--thgm-primary); border-color: var(--thgm-accent); }
.thgm-steps li.is-done span { background: var(--thgm-accent); color: var(--thgm-primary-dark); }
@media (max-width: 640px) {
	.thgm-steps li { font-size: 0; gap: 0; justify-content: center; }
	.thgm-steps li span { font-size: .8rem; }
}

.thgm-form {
	background: var(--thgm-white);
	border: 1px solid var(--thgm-line);
	border-radius: var(--thgm-radius);
	padding: clamp(1.25rem, 3.5vw, 2.25rem);
	box-shadow: 0 1px 2px rgba(14, 26, 22, .04), 0 18px 40px -24px rgba(14, 26, 22, .25);
}
.thgm-form--inline { background: none; border: 0; box-shadow: none; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.thgm-form--inline .thgm-field { flex: 1 1 260px; margin: 0; }

.thgm-step__title { font-family: var(--thgm-display); font-size: clamp(1.35rem, 2.6vw, 1.75rem); line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }

.thgm-tips {
	list-style: none;
	margin: 0 0 1.25rem;
	padding: 0;
	display: grid;
	gap: .4rem;
	font-size: .95rem;
}
.thgm-tips li { position: relative; padding-left: 1.6rem; margin: 0; }
.thgm-tips li::before {
	content: "";
	position: absolute;
	left: 0; top: .45em;
	width: .9rem; height: .5rem;
	border-left: 2.5px solid var(--thgm-primary);
	border-bottom: 2.5px solid var(--thgm-primary);
	transform: rotate(-45deg);
}

/* ---------- Felder ---------- */

.thgm-field { margin: 0 0 1.1rem; }
.thgm-field label,
.thgm-choice legend,
.thgm-checks legend { display: block; font-weight: 700; font-size: .95rem; margin-bottom: .4rem; }
.thgm-field input,
.thgm-field select,
.thgm-field textarea,
.thgm-copy {
	width: 100%;
	min-height: 48px;
	padding: .7rem .9rem;
	border: 1.5px solid var(--thgm-line);
	border-radius: 10px;
	background: var(--thgm-white);
	color: var(--thgm-ink);
	font: 500 1rem var(--thgm-font);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.thgm-field textarea { min-height: 110px; resize: vertical; }
.thgm-field input:focus,
.thgm-field select:focus,
.thgm-field textarea:focus {
	outline: none;
	border-color: var(--thgm-primary);
	box-shadow: 0 0 0 4px rgba(200, 240, 79, .45);
}
.thgm-field [aria-invalid="true"] { border-color: var(--thgm-danger); box-shadow: 0 0 0 4px rgba(179, 57, 42, .12); }
#thgm-kennzeichen { text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
#thgm-iban { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .03em; }
.thgm-iban-status.is-ok { color: var(--thgm-success); font-weight: 700; }
.thgm-iban-status.is-bad { color: var(--thgm-warning); }

.thgm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.thgm-grid--plz { grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); }
@media (max-width: 560px) {
	.thgm-grid { grid-template-columns: 1fr; }
	.thgm-grid--plz { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}

.thgm-choice,
.thgm-checks { border: 0; padding: 0; margin: 0 0 1.25rem; }
.thgm-choice { display: flex; flex-wrap: wrap; gap: .6rem; }
.thgm-choice legend { width: 100%; }
.thgm-radio {
	display: inline-flex;
	align-items: center;
	gap: .55rem;
	padding: .7rem 1rem;
	border: 1.5px solid var(--thgm-line);
	border-radius: 999px;
	cursor: pointer;
	font-weight: 600;
	background: var(--thgm-white);
	transition: border-color .15s ease, background-color .15s ease;
}
.thgm-radio:has(input:checked) { border-color: var(--thgm-primary); background: var(--thgm-surface-alt); }
.thgm-radio input { accent-color: var(--thgm-primary); width: 18px; height: 18px; margin: 0; }

.thgm-check {
	display: flex;
	align-items: flex-start;
	gap: .7rem;
	margin: 0 0 .75rem;
	font-size: .95rem;
	cursor: pointer;
	line-height: 1.45;
}
.thgm-check input { accent-color: var(--thgm-primary); width: 20px; height: 20px; flex: none; margin: .1rem 0 0; }
.thgm-check a { color: var(--thgm-primary); font-weight: 600; }
.thgm-check--inline { display: inline-flex; margin: .5rem 0 0; font-weight: 600; }
.thgm-checks { background: var(--thgm-surface); border-radius: 12px; padding: 1.1rem 1.1rem .4rem; }

.thgm-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: 1.75rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--thgm-line);
}

.thgm-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.thgm-captcha { margin: 1rem 0; min-height: 70px; }

/* ---------- Upload und Editor ---------- */

.thgm-upload { margin: 0 0 1.5rem; }
.thgm-upload.is-loading { opacity: .6; pointer-events: none; }
.thgm-drop {
	display: grid;
	justify-items: center;
	gap: 1rem;
	text-align: center;
	padding: clamp(1.75rem, 5vw, 3rem) 1rem;
	border: 2px dashed #A9C2B4;
	border-radius: var(--thgm-radius);
	background:
		radial-gradient(circle at 20% 0%, rgba(200, 240, 79, .22), transparent 45%),
		var(--thgm-surface);
	transition: border-color .15s ease, background-color .15s ease;
}
.thgm-drop.is-over { border-color: var(--thgm-primary); background-color: var(--thgm-surface-alt); }
.thgm-drop__icon { width: 56px; height: 56px; color: var(--thgm-primary); }
.thgm-drop__buttons { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.thgm-drop .thgm-small { margin: 0; }

.thgm-editor__stage {
	position: relative;
	background: #0E1A16;
	border-radius: 12px;
	overflow: visible;
	touch-action: none;
	user-select: none;
	line-height: 0;
}
.thgm-editor__canvas { display: block; width: 100%; height: auto; border-radius: 12px; }
.thgm-editor__overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.thgm-editor__poly { fill: rgba(200, 240, 79, .12); stroke: #C8F04F; stroke-width: 3; vector-effect: non-scaling-stroke; }
.thgm-handle {
	position: absolute;
	width: 36px; height: 36px;
	margin: -18px 0 0 -18px;
	border-radius: 50%;
	border: 3px solid #fff;
	background: var(--thgm-primary);
	box-shadow: 0 0 0 3px rgba(200, 240, 79, .9), 0 6px 16px rgba(0, 0, 0, .35);
	cursor: grab;
	touch-action: none;
	padding: 0;
	z-index: 2;
}
.thgm-handle::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; }
.thgm-handle:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.thgm-handle.is-dragging { cursor: grabbing; transform: scale(1.1); }
.thgm-loupe {
	position: absolute;
	width: 120px; height: 120px;
	margin: -150px 0 0 -60px;
	border-radius: 50%;
	overflow: hidden;
	border: 3px solid #fff;
	box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
	pointer-events: none;
	z-index: 3;
}
.thgm-loupe.is-below { margin-top: 30px; }
.thgm-loupe canvas { width: 100%; height: 100%; }
.thgm-hint { font-size: .9rem; color: var(--thgm-muted); margin: .75rem 0; }
.thgm-editor__tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.thgm-editor__tools [data-action="apply"] { margin-left: auto; }
@media (max-width: 560px) { .thgm-editor__tools [data-action="apply"] { width: 100%; margin-left: 0; } }

.thgm-result {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	gap: 1.25rem;
	align-items: start;
	background: var(--thgm-surface);
	border-radius: var(--thgm-radius);
	padding: 1rem;
}
.thgm-result { grid-template-rows: auto 1fr; }
.thgm-result__img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .35); background: #fff; grid-row: span 2; }
.thgm-result__actions { display: flex; flex-wrap: wrap; gap: .5rem; grid-column: 2; align-self: start; }
@media (max-width: 640px) {
	.thgm-result { grid-template-columns: 1fr; grid-template-rows: none; }
	.thgm-result__img { grid-row: auto; }
	.thgm-result__actions { grid-column: auto; }
}
.thgm-quality { border-radius: 10px; padding: .8rem 1rem; font-size: .95rem; }
.thgm-quality--ok { background: #E8F5EC; color: #145A33; }
.thgm-quality--hinweis { background: #FFF6E0; color: #6E4B0B; }
.thgm-quality--schlecht { background: #FBEDEA; color: #7E2117; }

/* ---------- Zusammenfassung ---------- */

.thgm-summary {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: .5rem 1.25rem;
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	background: var(--thgm-surface);
	border-radius: 12px;
	font-size: .95rem;
}
.thgm-summary dt { font-weight: 700; color: var(--thgm-muted); }
.thgm-summary dd { margin: 0; word-break: break-word; }
@media (max-width: 480px) { .thgm-summary { grid-template-columns: 1fr; } .thgm-summary dd { margin-bottom: .5rem; } }

.thgm-done {
	text-align: center;
	padding: clamp(2rem, 5vw, 3.5rem) 1.5rem;
	background: var(--thgm-white);
	border: 1px solid var(--thgm-line);
	border-radius: var(--thgm-radius);
}
.thgm-done:focus { outline: none; }
.thgm-done h2 { font-family: var(--thgm-display); margin: 1rem 0 .5rem; }
.thgm-done__icon { width: 72px; height: 72px; margin: 0 auto; color: var(--thgm-primary); background: var(--thgm-surface-alt); border-radius: 50%; display: grid; place-items: center; }
.thgm-done__icon svg { width: 44px; height: 44px; }

/* ---------- Flotte ---------- */

.thgm-uploadbox {
	border: 1.5px dashed #A9C2B4;
	border-radius: 12px;
	padding: 1rem 1.1rem;
	margin: 0 0 1rem;
	background: var(--thgm-surface);
}
.thgm-uploadbox__head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.thgm-filelist { list-style: none; margin: .75rem 0 0; padding: 0; font-size: .9rem; display: grid; gap: .25rem; }
.thgm-filelist li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem .6rem; background: var(--thgm-white); border-radius: 8px; margin: 0; }
.thgm-filelist li span { color: var(--thgm-muted); }
.thgm-filelist li.is-ok span { color: var(--thgm-success); font-weight: 700; }
.thgm-filelist li.is-bad span { color: var(--thgm-danger); font-weight: 700; }
.thgm-progress { height: 6px; background: var(--thgm-line); border-radius: 6px; overflow: hidden; margin-top: .75rem; }
.thgm-progress__bar { height: 100%; width: 0; background: var(--thgm-primary); transition: width .3s ease; }

/* ---------- Aktionen, Portal ---------- */

.thgm-aktion .thgm-card { max-width: 640px; margin: 0 auto; text-align: center; }
.thgm-aktion--ok .thgm-card { border-top: 4px solid var(--thgm-success); }
.thgm-aktion--warn .thgm-card { border-top: 4px solid var(--thgm-warning); }
.thgm-aktion--info .thgm-card { border-top: 4px solid var(--thgm-accent); }
.thgm-aktion__form { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.25rem; }

.thgm-portal__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 0 0 1.25rem; flex-wrap: wrap; }
.thgm-portal__head h2 { margin: 0; font-family: var(--thgm-display); font-size: 1.35rem; word-break: break-all; }
.thgm-vehicle { margin: 0 0 1.25rem; }
.thgm-vehicle__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.thgm-vehicle__head h3 { font-size: 1.5rem; letter-spacing: .03em; margin: 0; }
.thgm-vehicle__foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--thgm-line); padding-top: 1rem; margin-top: 1rem; }
.thgm-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.thgm-timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 1rem; margin: 0; }
.thgm-timeline__year { font-family: var(--thgm-display); font-weight: 800; font-size: 1.15rem; color: var(--thgm-primary); }
.thgm-timeline__body { display: grid; gap: .25rem; }
.thgm-inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: .4rem 0 0; }
.thgm-portal__data { margin: 0 0 1.25rem; }
.thgm-portal__data summary { cursor: pointer; font-weight: 700; }
.thgm-portal__data .thgm-form { border: 0; box-shadow: none; padding: 1rem 0 0; }
.thgm-portal__ref { margin: 0 0 1.25rem; background: linear-gradient(135deg, var(--thgm-surface-alt), var(--thgm-white)); }
.thgm-copy { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; cursor: text; }
.thgm-portal__login { max-width: 560px; }

.thgm-badge {
	display: inline-flex;
	align-items: center;
	padding: .3rem .75rem;
	border-radius: 999px;
	font-size: .8rem;
	font-weight: 700;
	background: var(--thgm-surface-alt);
	color: var(--thgm-primary-dark);
	white-space: nowrap;
}
.thgm-badge--angenommen, .thgm-badge--praemie_mitgeteilt, .thgm-badge--exportiert, .thgm-badge--eingereicht { background: #E3F0FF; color: #1B4F8A; }
.thgm-badge--bestaetigt, .thgm-badge--ausgezahlt { background: #DDF3E4; color: #145A33; }
.thgm-badge--abgelehnt, .thgm-badge--storniert, .thgm-badge--verfallen, .thgm-badge--widersprochen { background: #F4E7E4; color: #7E2117; }
.thgm-badge--pruefung, .thgm-badge--halter_offen, .thgm-badge--doi_offen { background: #FFF2CC; color: #6E4B0B; }

/* ---------- Kündigung/Widerruf ---------- */

.thgm-legal .thgm-form { max-width: 720px; }
.thgm-legal-result .thgm-card { max-width: 720px; }
@media print {
	body * { visibility: hidden; }
	.thgm-legal-result, .thgm-legal-result * { visibility: visible; }
	.thgm-legal-result { position: absolute; left: 0; top: 0; width: 100%; }
	.thgm-legal-result button { display: none; }
}

/* ---------- FAQ (Fallback, das Theme darf überschreiben) ---------- */

.thgm-faq { display: grid; gap: .75rem; }
.thgm-faq__item { background: var(--thgm-white); border: 1px solid var(--thgm-line); border-radius: 12px; padding: 0; }
.thgm-faq__item summary { cursor: pointer; list-style: none; padding: 1.1rem 3rem 1.1rem 1.25rem; font-weight: 700; position: relative; }
.thgm-faq__item summary::-webkit-details-marker { display: none; }
.thgm-faq__item summary::after { content: "+"; position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--thgm-primary); }
.thgm-faq__item[open] summary::after { content: "–"; }
.thgm-faq__answer { padding: 0 1.25rem 1.1rem; color: var(--thgm-muted); }
.thgm-faq__answer p:last-child { margin-bottom: 0; }

.thgm-praemie { font-weight: 800; white-space: nowrap; }
.thgm-praemie--leer { font-weight: 600; font-size: .9em; }

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

/* Folgejahr: aktueller Fahrzeugschein */
.thgm-alert--warn { background: #FFF6E0; color: #6E4B0B; border-color: #F1DDA8; }
.thgm-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.thgm-rescan { margin: 1rem 0 1.25rem; padding: 1rem 1.1rem; border: 1px solid var(--thgm-line, #D3DFD7); border-radius: 12px; background: var(--thgm-surface, #F5F8F4); text-align: left; }
.thgm-rescan.is-required { border-color: var(--thgm-primary, #0D5C4A); }
.thgm-rescan p { margin: 0 0 .75rem; }
.thgm-rescan__optional summary { cursor: pointer; font-weight: 600; }
.thgm-rescan__optional[open] summary { margin-bottom: .75rem; }
.thgm-rescan__pick { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.thgm-rescan__pick label { position: relative; cursor: pointer; }
.thgm-rescan .thgm-editor { margin-top: 1rem; }
.thgm-rescan__done { margin-top: 1rem; display: grid; gap: .6rem; justify-items: start; }
.thgm-rescan__done .thgm-result__img { max-width: 420px; grid-row: auto; }
.thgm-aktion__buttons { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.thgm-rescan-form { display: block; }
.thgm-rescan-form .thgm-aktion__buttons { justify-content: center; }

/* ---------- Prämienmodell (Festpreis / variabel) ---------- */

.thgm-modell { display: grid; gap: .75rem; margin: 0 0 1.5rem; border: 0; padding: 0; }
.thgm-modell legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.thgm-modell__option {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: .75rem;
	align-items: start;
	padding: 1rem 1.1rem;
	border: 1.5px solid var(--thgm-line);
	border-radius: var(--thgm-radius);
	background: var(--thgm-white);
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
}
.thgm-modell__option:hover { border-color: var(--thgm-primary); }
.thgm-modell__option:has(input:checked) { border-color: var(--thgm-primary); box-shadow: 0 0 0 3px rgba(13, 92, 74, .12); background: var(--thgm-surface); }
.thgm-modell__option input { margin-top: .3rem; accent-color: var(--thgm-primary); width: 1.1rem; height: 1.1rem; }
.thgm-modell__body { display: grid; gap: .25rem; }
.thgm-modell__body > span { color: var(--thgm-muted); font-size: .94rem; }
.thgm-modell .thgm-help { grid-column: 1 / -1; }

/* ---------- Portal: weiteres Fahrzeug, Modellwahl, Flotte ---------- */

.thgm-portal__add summary,
.thgm-portal__fleet summary { cursor: pointer; font-weight: 700; }
.thgm-portal__add[open] summary,
.thgm-portal__fleet[open] summary { margin-bottom: 1rem; }
.thgm-modell-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .5rem; }
.thgm-modell-switch select { padding: .35rem .5rem; border: 1px solid var(--thgm-line); border-radius: 8px; font: inherit; }
.thgm-fleet-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.thgm-fleet-table th,
.thgm-fleet-table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--thgm-line); vertical-align: top; }
.thgm-fleet-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--thgm-muted); }
.thgm-fleet-wrap { overflow-x: auto; margin: 1rem 0; }
.thgm-fleet-stats { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: .5rem 0 1rem; }
.thgm-fleet-stats div { display: grid; }
.thgm-fleet-stats strong { font-size: 1.4rem; font-family: var(--thgm-display); }
.thgm-fleet-stats span { color: var(--thgm-muted); font-size: .85rem; }
.thgm-fleet-search { width: 100%; max-width: 22rem; padding: .55rem .75rem; border: 1px solid var(--thgm-line); border-radius: 10px; font: inherit; }
@media (max-width: 640px) {
	.thgm-fleet-table thead { display: none; }
	.thgm-fleet-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .75rem; padding: .6rem 0; border-bottom: 1px solid var(--thgm-line); }
	.thgm-fleet-table td { border: 0; padding: .1rem 0; }
	.thgm-fleet-table td::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--thgm-muted); text-transform: uppercase; letter-spacing: .05em; }
}
