/* Krypto-Sparplan-Rechner (Krypto_Dca_Page, Seite und Bitcoin-Reiter) – baut auf kb-ui.css auf. */

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

.kdc-form {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 12px;
	margin: 0 0 16px;
}

.kdc-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	font-size: 0.85rem;
	color: var(--kb-muted);
}

.kdc-field--coin {
	grid-column: span 2;
}

.kdc-field input,
.kdc-field select {
	width: 100%;
	min-height: 46px;
	padding: 8px 12px;
	border: 1px solid var(--kb-border);
	border-radius: var(--kb-radius-sm);
	font: inherit;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--kb-text);
	background: #fff;
	font-variant-numeric: tabular-nums;
	box-sizing: border-box;
}

.kdc-input {
	position: relative;
	display: block;
}

.kdc-input input {
	padding-right: 36px;
}

.kdc-input span {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	font-weight: 600;
	color: var(--kb-muted);
}

.kdc-check {
	display: flex;
	align-items: center;
	gap: 8px;
	grid-column: 1 / -1;
	padding: 10px 12px;
	border: 1px dashed var(--kb-border);
	border-radius: var(--kb-radius-sm);
	font-weight: 600;
	cursor: pointer;
}

.kdc-check input {
	width: 18px;
	height: 18px;
	margin: 0;
}

.kdc-summary,
.kdc-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 10px;
	margin: 0 0 16px;
}

.kdc-summary > div,
.kdc-stats > div {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 12px 14px;
	border-radius: var(--kb-radius-sm);
	background: var(--kb-bg-soft);
	min-width: 0;
}

.kdc-summary strong {
	font-size: 1.45rem;
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.kdc-stats strong {
	font-size: 1.15rem;
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.kdc-sub {
	color: var(--kb-muted);
	font-size: 0.85rem;
	font-variant-numeric: tabular-nums;
}

.kdc-gain.is-up {
	background: #ecfdf3;
}

.kdc-gain.is-up strong,
.kdc-gain.is-up .kdc-sub,
.kdc .is-up {
	color: #047857;
}

.kdc-gain.is-down {
	background: #fef2f2;
}

.kdc-gain.is-down strong,
.kdc-gain.is-down .kdc-sub,
.kdc .is-down {
	color: #b91c1c;
}

.kdc-error {
	padding: 10px 14px;
	border-left: 4px solid #f59e0b;
	background: #fffbeb;
}

.kdc-compare td,
.kdc-compare th {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.kdc-compare td {
	text-align: right;
}

.kdc-compare tr.is-best th::after {
	content: " ★";
	color: #f7931a;
}

.kdc-compare tr.is-etf th {
	color: #2563eb;
}

/* Diagramm */
.kdc-chart {
	position: relative;
	width: 100%;
	touch-action: pan-y;
}

.kdc-svg {
	display: block;
	overflow: visible;
}

.kdc-grid {
	stroke: var(--kb-border);
	stroke-width: 1;
}

.kdc-axis {
	fill: var(--kb-muted);
	font-size: 11px;
	font-variant-numeric: tabular-nums;
}

.kdc-line {
	fill: none;
	stroke-width: 2;
	stroke-linejoin: round;
}

.kdc-line--value {
	stroke-width: 2.5;
}

.kdc-line--invested {
	stroke-dasharray: 5 4;
}

.kdc-cursor {
	stroke: var(--kb-text);
	stroke-width: 1;
	opacity: 0.4;
}

.kdc-tip {
	position: absolute;
	top: 8px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 10px;
	border: 1px solid var(--kb-border);
	border-radius: var(--kb-radius-sm);
	background: #fff;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	pointer-events: none;
}

.kdc-tip i,
.kdc-legend i {
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 6px;
	border-radius: 2px;
}

.kdc-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.85rem;
	color: var(--kb-muted);
}

/* Jahre */
.kdc-years {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 8px;
}

.kdc-year {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 12px;
	border-radius: var(--kb-radius-sm);
	background: var(--kb-bg-soft);
	font-variant-numeric: tabular-nums;
}

.kdc-year span {
	color: var(--kb-muted);
	font-size: 0.85rem;
}

.kdc-year small {
	display: block;
	font-size: 0.75rem;
}

.kdc-year strong {
	font-size: 1.1rem;
}

/* Käufe, Teilen */
.kdc-buys th,
.kdc-buys td {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.kdc-buys td {
	text-align: right;
}

.kdc-share {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
	margin-top: 8px;
}

.kdc-share .kdc-field {
	flex: 1 1 320px;
}

.kdc-share-row {
	display: flex;
	gap: 8px;
}

.kdc-share-row input {
	flex: 1;
	min-width: 0;
	font-size: 0.85rem;
	font-weight: 400;
}

/* Anbieter und Links (Seite) */
.kdc-prov-grid,
.kdc-links {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 10px;
}

.kdc-prov-name {
	margin: 0 0 4px;
	font-size: 1.05rem;
}

.kdc-prov-grid p {
	margin: 0 0 6px;
}

.kdc-links {
	margin: 0;
	padding: 0;
	list-style: none;
}

.kdc-links a {
	display: flex;
	flex-direction: column;
	gap: 2px;
	height: 100%;
	padding: 12px 14px;
	border: 1px solid var(--kb-border);
	border-radius: var(--kb-radius-sm);
	text-decoration: none;
	color: var(--kb-text);
	box-sizing: border-box;
}

.kdc-links a:hover {
	border-color: #f7931a;
}

.kdc-links span {
	color: var(--kb-muted);
	font-size: 0.85rem;
}

/* Handy: Vergleich als Karten, Käufe waagerecht wischbar (kb-ui bricht Tabellenzellen sonst mitten in Zahlen um) */
@media (max-width: 760px) {
	.kdc .kb-table.kdc-compare,
	.kdc .kb-table.kdc-compare tbody {
		display: block;
		width: 100%;
	}

	.kdc .kb-table.kdc-compare thead {
		display: none;
	}

	.kdc .kb-table.kdc-compare tr {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 6px 12px;
		padding: 10px 0;
		border-bottom: 1px solid var(--kb-border);
	}

	.kdc .kb-table.kdc-compare th[scope="row"],
	.kdc .kb-table.kdc-compare td {
		padding: 0;
		border: 0;
		font-size: 14px;
		text-align: left;
		white-space: nowrap;
		overflow-wrap: normal;
		hyphens: none;
	}

	.kdc .kb-table.kdc-compare th[scope="row"] {
		grid-column: 1 / -1;
		font-size: 15px;
	}

	.kdc .kb-table.kdc-compare td::before {
		content: attr(data-label);
		display: block;
		color: var(--kb-muted);
		font-size: 11px;
		font-weight: 400;
	}

	.kdc .kb-table.kdc-buys {
		width: max-content;
		min-width: 100%;
		table-layout: auto;
	}

	.kdc .kb-table.kdc-buys th,
	.kdc .kb-table.kdc-buys td {
		padding: 8px;
		font-size: 13px;
		white-space: nowrap;
		overflow-wrap: normal;
		hyphens: none;
	}

	.kdc .kb-table.kdc-buys tbody th,
	.kdc .kb-table.kdc-buys thead th:first-child {
		position: sticky;
		left: 0;
		background: #fff;
	}
}

@media (max-width: 560px) {
	.kdc-field--coin {
		grid-column: 1 / -1;
	}

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

	.kdc-summary strong {
		font-size: 1.25rem;
	}
}
