<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="https://www.xn--80abmnojgpmk.xn--p1ai/" xml:lang="ru">
  <id>https://www.xn--80abmnojgpmk.xn--p1ai/rasschitayte-stoimost-vashikh-otlivok-iz-stali-chuguna-bronzy</id>
  <link href="https://www.xn--80abmnojgpmk.xn--p1ai/rasschitayte-stoimost-vashikh-otlivok-iz-stali-chuguna-bronzy.xml" rel="self"/>
  <title>Рассчитайте стоимость Ваших отливок из стали, чугуна, бронзы</title>
  <subtitle type="html">
&lt;html lang="ru"&gt;
&lt;head&gt;
&lt;meta charset="UTF-8"&gt;
&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
&lt;title&gt;Калькулятор отливок · Бронза, чугун, сталь&lt;/title&gt;
&lt;style&gt;
  :root {
    --bg:    #0a0a0a;
    --bg2:   #111111;
    --bg3:   #16130a;
    --line:  #d4af37;
    --gold:  #d4af37;
    --goldB: #f0d060;
    --goldD: #8a7020;
    --red:   #e74c3c;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--gold);
    line-height: 1.5;
    padding: 20px 14px;
  }
  ::selection { background: var(--gold); color: #000; }
  .wrap { max-width: 1300px; margin: 0 auto; }

  /* БЕГУЩАЯ СТРОКА */
  .ticker-block {
    display: flex;
    align-items: stretch;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
    height: 44px;
  }
  .ticker-label {
    background: var(--gold);
    color: #0a0a0a;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 1.5px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    white-space: nowrap;
  }
  .ticker-viewport { flex: 1; overflow: hidden; position: relative; }
  .ticker-track {
    display: inline-flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: tickerScroll 50s linear infinite;
    padding-left: 20px;
  }
  .ticker-item { color: var(--gold); font-size: 13px; padding: 0 10px; letter-spacing: .3px; }
  .ticker-item b { color: var(--goldB); font-weight: 700; }
  .ticker-dot { color: var(--gold); font-size: 10px; }
  @keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
  }

  /* ШАПКА */
  header {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 30px 25px;
    text-align: center;
    margin-bottom: 14px;
  }
  .banner-tag {
    display: inline-block;
    background: var(--gold);
    color: #0a0a0a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
  }
  header h1 {
    margin: 0 0 12px 0;
    font-size: 28px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 800;
  }
  .banner-line {
    width: 60px;
    height: 2px;
    background: var(--gold);
    margin: 0 auto 14px;
  }
  header p { margin: 0; color: var(--gold); font-size: 15px; letter-spacing: .5px; opacity: .9; }

  /* ТУЛБАР */
  .promo-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
  }
  .promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 9px;
    border: 1px solid var(--gold);
    background: transparent;
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
    font-family: inherit;
    letter-spacing: .3px;
  }
  .promo-btn:hover { background: var(--gold); color: #0a0a0a; }
  .promo-btn.primary { background: var(--gold); color: #0a0a0a; }
  .promo-btn.primary:hover { background: var(--goldB); }

  /* СЕТКА ВВОДА — ОДНА КОЛОНКА */
  .calc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 14px;
  }

  .calc-block {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
  }
  .calc-title {
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
    text-align: center;
  }

  /* ВНУТРЕННЯЯ СЕТКА ВВОДА */
  .input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  @media (max-width: 860px) { .input-grid { grid-template-columns: 1fr; } }

  /* ПОЛЯ */
  .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
  .field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .8;
  }
  .field input, .field select {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 14px;
    background: var(--bg);
    color: var(--gold);
    outline: none;
    transition: .15s;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
  }
  .field input:focus, .field select:focus {
    border-color: var(--goldB);
    box-shadow: 0 0 0 3px rgba(212,175,55,.2);
  }
  .field select option { background: var(--bg); color: var(--gold); }
  .field input.error {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(231,76,60,.2);
  }
  .field-hint { font-size: 11px; color: var(--gold); opacity: .55; font-style: italic; }
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

  /* ФОРМЫ */
  .shape-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }
  .shape-btn {
    padding: 14px 8px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 9px;
    cursor: pointer;
    text-align: center;
    transition: .15s;
    color: var(--gold);
    font-family: inherit;
  }
  .shape-btn:hover { background: rgba(212,175,55,.1); }
  .shape-btn.active { background: var(--gold); color: #0a0a0a; }
  .shape-icon { font-size: 22px; display: block; margin-bottom: 4px; }
  .shape-name { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }

  /* РЕЖИМ */
  .mode-toggle { display: flex; gap: 8px; margin-bottom: 16px; }
  .mode-btn {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
    transition: .15s;
    font-family: inherit;
  }
  .mode-btn.active { background: var(--gold); color: #0a0a0a; }

  /* РЕЗУЛЬТАТ */
  .result-block {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 14px;
  }
  .result-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 16px;
  }
  @media (max-width: 1000px) { .result-grid { grid-template-columns: repeat(3, 1fr); } }
  @media (max-width: 700px) { .result-grid { grid-template-columns: 1fr 1fr; } }
  .result-item {
    background: #0a0a0a;
    border: 1px solid rgba(212,175,55,.3);
    border-radius: 9px;
    padding: 14px;
    text-align: center;
  }
  .result-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: .7;
    margin-bottom: 6px;
  }
  .result-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--goldB);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
  }
  .result-value.small { font-size: 18px; }
  .result-value.big { font-size: 28px; color: var(--gold); }
  .result-unit { font-size: 12px; color: var(--gold); opacity: .7; font-weight: 600; margin-left: 3px; }

  .result-total {
    background: linear-gradient(135deg, #1a1408, #0a0a0a);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-top: 8px;
  }
  .result-total-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: .8;
    margin-bottom: 8px;
  }
  .result-total-value {
    font-size: 40px;
    font-weight: 800;
    color: var(--goldB);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
  }
  .result-total-note {
    font-size: 12px;
    color: var(--gold);
    opacity: .7;
    margin-top: 8px;
  }

  /* ПРЕДУПРЕЖДЕНИЯ */
  .warn {
    background: rgba(231,76,60,.1);
    border: 1px solid var(--red);
    border-left: 4px solid var(--red);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    color: #ff8a7a;
    font-size: 13px;
    display: none;
  }
  .warn.show { display: block; }
  .warn b { color: #ffaa99; }

  .info-note {
    background: rgba(212,175,55,.08);
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    color: var(--gold);
    font-size: 13px;
    display: none;
  }
  .info-note.show { display: block; }
  .info-note b { color: var(--goldB); }

  /* ПРИМЕР */
  .example-block {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 14px;
  }
  .example-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }
  .example-tag {
    display: inline-block;
    background: var(--gold);
    color: #0a0a0a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 3px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
  }
  .example-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
  }
  .example-header p { margin: 0; font-size: 14px; color: var(--gold); opacity: .85; }
  .example-header p b { color: var(--goldB); }

  .example-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
  }
  @media (max-width: 860px) { .example-grid { grid-template-columns: 1fr; } }

  .example-col {
    background: #0a0a0a;
    border: 1px solid rgba(212,175,55,.4);
    border-radius: 10px;
    padding: 14px 16px;
  }
  .example-col-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: .7;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(212,175,55,.3);
  }
  .example-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .example-table td {
    padding: 6px 0;
    color: var(--gold);
    border-bottom: 1px solid rgba(212,175,55,.12);
  }
  .example-table td:first-child { opacity: .75; }
  .example-table td:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--goldB);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .example-table tr:last-child td { border-bottom: none; }

  .example-total { text-align: center; padding: 10px 0; }
  .example-total-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: .7;
    margin-bottom: 6px;
  }
  .example-total-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--goldB);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
  }
  .example-total-note { font-size: 11px; color: var(--gold); opacity: .7; line-height: 1.5; }

  .example-compare {
    background: rgba(212,175,55,.05);
    border: 1px dashed var(--gold);
    border-radius: 10px;
    padding: 16px;
  }
  .example-compare-title {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: .8;
    margin-bottom: 14px;
  }
  .example-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  @media (max-width: 600px) { .example-compare-grid { grid-template-columns: 1fr; } }
  .example-compare-item {
    background: #0a0a0a;
    border: 1px solid rgba(212,175,55,.3);
    border-radius: 9px;
    padding: 14px;
    text-align: center;
  }
  .example-compare-label { font-size: 12px; color: var(--gold); opacity: .8; margin-bottom: 8px; }
  .example-compare-value { font-size: 22px; font-weight: 800; color: var(--goldB); font-variant-numeric: tabular-nums; margin-bottom: 6px; }
  .example-compare-note { font-size: 11px; color: var(--gold); opacity: .65; }

  /* СВОДКА */
  .summary-block {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 14px;
  }
  .summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
  }
  .summary-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(212,175,55,.2);
    color: var(--gold);
  }
  .summary-table td:first-child { color: var(--gold); opacity: .8; width: 60%; }
  .summary-table td:last-child {
    color: var(--goldB);
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .summary-table tr:last-child td { border-bottom: none; }

  /* КОНТАКТЫ */
  .cta-section {
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 28px 20px;
    margin-top: 14px;
  }
  .cta-text { font-size: 16px; font-weight: 600; color: var(--gold); margin: 0 0 16px 0; }
  .cta-button {
    display: inline-block;
    background: var(--gold);
    color: #0a0a0a !important;
    text-decoration: none;
    padding: 16px 40px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 999px;
    transition: .25s;
  }
  .cta-button:hover { background: var(--goldB); transform: scale(1.03); }
  .manager-info { margin: 16px 0 0 0; font-size: 13px; color: var(--gold); opacity: .8; }

  /* SEO */
  .seo-text {
    position: absolute;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
  }

  /* ПОЛЗУНКИ */
  ::-webkit-scrollbar { width: 18px; height: 18px; }
  ::-webkit-scrollbar-track {
    background: #050505;
    border: 1px solid #2a2210;
    border-radius: 9px;
    box-shadow: inset 0 0 12px rgba(212,175,55,.2);
  }
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
      #ffffcc 0%, #ffd700 15%, #ff8c00 35%, #d4af37 50%,
      #ff8c00 65%, #ffd700 85%, #ffffcc 100%);
    border: 1px solid #ffd700;
    border-radius: 9px;
    box-shadow:
      0 0 10px rgba(255,215,0,.9),
      0 0 20px rgba(255,140,0,.7),
      0 0 30px rgba(255,80,0,.4),
      inset 0 0 8px rgba(255,255,255,.5);
    background-size: 100% 200%;
    animation: fireFlow 2.5s linear infinite;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
      #ffffff 0%, #ffffcc 20%, #ffd700 40%, #ff8c00 60%,
      #ffd700 80%, #ffffff 100%);
    box-shadow:
      0 0 18px rgba(255,215,0,1),
      0 0 36px rgba(255,140,0,.9),
      0 0 54px rgba(255,80,0,.6),
      inset 0 0 12px rgba(255,255,255,.8);
  }
  ::-webkit-scrollbar-button:single-button {
    background-color: #0a0a0a;
    display: block;
    background-size: 12px;
    background-repeat: no-repeat;
    background-position: center;
    border: 1px solid #3a2f10;
    border-radius: 8px;
    height: 18px;
    width: 18px;
    box-shadow: inset 0 0 6px rgba(212,175,55,.4);
    transition: .2s;
  }
  ::-webkit-scrollbar-button:single-button:hover {
    background-color: #1a0e08;
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255,215,0,.9), inset 0 0 8px rgba(255,140,0,.5);
  }
  ::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-image: url("data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'&gt;&lt;path d='M8 3 L13 11 L3 11 Z' fill='%23ffd700' stroke='%23ff5500' stroke-width='0.8'/&gt;&lt;/svg&gt;");
  }
  ::-webkit-scrollbar-button:single-button:vertical:increment {
    background-image: url("data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'&gt;&lt;path d='M8 13 L3 5 L13 5 Z' fill='%23ffd700' stroke='%23ff5500' stroke-width='0.8'/&gt;&lt;/svg&gt;");
  }
  @keyframes fireFlow {
    0%   { background-position: 0% 0%; }
    100% { background-position: 0% 200%; }
  }
  * { scrollbar-width: thin; scrollbar-color: #ffd700 #0a0a0a; }

  /* Адаптив */
  @media (max-width: 700px) {
    body { padding: 12px 10px; }
    header h1 { font-size: 20px; letter-spacing: 1.5px; }
    header p { font-size: 13px; }
    .shape-grid { grid-template-columns: repeat(3, 1fr); }
    .shape-icon { font-size: 18px; }
    .shape-name { font-size: 10px; }
    .result-total-value { font-size: 30px; }
    .result-value { font-size: 18px; }
    .result-value.big { font-size: 22px; }
    .promo-btn { padding: 9px 12px; font-size: 12px; }
    .cta-button { width: 100%; padding: 16px 10px; font-size: 17px; }
    .ticker-block { height: 40px; }
    .ticker-item { font-size: 12px; }
    .field-row { grid-template-columns: 1fr; }
  }

  /* Печать */
  @media print {
    body { background: #fff; color: #000; padding: 0; }
    .ticker-block, .promo-toolbar, .shape-btn, .mode-btn { display: none !important; }
    header {
      background: #000 !important;
      color: #ffd700 !important;
      border-color: #000 !important;
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
    }
    header h1, header p { color: #ffd700 !important; }
    .banner-tag { background: #ffd700 !important; color: #000 !important;
      -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .banner-line { background: #ffd700 !important; }
    .calc-block, .result-block, .summary-block, .example-block {
      background: #fff !important;
      border: 1px solid #999 !important;
    }
    .calc-title, .result-label, .result-total-label, .example-header h3 { color: #000 !important; }
    .field label { color: #000 !important; }
    .field input, .field select {
      background: #fff !important;
      color: #000 !important;
      border-color: #999 !important;
    }
    .result-item { background: #f5f5f5 !important; border-color: #999 !important; }
    .result-value { color: #000 !important; }
    .result-total { background: #000 !important; border-color: #000 !important; }
    .result-total-value { color: #ffd700 !important; }
    .summary-table td { color: #000 !important; }
    .summary-table td:last-child { color: #000 !important; }
    .example-header p { color: #666 !important; }
    .example-tag { background: #000 !important; color: #fff !important;
      -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .example-col { background: #f5f5f5 !important; border-color: #999 !important; }
    .example-col-title { color: #000 !important; }
    .example-table td { color: #000 !important; }
    .example-table td:last-child { color: #000 !important; }
    .example-total-value { color: #000 !important; }
    .example-compare { background: #f5f5f5 !important; border-color: #999 !important; }
    .example-compare-title { color: #000 !important; }
    .example-compare-item { background: #fff !important; border-color: #999 !important; }
    .example-compare-label { color: #000 !important; }
    .example-compare-value { color: #000 !important; }
    .cta-section { background: #fff !important; border-color: #999 !important; }
    .cta-text { color: #000 !important; }
    .cta-button { background: #000 !important; color: #fff !important;
      -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .manager-info { color: #666 !important; }
  }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class="wrap"&gt;

  
  &lt;div class="ticker-block"&gt;
    &lt;div class="ticker-label"&gt;ЦЕНЫ&lt;/div&gt;
    &lt;div class="ticker-viewport"&gt;
      &lt;div class="ticker-track"&gt;
        &lt;span class="ticker-item"&gt;СЧ20 — &lt;b&gt;750 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;СЧ18-36 — &lt;b&gt;750 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;СЧ25 — &lt;b&gt;810 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;ВЧ40 — &lt;b&gt;840 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;ЧХ16 — &lt;b&gt;1 702 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;ЧХ3 — &lt;b&gt;1 768 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;Бронза БрО10Ф1 — &lt;b&gt;2 440 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;Бронза БрО10Ц2 — &lt;b&gt;2 485 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;Точность &lt;b&gt;16-00-16&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;Мин. плавка: чугун &lt;b&gt;100 кг&lt;/b&gt;, бронза &lt;b&gt;200 кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;СЧ20 — &lt;b&gt;750 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;СЧ18-36 — &lt;b&gt;750 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;СЧ25 — &lt;b&gt;810 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;ВЧ40 — &lt;b&gt;840 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;ЧХ16 — &lt;b&gt;1 702 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;ЧХ3 — &lt;b&gt;1 768 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;Бронза БрО10Ф1 — &lt;b&gt;2 440 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;Бронза БрО10Ц2 — &lt;b&gt;2 485 ₽/кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;Точность &lt;b&gt;16-00-16&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
        &lt;span class="ticker-item"&gt;Мин. плавка: чугун &lt;b&gt;100 кг&lt;/b&gt;, бронза &lt;b&gt;200 кг&lt;/b&gt;&lt;/span&gt;
        &lt;span class="ticker-dot"&gt;◆&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  
  &lt;header&gt;
    &lt;div class="banner-tag"&gt;КАЛЬКУЛЯТОР&lt;/div&gt;
    &lt;h1&gt;Расчёт стоимости отливок&lt;/h1&gt;
    &lt;div class="banner-line"&gt;&lt;/div&gt;
    &lt;p&gt;Чугун · Сталь · Бронза · Точность 16-00-16&lt;/p&gt;
  &lt;/header&gt;

  
  &lt;div class="promo-toolbar"&gt;
    &lt;button class="promo-btn primary" onclick="downloadCSV()"&gt;⬇ Скачать расчёт CSV&lt;/button&gt;
    &lt;button class="promo-btn primary" onclick="downloadExcel()"&gt;⬇ Скачать Excel&lt;/button&gt;
    &lt;button class="promo-btn" onclick="window.print()"&gt;? Печать / PDF&lt;/button&gt;
    &lt;button class="promo-btn" onclick="resetAll()"&gt;✕ Сбросить&lt;/button&gt;
  &lt;/div&gt;

  
  &lt;div class="calc-block" style="margin-bottom:14px"&gt;
    &lt;div class="calc-title"&gt;Параметры отливки&lt;/div&gt;

    &lt;div class="input-grid"&gt;
      
      &lt;div&gt;
        &lt;div class="field"&gt;
          &lt;label&gt;Материал&lt;/label&gt;
          &lt;select id="material"&gt;&lt;/select&gt;
        &lt;/div&gt;

        &lt;div class="field"&gt;
          &lt;label&gt;Форма отливки&lt;/label&gt;
          &lt;div class="shape-grid"&gt;
            &lt;div class="shape-btn active" data-shape="circle"&gt;
              &lt;span class="shape-icon"&gt;⬤&lt;/span&gt;
              &lt;span class="shape-name"&gt;Круг&lt;/span&gt;
            &lt;/div&gt;
            &lt;div class="shape-btn" data-shape="bushing"&gt;
              &lt;span class="shape-icon"&gt;◎&lt;/span&gt;
              &lt;span class="shape-name"&gt;Втулка&lt;/span&gt;
            &lt;/div&gt;
            &lt;div class="shape-btn" data-shape="plate"&gt;
              &lt;span class="shape-icon"&gt;▬&lt;/span&gt;
              &lt;span class="shape-name"&gt;Плита&lt;/span&gt;
            &lt;/div&gt;
            &lt;div class="shape-btn" data-shape="ball"&gt;
              &lt;span class="shape-icon"&gt;●&lt;/span&gt;
              &lt;span class="shape-name"&gt;Шар&lt;/span&gt;
            &lt;/div&gt;
            &lt;div class="shape-btn" data-shape="bar"&gt;
              &lt;span class="shape-icon"&gt;▭&lt;/span&gt;
              &lt;span class="shape-name"&gt;Брусок&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class="field"&gt;
          &lt;label&gt;Способ расчёта&lt;/label&gt;
          &lt;div class="mode-toggle"&gt;
            &lt;button class="mode-btn active" data-mode="size"&gt;По размерам&lt;/button&gt;
            &lt;button class="mode-btn" data-mode="weight"&gt;По весу&lt;/button&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      
      &lt;div&gt;
        &lt;div id="sizeFields"&gt;
          &lt;div class="shape-fields" data-shape="circle"&gt;
            &lt;div class="field"&gt;
              &lt;label&gt;Диаметр, мм&lt;/label&gt;
              &lt;input type="number" id="circleD" min="50" max="500" step="1" value="100" /&gt;
              &lt;div class="field-hint"&gt;от 50 до 500 мм&lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="field"&gt;
              &lt;label&gt;Длина, мм&lt;/label&gt;
              &lt;input type="number" id="circleL" min="1" max="600" step="1" value="200" /&gt;
              &lt;div class="field-hint"&gt;не более 600 мм&lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;

          &lt;div class="shape-fields" data-shape="bushing" style="display:none"&gt;
            &lt;div class="field-row"&gt;
              &lt;div class="field"&gt;
                &lt;label&gt;Наружный Ø, мм&lt;/label&gt;
                &lt;input type="number" id="bushD" min="50" max="500" step="1" value="200" /&gt;
              &lt;/div&gt;
              &lt;div class="field"&gt;
                &lt;label&gt;Внутренний Ø, мм&lt;/label&gt;
                &lt;input type="number" id="bushd" min="30" max="450" step="1" value="100" /&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="field"&gt;
              &lt;label&gt;Длина, мм&lt;/label&gt;
              &lt;input type="number" id="bushL" min="1" max="600" step="1" value="200" /&gt;
            &lt;/div&gt;
          &lt;/div&gt;

          &lt;div class="shape-fields" data-shape="plate" style="display:none"&gt;
            &lt;div class="field"&gt;
              &lt;label&gt;Толщина, мм&lt;/label&gt;
              &lt;input type="number" id="plateT" min="40" max="300" step="1" value="50" /&gt;
            &lt;/div&gt;
            &lt;div class="field-row"&gt;
              &lt;div class="field"&gt;
                &lt;label&gt;Ширина, мм&lt;/label&gt;
                &lt;input type="number" id="plateW" min="50" max="500" step="1" value="200" /&gt;
              &lt;/div&gt;
              &lt;div class="field"&gt;
                &lt;label&gt;Длина, мм&lt;/label&gt;
                &lt;input type="number" id="plateL" min="50" max="600" step="1" value="300" /&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;

          &lt;div class="shape-fields" data-shape="ball" style="display:none"&gt;
            &lt;div class="field"&gt;
              &lt;label&gt;Диаметр, мм&lt;/label&gt;
              &lt;input type="number" id="ballD" min="50" max="500" step="1" value="100" /&gt;
              &lt;div class="field-hint"&gt;от 50 до 500 мм&lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;

          &lt;div class="shape-fields" data-shape="bar" style="display:none"&gt;
            &lt;div class="field"&gt;
              &lt;label&gt;Высота, мм&lt;/label&gt;
              &lt;input type="number" id="barH" min="40" max="300" step="1" value="50" /&gt;
            &lt;/div&gt;
            &lt;div class="field-row"&gt;
              &lt;div class="field"&gt;
                &lt;label&gt;Ширина, мм&lt;/label&gt;
                &lt;input type="number" id="barW" min="50" max="500" step="1" value="200" /&gt;
              &lt;/div&gt;
              &lt;div class="field"&gt;
                &lt;label&gt;Длина, мм&lt;/label&gt;
                &lt;input type="number" id="barL" min="50" max="600" step="1" value="300" /&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;

        &lt;div id="weightFields" style="display:none"&gt;
          &lt;div class="field"&gt;
            &lt;label&gt;Вес одной детали, кг&lt;/label&gt;
            &lt;input type="number" id="weightInput" min="5" max="500" step="0.1" value="10" /&gt;
            &lt;div class="field-hint"&gt;от 5 до 500 кг&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class="field"&gt;
          &lt;label&gt;Количество, шт&lt;/label&gt;
          &lt;input type="number" id="qty" min="1" max="1000" step="1" value="1" /&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  
  &lt;div class="example-block"&gt;
    &lt;div class="example-header"&gt;
      &lt;div class="example-tag"&gt;ПРИМЕР&lt;/div&gt;
      &lt;h3&gt;Пример расчёта по чугуну СЧ20&lt;/h3&gt;
      &lt;p&gt;Самый доступный материал · минимальная плавка &lt;b&gt;100 кг&lt;/b&gt;&lt;/p&gt;
    &lt;/div&gt;

    &lt;div class="example-grid"&gt;
      &lt;div class="example-col"&gt;
        &lt;div class="example-col-title"&gt;Вводные данные&lt;/div&gt;
        &lt;table class="example-table"&gt;
          &lt;tr&gt;&lt;td&gt;Материал&lt;/td&gt;&lt;td&gt;СЧ20&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Цена&lt;/td&gt;&lt;td&gt;750 ₽/кг&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Плотность&lt;/td&gt;&lt;td&gt;7 100 кг/м³&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Форма&lt;/td&gt;&lt;td&gt;Круг&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Диаметр&lt;/td&gt;&lt;td&gt;200 мм&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Длина&lt;/td&gt;&lt;td&gt;400 мм&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Количество&lt;/td&gt;&lt;td&gt;2 шт&lt;/td&gt;&lt;/tr&gt;
        &lt;/table&gt;
      &lt;/div&gt;

      &lt;div class="example-col"&gt;
        &lt;div class="example-col-title"&gt;Расчёт&lt;/div&gt;
        &lt;table class="example-table"&gt;
          &lt;tr&gt;&lt;td&gt;Объём детали&lt;/td&gt;&lt;td&gt;0,01257 м³&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Вес детали&lt;/td&gt;&lt;td&gt;89,22 кг&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Вес партии&lt;/td&gt;&lt;td&gt;178,44 кг&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Коэф. точности 16-00-16&lt;/td&gt;&lt;td&gt;+15%&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Цена за кг с коэф.&lt;/td&gt;&lt;td&gt;862,50 ₽&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Цена за деталь&lt;/td&gt;&lt;td&gt;76 952 ₽&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Оплата за партию&lt;/td&gt;&lt;td&gt;178,44 кг&lt;/td&gt;&lt;/tr&gt;
        &lt;/table&gt;
      &lt;/div&gt;

      &lt;div class="example-col"&gt;
        &lt;div class="example-col-title"&gt;Итог&lt;/div&gt;
        &lt;div class="example-total"&gt;
          &lt;div class="example-total-label"&gt;Цена за партию&lt;/div&gt;
          &lt;div class="example-total-value"&gt;153 905 ₽&lt;/div&gt;
          &lt;div class="example-total-note"&gt;Партия 178,44 кг ≥ 100 кг&lt;br /&gt;Оплата по фактическому весу&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="example-compare"&gt;
      &lt;div class="example-compare-title"&gt;Сравнение с минимальной плавкой&lt;/div&gt;
      &lt;div class="example-compare-grid"&gt;
        &lt;div class="example-compare-item"&gt;
          &lt;div class="example-compare-label"&gt;Если заказать 1 шт (89,22 кг)&lt;/div&gt;
          &lt;div class="example-compare-value"&gt;86 250 ₽&lt;/div&gt;
          &lt;div class="example-compare-note"&gt;Партия &amp;lt; 100 кг → оплата за 100 кг&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="example-compare-item"&gt;
          &lt;div class="example-compare-label"&gt;Если заказать 2 шт (178,44 кг)&lt;/div&gt;
          &lt;div class="example-compare-value"&gt;153 905 ₽&lt;/div&gt;
          &lt;div class="example-compare-note"&gt;Партия ≥ 100 кг → оплата по факту&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  
  &lt;div class="result-block"&gt;
    &lt;div class="calc-title"&gt;Результат расчёта&lt;/div&gt;

    &lt;div class="warn" id="warnBox"&gt;&lt;/div&gt;
    &lt;div class="info-note" id="infoBox"&gt;&lt;/div&gt;

    &lt;div class="result-grid"&gt;
      &lt;div class="result-item"&gt;
        &lt;div class="result-label"&gt;Объём детали&lt;/div&gt;
        &lt;div class="result-value small" id="resVolume"&gt;—&lt;/div&gt;
        &lt;div class="result-unit"&gt;м³&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="result-item"&gt;
        &lt;div class="result-label"&gt;Вес детали&lt;/div&gt;
        &lt;div class="result-value" id="resWeight"&gt;—&lt;/div&gt;
        &lt;div class="result-unit"&gt;кг&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="result-item"&gt;
        &lt;div class="result-label"&gt;Кол-во&lt;/div&gt;
        &lt;div class="result-value" id="resQty"&gt;—&lt;/div&gt;
        &lt;div class="result-unit"&gt;шт&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="result-item"&gt;
        &lt;div class="result-label"&gt;Вес партии&lt;/div&gt;
        &lt;div class="result-value" id="resBatchWeight"&gt;—&lt;/div&gt;
        &lt;div class="result-unit"&gt;кг&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="result-item"&gt;
        &lt;div class="result-label"&gt;Цена за кг&lt;/div&gt;
        &lt;div class="result-value small" id="resPriceKg"&gt;—&lt;/div&gt;
        &lt;div class="result-unit"&gt;₽&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="result-item"&gt;
        &lt;div class="result-label"&gt;Цена за деталь&lt;/div&gt;
        &lt;div class="result-value small" id="resPricePart"&gt;—&lt;/div&gt;
        &lt;div class="result-unit"&gt;₽&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="result-total"&gt;
      &lt;div class="result-total-label"&gt;Цена за партию&lt;/div&gt;
      &lt;div class="result-total-value" id="resPriceBatch"&gt;—&lt;/div&gt;
      &lt;div class="result-total-note" id="resPriceBatchNote"&gt;—&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  
  &lt;div class="summary-block"&gt;
    &lt;div class="calc-title"&gt;Детализация расчёта&lt;/div&gt;
    &lt;table class="summary-table"&gt;
      &lt;tr&gt;&lt;td&gt;Материал&lt;/td&gt;&lt;td id="sumMaterial"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Группа&lt;/td&gt;&lt;td id="sumGroup"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Цена материала&lt;/td&gt;&lt;td id="sumPriceKg"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Плотность&lt;/td&gt;&lt;td id="sumDensity"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Форма&lt;/td&gt;&lt;td id="sumShape"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Способ расчёта&lt;/td&gt;&lt;td id="sumMode"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Объём одной детали&lt;/td&gt;&lt;td id="sumVolume"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Вес одной детали&lt;/td&gt;&lt;td id="sumWeightOne"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Количество&lt;/td&gt;&lt;td id="sumQty"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Общий вес партии&lt;/td&gt;&lt;td id="sumBatchWeight"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Коэффициент точности 16-00-16&lt;/td&gt;&lt;td id="sumCoef"&gt;+15%&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Минимальная плавка&lt;/td&gt;&lt;td id="sumMinMelt"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Расчётный вес для оплаты&lt;/td&gt;&lt;td id="sumPayWeight"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;&lt;b&gt;Цена за деталь&lt;/b&gt;&lt;/td&gt;&lt;td id="sumPriceOne"&gt;—&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;&lt;b&gt;Цена за партию&lt;/b&gt;&lt;/td&gt;&lt;td id="sumPriceBatch"&gt;—&lt;/td&gt;&lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;

  
  &lt;div class="cta-section"&gt;
    &lt;p class="cta-text"&gt;Нужен точный расчёт или нестандартная форма?&lt;/p&gt;
    &lt;a href="tel:+79028733690" class="cta-button"&gt;8 (902) 873-36-90&lt;/a&gt;
    &lt;p class="manager-info"&gt;Менеджер: Ольга · Бронесталь · ООО «Арсенал Деталь»&lt;/p&gt;
  &lt;/div&gt;

  
  &lt;div class="seo-text"&gt;
    &lt;p&gt;Калькулятор стоимости отливок из чугуна СЧ18-36, СЧ20, СЧ25, ВЧ40, ЧХ1, ЧХ3, ЧХ16, АЧС-1, стали 110Г13Л, 20Л, 25Л, 30Л, 40ХНЛ, 40ХМЛ, 30ХМЛ, 40ХФЛ, 35ХГФЛ, 70Х2ГЛ, 60ХГЛ, 50ХГЛ, 35ХГЛ, 25ХГЛ, 30ХЛ, 15ФЛ, 55СЛ, 70ГЛ, 70ХЛ, 45ГЛ, 30ГЛ, 15ГЛ, 35НГМЛ, 35ХГСЛ, 30ХНМЛ, 35ХМЛ, 20ГНМФЛ, 20ХМФЛ, 20ХМЛ, бронзы БрО10Ф1, БрО10Ц2. Расчёт веса и цены по размерам или весу. Круг, втулка, плита, шар, брусок. Точность отливки 16-00-16. Цены с НДС. ООО «Арсенал-Деталь», 8 992-017-49-73.&lt;/p&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;script&gt;
/* ==================== ДАННЫЕ: МАТЕРИАЛЫ (отсортированы по цене) ==================== */
const MATERIALS = [
  // --- Чугун дешёвый ---
  {key:'sch20',    name:'СЧ20',        price:750,  density:7100, minMelt:100, group:'Чугун'},
  {key:'sch1836',  name:'СЧ18-36',     price:750,  density:7100, minMelt:50,  group:'Чугун'},
  {key:'sch25',    name:'СЧ25',        price:810,  density:7200, minMelt:100, group:'Чугун'},
  {key:'vch40',    name:'ВЧ40',        price:840,  density:7200, minMelt:100, group:'Чугун'},
  {key:'chh16',    name:'ЧХ16',        price:1702, density:7300, minMelt:100, group:'Чугун'},
  {key:'chh3',     name:'ЧХ3',         price:1768, density:7300, minMelt:100, group:'Чугун'},
  {key:'chh1',     name:'ЧХ1',         price:1768, density:7300, minMelt:200, group:'Чугун'},
  {key:'achs1',    name:'АЧС-1',       price:1702, density:7300, minMelt:200, group:'Чугун'},

  // --- Стали 600 ₽/кг ---
  {key:'st110g13l',name:'110Г13Л',     price:600,  density:7820, minMelt:100, group:'Сталь'},
  {key:'st20l',    name:'20Л',         price:600,  density:7820, minMelt:100, group:'Сталь'},
  {key:'st25l',    name:'25Л',         price:600,  density:7820, minMelt:100, group:'Сталь'},
  {key:'st30l',    name:'30Л',         price:600,  density:7820, minMelt:100, group:'Сталь'},
  {key:'st40hnl',  name:'40ХНЛ',       price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st40hml',  name:'40ХМЛ',       price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st30hml',  name:'30ХМЛ',       price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st40hfl',  name:'40ХФЛ',       price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st35hghfl',name:'35ХГФЛ',      price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st70h2gl', name:'70Х2ГЛ',      price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st60hgl',  name:'60ХГЛ',       price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st50hgl',  name:'50ХГЛ',       price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st35hgl',  name:'35ХГЛ',       price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st25hgl',  name:'25ХГЛ',       price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st30hl',   name:'30ХЛ',        price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st15fl',   name:'15ФЛ',        price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st55sl',   name:'55СЛ',        price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st70gl',   name:'70ГЛ',        price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st70hl',   name:'70ХЛ',        price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st45gl',   name:'45ГЛ',        price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st30gl',   name:'30ГЛ',        price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st15gl',   name:'15ГЛ',        price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st35ngml', name:'35НГМЛ',      price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st35hgsl', name:'35ХГСЛ',      price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st30hnml', name:'30ХНМЛ',      price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st35hml',  name:'35ХМЛ',       price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st20gnmfl',name:'20ГНМФЛ',     price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st20hmfl', name:'20ХМФЛ',      price:600,  density:7830, minMelt:300, group:'Сталь'},
  {key:'st20hml',  name:'20ХМЛ',       price:600,  density:7830, minMelt:300, group:'Сталь'},

  // --- Бронза ---
  {key:'bro10f1',  name:'Бронза БрО10Ф1', price:2440, density:8700, minMelt:200, group:'Бронза'},
  {key:'bro10c2',  name:'Бронза БрО10Ц2', price:2485, density:8700, minMelt:200, group:'Бронза'}
];

const SHAPES = {
  circle:  'Круг (сигара)',
  bushing: 'Втулка',
  plate:   'Плита',
  ball:    'Шар',
  bar:     'Брусок'
};

const COEF_PRECISION = 1.15;
const MIN_WEIGHT = 5;
const MAX_WEIGHT = 500;

/* ==================== СОСТОЯНИЕ ==================== */
let state = { material:'sch20', shape:'circle', mode:'size', qty:1 };

/* ==================== ЗАПОЛНЕНИЕ SELECT ==================== */
const matSelect = document.getElementById('material');
const groups = { 'Чугун':[], 'Сталь':[], 'Бронза':[] };
MATERIALS.forEach(m =&gt; {
  if (!groups[m.group]) groups[m.group] = [];
  groups[m.group].push(m);
});
Object.entries(groups).forEach(([groupName, items]) =&gt; {
  const og = document.createElement('optgroup');
  og.label = groupName;
  items.forEach(item =&gt; {
    const opt = document.createElement('option');
    opt.value = item.key;
    opt.textContent = `${item.name} — ${item.price} ₽/кг (мин. плавка ${item.minMelt} кг)`;
    og.appendChild(opt);
  });
  matSelect.appendChild(og);
});

/* ==================== УТИЛИТЫ ==================== */
const fmt = n =&gt; (n === null || n === undefined || isNaN(n)) ? '—' : n.toLocaleString('ru-RU', {maximumFractionDigits: 2});
const fmtInt = n =&gt; (n === null || n === undefined || isNaN(n)) ? '—' : Math.round(n).toLocaleString('ru-RU');
const num = id =&gt; { const el = document.getElementById(id); if (!el) return 0; const v = parseFloat(el.value); return isNaN(v) ? 0 : v; };

function getMaterial(key) {
  return MATERIALS.find(m =&gt; m.key === key) || MATERIALS[0];
}

/* ==================== ОБЪЁМ ==================== */
function calcVolume() {
  const m = 0.001;
  switch (state.shape) {
    case 'circle': { const r = num('circleD')*m/2; return Math.PI * r * r * num('circleL')*m; }
    case 'bushing': { const R = num('bushD')*m/2, r = num('bushd')*m/2; return Math.PI * (R*R - r*r) * num('bushL')*m; }
    case 'plate': return num('plateT')*m * num('plateW')*m * num('plateL')*m;
    case 'ball': { const r = num('ballD')*m/2; return (4/3) * Math.PI * r**3; }
    case 'bar': return num('barH')*m * num('barW')*m * num('barL')*m;
  }
  return 0;
}

/* ==================== ПРОВЕРКИ ==================== */
function validate() {
  const warns = [];
  const checks = {
    circle: [{id:'circleD',min:50,max:500,label:'Диаметр'},{id:'circleL',min:1,max:600,label:'Длина'}],
    bushing: [{id:'bushD',min:50,max:500,label:'Наружный Ø'},{id:'bushd',min:30,max:450,label:'Внутренний Ø'},{id:'bushL',min:1,max:600,label:'Длина'}],
    plate: [{id:'plateT',min:40,max:300,label:'Толщина'},{id:'plateW',min:50,max:500,label:'Ширина'},{id:'plateL',min:50,max:600,label:'Длина'}],
    ball: [{id:'ballD',min:50,max:500,label:'Диаметр'}],
    bar: [{id:'barH',min:40,max:300,label:'Высота'},{id:'barW',min:50,max:500,label:'Ширина'},{id:'barL',min:50,max:600,label:'Длина'}]
  };
  if (state.mode === 'size') {
    (checks[state.shape] || []).forEach(c =&gt; {
      const el = document.getElementById(c.id);
      if (!el) return;
      const v = parseFloat(el.value);
      if (isNaN(v) || v &lt; c.min || v &gt; c.max) { el.classList.add('error'); warns.push(`${c.label}: от ${c.min} до ${c.max} мм`); }
      else el.classList.remove('error');
    });
    if (state.shape === 'bushing' &amp;&amp; num('bushd') &gt;= num('bushD')) {
      warns.push('Внутренний Ø должен быть меньше наружного');
      document.getElementById('bushd').classList.add('error');
    }
  } else {
    const w = num('weightInput');
    if (w &lt; MIN_WEIGHT || w &gt; MAX_WEIGHT) { warns.push(`Вес детали: от ${MIN_WEIGHT} до ${MAX_WEIGHT} кг`); document.getElementById('weightInput').classList.add('error'); }
    else document.getElementById('weightInput').classList.remove('error');
  }
  return warns;
}

/* ==================== РАСЧЁТ ==================== */
function calculate() {
  const m = getMaterial(state.material);
  const warns = validate();

  let volume = 0, weightOne = 0;
  if (state.mode === 'size') { volume = calcVolume(); weightOne = volume * m.density; }
  else { weightOne = num('weightInput'); volume = weightOne / m.density; }

  if (weightOne &lt; MIN_WEIGHT) warns.push(`Минимальный вес детали — ${MIN_WEIGHT} кг`);
  if (weightOne &gt; MAX_WEIGHT) warns.push(`Максимальный вес детали — ${MAX_WEIGHT} кг`);

  const qty = Math.max(1, parseInt(num('qty')) || 1);
  const batchWeight = weightOne * qty;
  const priceKg = m.price * COEF_PRECISION;
  const priceOne = weightOne * priceKg;
  const minMelt = m.minMelt || 300;
  const payWeight = Math.max(batchWeight, minMelt);
  const priceBatch = payWeight * priceKg;

  let infoText = '';
  if (batchWeight &lt; minMelt) infoText = `Партия ${fmt(batchWeight)} кг меньше минимальной плавки. Оплата за ${minMelt} кг.`;

  document.getElementById('resVolume').textContent = volume.toFixed(6);
  document.getElementById('resWeight').textContent = fmt(weightOne);
  document.getElementById('resQty').textContent = qty;
  document.getElementById('resBatchWeight').textContent = fmt(batchWeight);
  document.getElementById('resPriceKg').textContent = fmtInt(priceKg);
  document.getElementById('resPricePart').textContent = fmtInt(priceOne);
  document.getElementById('resPriceBatch').textContent = fmtInt(priceBatch) + ' ₽';
  document.getElementById('resPriceBatchNote').textContent = batchWeight &lt; minMelt
    ? `Оплата за ${minMelt} кг (мин. плавка ${m.group.toLowerCase()})`
    : `Фактический вес партии: ${fmt(batchWeight)} кг`;

  const warnBox = document.getElementById('warnBox');
  if (warns.length) { warnBox.innerHTML = warns.map(w =&gt; '• ' + w).join('&lt;br&gt;'); warnBox.classList.add('show'); }
  else warnBox.classList.remove('show');

  const infoBox = document.getElementById('infoBox');
  if (infoText) { infoBox.innerHTML = '&lt;b&gt;Минимальная плавка:&lt;/b&gt; ' + infoText; infoBox.classList.add('show'); }
  else infoBox.classList.remove('show');

  document.getElementById('sumMaterial').textContent = m.name;
  document.getElementById('sumGroup').textContent = m.group;
  document.getElementById('sumPriceKg').textContent = fmtInt(m.price) + ' ₽/кг (с НДС)';
  document.getElementById('sumDensity').textContent = fmtInt(m.density) + ' кг/м³';
  document.getElementById('sumShape').textContent = SHAPES[state.shape];
  document.getElementById('sumMode').textContent = state.mode === 'size' ? 'По размерам' : 'По весу';
  document.getElementById('sumVolume').textContent = volume.toFixed(6) + ' м³';
  document.getElementById('sumWeightOne').textContent = fmt(weightOne) + ' кг';
  document.getElementById('sumQty').textContent = qty + ' шт';
  document.getElementById('sumBatchWeight').textContent = fmt(batchWeight) + ' кг';
  document.getElementById('sumMinMelt').textContent = minMelt + ' кг';
  document.getElementById('sumPayWeight').textContent = fmt(payWeight) + ' кг';
  document.getElementById('sumPriceOne').textContent = fmtInt(priceOne) + ' ₽';
  document.getElementById('sumPriceBatch').textContent = fmtInt(priceBatch) + ' ₽';

  state.result = { material:m, shape:SHAPES[state.shape], mode:state.mode === 'size' ? 'По размерам' : 'По весу', volume, weightOne, qty, batchWeight, payWeight, priceKg, priceOne, priceBatch, minMelt };
}

/* ==================== ФОРМЫ ==================== */
function setShape(shape) {
  state.shape = shape;
  document.querySelectorAll('.shape-btn').forEach(b =&gt; b.classList.toggle('active', b.dataset.shape === shape));
  document.querySelectorAll('.shape-fields').forEach(f =&gt; f.style.display = f.dataset.shape === shape ? 'block' : 'none');
  calculate();
}
function setMode(mode) {
  state.mode = mode;
  document.querySelectorAll('.mode-btn').forEach(b =&gt; b.classList.toggle('active', b.dataset.mode === mode));
  document.getElementById('sizeFields').style.display = mode === 'size' ? 'block' : 'none';
  document.getElementById('weightFields').style.display = mode === 'weight' ? 'block' : 'none';
  calculate();
}

/* ==================== СОБЫТИЯ ==================== */
document.querySelectorAll('.shape-btn').forEach(btn =&gt; btn.addEventListener('click', () =&gt; setShape(btn.dataset.shape)));
document.querySelectorAll('.mode-btn').forEach(btn =&gt; btn.addEventListener('click', () =&gt; setMode(btn.dataset.mode)));
matSelect.addEventListener('change', e =&gt; { state.material = e.target.value; calculate(); });
document.getElementById('qty').addEventListener('input', calculate);
['circleD','circleL','bushD','bushd','bushL','plateT','plateW','plateL','ballD','barH','barW','barL','weightInput']
  .forEach(id =&gt; { const el = document.getElementById(id); if (el) el.addEventListener('input', calculate); });

/* ==================== СБРОС ==================== */
function resetAll() {
  matSelect.value = 'sch20';
  state.material = 'sch20';
  setShape('circle');
  setMode('size');
  document.getElementById('qty').value = 1;
  document.getElementById('circleD').value = 100;
  document.getElementById('circleL').value = 200;
  document.getElementById('bushD').value = 200;
  document.getElementById('bushd').value = 100;
  document.getElementById('bushL').value = 200;
  document.getElementById('plateT').value = 50;
  document.getElementById('plateW').value = 200;
  document.getElementById('plateL').value = 300;
  document.getElementById('ballD').value = 100;
  document.getElementById('barH').value = 50;
  document.getElementById('barW').value = 200;
  document.getElementById('barL').value = 300;
  document.getElementById('weightInput').value = 10;
  document.querySelectorAll('.error').forEach(el =&gt; el.classList.remove('error'));
  calculate();
}

/* ==================== ЭКСПОРТ ==================== */
function downloadBlob(blob, filename) {
  const url = URL.createObjectURL(blob);
  const a = document.createElement('a');
  a.href = url; a.download = filename;
  document.body.appendChild(a); a.click(); a.remove();
  setTimeout(() =&gt; URL.revokeObjectURL(url), 500);
}
function today() { const d = new Date(), p = n =&gt; String(n).padStart(2,'0'); return `${d.getFullYear()}-${p(d.getMonth()+1)}-${p(d.getDate())}`; }

function buildRows() {
  const r = state.result;
  if (!r) return {header:[], body:[]};
  const header = ['Параметр','Значение'];
  const body = [
    ['Материал', r.material.name],
    ['Группа', r.material.group],
    ['Цена материала', r.material.price + ' ₽/кг (с НДС)'],
    ['Плотность', r.material.density + ' кг/м³'],
    ['Форма', r.shape],
    ['Способ расчёта', r.mode],
    ['Объём детали', r.volume.toFixed(6) + ' м³'],
    ['Вес детали', r.weightOne.toFixed(2) + ' кг'],
    ['Количество', r.qty + ' шт'],
    ['Вес партии', r.batchWeight.toFixed(2) + ' кг'],
    ['Коэффициент точности 16-00-16', '+15%'],
    ['Минимальная плавка', r.minMelt + ' кг'],
    ['Расчётный вес для оплаты', r.payWeight.toFixed(2) + ' кг'],
    ['Цена за кг (с коэф.)', Math.round(r.priceKg) + ' ₽'],
    ['Цена за деталь', Math.round(r.priceOne) + ' ₽'],
    ['Цена за партию', Math.round(r.priceBatch) + ' ₽']
  ];
  return {header, body};
}

function downloadCSV() {
  const {header, body} = buildRows();
  const esc = v =&gt; `"${String(v).replace(/"/g,'""')}"`;
  const csv = [header, ...body].map(r =&gt; r.map(esc).join(';')).join('\r\n');
  downloadBlob(new Blob(['\uFEFF' + csv], {type:'text/csv;charset=utf-8;'}), 'calc_otlivki_' + today() + '.csv');
}
function downloadExcel() {
  const {header, body} = buildRows();
  const esc = v =&gt; String(v ?? '').replace(/&amp;/g,'&amp;amp;').replace(/&lt;/g,'&amp;lt;').replace(/&gt;/g,'&amp;gt;');
  const table = `&lt;table border="1" cellspacing="0" cellpadding="4"&gt;
    &lt;thead style="background:#000;color:#ffd700;"&gt;&lt;tr&gt;${header.map(h=&gt;`&lt;th&gt;${esc(h)}&lt;/th&gt;`).join('')}&lt;/tr&gt;&lt;/thead&gt;
    &lt;tbody&gt;${body.map(r=&gt;`&lt;tr&gt;${r.map(c=&gt;`&lt;td&gt;${esc(c)}&lt;/td&gt;`).join('')}&lt;/tr&gt;`).join('')}&lt;/tbody&gt;&lt;/table&gt;`;
  const html = `&lt;html xmlns:x="urn:schemas-microsoft-com:office:excel"&gt;&lt;head&gt;&lt;meta charset="UTF-8"&gt;
    &lt;style&gt;td,th{font-family:Arial;font-size:12px;}&lt;/style&gt;&lt;/head&gt;
    &lt;body&gt;&lt;h2&gt;Расчёт стоимости отливки — ${today()}&lt;/h2&gt;
    &lt;p&gt;ООО «Арсенал-Деталь» · 8 992-017-49-73 · bronestali@inbox.ru&lt;/p&gt;
    ${table}
    &lt;p&gt;&lt;i&gt;Точность отливки 16-00-16 · Цены с НДС&lt;/i&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;`;
  downloadBlob(new Blob(['\uFEFF' + html], {type:'application/vnd.ms-excel;charset=utf-8;'}), 'calc_otlivki_' + today() + '.xls');
}

/* ==================== СТАРТ ==================== */
calculate();
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</subtitle>
  <updated>2026-10-08T15:01:00Z</updated>
  <logo>https://xn--80abmnojgpmk.xn--p1ai/ssl/u/pic/f9/71f28ebd6c11f1bc96a94a3b2a5b30/-/XpnoBpMGVrE3AtfQUGFKD80ejOZ4gg39jykiODEqmDqeUPqSFm0Kxv05wtgrESirqqynC9qM7bP1a92QW6pNZBkp.jpg</logo>
  <author>
    <name>1761815</name>
    <uri>https://www.xn--80abmnojgpmk.xn--p1ai/</uri>
  </author>
</feed>
