/* ==========================================
   TWO HANDS — КАЛЬКУЛЯТОР ПЛОТНОСТИ ВЯЗАНИЯ
   ========================================== */


#th-gauge-calculator {
  --th-text: #292929;
  --th-muted:#737373;
  --th-border: #d8d8d8;
  --th-bg: #f6f6f6;

  max-width: 830px;
  margin: 0 auto;
  color: var(--th-text);
  font-family: inherit;
  font-size:var(--th-type-16,16px);
  line-height: 1.55;
}

#th-gauge-calculator,
#th-gauge-calculator * {
  box-sizing: border-box;
}

#th-gauge-calculator .th-gauge__intro {
  margin: 0 0 24px;
  font-size:var(--th-type-16,16px);
}

#th-gauge-calculator .th-gauge__section {
  margin-bottom: 28px;
}

#th-gauge-calculator .th-gauge__title {
  margin: 0 0 8px !important;
  font-size:var(--th-type-24,24px)!important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: #292929 !important;
}

#th-gauge-calculator .th-gauge__description {
  margin: 0 0 16px;
  color:#737373;
  font-size:var(--th-type-16,16px);
}

#th-gauge-calculator .th-gauge__card {
  padding: 18px;
  background: #f6f6f6;
  border-radius:16px;
}

#th-gauge-calculator .th-gauge__grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#th-gauge-calculator .th-gauge__field {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0;
  gap: 6px;
}

#th-gauge-calculator .th-gauge__label {
  display: block;
  margin: 0;
  font-size:var(--th-type-16,16px);
  font-weight: 500;
  color: #292929;
}

#th-gauge-calculator input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  background: #fff;
  color: #292929;
  font: inherit;
  font-size:var(--th-type-16,16px);
  line-height: 1.3;
  box-shadow: none;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

#th-gauge-calculator input:not([type="checkbox"]):focus {
  border-color: #777;
}

/* Calculator field hints and focus */
.th-site .th-calc input:focus,
.th-site .th-calc input:focus-visible,
#th-gauge-calculator input:focus,
#th-gauge-calculator input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.th-site .th-calc input::placeholder,
#th-gauge-calculator input::placeholder {
  color: #b4b4b4 !important;
  opacity: 1 !important;
  font-weight: 400 !important;
}
#th-gauge-calculator input::placeholder {
  color:#737373;
  opacity: 1;
}

#th-gauge-calculator .th-gauge__divider {
  height: 1px;
  margin: 19px 0;
  background: #dedede;
}

#th-gauge-calculator .th-gauge__options {
  margin-top: 18px;
}

#th-gauge-calculator .th-gauge__option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size:var(--th-type-16,16px);
  line-height: 1.5;
}

#th-gauge-calculator .th-gauge__option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: #555;
  cursor: pointer;
}

#th-gauge-calculator .th-gauge__repeat-fields {
  margin: 14px 0 0;
  padding: 16px;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  background: #fff;
}

#th-gauge-calculator .th-gauge__hint {
  margin: 9px 0 0;
  color:#737373;
  font-size:var(--th-type-12,12px);
  line-height: 1.55;
}

#th-gauge-calculator .th-gauge__result {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #e2e2e2;
  border-radius: 11px;
  background: #fff;
}

#th-gauge-calculator .th-gauge__result-title {
  margin: 0 0 16px !important;
  font-size:var(--th-type-16,16px)!important;
  font-weight: 600 !important;
}

#th-gauge-calculator .th-gauge__result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#th-gauge-calculator .th-gauge__result-item {
  padding: 16px;
  background: #f6f6f6;
  border-radius: 8px;
}

#th-gauge-calculator .th-gauge__result-label {
  margin-bottom: 6px;
  font-size:var(--th-type-12,12px);
  color:#737373;
}

#th-gauge-calculator .th-gauge__result-value {
  font-size:var(--th-type-28,28px);
  line-height: 1.2;
  font-weight: 600;
  color: #292929;
}

#th-gauge-calculator .th-gauge__result-unit {
  margin-top: 5px;
  font-size:var(--th-type-12,12px);
  color:#737373;
}

#th-gauge-calculator .th-gauge__gauge-result {
  margin-top: 14px;
  padding: 13px 15px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size:var(--th-type-16,16px);
}

#th-gauge-calculator .th-gauge__repeat-results {
  margin-top: 18px;
}

#th-gauge-calculator .th-gauge__subheading {
  margin: 20px 0 12px !important;
  font-size:var(--th-type-16,16px)!important;
  font-weight: 600 !important;
}

#th-gauge-calculator .th-gauge__repeat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#th-gauge-calculator .th-gauge__repeat-card {
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius:16px;
  background: #f6f6f6;
}

#th-gauge-calculator .th-gauge__repeat-name {
  margin-bottom: 8px;
  color:#737373;
  font-size:var(--th-type-12,12px);
}

#th-gauge-calculator .th-gauge__repeat-count {
  font-size:var(--th-type-24,24px);
  font-weight: 600;
  line-height: 1.25;
}

#th-gauge-calculator .th-gauge__repeat-detail {
  margin-top: 8px;
  font-size:var(--th-type-12,12px);
  line-height: 1.6;
}

#th-gauge-calculator .th-gauge__important {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid #999;
  background: #f6f6f6;
  font-size:var(--th-type-12,12px);
  font-weight: 600;
}

#th-gauge-calculator .th-gauge__warning {
  margin: 22px 0 16px;
  color:#737373;
  font-size:var(--th-type-12,12px);
  line-height: 1.7;
}

#th-gauge-calculator .th-gauge__warning strong {
  color: #292929;
}

#th-gauge-calculator .th-gauge__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 18px;
  border: 1px solid #c8c8c8;
  border-radius:8px;
  background: #fff;
  color: #292929;
  font: inherit;
  font-size:var(--th-type-16,16px);
  cursor: pointer;
}

#th-gauge-calculator .th-gauge__button {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
@media (hover: hover) and (pointer: fine) {@media (hover:hover) and (pointer:fine){@media (min-width:768px) and (hover:hover) and (pointer:fine){
  #th-gauge-calculator .th-gauge__button:not(:disabled):hover {
    background: #f8e8e3;
    border-color: #e58b7e;
    color: #333;
  }}}
}

#th-gauge-calculator .th-gauge__error {
  margin-top: 12px;
  color: #c83c32;
  font-size:var(--th-type-12,12px);
}

#th-gauge-calculator [hidden] {
  display: none !important;
}

/* Адаптация под мобильные устройства */

@media (max-width: 600px) {
  #th-gauge-calculator {
    font-size:var(--th-type-16,16px);
  }

  #th-gauge-calculator .th-gauge__title {
    font-size:var(--th-type-16,16px)!important;
  }

  #th-gauge-calculator .th-gauge__card {
    padding: 14px;
  }

  #th-gauge-calculator .th-gauge__grid {
    gap: 13px 10px;
  }

  #th-gauge-calculator .th-gauge__label {
    font-size:var(--th-type-12,12px);
  }

  #th-gauge-calculator input:not([type="checkbox"]) {
    font-size:var(--th-type-16,16px);
    padding: 8px 9px;
  }

  #th-gauge-calculator .th-gauge__result {
    padding: 14px;
  }

  #th-gauge-calculator .th-gauge__result-value {
    font-size:var(--th-type-24,24px);
  }
}

@media (max-width: 360px) {
  #th-gauge-calculator .th-gauge__grid {
    grid-template-columns: 1fr;
  }
}
/* ==========================================
   TWO HANDS — МОБИЛЬНАЯ ВЕРСИЯ КАЛЬКУЛЯТОРА
   ПЛОТНОСТИ ВЯЗАНИЯ
   ========================================== */

@media screen and (max-width: 767px) {

  .th-gauge,
  .th-gauge * {
    box-sizing: border-box;
  }

  .th-gauge {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .th-gauge__section {
    width: 100%;
    max-width: 100%;
  }

  /* Все поля располагаются вертикально */

  .th-gauge__grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
    width: 100%;
  }

  .th-gauge__field {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    min-width: 0;
    gap: 7px;
  }

  .th-gauge__label {
    display: block !important;
    width: 100%;
  }

  .th-gauge__field input {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  /* Карточки */

  .th-gauge__card {
    width: 100%;
    max-width: 100%;
    padding: 18px !important;
    border-radius:16px;
  }

  /* Результаты */

  .th-gauge__results,
  .th-gauge__result-grid,
  .th-gauge__repeat-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  /* Заголовки */

  .th-gauge__title {
    font-size:var(--th-type-24,24px)!important;
    line-height: 1.3 !important;
  }

  .th-gauge__description {
    font-size:var(--th-type-16,16px)!important;
    line-height: 1.6 !important;
  }

  /* Изображение */

  .th-gauge img {
    display: block;
    max-width: 100%;
    height: auto;
  }
}
#th-gauge-calculator {width:100%;min-width:0;}
#th-gauge-calculator img {display:block;max-width:100%;height:auto;border-radius:8px;}
#th-gauge-calculator .th-gauge__button {margin-top:14px;min-height:44px;}
@media(max-width:767px){
#th-gauge-calculator .th-gauge__grid,#th-gauge-calculator .th-gauge__result-grid,#th-gauge-calculator .th-gauge__repeat-grid{grid-template-columns:minmax(0,1fr)!important;}
#th-gauge-calculator input:not([type="checkbox"]){font-size:var(--th-type-16,16px);min-height:44px;max-width:100%;}
.th-calc__row{grid-template-columns:minmax(0,1fr)!important;}
.th-calc__row>*{min-width:0;}
}

/* Gauge page v2: approved prototype */

#th-gauge-v2{--ink:#292a2c;--muted:#737373;--field:#f5f5f5;--beige:#f6efe7;--error:#c83c32;--coral:#f36e62;color:var(--ink);font:400 16px/1.55 'Golos Text',Arial,sans-serif;max-width:960px;margin:0 auto 64px}
#th-gauge-v2 *,#th-gauge-v2 *::before,#th-gauge-v2 *::after{box-sizing:border-box}
body:has(#th-gauge-v2) .article{max-width:960px;margin-inline:auto}
body:has(#th-gauge-v2) .article h1.heading{font:600 32px/1.2 'Golos Text',Arial,sans-serif!important;color:#292a2c;margin:0 0 16px!important}
#th-gauge-v2 [hidden]{display:none!important}
#th-gauge-v2 p{margin:0;font:inherit;line-height:1.55}
#th-gauge-v2 form{margin:0;padding:0;border:0}
#th-gauge-v2 .intro{max-width:760px;margin-bottom:40px}
#th-gauge-v2 h2,#th-gauge-v2 h3{font:600 24px/1.35 'Golos Text',Arial,sans-serif!important;margin:0!important;color:var(--ink)}
#th-gauge-v2 .step{margin-top:40px}
#th-gauge-v2 .step-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:12px}
#th-gauge-v2 .description{max-width:760px;color:var(--muted);margin-bottom:24px}
#th-gauge-v2 .fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
#th-gauge-v2 .field{min-width:0}
#th-gauge-v2 .field label{display:block;font:500 16px/1.4 'Golos Text',Arial,sans-serif;color:var(--ink);margin:0 0 8px}
#th-gauge-v2 .field input{display:block;width:100%;height:44px;min-height:44px;background:#f5f5f5;border:1px solid transparent;border-radius:8px;padding:10px 14px;outline:none;box-shadow:none;color:var(--ink);font:400 16px/1.4 'Golos Text',Arial,sans-serif;font-variant-numeric:tabular-nums;transition:none;appearance:none}@media (min-width:768px) and (hover:hover) and (pointer:fine){
#th-gauge-v2 .field input:hover{background:#f5f5f5;border-color:transparent;box-shadow:none}}
#th-gauge-v2 .field input:focus,#th-gauge-v2 .field input:focus-visible{border-color:#737373;background:transparent;outline:none;box-shadow:none}
#th-gauge-v2 .field input[aria-invalid=true]{border-color:#c83c32}@media (min-width:768px) and (hover:hover) and (pointer:fine){#th-gauge-v2 .field input[aria-invalid=true]:hover{border-color:#c83c32}}
#th-gauge-v2 .field input[aria-invalid=true]:focus{border-color:#c83c32;background:transparent}
#th-gauge-v2 .field input::placeholder{color:#737373;opacity:1}
#th-gauge-v2 .error{display:block;color:#c83c32;font-size:14px;line-height:1.4;margin-top:6px}
#th-gauge-v2 .error:empty{display:none}
#th-gauge-v2 button{font:500 16px/1.55 'Golos Text',Arial,sans-serif;cursor:pointer;box-shadow:none;transform:none;transition:none}
#th-gauge-v2 .text-button{background:transparent;border:0;border-radius:0;padding:8px 0;min-height:44px;white-space:nowrap;color:#db5a49}@media (min-width:768px) and (hover:hover) and (pointer:fine){
#th-gauge-v2 .text-button:hover{color:#c55242;background:transparent}}
#th-gauge-v2 button:focus-visible,#th-gauge-v2 summary:focus-visible{outline:2px solid #737373;outline-offset:4px}
#th-gauge-v2 .density{margin-top:20px;padding:16px 20px;border-radius:8px;background:#f6efe7}
#th-gauge-v2 .density strong{font-weight:600}
#th-gauge-v2 .instruction{margin-top:24px;color:#737373;border:0;padding:0}
#th-gauge-v2 summary{cursor:pointer;color:#db5a49;min-height:44px;padding:10px 0;font:400 16px/1.55 'Golos Text',Arial,sans-serif}
#th-gauge-v2 .sample-guide{display:block;width:100%;max-width:100%;height:auto;border-radius:12px;margin-top:16px}
#th-gauge-v2 .options{margin-top:24px}
#th-gauge-v2 .check{display:flex;align-items:center;gap:12px;min-height:44px;cursor:pointer;font-weight:400;margin:0}
#th-gauge-v2 .check input{appearance:auto;width:20px;height:20px;margin:0;accent-color:#292a2c;flex-shrink:0}
#th-gauge-v2 .repeat-fields{margin:16px 0 20px 32px}
#th-gauge-v2 .hint{margin-top:12px;color:#737373;font-size:14px}
#th-gauge-v2 .result{background:#f6efe7;border:0;border-radius:16px;padding:28px;margin-top:32px}
#th-gauge-v2 .result-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:24px}
#th-gauge-v2 .metric{display:flex;flex-direction:column;gap:8px}
#th-gauge-v2 .metric span{color:#737373}
#th-gauge-v2 .metric strong{font-size:44px;line-height:1.2;font-weight:600;overflow-wrap:anywhere}
#th-gauge-v2 .result-note{color:#737373;margin-top:20px;font-size:14px}
#th-gauge-v2 .variants{margin-top:20px;display:grid;grid-template-columns:1fr 1fr;gap:16px}
#th-gauge-v2 .variant{border:1px solid #cbbeb1;border-radius:8px;padding:16px;background:transparent;text-align:left;min-width:0;white-space:normal;color:var(--ink)}
#th-gauge-v2 .variant.selected{border:2px solid #db5a49;padding:15px;background:#fff}
#th-gauge-v2 .variant strong{display:block;font-size:24px;font-weight:600}
#th-gauge-v2 .variant span{display:block;font-size:14px;margin-top:6px;color:#737373}
#th-gauge-v2 .warning{font-size:14px;line-height:1.55;color:#737373;margin-top:24px}
@media(max-width:767px){body:has(#th-gauge-v2) .article h1.heading{font-size:28px!important}#th-gauge-v2 .intro{margin-bottom:32px}#th-gauge-v2 .step{margin-top:32px}#th-gauge-v2 .fields{gap:20px 16px}#th-gauge-v2 .description{margin-bottom:20px}#th-gauge-v2 .step-head{align-items:start}#th-gauge-v2 .step-head h2{flex:1}#th-gauge-v2 .result{padding:20px;margin-top:24px}#th-gauge-v2 .metric strong{font-size:40px}#th-gauge-v2 .variants{grid-template-columns:1fr}#th-gauge-v2 .repeat-fields{margin-left:0}#th-gauge-v2 .field input{padding-inline:12px}}
@media(max-width:380px){#th-gauge-v2 .fields{grid-template-columns:1fr}#th-gauge-v2 .result-grid{gap:16px}#th-gauge-v2 .metric strong{font-size:36px}}


/* Gauge spacing and control states: approved update */
body:has(#th-gauge-v2) .article{row-gap:0!important}
#th-gauge-v2 .step-head{position:relative;display:block;padding-right:100px;margin-bottom:16px}
#th-gauge-v2 .step-head .text-button{position:absolute;right:0;top:-6px}
#th-gauge-v2 .step .description{margin-top:0!important}
#th-gauge-v2 .field input[aria-invalid=true]{background:#fff0f2;border-color:transparent}@media (min-width:768px) and (hover:hover) and (pointer:fine){#th-gauge-v2 .field input[aria-invalid=true]:hover{background:#fff0f2;border-color:transparent}}
#th-gauge-v2 .field input[aria-invalid=true]:focus,#th-gauge-v2 .field input[aria-invalid=true]:focus-visible{background:transparent;border-color:#c83c32;outline:none;box-shadow:none}
#th-gauge-v2 .check input{appearance:none;-webkit-appearance:none;position:relative;display:inline-block;width:20px;height:20px;min-width:20px;border:1px solid #737373!important;border-radius:3px;background:transparent;box-shadow:none;padding:0;cursor:pointer}
#th-gauge-v2 .check input::after{content:"";position:absolute;left:6px;top:3px;width:5px;height:10px;border:solid #737373;border-width:0 1px 1px 0;transform:rotate(45deg);opacity:0}
#th-gauge-v2 .check input:checked::after{opacity:1}
#th-gauge-v2 .check input:focus-visible{outline:2px solid #737373;outline-offset:3px}

/* Gauge selection and result caption refinement */
#th-gauge-v2 .variant.selected{background:transparent}@media (min-width:768px) and (hover:hover) and (pointer:fine){#th-gauge-v2 .variant.selected:hover{background:transparent}}
#th-gauge-v2 .check input:checked{background:#292A2C;border-color:#292A2C!important}
#th-gauge-v2 .check input:checked::after{border-color:#fff}
#th-gauge-v2 .text-button{font-weight:400}
#th-gauge-v2 .result-note{margin-top:8px}
#th-gauge-v2 .variants{margin-top:24px}

/* Placeholder lightening: 15% white in sRGB; preserve entered text. */
body.th-site section.th-calc input::placeholder,body.th-site #th-gauge-calculator input::placeholder{color:#888888!important;opacity:1!important}
#th-gauge-v2 .field input::placeholder{color:#888888;opacity:1}
.th-site .th-header form.th-search > span.th-search-hint{color:#888888!important}
.th-site .th-search input::placeholder{color:#888888;opacity:1}
/* Consistent result weights and one-pixel selection borders. */
#th-gauge-v2 .variant,#th-gauge-v2 .variant.selected{border-width:1px;padding:16px;font-weight:400}
#th-gauge-v2 .variant span,#th-gauge-v2 .result-note,#th-gauge-v2 .metric span{font-weight:400}
#th-gauge-v2 .result h3,#th-gauge-v2 .result strong{font-weight:600!important}
