/* =========================================================
   TC Calc — калькулятор подбора мощности. АВТОНОМНЫЙ CSS.
   Префикс tcc-, ни одного общего класса с темой/каталогом.
   Все размеры — в px/em внутри блока, сетки — по ширине
   самого блока (container queries), а не экрана.
   ======================================================= */

.tcc {
	/* собственная палитра */
	--y: #FFD629;          /* фирменный жёлтый */
	--y-soft: #FFF4C2;
	--y-hover: #FFE15C;
	--ink: #111111;
	--ink-2: #3a3f45;
	--mute: #8a9097;
	--line: #e6e9ed;
	--line-2: #d2d7dd;
	--bg: #f4f5f7;
	--card: #ffffff;
	--red: #d93025;
	--r: 16px;
	--r-s: 10px;
	--sh: 0 1px 3px rgba(17, 17, 17, .06);
	--sh-2: 0 14px 36px -14px rgba(17, 17, 17, .2);

	all: initial;                     /* отрезаем наследование от темы */
	display: block;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0 0 28px;
	padding: 22px;
	font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--ink);
	background: var(--bg);
	border-radius: var(--r);
	container-type: inline-size;
	-webkit-font-smoothing: antialiased;
}
.tcc.tcc-text, .tcc.tcc-facts { background: transparent; padding: 0; }
.tcc.tcc-facts { background: var(--bg); padding: 24px; }

/* Базовый сброс только внутри блока */
.tcc *, .tcc *::before, .tcc *::after { box-sizing: border-box; min-width: 0; }
.tcc h2, .tcc h3, .tcc h4, .tcc h5, .tcc p, .tcc ul { margin: 0; padding: 0; font: inherit; color: inherit; }
.tcc button, .tcc input, .tcc select, .tcc textarea { font: inherit; color: inherit; margin: 0; line-height: normal; }
.tcc button { cursor: pointer; background: none; border: 0; border-radius: 0; text-transform: none; letter-spacing: normal; box-shadow: none; }
.tcc a { color: inherit; text-decoration: none; }
.tcc img { max-width: 100%; height: auto; display: block; border: 0; }
.tcc svg { display: block; }
.tcc input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.tcc input[type="number"]::-webkit-inner-spin-button, .tcc input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tcc [hidden] { display: none !important; }

/* ---------- Шапка ---------- */
.tcc-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.tcc-titlebar { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; }
.tcc-ico { width: 38px; height: 38px; background: var(--y); border-radius: 10px; display: grid; place-items: center; color: var(--ink); flex-shrink: 0; }
.tcc-ico svg { width: 20px; height: 20px; }
.tcc-modes { display: flex; background: var(--card); padding: 4px; border-radius: 100px; box-shadow: var(--sh); }
.tcc-mode { padding: 10px 18px; border-radius: 100px; font-size: 14px; font-weight: 600; color: var(--mute); transition: background .15s, color .15s; white-space: nowrap; }
.tcc-mode.is-active { background: var(--y); color: var(--ink); }

/* ---------- Прогресс ---------- */
.tcc-progress { background: var(--card); border-radius: var(--r-s); padding: 12px 16px; margin-bottom: 16px; box-shadow: var(--sh); }
.tcc-progress-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); margin-bottom: 8px; }
.tcc-progress-head b { color: var(--ink); font-weight: 700; }
.tcc-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.tcc-fill { height: 100%; width: 0; background: var(--y); border-radius: 3px; transition: width .5s cubic-bezier(.34, 1.56, .64, 1); }

/* ---------- Тело ---------- */
.tcc-body { display: grid; grid-template-columns: 1fr; gap: 16px; }
.tcc-tiles { display: grid; grid-template-columns: 1fr; gap: 10px; }
.tcc-tile { background: var(--card); border-radius: var(--r-s); padding: 14px; position: relative; box-shadow: var(--sh); transition: box-shadow .2s, transform .2s; }
.tcc-tile:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.tcc-tile.is-filled { box-shadow: inset 0 0 0 2px var(--y); }
.tcc-tile.is-filled::after {
	content: ""; position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%;
	background: var(--y) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3 8l3 3 7-7' stroke='%23111111' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/12px no-repeat;
}
@keyframes tcc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tcc-tile.is-expert.is-shown { animation: tcc-in .3s ease both; }
.tcc-tile-label { font-size: 13px; font-weight: 600; margin-bottom: 9px; padding-right: 28px; }
.tcc-input {
	width: 100%; padding: 10px 12px; font-size: 15px; font-weight: 600; color: var(--ink);
	background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-s);
	transition: border-color .15s; -webkit-appearance: none; appearance: none; box-shadow: none; outline: none;
}
.tcc-input:hover { border-color: var(--line-2); }
.tcc-input:focus { border-color: var(--ink); }
.tcc-hint { font-size: 11px; color: var(--mute); margin-top: 6px; }
.tcc-toggle { display: flex; gap: 4px; flex-wrap: wrap; }
.tcc-toggle button {
	flex: 1; min-width: 50px; padding: 9px 8px; border: 1.5px solid var(--line); border-radius: 9px;
	background: var(--bg); color: var(--mute); font-size: 12px; font-weight: 600; transition: all .15s;
}
.tcc-toggle button:hover { border-color: var(--y); color: var(--ink); }
.tcc-toggle button.is-active { background: var(--y); border-color: var(--y); color: var(--ink); }
.tcc-stepper { display: flex; border: 1.5px solid var(--line); border-radius: var(--r-s); overflow: hidden; background: var(--bg); }
.tcc-stepper button { width: 38px; flex-shrink: 0; font-size: 18px; font-weight: 600; color: var(--mute); transition: background .15s, color .15s; }
.tcc-stepper button:hover { background: var(--y); color: var(--ink); }
.tcc-stepper input {
	flex: 1; min-width: 0; text-align: center; border: 0; border-left: 1.5px solid var(--line); border-right: 1.5px solid var(--line);
	padding: 9px 0; font-size: 15px; font-weight: 700; background: transparent; outline: none;
}
.tcc-stepper-mini { background: var(--card); }
.tcc-stepper-mini button { width: 28px; font-size: 15px; }
.tcc-stepper-mini input { width: 46px; flex: 0 0 46px; padding: 6px 0; font-size: 14px; }

/* ---------- Кнопки ---------- */
.tcc-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 15px 22px; border-radius: 100px; background: var(--y); color: var(--ink);
	font-size: 15px; font-weight: 700; transition: background .15s, color .15s, transform .12s;
}
.tcc-btn:hover { background: var(--ink); color: var(--y); }
.tcc-btn:active { transform: scale(.97); }
.tcc-submit { width: 100%; margin-top: 14px; }
.tcc-submit.is-locked { background: var(--line); color: var(--mute); pointer-events: none; }
.tcc-error { color: var(--red); font-size: 13.5px; font-weight: 500; margin-top: 10px; }

/* ---------- Визуализация ---------- */
.tcc-vis { background: var(--card); border-radius: var(--r-s); padding: 16px; box-shadow: var(--sh); align-self: start; }
.tcc-vis-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 12px; }
@keyframes tcc-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); opacity: .6; } }
.tcc-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--y); animation: tcc-pulse 1.5s ease infinite; }
.tcc-room { width: 100%; height: auto; max-width: 100%; background: var(--bg); border-radius: 10px; }
.tcc-stat { display: flex; justify-content: space-between; padding: 9px 12px; margin-top: 8px; background: var(--bg); border-radius: 10px; font-size: 13px; color: var(--mute); }
.tcc-stat b { color: var(--ink); font-weight: 700; }
.tcc-stat-accent { background: var(--y); color: var(--ink); }

/* ---------- Результат ---------- */
.tcc-result { margin-top: 18px; }
.tcc-result.is-active { animation: tcc-in .4s ease both; }
.tcc-result-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
.tcc-result-main { background: var(--y); border-radius: var(--r); padding: 28px 22px; text-align: center; position: relative; overflow: hidden; }
.tcc-result-main::before { content: ""; position: absolute; top: -40px; right: -40px; width: 140px; height: 140px; background: rgba(255, 255, 255, .3); border-radius: 50%; }
.tcc-result-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; opacity: .7; position: relative; }
.tcc-result-kw { font-size: 56px; font-weight: 800; line-height: 1; margin: 8px 0 4px; letter-spacing: -.02em; position: relative; }
.tcc-result-btu { font-size: 16px; font-weight: 600; opacity: .75; position: relative; }
.tcc-result-size { display: inline-block; margin-top: 14px; padding: 8px 20px; background: var(--ink); color: var(--y); border-radius: 100px; font-size: 14px; font-weight: 700; letter-spacing: .1em; position: relative; }
.tcc-result-side, .tcc-install, .tcc-models { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: var(--sh); margin-bottom: 12px; }
.tcc-result-side h4, .tcc-install h4, .tcc-models h4 { margin-bottom: 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); font-weight: 700; }
.tcc-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; color: var(--mute); border-bottom: 1px solid var(--line); }
.tcc-row span:last-child { font-weight: 700; color: var(--ink); text-align: right; }
.tcc-row.is-total { border-top: 2px solid var(--y); border-bottom: 0; margin-top: 6px; padding-top: 10px; font-size: 14px; color: var(--ink); font-weight: 700; }

/* ---------- Монтаж ---------- */
.tcc-install-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tcc-install-head h4 { margin: 0; }
.tcc-install-total { font-size: 22px; font-weight: 800; }
.tcc-install-total small { font-size: 12px; color: var(--mute); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.tcc-install-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.tcc-install-params { display: grid; gap: 8px; align-content: start; }
.tcc-param { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--bg); border-radius: 10px; font-size: 13px; color: var(--mute); }
.tcc-param b { color: var(--ink); font-weight: 700; }
.tcc-param small { color: var(--mute); font-size: 12px; white-space: nowrap; }
.tcc-check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--ink); font-weight: 500; position: relative; }
.tcc-check input { position: absolute; opacity: 0; pointer-events: none; }
.tcc-check-box { width: 19px; height: 19px; flex-shrink: 0; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--card); position: relative; transition: all .12s; }
.tcc-check input:checked + .tcc-check-box { background: var(--ink); border-color: var(--ink); }
.tcc-check input:checked + .tcc-check-box::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid var(--y); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tcc-install-break { background: var(--bg); border-radius: var(--r-s); padding: 14px; }
.tcc-install-break h5 { margin-bottom: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); font-weight: 700; }
.tcc-order { width: 100%; margin-top: 12px; }

/* ---------- Модели ---------- */
.tcc-models-sub { font-size: 13px; color: var(--mute); margin: -6px 0 14px; }
.tcc-tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--r-s); margin-bottom: 14px; flex-wrap: wrap; }
.tcc-tab {
	flex: 1; min-width: 110px; padding: 10px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--mute);
	display: flex; flex-direction: column; align-items: center; gap: 3px; transition: background .15s, color .15s;
}
.tcc-tab small { font-size: 11px; font-weight: 500; }
.tcc-tab.is-active { background: var(--y); color: var(--ink); }
.tcc-tab[disabled] { opacity: .4; cursor: not-allowed; }
.tcc-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.tcc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s, border-color .2s; animation: tcc-in .3s ease both; }
.tcc-card:hover { box-shadow: var(--sh-2); transform: translateY(-3px); border-color: var(--line-2); }
.tcc-card-img { position: relative; display: block; padding: 14px; background: var(--card); }
.tcc-card-img img { width: 100%; height: 150px; object-fit: contain; }
.tcc-card-badge { position: absolute; top: 10px; left: 10px; background: var(--ink); color: var(--y); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-radius: 100px; padding: 4px 10px; }
.tcc-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; gap: 6px; }
.tcc-card-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcc-card-name:hover { text-decoration: underline; text-decoration-color: var(--y); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.tcc-card-meta { font-size: 12px; color: var(--mute); }
.tcc-card-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.tcc-card-price { font-size: 18px; font-weight: 800; }
.tcc-card-price del { color: var(--mute); font-weight: 400; font-size: 13px; margin-right: 6px; }
.tcc-card-price ins { text-decoration: none; color: var(--red); }
.tcc-card-buy { width: 100%; padding: 11px 12px; border-radius: 100px; background: var(--y); color: var(--ink); font-size: 13px; font-weight: 700; transition: background .15s, color .15s; }
.tcc-card-buy:hover { background: var(--ink); color: var(--y); }
.tcc-empty { background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 30px; text-align: center; color: var(--mute); }
.tcc-loader { display: flex; justify-content: center; gap: 6px; padding: 18px; }
@keyframes tcc-b { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.tcc-loader span { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); animation: tcc-b 1s infinite ease-in-out; }
.tcc-loader span:nth-child(2) { animation-delay: .15s; background: var(--y); }
.tcc-loader span:nth-child(3) { animation-delay: .3s; }
.tcc-warning { background: var(--y-soft); border-left: 4px solid var(--y); padding: 12px 16px; border-radius: 0 10px 10px 0; font-size: 13px; }
.tcc-warning b { font-weight: 700; }

/* ---------- Текст и факты ---------- */
.tcc-text h3 { font-size: 20px; font-weight: 700; margin: 26px 0 10px; }
.tcc-text h3:first-child { margin-top: 0; }
.tcc-text p { color: var(--ink-2); margin-bottom: 10px; }
.tcc-text strong { font-weight: 700; }
.tcc-table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 14px; background: var(--card); border-radius: var(--r-s); overflow: hidden; box-shadow: var(--sh); display: table; }
.tcc-table th { background: var(--y); text-align: left; padding: 11px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.tcc-table td { padding: 11px 14px; border-top: 1px solid var(--line); }
.tcc-facts h2 { font-size: 24px; font-weight: 700; margin-bottom: 16px; }
.tcc-fact { background: var(--card); border-radius: var(--r-s); padding: 18px 20px; margin-bottom: 10px; box-shadow: var(--sh); }
.tcc-fact h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.tcc-fact p { color: var(--ink-2); font-size: 14.5px; }
.tcc-disclaimer { background: var(--y); border-radius: var(--r-s); padding: 16px 18px; font-size: 14px; margin-top: 12px; }
.tcc-disclaimer b { font-weight: 700; }

/* ---------- Сетки по ширине блока ---------- */
@container (min-width: 520px) {
	.tcc-tiles { grid-template-columns: 1fr 1fr; }
	.tcc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tcc-card-foot { flex-direction: row; align-items: center; justify-content: space-between; }
	.tcc-card-buy { width: auto; }
	.tcc-result-kw { font-size: 64px; }
}
@container (min-width: 760px) {
	.tcc-body { grid-template-columns: 1.4fr 1fr; }
	.tcc-vis { position: sticky; top: 16px; }
	.tcc-result-grid { grid-template-columns: 1.5fr 1fr; }
	.tcc-install-grid { grid-template-columns: 1fr 1fr; }
	.tcc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container (min-width: 1000px) {
	.tcc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
	.tcc * { animation: none !important; transition: none !important; }
}
