/* Раздел «Расчёты и подбор»: полоса вкладок (includes/tools-tabs.php),
   общий блок действий калькулятора (includes/calc-actions.php,
   calc-common.js), страница ведомости /raschety/vedomost/.
   Только токены :root из styles.css — новых не заводим. */

/* ---- Полоса вкладок ----------------------------------------------------
   Одна строка: инструменты прокручиваются по горизонтали, «Ведомость» —
   справа вне прокрутки, всегда на виду. Перенос строк запрещён и на телефоне. */

.tools-tabs {
  display: flex;
  align-items: stretch;
  gap: 8px;
  max-width: 100%;
  margin: 18px 0 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.tools-tabs-scroll {
  display: flex;
  flex: 1 1 auto;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.tools-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.tools-tab {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 9px 12px 10px;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.tools-tab:hover {
  color: var(--blue-dark);
}

.tools-tab:focus-visible {
  outline: 2px solid var(--blue-dark);
  outline-offset: -2px;
}

.tools-tab[aria-current="page"] {
  border-bottom-color: var(--amber);
  color: var(--blue-dark);
  font-weight: 700;
}

.tools-tab-list {
  flex: 0 0 auto;
  border-left: 1px solid var(--line);
  padding-left: 14px;
  color: var(--blue-dark);
  font-weight: 700;
}

.tools-tab-count {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.tools-tab-count[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .tools-tabs {
    font-size: 13px;
  }

  .tools-tab {
    padding: 8px 9px 9px;
  }

  .tools-tab-list {
    padding-left: 10px;
  }
}

/* ---- Блок действий калькулятора --------------------------------------- */

.calc-action[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.calc-action-hint {
  flex: 1 0 100%;
  font-size: 13px;
  color: var(--muted);
}

.calc-action-hint[hidden] {
  display: none;
}

.calc-action-status a {
  color: var(--blue-dark);
  font-weight: 700;
}

@media print {
  .tools-tabs {
    display: none !important;
  }
}

/* ---- Ведомость материалов ---------------------------------------------- */

.vd-page .vd-hero,
.vd-page .vd-section {
  padding-left: clamp(18px, 4vw, 54px);
  padding-right: clamp(18px, 4vw, 54px);
}

.vd-hero {
  padding-top: 28px;
}

.vd-hero h1 {
  margin: 6px 0 8px;
}

.vd-lead {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.vd-section {
  padding-top: 22px;
  padding-bottom: 48px;
}

/* position: relative — чтобы .sr-only в заголовке (position: absolute) был
   внутри прокрутки: иначе его контейнер — корень документа, overflow его не
   обрезает, и на телефоне вся страница уезжала вбок (759 px при 390). */
.vd-table-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.vd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.vd-table th,
.vd-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.vd-table thead th {
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.vd-table tbody tr:last-child td {
  border-bottom: 0;
}

.vd-calc a {
  color: var(--blue-dark);
  font-weight: 700;
}

.vd-note {
  min-width: 180px;
  color: var(--muted);
}

.vd-table select,
.vd-table input,
.vd-object textarea {
  box-sizing: border-box;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.vd-table select {
  width: 220px;
}

.vd-table input.vd-dia {
  width: 70px;
}

.vd-table input.vd-qty {
  width: 90px;
  text-align: right;
}

.vd-table input[aria-invalid="true"] {
  border-color: var(--amber-dark);
}

.vd-remove {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.vd-remove:hover {
  color: var(--blue-dark);
}

.vd-object {
  display: grid;
  gap: 6px;
  max-width: 760px;
  margin-top: 18px;
  font-weight: 700;
}

.vd-object textarea {
  width: 100%;
  min-height: 64px;
  font-weight: 400;
}

.vd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.vd-action {
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--blue-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.vd-action-main {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  color: var(--panel);
}

.vd-action-quiet {
  color: var(--muted);
  font-weight: 400;
}

.vd-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--amber);
  border-radius: 10px;
  background: var(--amber-soft);
}

.vd-confirm[hidden],
.vd-filled[hidden],
.vd-empty[hidden],
.vd-nostore[hidden] {
  display: none;
}

.vd-confirm p {
  margin: 0;
  flex: 1 1 240px;
}

.vd-empty,
.vd-nostore {
  max-width: 760px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.vd-empty p,
.vd-nostore p {
  margin: 0 0 10px;
}

.vd-empty ul {
  margin: 0;
  padding-left: 20px;
}

.vd-empty li {
  margin: 4px 0;
}

.vd-local {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Печатная шапка ведомости: только на бумаге. */
.vd-print-head {
  display: none;
}

@media (max-width: 720px) {
  .vd-table select {
    width: 160px;
  }
}

/* ---- Печать: «Ведомость сварочных материалов», дата, таблица.
   Без меню, вкладок, кнопок; поля ввода печатаются значением. */
@media print {
  .site-header,
  .site-footer,
  .vd-hero,
  .vd-actions,
  .vd-confirm,
  .vd-local,
  .vd-empty,
  .vd-nostore,
  .vd-remove-col {
    display: none !important;
  }

  .vd-print-head {
    display: block;
    margin: 0 0 12px;
  }

  .vd-print-head h1 {
    margin: 0 0 4px;
    font-size: 18pt;
  }

  .vd-print-head p {
    margin: 0;
    font-size: 10pt;
  }

  .vd-page .vd-section {
    padding: 0;
  }

  .vd-table-wrap {
    overflow: visible;
    border: 0;
  }

  .vd-table {
    font-size: 10pt;
  }

  .vd-table th,
  .vd-table td {
    padding: 4px 6px;
    border: 1px solid var(--muted);
  }

  .vd-table select,
  .vd-table input {
    display: none !important;
  }

  .vd-print-value {
    display: inline !important;
  }

  .vd-object {
    display: block;
    margin-top: 10px;
  }

  .vd-object textarea {
    display: none;
  }

  .vd-object-print {
    display: block !important;
    font-weight: 400;
    white-space: pre-wrap;
  }

  .vd-calc a {
    color: inherit;
    text-decoration: none;
  }
}

.vd-print-value,
.vd-object-print {
  display: none;
}

/* ---- Хаб /raschety/: группы «Подобрать» / «Рассчитать» и блок ведомости.
   Сетка карточек внутри группы — прежняя .raschety-grid (raschety.css). */

.raschety-group + .raschety-group {
  margin-top: 30px;
}

.raschety-group-title {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--ink);
}

.raschety-vedomost {
  max-width: 760px;
}

.raschety-vedomost p {
  margin: 0 0 8px;
  color: var(--muted);
}

.raschety-vedomost-link {
  color: var(--blue-dark);
  font-weight: 700;
}

.raschety-vedomost + .raschety-faq,
.raschety-vedomost + * {
  margin-top: 30px;
}
