/* С08 список калькуляторов, С09 калькулятор, С10 смета, калькулятор на странице материала */
.stage { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-top: 1px solid var(--line-strong); }
.stage:first-of-type { margin-top: 24px; }
.stage h2 { font-size: 22px; padding-top: 10px; }
.stage__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.calc-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; min-height: 76px; color: var(--text); height: 100%; }
.calc-card:hover { text-decoration: none; border-color: #C9D6EA; }
.calc-card b { display: block; font-size: 15px; }
.calc-card .muted { display: block; line-height: 1.35; }

.home-calcs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.home-calc { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); }
.home-calc:hover { text-decoration: none; border-color: #C9D6EA; }
.home-calc b { flex: 1; font-size: 15px; }
.home-calc .icon-tile { width: 36px; height: 36px; }

.calc-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; align-items: start; }
.calc { padding: 22px 24px; display: grid; gap: 16px; }
.calc--widget { padding: 20px; gap: 12px; }
.calc__h { font-size: 20px; }
.cfields { display: flex; flex-wrap: wrap; gap: 0 16px; }
.cfield { margin-bottom: 4px; flex: 1 1 140px; min-width: 0; }
.cfield:has(.seg) { flex: 2 1 280px; }
.cfield--wide { flex-basis: 100%; }
.cfield[hidden] { display: none; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); }
.seg label { position: relative; flex: 1 1 0; min-width: max-content; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span, .seg--tabs a { display: grid; place-items: center; min-height: 46px; padding: 0 16px; font-weight: 700; font-size: 15px; color: var(--text); white-space: nowrap; }
.seg input:checked + span, .seg--tabs a[aria-current="true"] { background: var(--primary); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid rgba(26, 95, 214, .35); outline-offset: -3px; }
.seg--tabs { width: max-content; max-width: 100%; }
.seg--tabs a:hover { text-decoration: none; }
.cfield .seg { display: flex; flex-wrap: nowrap; overflow-x: auto; }
.cres { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.cres__label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cres__value { margin: 2px 0 8px; }
.cres__value b { font-size: 36px; font-weight: 800; line-height: 1.15; }
.cres__value span { font-size: 18px; font-weight: 700; }
.cres__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.cres__details { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 1.5; }
.cres__note { font-size: 12px; color: var(--muted); }
.cres__lines { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line-strong); font-size: 14px; }
.cres__lines li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.cactions { display: grid; grid-template-columns: repeat(3, auto); gap: 10px; justify-content: start; }
.calc--widget .cactions { grid-template-columns: 1fr 1fr; }
.calc--widget .cres__grid { grid-template-columns: 1fr; gap: 6px; }
.calc--widget .cres__value b { font-size: 30px; }
.calc-about { max-width: 720px; line-height: 1.6; margin-top: 10px; }
.qa { border-bottom: 1px solid var(--line-strong); max-width: 720px; }
.qa summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; font-weight: 700; cursor: pointer; }
.qa summary::-webkit-details-marker { display: none; }
.qa[open] summary .icon { transform: rotate(180deg); }
.qa p { padding-bottom: 14px; line-height: 1.6; }
.qa:first-of-type { border-top: 1px solid var(--line-strong); margin-top: 10px; }
.calc-side { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.norms { overflow: hidden; }
.norms h2 { font-size: 17px; padding: 16px 18px 10px; }
.norms__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.norms__table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 18px; background: #F1F4F9; }
.norms__table td { padding: 10px 18px; border-top: 1px solid var(--line); }
.norms__table .r { text-align: right; white-space: nowrap; }
.norms__table tr.is-hl td { background: var(--primary-soft); }
.norms__src { font-size: 12px; color: var(--muted); padding: 10px 18px 14px; }
.mat-mini { display: flex; gap: 14px; align-items: center; padding: 12px 14px; color: var(--text); }
.mat-mini:hover { text-decoration: none; border-color: #C9D6EA; }
.mat-mini > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.mat-mini__photo { width: 72px; height: 72px; border-radius: 10px; background: #EDF0F5; display: grid; place-items: center; color: #A9B6CA; overflow: hidden; flex: none; }
.mat-mini__photo img { width: 100%; height: 100%; object-fit: cover; }

.est { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.est__table { overflow: hidden; }
.est-table td { vertical-align: middle; }
.est-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.btn--icon { width: 36px; padding: 0; }
.est-where { background: var(--primary-soft); color: var(--primary); }
.est__total { padding: 20px; display: grid; gap: 10px; position: sticky; top: calc(var(--header-h) + 16px); }
.est__label { font-weight: 800; font-size: 15px; }
.est__sum { font-size: 34px; font-weight: 800; line-height: 1.1; }
.est__exports { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 1100px) {
  .stage__list { grid-template-columns: repeat(2, 1fr); }
  .home-calcs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; gap: 10px; padding: 16px 0; }
  .stage h2 { padding-top: 0; }
  .stage__list { grid-template-columns: 1fr; gap: 10px; }
  .home-calcs { grid-template-columns: 1fr; gap: 0; }
  .home-calcs li + li .home-calc { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
  .calc-layout { grid-template-columns: 1fr; margin-top: 16px; }
  .calc { padding: 16px; }
  .calc-side { position: static; }
  .cres__grid { grid-template-columns: 1fr; gap: 6px; }
  .cres__value b { font-size: 30px; }
  .cactions { grid-template-columns: 1fr 1fr; }
  .cactions > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .seg span, .seg--tabs a { padding: 0 12px; font-size: 14px; }
  .est { grid-template-columns: 1fr; }
  .est__total { position: static; }
  .est-table, .est-table tbody, .est-table tr, .est-table td { display: block; width: 100%; }
  .est-table { min-width: 0 !important; }
  .est-table thead { display: none; }
  .est-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .est-table td { border: 0; padding: 4px 0; }
  .est-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
  .est-table td:first-child::before { content: none; }
  .est-actions { justify-content: flex-start; padding-top: 8px !important; }
}
.calc-layout > *, .calc > *, .est > * { min-width: 0; }
.cactions .btn { min-width: 0; white-space: normal; text-align: center; line-height: 1.2; }
