/* Krypto-Haltefrist- und Steuerrechner (Präfix ktx-, Bausteine aus kb-ui.css) */

.ktx-page [hidden] {
	display: none !important;
}

.ktx-trust {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 14px 0 6px;
	padding: 0;
	list-style: none;
	font-size: 15px;
	color: var(--kb-muted);
}

.ktx-trust li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.ktx-sub {
	margin: -6px 0 16px;
	font-size: 16px;
	color: var(--kb-muted);
}

/* Eingabe */

.ktx-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
}

.ktx-tabs [aria-selected="true"] {
	border-color: var(--kb-accent);
	background: var(--kb-accent-soft);
	color: var(--kb-accent-dark);
	font-weight: 700;
}

.ktx-demo {
	margin-left: auto;
}

.ktx-form {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 12px 14px;
	align-items: end;
}

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

.ktx-field label {
	font-size: 14px;
	font-weight: 700;
	color: var(--kb-text);
	line-height: 1.3;
}

.ktx-field input,
.ktx-field select {
	width: 100%;
	min-height: 44px;
	padding: 8px 10px;
	border: 1px solid var(--kb-border);
	border-radius: var(--kb-radius-sm);
	background: #fff;
	color: var(--kb-text);
	font: inherit;
	font-size: 16px;
	box-sizing: border-box;
}

.ktx-field input:focus,
.ktx-field select:focus {
	outline: 2px solid var(--kb-accent);
	outline-offset: 1px;
	border-color: var(--kb-accent);
}

.ktx-field input[aria-invalid="true"] {
	border-color: var(--kb-bad);
}

.ktx-field--submit .kb-btn {
	width: 100%;
	min-height: 44px;
}

.ktx-form-msg {
	min-height: 1.4em;
	margin: 10px 0 0;
	font-size: 15px;
}

.ktx-form-msg.is-error {
	color: var(--kb-bad);
}

.ktx-form-msg.is-ok {
	color: var(--kb-good);
}

.ktx-drop {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 28px 18px;
	border: 2px dashed var(--kb-border);
	border-radius: var(--kb-radius);
	background: var(--kb-bg-soft);
	text-align: center;
	cursor: pointer;
}

.ktx-drop:hover,
.ktx-drop.is-over,
.ktx-drop:focus-within {
	border-color: var(--kb-accent);
	background: var(--kb-accent-soft);
}

.ktx-drop span {
	max-width: 640px;
	font-size: 15px;
	color: var(--kb-muted);
}

.ktx-drop input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.ktx-imports {
	display: grid;
	gap: 10px;
	margin-top: 14px;
}

.ktx-import {
	padding: 12px 16px;
	border-radius: var(--kb-radius-sm);
	background: var(--kb-bg-soft);
	font-size: 15px;
}

.ktx-import.is-error {
	background: var(--kb-bad-soft);
}

.ktx-import strong {
	display: block;
	margin-bottom: 2px;
}

.ktx-import details {
	margin-top: 6px;
}

.ktx-import ul {
	margin: 6px 0 0 18px;
	font-size: 14px;
}

.ktx-import label {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

.ktx-import input {
	min-height: 36px;
	padding: 4px 8px;
	border: 1px solid var(--kb-border);
	border-radius: var(--kb-radius-sm);
	font: inherit;
	font-size: 15px;
}

.ktx-csv-actions,
.ktx-entry-actions,
.ktx-lot-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 14px 0;
}

.ktx-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-right: auto;
	font-size: 15px;
	cursor: pointer;
}

.ktx-check input {
	width: 18px;
	height: 18px;
}

.ktx-entries {
	margin-top: 22px;
}

.ktx-count {
	font-weight: 400;
	color: var(--kb-muted);
	font-size: 16px;
}

.ktx-settings {
	margin-top: 22px;
	padding: 14px 18px;
	border-radius: var(--kb-radius);
	background: var(--kb-bg-soft);
}

.ktx-settings summary {
	font-weight: 700;
	cursor: pointer;
}

.ktx-settings-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px 14px;
	margin-top: 14px;
	align-items: end;
}

/* Tabellen */

.ktx-table td,
.ktx-table th {
	vertical-align: middle;
}

.ktx-table thead th.num {
	text-align: right;
}

.ktx-table td.num {
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.ktx-table .ktx-x {
	width: 40px;
	text-align: center;
}

.ktx-x button {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: var(--kb-radius-sm);
	background: transparent;
	color: var(--kb-muted);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.ktx-x button:hover,
.ktx-x button:focus-visible {
	background: var(--kb-bad-soft);
	color: var(--kb-bad);
}

.ktx-up {
	color: var(--kb-good);
}

.ktx-down {
	color: var(--kb-bad);
}

.ktx-small {
	display: block;
	font-size: 13px;
	color: var(--kb-muted);
	font-weight: 400;
}

.ktx-more {
	margin-top: 10px;
}

/* Ergebnis */

.ktx-tiles {
	--kb-min: 220px;
	margin-bottom: 18px;
}

.ktx-tile {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 18px;
	border-radius: var(--kb-radius);
	background: var(--kb-bg-soft);
}

.ktx-tile .kb-label {
	font-size: 14px;
}

.ktx-tile strong {
	font-size: 26px;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.ktx-tile span {
	font-size: 14px;
	color: var(--kb-muted);
}

.ktx-tile--good {
	background: var(--kb-good-soft);
}

.ktx-tile--warn {
	background: var(--kb-warn-soft);
}

.ktx-tile .kb-bar {
	margin-top: 6px;
}

.ktx-warnings {
	display: grid;
	gap: 8px;
	margin-bottom: 18px;
}

.ktx-warning {
	padding: 12px 16px;
	border-radius: var(--kb-radius-sm);
	background: var(--kb-warn-soft);
	font-size: 15px;
}

.ktx-warning--info {
	background: var(--kb-accent-soft);
}

.ktx-warning strong {
	display: block;
}

.ktx-chart {
	position: relative;
	height: 260px;
	margin-bottom: 18px;
}

.ktx-loading {
	color: var(--kb-muted);
}

/* Szenario und Reform */

.ktx-scenario-result {
	margin-top: 18px;
}

.ktx-result-grid {
	--kb-min: 200px;
	margin-bottom: 12px;
}

.ktx-slices {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	font-size: 15px;
}

.ktx-slices li {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	padding: 8px 0;
	border-bottom: 1px solid var(--kb-border);
}

.ktx-status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
	font-size: 15px;
	color: var(--kb-muted);
}

.ktx-reform-form {
	margin-bottom: 16px;
}

.ktx-reform-tiles {
	--kb-min: 240px;
}

.ktx-reform-mine:not(:empty) {
	margin: 12px 0 4px;
	padding: 12px 16px;
	border-radius: var(--kb-radius-sm);
	background: var(--kb-accent-soft);
	font-size: 15px;
}

/* Nächste Schritte */

.ktx-next-tiles {
	--kb-min: 260px;
}

.ktx-next-tile {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px 20px;
	border: 1px solid var(--kb-border);
	border-radius: var(--kb-radius);
	background: #fff;
}

.ktx-next-tile h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}

.ktx-next-tile p {
	margin: 0;
	font-size: 15px;
}

.ktx-next-tile ul {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 15px;
}

.ktx-next-tile li {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 0;
	border-bottom: 1px solid var(--kb-border);
}

.ktx-next-tile .kb-btn {
	margin-top: auto;
	align-self: flex-start;
}

/* Texte */

.ktx-text p:last-child {
	margin-bottom: 0;
}

.ktx-sources {
	margin: 0 0 14px 20px;
}

.ktx-sources li {
	margin-bottom: 6px;
}

.ktx-related {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 14px 0 0;
}

@media (min-width: 721px) {
	.ktx-lot-table th,
	.ktx-lot-table td,
	.ktx-coin-table td {
		white-space: nowrap;
	}

	.ktx-lot-table .ktx-small,
	.ktx-coin-table .ktx-small {
		white-space: nowrap;
	}
}

/* Schnellcheck */

.ktx-quick {
	margin: 18px 0 14px;
	padding: 20px 22px;
	border-radius: var(--kb-radius);
	background: var(--kb-bg-soft);
}

.ktx-quick-title {
	margin: 0 0 14px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
}

.ktx-quick-form {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px 14px;
	align-items: end;
}

.ktx-quick-result:not(:empty) {
	margin-top: 16px;
	padding: 16px 18px;
	border-radius: var(--kb-radius-sm);
	background: #fff;
}

.ktx-q-big {
	display: block;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
}

.ktx-q-big.is-free {
	color: var(--kb-good);
}

.ktx-q-sub {
	display: block;
	margin-top: 2px;
	color: var(--kb-muted);
}

.ktx-q-lines {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	font-size: 16px;
}

.ktx-q-lines li {
	margin: 6px 0 0;
}

.ktx-q-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
}

/* Beschriftung mit Info-Knopf */

.ktx-label {
	display: flex;
	align-items: center;
	gap: 4px;
	min-height: 24px;
}

.ktx-help-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--kb-muted);
	cursor: pointer;
	flex: 0 0 auto;
}

.ktx-help-btn:hover,
.ktx-help-btn:focus-visible,
.ktx-help-btn[aria-expanded="true"] {
	background: var(--kb-accent-soft);
}

.ktx-help-text {
	margin: 6px 0 0;
	padding: 8px 10px;
	border-radius: var(--kb-radius-sm);
	background: var(--kb-accent-soft);
	font-size: 14px;
	line-height: 1.45;
}

.ktx-linkbtn {
	align-self: flex-start;
	margin-top: 8px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--kb-accent-dark);
	font: inherit;
	font-size: 15px;
	text-decoration: underline;
	cursor: pointer;
}

.ktx-gross-out {
	margin-top: 6px;
	font-size: 14px;
	color: var(--kb-muted);
}

/* Formular: weitere Angaben */

.ktx-more-fields {
	grid-column: 1 / -1;
}

.ktx-more-fields > summary,
.ktx-advanced > summary {
	font-size: 15px;
	font-weight: 700;
	color: var(--kb-accent-dark);
	cursor: pointer;
}

.ktx-more-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 12px 14px;
	margin-top: 10px;
	align-items: end;
}

.ktx-advanced {
	margin-top: 14px;
}

/* Zusammenfassung unter dem Formular */

.ktx-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: var(--kb-radius-sm);
	background: var(--kb-accent-soft);
}

.ktx-summary-text {
	flex: 1 1 260px;
	margin: 0;
	font-size: 16px;
}

.ktx-result-lead:empty {
	display: none;
}

/* Kompakte Kaufzeilen (mobil) */

.ktx-mobile-meta,
.ktx-row-toggle {
	display: none;
}

/* Mobil: Tabellen als Karten */

@media (max-width: 720px) {
	.ktx-demo {
		margin-left: 0;
	}

	.ktx-form {
		grid-template-columns: 1fr 1fr;
	}

	.ktx-field--submit {
		grid-column: 1 / -1;
	}

	.ktx-table thead {
		display: none;
	}

	.ktx-table,
	.ktx-table tbody,
	.ktx-table tr,
	.ktx-table td,
	.ktx-table th {
		display: block;
		width: 100%;
	}

	.ktx-table tr {
		position: relative;
		margin-bottom: 10px;
		padding: 10px 14px;
		border-radius: var(--kb-radius-sm);
		background: var(--kb-bg-soft);
	}

	.ktx-table td,
	.ktx-table tbody th {
		display: block;
		padding: 4px 0;
		border: 0;
		text-align: right;
		white-space: normal;
		overflow: hidden;
	}

	.ktx-table td::before,
	.ktx-table tbody th::before {
		content: attr(data-label);
		float: left;
		margin-right: 12px;
		font-weight: 400;
		color: var(--kb-muted);
		text-align: left;
	}

	.ktx-table td.num {
		white-space: normal;
	}

	.ktx-page .ktx-table tbody th {
		text-align: right;
	}

	.ktx-table td.ktx-x {
		position: absolute;
		top: 6px;
		right: 6px;
		width: auto;
		padding: 0;
	}

	.ktx-table td.ktx-x::before {
		content: none;
	}

	.ktx-tile strong {
		font-size: 22px;
	}

	.ktx-chart {
		height: 220px;
	}
	.ktx-quick {
		padding: 16px;
	}

	.ktx-quick-form {
		grid-template-columns: 1fr;
	}

	.ktx-mobile-meta {
		display: block;
		font-size: 14px;
		font-weight: 400;
		color: var(--kb-muted);
	}

	.ktx-row-toggle {
		display: inline-block;
		margin-top: 6px;
		padding: 0;
		border: 0;
		background: none;
		color: var(--kb-accent-dark);
		font: inherit;
		font-size: 14px;
		text-decoration: underline;
		cursor: pointer;
	}

	.ktx-lot-table tr:not(.is-open) .ktx-opt {
		display: none;
	}

	.ktx-page .ktx-lot-table tbody th {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 2px 10px;
		width: auto;
		padding: 0 0 8px;
		margin-bottom: 4px;
		border-bottom: 1px solid var(--kb-border);
		text-align: left;
		font-size: 18px;
	}

	.ktx-page .ktx-lot-table tbody th::before {
		content: none;
	}

	.ktx-lot-table .ktx-mobile-meta {
		flex: 1 1 100%;
		order: 3;
	}

	.ktx-lot-table .ktx-row-toggle {
		margin: 0 0 0 auto;
		order: 2;
	}
}
