/* Расчёт печати по STL (/stl-calculator.html). Общая часть инструмента (tl-*) повторяет calculator.css:
   у файлов в c.css генератора нет версии по содержимому, поэтому общий файл не выносим. */
/* ===== Карточка инструмента: ввод слева, итог справа ===== */
.tl { margin-top: 16px; }
.tl-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(16px, 2vw, 24px); padding: clamp(16px, 2.4vw, 28px); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); background: #fff; }
.tl-in { display: flex; flex-direction: column; gap: 26px; padding: clamp(4px, 1vw, 12px); }
.tl-field__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.tl-field__top label { font-weight: 700; font-size: 17px; }
.tl-field__val { font: 800 24px/1 var(--display); color: var(--accent-strong); white-space: nowrap; letter-spacing: -0.01em; }
.tl-scale { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 13px; }
.tl-hint { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.tl-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--bg-2); font-size: 15px; line-height: 1.5; }
.tl-note svg { flex: none; margin-top: 2px; color: var(--accent-strong); }

/* Ползунок: серая дорожка, зелёная заливка до бегунка (--p ставит скрипт) */
.tl-range { --p: 50%; -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; accent-color: var(--accent-strong); }
.tl-range:focus { outline: none; }
.tl-range::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, var(--accent-strong) 0 var(--p), var(--bg-3, #e6eae7) var(--p) 100%); }
.tl-range::-moz-range-track { height: 8px; border-radius: 999px; background: var(--bg-3, #e6eae7); }
.tl-range::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--accent-strong); }
.tl-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 2px var(--accent-strong), 0 2px 8px rgba(14, 36, 22, 0.2); transition: transform 120ms var(--ease); }
.tl-range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 2px var(--accent-strong), 0 2px 8px rgba(14, 36, 22, 0.2); }
.tl-range:active::-webkit-slider-thumb { transform: scale(1.08); }
.tl-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--accent-strong), 0 0 0 6px rgba(0, 178, 45, 0.25); }
.tl-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--accent-strong), 0 0 0 6px rgba(0, 178, 45, 0.25); }

/* Итог */
.tl-out { display: flex; flex-direction: column; padding: clamp(20px, 2.4vw, 32px); border-radius: 14px; background: var(--bg-2); }
.tl-out__label { color: var(--muted); font-size: 15px; font-weight: 600; }
.tl-out__big { margin-top: 6px; font: 800 clamp(44px, 5.6vw, 68px)/1 var(--display); letter-spacing: -0.03em; color: var(--accent-strong); white-space: nowrap; }
.tl-out__split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.tl-out__split div { padding: 12px 14px; border-radius: 12px; background: #fff; }
.tl-out__split dt { color: var(--muted); font-size: 13px; }
.tl-out__split dd { margin: 2px 0 0; font: 700 19px/1.2 var(--display); }
.tl-out__sub { margin-top: 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tl-out__cta { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 22px; }
.tl-out__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tl-out__row .btn { padding: 0 12px; }
.tl-field__label { font-weight: 700; font-size: 17px; }
.stl [hidden] { display: none !important; }

/* ===== До загрузки: зона файла + что посчитаем ===== */
.stl-start { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.stl-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 300px; padding: 32px 20px; width: 100%; border: 2px dashed #c9d2cb; border-radius: 14px; background: #fff; color: var(--ink); font: inherit; text-align: center; cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease; }
.stl-drop:hover, .stl-drop.is-over { border-color: var(--accent-strong); background: var(--bg-2); }
.stl-drop:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
.stl-drop__ic { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 18px; background: var(--ink); color: #fff; }
.stl-drop__title { font: 700 clamp(20px, 2vw, 24px)/1.25 var(--display); }
.stl-drop__sub { color: var(--muted); font-size: 15px; }
.stl-drop__btn { margin-top: 14px; pointer-events: none; }
.stl-what { display: flex; flex-direction: column; padding: clamp(20px, 2.4vw, 28px); border-radius: 14px; background: var(--bg-2); }
.stl-what .sv-check { margin-top: 14px; }
.stl-what .sv-check li { font-size: 15px; }
.stl-what .tl-hint { margin-top: auto; padding-top: 18px; }
.stl a:not(.btn) { color: var(--accent-strong); font-weight: 600; }
.stl-error { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: #fdecea; color: #8a1c1c; font-size: 15px; line-height: 1.5; }

/* ===== После загрузки ===== */
.stl-file { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 4px 4px 14px; border-bottom: 1px solid var(--line); }
.stl-file svg { flex: none; color: var(--accent-strong); }
.stl-file b { min-width: 0; overflow-wrap: anywhere; }
.stl-file__meta { color: var(--muted); font-size: 14px; }
.stl-file__change { margin-left: auto; padding: 8px 14px; border: 0; border-radius: 10px; background: var(--bg-2); font-size: 14px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .stl-file__change:hover { background: var(--bg-3); } }
.stl-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stl-facts div { padding: 12px 14px; border-radius: 12px; background: var(--bg-2); }
.stl-facts dt { color: var(--muted); font-size: 13px; }
.stl-facts dd { margin: 2px 0 0; font: 700 19px/1.2 var(--display); white-space: nowrap; }
.stl-fit { margin-top: -10px; padding: 12px 14px 12px 40px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; line-height: 1.45; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300b22d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") 14px 14px / 18px no-repeat; }
.stl-fit--warn { background-color: #fff8eb; box-shadow: inset 0 0 0 1px #f0c47a; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.5 20h19z'/%3E%3Cpath d='M12 10v4M12 17v.01'/%3E%3C/svg%3E"); }
.stl-mat { padding: 12px 14px; border-radius: 12px; background: var(--bg-2); font-weight: 700; }
.stl-home { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: #fff; }
.stl-home span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stl-home small { font-size: 14px; font-weight: 600; }
.stl-home em { color: var(--muted); font-size: 13px; font-style: normal; }
.stl-home b { flex: none; font: 800 24px/1 var(--display); white-space: nowrap; }

.tl-related .sv-card { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }

@media (max-width: 960px) {
  .tl-card, .stl-start { grid-template-columns: 1fr; }
  /* на узком экране цена сразу под файлом, настройки — ниже */
  .stl-res .tl-out { order: 1; }
  .stl-res .tl-in { order: 2; }
}
@media (max-width: 600px) {
  .tl-card { padding: 12px; }
  .tl-in { padding: 8px 4px; gap: 22px; }
  .tl-out { padding: 20px 16px; }
  .tl-out__row { grid-template-columns: 1fr; }
  .stl-drop { min-height: 220px; padding: 24px 16px; }
  .stl-file__change { margin-left: 0; }
  .stl-facts dd { font-size: 17px; }
}
/* Влезет ли на стол */
.stl-bed { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; padding: 14px 16px; border-radius: 14px; background: var(--bg-2); }
.stl-bed__top { display: flex; flex-direction: column; gap: 8px; }
.stl-bed__pick { display: flex; flex-wrap: wrap; gap: 6px; }
.stl-bed__pick button { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: #fff; color: var(--ink); font: 600 13px/1 var(--text); cursor: pointer; }
.stl-bed__pick button.is-on { background: var(--ink); color: #fff; }
.stl-bed__viz svg { display: block; width: 100%; max-width: 360px; height: auto; }
.sb-bed { fill: #fff; stroke: #cfd5d1; stroke-width: 1; stroke-dasharray: 4 3; }
.sb-m { fill: color-mix(in srgb, var(--c) 18%, transparent); stroke: var(--c); stroke-width: 1.6; transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1); }
.sb-l { fill: var(--muted); font: 600 9px var(--text); }
.sb-t { fill: var(--ink); font: 600 9px var(--text); }
.stl-bed .stl-fit { margin: 0; }

/* Телефон: сам инструмент — на первом экране, плитки с цифрами в шапке не нужны */
@media (max-width: 600px) { .sv-hero .sv-facts { display: none; } }
