/* Bolåneräntor – frontend. Allt är prefixat .efbr för att inte krocka med temat. */
.efbr {
	--efbr-accent: #1d4ed8;
	--efbr-text: #0f172a;
	--efbr-muted: #64748b;
	--efbr-line: #e2e8f0;
	--efbr-soft: #f1f5f9;
	--efbr-head: #f8fafc;
	--efbr-best: #047857;
	--efbr-best-bg: #d1fae5;
	--efbr-worst: #b91c1c;
	--efbr-worst-bg: #fee2e2;
	--efbr-radius: 14px;
	position: relative;
	max-width: 760px;
	margin: 1.5em 0;
	color: var(--efbr-text);
	font-size: 16px;
	line-height: 1.4;
	-webkit-text-size-adjust: 100%;
}
.efbr *,
.efbr *::before,
.efbr *::after { box-sizing: border-box; }

/* Gemensam knappåterställning (teman stylar ofta button hårt) */
.efbr button {
	margin: 0;
	font: inherit;
	font-size: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}
.efbr button:focus-visible,
.efbr .efbr-opt input:focus-visible + .efbr-opt__box {
	outline: 3px solid color-mix(in srgb, var(--efbr-accent) 45%, transparent);
	outline-offset: 2px;
}

/* ---------- Listräntor / Snitträntor ---------- */
.efbr-switch {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	padding: 4px;
	margin: 0 0 16px;
	background: var(--efbr-soft);
	border-radius: 999px;
}
.efbr .efbr-switch__btn {
	min-height: 48px;
	padding: 10px 12px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--efbr-muted);
	font-weight: 600;
	font-size: 16px;
	line-height: 1.2;
	transition: background .15s, color .15s, box-shadow .15s;
}
.efbr .efbr-switch__btn:hover { color: var(--efbr-text); background: transparent; }
.efbr .efbr-switch__btn.is-active {
	background: var(--efbr-accent);
	color: #fff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, .18);
}

/* ---------- Dropdown bindningstid ---------- */
.efbr-picker { position: relative; margin: 0 0 14px; }
.efbr-picker__label {
	display: block;
	margin: 0 0 6px;
	font-weight: 600;
	font-size: 15px;
}
.efbr-picker__sub { font-weight: 400; color: var(--efbr-muted); }
.efbr .efbr-picker__btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-height: 52px;
	padding: 12px 16px;
	border: 1.5px solid var(--efbr-line);
	border-radius: 12px;
	background: #fff;
	color: var(--efbr-text);
	font-size: 16px;
	font-weight: 500;
	text-align: left;
	transition: border-color .15s;
}
.efbr .efbr-picker__btn:hover,
.efbr.is-open .efbr-picker__btn { border-color: var(--efbr-accent); background: #fff; color: var(--efbr-text); }
.efbr-picker__val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.efbr-picker__chev { flex: none; color: var(--efbr-muted); transition: transform .2s; }
.efbr.is-open .efbr-picker__chev { transform: rotate(180deg); }

.efbr-picker__panel {
	position: absolute;
	z-index: 50;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	padding: 14px;
	background: #fff;
	border: 1px solid var(--efbr-line);
	border-radius: 14px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
}
.efbr-picker__panel[hidden] { display: none; }
.efbr-picker__opts {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}
.efbr-opt {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 46px;
	margin: 0;
	padding: 8px 10px;
	border: 1.5px solid var(--efbr-line);
	border-radius: 10px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	user-select: none;
	transition: border-color .15s, background .15s;
}
.efbr-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.efbr-opt__box {
	flex: none;
	width: 20px;
	height: 20px;
	border: 2px solid #cbd5e1;
	border-radius: 6px;
	background: #fff center / 14px no-repeat;
}
.efbr-opt.is-on { border-color: var(--efbr-accent); background: color-mix(in srgb, var(--efbr-accent) 7%, #fff); }
.efbr-opt.is-on .efbr-opt__box {
	border-color: var(--efbr-accent);
	background-color: var(--efbr-accent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.efbr-opt.is-disabled { opacity: .4; cursor: not-allowed; }
.efbr-picker__msg { margin: 12px 0 10px; font-size: 14px; color: var(--efbr-muted); }
.efbr .efbr-picker__done {
	width: 100%;
	min-height: 48px;
	border: 0;
	border-radius: 10px;
	background: var(--efbr-accent);
	color: #fff;
	font-weight: 600;
	font-size: 16px;
}
.efbr .efbr-picker__done:hover { filter: brightness(1.08); background: var(--efbr-accent); color: #fff; }

/* ---------- Meta ---------- */
.efbr-meta {
	margin: 0 0 8px;
	font-size: 14px;
	color: var(--efbr-muted);
}

/* ---------- Tabell ---------- */
.efbr-tablewrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--efbr-line);
	border-radius: var(--efbr-radius);
	background: #fff;
}
.efbr table.efbr-table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	border-spacing: 0;
	table-layout: auto;
	font-size: 16px;
	background: transparent;
}
.efbr .efbr-table th,
.efbr .efbr-table td {
	padding: 14px 16px;
	border: 0;
	border-bottom: 1px solid var(--efbr-line);
	background: transparent;
	color: inherit;
	vertical-align: middle;
	text-align: left;
	font-size: inherit;
	line-height: 1.3;
}
.efbr .efbr-table tbody tr:last-child > * { border-bottom: 0; }
.efbr .efbr-table tbody tr:nth-child(even) > * { background: #fbfcfd; }
.efbr .efbr-table thead th {
	background: var(--efbr-head);
	font-size: 14px;
	font-weight: 600;
	color: var(--efbr-muted);
	white-space: nowrap;
	padding-top: 10px;
	padding-bottom: 10px;
}
.efbr .efbr-table th.efbr-table__bank { font-weight: 600; color: var(--efbr-text); -webkit-hyphens: auto; hyphens: auto; overflow-wrap: anywhere; }
.efbr .efbr-table th.efbr-table__rate { padding-right: 24px; }
@media (min-width: 601px) { .efbr .efbr-table .efbr-table__rate { min-width: 104px; } }
.efbr .efbr-table thead th.efbr-table__bank { color: var(--efbr-muted); }
.efbr .efbr-table__bank a {
	color: var(--efbr-accent);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-decoration-color: color-mix(in srgb, var(--efbr-accent) 40%, transparent);
	text-underline-offset: 3px;
}
.efbr .efbr-nw { white-space: nowrap; }
.efbr .efbr-table__bank a .efbr-nw::after {
	content: "";
	display: inline-block;
	width: 13px;
	height: 13px;
	margin-left: 5px;
	vertical-align: -1px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3H3.5A1.5 1.5 0 0 0 2 4.5v8A1.5 1.5 0 0 0 3.5 14h8a1.5 1.5 0 0 0 1.5-1.5V10M9 2h5v5M14 2L7 9'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3H3.5A1.5 1.5 0 0 0 2 4.5v8A1.5 1.5 0 0 0 3.5 14h8a1.5 1.5 0 0 0 1.5-1.5V10M9 2h5v5M14 2L7 9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.efbr .efbr-table__bank a:hover,
.efbr .efbr-table__bank a:focus-visible { text-decoration-color: currentColor; filter: brightness(.85); }

.efbr .efbr-table .efbr-table__rate {
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	width: 1%;
}
.efbr .efbr-table td.efbr-table__rate > span {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 6px;
}
.efbr .efbr-table td.is-worst > span {
	background: var(--efbr-worst-bg);
	color: var(--efbr-worst);
	font-weight: 700;
}
.efbr .efbr-table td.is-best > span {
	background: var(--efbr-best-bg);
	color: var(--efbr-best);
	font-weight: 700;
}
.efbr .efbr-table td.is-na { color: #cbd5e1; }

.efbr .efbr-sort {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: inherit;
	font-weight: inherit;
	font-size: inherit;
	white-space: nowrap;
}
.efbr .efbr-sort:hover { color: var(--efbr-text); background: none; }
.efbr-sort__ico {
	width: 0; height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid #cbd5e1;
}
.efbr .is-sorted .efbr-sort,
.efbr th[aria-sort] .efbr-sort { color: var(--efbr-accent); }
.efbr th[aria-sort] .efbr-sort__ico { border-top-color: var(--efbr-accent); }
.efbr .efbr-empty { text-align: center; color: var(--efbr-muted); padding: 28px 16px; }

/* ---------- Fotnot ---------- */
.efbr-note {
	margin: 10px 0 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--efbr-muted);
}
.efbr-note__legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-right: 8px; font-weight: 600; }
.efbr-note__best,
.efbr-note__worst {
	display: inline-block;
	width: 10px; height: 10px;
	border-radius: 3px;
	background: var(--efbr-best-bg);
	border: 1px solid var(--efbr-best);
}
.efbr-note__worst { margin-left: 8px; background: var(--efbr-worst-bg); border-color: var(--efbr-worst); }

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
	.efbr-picker__opts { grid-template-columns: repeat(3, 1fr); }
	.efbr .efbr-table th,
	.efbr .efbr-table td { padding: 13px 10px; }
	.efbr .efbr-table th.efbr-table__bank { padding-left: 14px; font-size: 15px; }
	.efbr .efbr-table .efbr-table__rate:last-child { padding-right: 14px; }
	.efbr .efbr-table td.efbr-table__rate > span { padding: 3px 6px; font-size: 15px; }
	.efbr .efbr-table th.efbr-table__rate { padding-right: 16px; }
	.efbr .efbr-table thead th { font-size: 13px; }
}
@media (max-width: 400px) {
	.efbr .efbr-pct { display: none; }
	.efbr .efbr-table th,
	.efbr .efbr-table td { padding-left: 7px; padding-right: 7px; }
	.efbr .efbr-table td.efbr-table__rate > span { font-size: 14px; padding: 2px 5px; }
	.efbr .efbr-table th.efbr-table__rate { padding-right: 12px; }
	.efbr .efbr-table th.efbr-table__bank { font-size: 14px; }
	.efbr .efbr-switch__btn { font-size: 15px; }
}
