/* ATF Likviditetsbudget v1.4 */
.atf-lb {
	background: #faf7f2;
	border: 1px solid #e6ddce;
	border-radius: 4px;
	padding: 32px;
	margin: 32px 0;
	color: #0f1e2e;
}

.atf-lb__header {
	margin-bottom: 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e6ddce;
}

.atf-lb__eyebrow {
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #c97a4a;
	margin-bottom: 8px;
	font-weight: 600;
}

.atf-lb__title {
	font-size: 28px;
	font-weight: 700;
	color: #0f1e2e;
	margin: 0 0 10px;
	line-height: 1.2;
}

.atf-lb__subtitle {
	font-size: 15px;
	color: #4a5568;
	margin: 0;
	line-height: 1.6;
}

.atf-lb__top {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 20px;
	margin-bottom: 24px;
}

.atf-lb__shortcuts {
	background: #fff;
	border: 1px solid #e6ddce;
	border-radius: 4px;
	padding: 20px;
	margin-bottom: 20px;
}

.atf-lb-sh-title {
	font-size: 14px;
	font-weight: 600;
	color: #0f1e2e;
	margin: 0 0 14px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.atf-lb__shortcuts-row {
	display: grid;
	grid-template-columns: 1fr 1fr auto auto;
	gap: 12px;
	align-items: end;
}

.atf-lb-field {
	display: flex;
	flex-direction: column;
}

.atf-lb-field label {
	font-size: 13px;
	font-weight: 600;
	color: #0f1e2e;
	margin-bottom: 6px;
}

.atf-lb-field input,
.atf-lb-field select {
	padding: 10px 12px;
	border: 1px solid #d4cab8;
	border-radius: 3px;
	background: #fff;
	font-size: 15px;
	color: #0f1e2e;
	transition: border-color 0.15s;
}

.atf-lb-field input:focus,
.atf-lb-field select:focus {
	outline: none;
	border-color: #1a5d3e;
	box-shadow: 0 0 0 3px rgba(26, 93, 62, 0.12);
}

.atf-lb-hint {
	font-size: 12px;
	color: #6b7a8c;
	margin-top: 4px;
	line-height: 1.4;
}

.atf-lb-btn {
	padding: 10px 18px;
	background: #1a5d3e;
	color: #fff;
	border: 0;
	border-radius: 3px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
}

.atf-lb-btn:hover {
	background: #134530;
}

.atf-lb-btn.is-copied {
	background: #c97a4a;
}

.atf-lb-btn--small {
	padding: 10px 16px;
	font-size: 13px;
}

.atf-lb-btn--ghost {
	background: #fff;
	color: #0f1e2e;
	border: 1px solid #d4cab8;
}

.atf-lb-btn--ghost:hover {
	background: #f5f0e6;
}

.atf-lb__table-wrap {
	overflow-x: auto;
	margin-bottom: 24px;
	background: #fff;
	border: 1px solid #e6ddce;
	border-radius: 4px;
}

.atf-lb__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	min-width: 720px;
}

.atf-lb__table th {
	background: #0f1e2e;
	color: #faf7f2;
	padding: 12px 10px;
	text-align: left;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.02em;
}

.atf-lb__table th:nth-child(2),
.atf-lb__table th:nth-child(3),
.atf-lb__table th:nth-child(4),
.atf-lb__table th:nth-child(5),
.atf-lb__table th:nth-child(6) {
	text-align: right;
}

.atf-lb__table td {
	padding: 8px 10px;
	border-bottom: 1px solid #f0ebe0;
	vertical-align: middle;
}

.atf-lb__table tr:last-child td {
	border-bottom: 0;
}

.atf-lb__table tr:nth-child(even) td {
	background: #fbf8f3;
}

.atf-lb-td-month {
	font-weight: 600;
	color: #0f1e2e;
}

.atf-lb-td-money {
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: #0f1e2e;
}

.atf-lb-td-neg {
	color: #c0392b;
	font-weight: 600;
}

.atf-lb-td-warn {
	color: #c97a4a;
	font-weight: 600;
}

.atf-lb-cell {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid #e6ddce;
	border-radius: 3px;
	background: #fff;
	font-size: 14px;
	text-align: right;
	color: #0f1e2e;
	font-variant-numeric: tabular-nums;
	transition: border-color 0.15s;
}

.atf-lb-cell:focus {
	outline: none;
	border-color: #1a5d3e;
	box-shadow: 0 0 0 2px rgba(26, 93, 62, 0.12);
}

.atf-lb__summary {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-bottom: 20px;
}

.atf-lb-sum {
	background: #fff;
	border: 1px solid #e6ddce;
	padding: 16px 18px;
	border-radius: 4px;
}

.atf-lb-sum--highlight {
	background: #0f1e2e;
	border-color: #0f1e2e;
	color: #faf7f2;
}

.atf-lb-sum--highlight .atf-lb-sum__label {
	color: #c97a4a;
}

.atf-lb-sum--highlight .atf-lb-sum__value {
	color: #faf7f2;
}

.atf-lb-sum--highlight .atf-lb-sum__sub {
	color: rgba(250, 247, 242, 0.7);
}

.atf-lb-sum__label {
	font-size: 12px;
	color: #6b7a8c;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 6px;
	font-weight: 600;
}

.atf-lb-sum__value {
	font-size: 22px;
	font-weight: 700;
	color: #0f1e2e;
	font-variant-numeric: tabular-nums;
}

.atf-lb-sum__value.atf-lb-pos {
	color: #1a5d3e;
}

.atf-lb-sum__value.atf-lb-neg {
	color: #c0392b;
}

.atf-lb-sum__sub {
	font-size: 12px;
	color: #6b7a8c;
	margin-top: 4px;
}

.atf-lb-note {
	background: #f5f0e6;
	border-left: 4px solid #c97a4a;
	padding: 16px 20px;
	border-radius: 0 4px 4px 0;
	margin-bottom: 20px;
	font-size: 14px;
	line-height: 1.6;
}

.atf-lb-note p {
	margin: 8px 0 0;
	color: #4a5568;
}

#atf-lb-warning {
	background: #fdf2e9;
	border-left-color: #c0392b;
}

.atf-lb__actions {
	display: flex;
	gap: 12px;
	margin-bottom: 20px;
}

@media (max-width: 768px) {
	.atf-lb {
		padding: 20px;
	}

	.atf-lb__title {
		font-size: 22px;
	}

	.atf-lb__top,
	.atf-lb__shortcuts-row {
		grid-template-columns: 1fr;
	}

	.atf-lb__summary {
		grid-template-columns: 1fr 1fr;
	}
}

/* =========================================================================
   CONTAINER QUERIES v2.9
   Brytpunkten @media (max-width: 768px) ovan mäter fönsterbredden och löser
   därför aldrig ut i artikelspalten, som bara är ca 690 px bred på desktop.
   Fyra sammanfattningskort på den bredden ger ca 136 px text per kort, vilket
   inte räcker för miljonbelopp. Reglerna nedan mäter verktygets egen bredd.
   @media-versionen ligger kvar som fallback.
   ========================================================================= */

.atf-lb {
	container-type: inline-size;
	container-name: atfcalc;
}

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

.atf-lb-sum {
	min-width: 0;
}

.atf-lb-sum__value {
	overflow-wrap: break-word;
}

@container atfcalc (max-width: 900px) {
	.atf-lb__summary {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@container atfcalc (max-width: 760px) {
	.atf-lb__shortcuts-row {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.atf-lb__shortcuts-row .atf-lb-btn {
		width: 100%;
	}
}

@container atfcalc (max-width: 560px) {
	.atf-lb {
		padding: 20px;
	}

	.atf-lb__top,
	.atf-lb__shortcuts-row {
		grid-template-columns: minmax(0, 1fr);
	}
}

@container atfcalc (max-width: 420px) {
	.atf-lb__summary {
		grid-template-columns: minmax(0, 1fr);
	}
}
