:root {
	--page-bg: #ececec;
	--page-text: #2b2e33;
	--page-muted: #94a5b9;
	--g57-link: #4b6a88;
	--g57-gray: #e0e0e0;
	--g57-light: #f5f5f5;
	--g57-yellow: #ffc32a;
	--g57-shadow: 0 0 4px rgba(37, 36, 41, 0.04), 0 4px 16px rgba(37, 36, 41, 0.08);
}

[hidden] {
	display: none !important;
}

#calc-root {
	padding: 10px 0 15px 0;
}

.calculator {
	--c-accent: #4b6a88;
	--c-accent-dark: #3a5470;
	--c-accent-soft: #eef2f6;
	--c-percent: #ffc32a;
	--c-surface: #ffffff;
	--c-surface-2: #f5f5f5;
	--c-text: #2b2e33;
	--c-muted: #94a5b9;
	--c-border: #e0e0e0;
	--c-result-bg: #ffffff;
	--c-result-text: #2b2e33;
	--c-result-muted: #94a5b9;
	--c-result-border: #e0e0e0;
	--c-ring: #e0e0e0;
	--c-btn-bg: #4b6a88;
	--c-btn-text: #ffffff;
	--c-shadow: 0 0 4px rgba(37, 36, 41, 0.04), 0 4px 16px rgba(37, 36, 41, 0.08);
	--c-radius: 8px;

	display: grid;
	gap: 20px;
	align-items: start;
}

.panel {
	background: var(--c-surface);
	border-radius: var(--c-radius);
	box-shadow: var(--c-shadow);
	padding: 20px;
	min-width: 0;
}

.form-panel {
	order: 1;
}
.result-panel {
	order: 2;
	background: var(--c-result-bg);
	color: var(--c-result-text);
}
.early-panel {
	order: 3;
}

/* ---------- Поля ---------- */
.field {
	margin-bottom: 24px;
}
.field:last-child {
	margin-bottom: 0;
}

.field__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 12px;
}
.field label {
	font-size: 14px;
	font-weight: 600;
	color: var(--c-muted);
}
.field__label-block {
	display: block;
	margin-bottom: 12px;
}

.input-money {
	display: inline-flex;
	align-items: center;
	background: var(--c-surface-2);
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 0 8px;
	transition: border-color 0.15s, background 0.15s;
}
.input-money:focus-within {
	border-color: var(--c-accent);
	background: var(--c-surface);
}
.input-money input {
	border: 0;
	background: transparent;
	outline: none;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	color: var(--c-text);
	width: 100%;
	min-width: 0;
	padding: 10px 0;
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.input-money__unit {
	margin-left: 6px;
	color: var(--c-muted);
	font-size: 14px;
	font-weight: 600;
}
.input-duo {
	display: flex;
	gap: 8px;
}
.input-duo .input-money {
	flex: 1;
}
.input-money--percent input {
	width: 100%;
}
.input-duo .input-money--percent {
	flex: none;
	width: 70px;
}
.input-money:has(.js-term) {
	width: 70px;
}
.input-money:has(.js-rate) {
	width: 70px;
}

/* ---------- Слайдеры ---------- */
input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	border-radius: 3px;
	background: var(--c-accent-soft);
	outline: none;
	cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--c-accent);
	border: 4px solid #fff;
	box-shadow: 0 1px 6px rgba(37, 36, 41, 0.35);
	transition: transform 0.12s;
}
input[type="range"]::-webkit-slider-thumb:hover {
	transform: scale(1.12);
}
input[type="range"]::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--c-accent);
	border: 4px solid #fff;
	box-shadow: 0 1px 6px rgba(37, 36, 41, 0.35);
}
.range-scale {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	font-size: 12px;
	color: var(--c-muted);
}

/* ---------- Пресеты ---------- */
.presets {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-top: 14px;
}
.preset {
	border: 0;
	background: transparent;
	padding: 0;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	color: var(--c-accent);
	cursor: pointer;
	border-bottom: 1px dashed rgba(75, 106, 136, 0.45);
	line-height: 1.3;
	transition: color 0.15s, border-color 0.15s;
}
.preset:hover {
	color: var(--c-accent-dark);
	border-bottom-style: solid;
}
.preset.is-active {
	color: var(--c-muted);
	font-weight: 700;
	border: 1px solid;
	cursor: default;
	border-radius: 8px;
	padding: 2px 3px 2px 3px;
}

/* ---------- Сегменты ---------- */
.segmented {
	display: flex;
	background: var(--c-surface-2);
	border-radius: 10px;
	padding: 4px; gap: 4px;
}
.segmented__item {
	flex: 1;
	border: 0;
	background: transparent;
	padding: 12px 10px;
	border-radius: 7px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--c-muted);
	cursor: pointer;
	transition: all 0.15s;
}
.segmented__item.is-active {
	background: var(--c-surface);
	color: var(--c-accent);
	box-shadow: 0 2px 8px rgba(37, 36, 41, 0.1);
}
.segmented--sm .segmented__item {
	padding: 9px 8px;
	font-size: 13px;
}

/* ---------- Переключатель ---------- */
.switch {
	cursor: pointer;
	display: inline-flex;
}
.switch input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.switch__track {
	width: 46px;
	height: 26px;
	border-radius: 13px;
	background: #cfd6e2;
	position: relative;
	transition: background 0.2s;
	display: block;
}
.switch__thumb {
	position: absolute;
	top: 3px; left: 3px;
	width: 20px; height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.2s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.switch input:checked + .switch__track {
	background: var(--c-accent);
}
.switch input:checked + .switch__track .switch__thumb {
	transform: translateX(20px);
}

.early-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.early-head .dospog {
	font-size: 16px;
	font-weight: 700;
	color: var(--c-muted);
}
.early-fields {
	margin-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.early-once .select, .early-yearly .select {
	min-height: 43px;
}
.early-yearly {
	display: flex;
}

/* ---------- Селект ---------- */
.select {
	flex: 1;
	border: 1px solid var(--c-border);
	border-radius: 8px;
	background: var(--c-surface-2);
	padding: 0 12px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--c-text);
	cursor: pointer;
	outline: none;
}
.select:focus {
	border-color: var(--c-accent);
}

/* ---------- Результат: hero ---------- */
.result-hero {
	text-align: center;
	padding: 6px 0 20px;
	border-bottom: 1px solid var(--c-result-border);
	margin-bottom: 20px;
}
.result-hero__label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--c-result-muted);
	margin-bottom: 4px;
}
.result-hero__value {
	line-height: 56px;
	font-size: 40px;
	font-weight: 800;
	letter-spacing: -1px;
	color: var(--c-result-text);
	font-variant-numeric: tabular-nums;
}
.result-hero__note {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: var(--c-result-muted);
}

.result-hero__breakdown {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 320px;
	margin: 14px auto 0;
	text-align: left;
}
.hero-split {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
	padding: 0 10px 0 10px;
}
.hero-split__label {
	color: var(--c-result-muted);
}
.hero-split__value {
	font-weight: 700;
	color: var(--c-result-text);
	font-variant-numeric: tabular-nums;
}
.hero-split--extra {
	background: var(--c-accent-soft);
	border-radius: 6px;
	padding: 6px 10px;
}
.hero-split--extra .hero-split__label {
	color: var(--c-accent);
	font-weight: 600;
}
.hero-split--extra .hero-split__value {
	color: var(--c-accent);
}

/* ---------- Бублик ---------- */
.donut-wrap {
	display: flex;
	align-items: center;
	gap: 24px;
	margin-bottom: 22px;
}
.donut {
	width: 118px;
	height: 118px;
	flex-shrink: 0;
	transform: rotate(-90deg);
}
.donut__ring {
	fill: none;
	stroke: var(--c-ring);
	stroke-width: 5;
}
.donut__seg {
	fill: none;
	stroke-width: 5;
	transition: stroke-dasharray 0.4s ease, stroke-dashoffset 0.4s ease;
}
.donut__seg--body {
	stroke: var(--c-accent);
}
.donut__seg--percent {
	stroke: var(--c-percent);
}

.donut-legend {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}
.legend-item {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
}
.legend-dot {
	width: 12px;
	height: 12px;
	border-radius: 3px;
	flex-shrink: 0;
}
.legend-dot--body {
	background: var(--c-accent);
}
.legend-dot--percent {
	background: var(--c-percent);
}
.legend-label {
	color: var(--c-result-muted);
}
.legend-value {
	margin-left: auto;
	font-weight: 700;
	color: var(--c-result-text);
	font-variant-numeric: tabular-nums;
}

/* ---------- Статистика ---------- */
.stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin-bottom: 22px;
}
.stat {
	background: var(--c-surface-2);
	border-radius: 8px;
	padding: 14px 16px;
}
.stat__label {
	display: block;
	font-size: 13px;
	color: var(--c-muted);
	margin-bottom: 4px;
}
.stat__value {
	font-size: 18px;
	font-weight: 700;
	color: var(--c-text);
	font-variant-numeric: tabular-nums;
}

/* ---------- Выгода от досрочного погашения ---------- */
.benefits {
	background: var(--c-accent-soft);
	border-radius: 8px;
	padding: 16px 18px;
	margin-bottom: 22px;
}
.benefits__head {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--c-accent);
	margin-bottom: 12px;
}
.benefits__list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.benefit {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 8px;
	font-size: 14px;
}
.benefit__label {
	flex: 0 0 100%;
	font-size: 13px;
	color: var(--c-result-muted);
}
.benefit__base {
	color: var(--c-result-muted);
	text-decoration: line-through;
	font-variant-numeric: tabular-nums;
}
.benefit__arrow {
	color: var(--c-result-muted);
}
.benefit__now {
	font-weight: 700;
	color: var(--c-result-text);
	font-variant-numeric: tabular-nums;
}
.benefit__save {
	margin-left: auto;
	font-weight: 700;
	color: var(--c-accent);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* ---------- Кнопка ---------- */
.btn {
	width: 100%;
	border: 0;
	border-radius: 8px;
	padding: 15px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s, transform 0.05s;
}
.btn--primary {
	background: var(--c-btn-bg);
	color: var(--c-btn-text);
}
.btn--primary:hover {
	filter: brightness(0.94);
}
.btn--primary:active {
	transform: scale(0.99);
}

/* ---------- График платежей ---------- */
.schedule {
	margin-top: 20px;
	animation: fade 0.2s ease;
}
@keyframes fade {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
.schedule__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.schedule__head h3 {
	font-size: 17px;
	font-weight: 700;
	color: var(--c-result-text);
}
.schedule__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border: 1px solid var(--c-border);
	border-radius: 4px;
	background: var(--c-surface);
	color: var(--c-result-text);
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}
.schedule__close:hover {
	outline: 2px solid var(--c-border);
	opacity: 0.8;
}
.schedule__close:focus {
	outline: 2px solid var(--c-border);
}
.schedule__scroll {
	max-height: 227px;
	overflow-y: auto;
	overflow-x: hidden;
	border: 1px solid var(--c-result-border);
	border-radius: 8px;
}
.schedule-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}
.schedule-table th {
	position: sticky;
	top: 0;
	background: var(--c-surface-2);
	color: var(--c-muted);
	font-weight: 600;
	text-align: right;
	padding: 9px 6px;
	white-space: nowrap;
	z-index: 1;
}
.schedule-table th:first-child, .schedule-table th:nth-child(2) {
	text-align: left;
}
.schedule-table td {
	text-align: right;
	padding: 9px 6px;
	border-top: 1px solid var(--c-result-border);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--c-result-text);
}
.schedule-table col.col-num {
	width: 40px;
}
.schedule-table col.col-date {
	width: 64px;
}
.schedule-table td:first-child, .schedule-table td:nth-child(2) {
	text-align: left;
	color: var(--c-muted);
}
.schedule-table tbody tr:hover td {
	background: var(--c-accent-soft);
}
.schedule-table .early-row td {
	color: var(--c-percent);
}

.lay-1 {
	grid-template-columns: 1fr 1fr;
}
.lay-1 .calc-col {
	grid-column: 1;
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.lay-1 .result-panel {
	grid-column: 2;
}



@media (max-width: 768px) {
	
.lay-1 {
	grid-template-columns: 1fr;
}
.lay-1 .calc-col {
	display: contents;
}
.lay-1 .result-panel {
	grid-column: auto;
	position: static;
}
.result-hero__value {
	font-size: 32px;
}
.panel {
	padding: 20px;
}
.early-panel {
	order: 2;
}
.result-panel {
	order: 3;
}
.field__head {
	display: block;
}
.field__head > label {
	display: block;
	margin-bottom: 10px;
}
.field__head > .input-money, .field__head > .input-duo {
	margin-left: 0;
}
.field__head > .input-money {
	display: flex;
}
.field__head > .input-duo {
	display: flex;
	width: 100%;
	gap: 8px;
}
.field__head:has(.js-term), .field__head:has(.js-rate) {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.field__head:has(.js-term) > label, .field__head:has(.js-rate) > label {
	margin-bottom: 0;
	flex: 1;
}
.field__head:has(.js-term) > .input-money, .field__head:has(.js-rate) > .input-money {
	width: 70px;
	flex: none;
	display: flex;
}

}