.materials-page { padding-bottom: 110px; }
.materials-hero { max-width: 900px; padding: 72px 0 55px; }
.materials-hero h1 { font-size: clamp(50px, 7vw, 86px); }
.materials-hero h1 em { color: var(--orange); font-style: normal; }
.materials-lead { max-width: 760px; margin: 26px 0 0; color: var(--muted); font-size: 18px; }
.materials-trust { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 34px 0 0; padding: 0; color: var(--muted); font-size: 12px; list-style: none; }
.materials-trust li::before { content: "✓"; margin-right: 7px; color: var(--orange-dark); font-weight: 900; }

.materials-tool { padding: 34px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.materials-tool-head { display: grid; grid-template-columns: .72fr 1.28fr; gap: 34px; align-items: start; }
.tool-kicker { margin: 0 0 7px; color: var(--orange-dark); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.materials-tool h2 { margin: 0; font-size: clamp(34px, 4vw, 52px); }
.materials-meta { display: grid; grid-template-columns: .78fr 1.35fr 1.15fr; gap: 12px; }
.materials-meta label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.materials-meta label > input, .money-input { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: #f7f4ed; }
.materials-meta label > input { width: 100%; padding: 0 13px; color: var(--ink); outline: 0; }
.materials-meta label > input:focus, .money-input:focus-within { border-color: var(--orange); background: white; }
.materials-meta small { color: var(--muted); font-size: 10px; font-weight: 500; }
.money-input { display: flex; align-items: center; gap: 7px; padding: 0 13px; }
.money-input > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.money-input input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-weight: 750; }

.mobile-table-hint { display: none; margin: 28px 0 10px; color: var(--muted); font-size: 11px; }
.materials-table-wrap { margin-top: 30px; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
.materials-table { width: 100%; min-width: 860px; border-collapse: collapse; background: white; }
.materials-table th { padding: 13px 12px; background: #e8eee4; color: var(--green); font-size: 11px; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.materials-table td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.materials-table th:nth-child(1) { width: 28%; }
.materials-table th:nth-child(2) { width: 12%; }
.materials-table th:nth-child(3) { width: 12%; }
.materials-table th:nth-child(4) { width: 18%; }
.materials-table th:nth-child(5) { width: 20%; }
.materials-table th:nth-child(6) { width: 10%; }
.materials-table input { width: 100%; min-height: 44px; padding: 0 11px; border: 1px solid transparent; border-radius: 10px; background: #f7f4ed; color: var(--ink); outline: 0; }
.materials-table input:focus { border-color: var(--orange); background: white; }
.materials-table input[data-field="quantity"], .materials-table input[data-field="unit"] { text-align: center; }
.materials-price { min-height: 44px; padding: 0 10px; display: flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; background: #f7f4ed; }
.materials-price:focus-within { border-color: var(--orange); background: white; }
.materials-price span { color: var(--muted); font-size: 11px; font-weight: 750; }
.materials-price input { min-height: 40px; padding: 0; border: 0; background: transparent; }
.materials-price input:focus { border: 0; background: transparent; }
.row-total { display: block; color: var(--green); font-size: 14px; font-weight: 800; white-space: nowrap; }
.remove-row { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.remove-row:hover { border-color: #bb3c21; color: #bb3c21; background: #fff1ed; }

.materials-list-controls { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }
.materials-list-controls button { min-height: 44px; padding: 0 16px; border-radius: 12px; font-weight: 750; cursor: pointer; }
.materials-add { border: 0; background: var(--orange); color: #24150f; }
.materials-add:hover { background: #ff8052; }
.materials-clear { border: 1px solid var(--line); background: transparent; color: var(--muted); }
.materials-clear:hover { color: #9d2d18; border-color: #c95a42; }

.materials-summary { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.materials-summary > div { min-height: 126px; padding: 22px; display: grid; align-content: center; border-radius: 18px; }
.materials-summary span { color: var(--muted); font-size: 12px; font-weight: 700; }
.materials-summary strong { margin: 2px 0; font-size: clamp(27px, 4vw, 40px); letter-spacing: -.04em; }
.materials-summary small { color: var(--muted); font-size: 11px; }
.summary-total { background: var(--ink); color: white; }
.summary-total span, .summary-total small { color: #cbd5d0; }
.budget-status { background: #ece9e1; border: 1px solid var(--line); }
.budget-status.is-safe { background: #e5efe6; border-color: #b6cdb9; }
.budget-status.is-over { background: #fff0eb; border-color: #efb6a5; }
.budget-status.is-over strong { color: #a8391d; }

.materials-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.materials-pdf-share { background: var(--orange); color: #24150f; box-shadow: none; }
.materials-pdf-share:hover { background: #ff8052; }
.materials-secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); box-shadow: none; }
.materials-secondary:hover { background: #f1ede5; }
.materials-status { min-height: 20px; margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.materials-status.is-success { color: #2e6440; }
.materials-status.is-warning { color: #8a5a14; }
.materials-status.is-error { color: #a8391d; }
.materials-privacy { margin: 12px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }

.materials-how { margin-top: 70px; padding-top: 55px; display: grid; grid-template-columns: .78fr 1.22fr; gap: 60px; border-top: 1px solid var(--line); }
.materials-how h2 { margin: 0; font-size: clamp(38px, 5vw, 62px); }
.materials-how ol { margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: step; list-style: none; }
.materials-how li { padding: 18px 20px; display: grid; grid-template-columns: 44px 1fr; gap: 6px 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.35); counter-increment: step; }
.materials-how li::before { content: "0" counter(step); grid-row: span 2; color: var(--orange-dark); font: 800 12px ui-monospace, monospace; }
.materials-how strong { font-size: 17px; }
.materials-how span { color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 920px) {
  .materials-tool-head, .materials-how { grid-template-columns: 1fr; }
  .materials-meta { grid-template-columns: 1fr 1fr; }
  .materials-meta label:last-child { grid-column: 1 / -1; }
  .materials-how { gap: 25px; }
}

@media (max-width: 720px) {
  .materials-page { padding-bottom: 80px; }
  .materials-hero { padding: 42px 0; }
  .materials-hero h1 { font-size: 50px; }
  .materials-lead { font-size: 16px; }
  .materials-tool { padding: 22px 16px; border-radius: 22px; }
  .materials-meta { grid-template-columns: 1fr; }
  .materials-meta label:last-child { grid-column: auto; }
  .mobile-table-hint { display: block; }
  .materials-table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .materials-table { min-width: 0; background: transparent; }
  .materials-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .materials-table tbody { display: grid; gap: 12px; }
  .materials-table tr { padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 16px; background: white; }
  .materials-table td { padding: 0; display: grid; gap: 5px; border: 0; }
  .materials-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .materials-table td:first-child { grid-column: 1 / -1; }
  .materials-table td:nth-child(5) { align-content: end; }
  .materials-table td:nth-child(6) { display: flex; align-items: end; justify-content: flex-end; }
  .materials-table td:nth-child(6)::before { display: none; }
  .row-total { min-height: 44px; display: flex; align-items: center; padding: 0 11px; border-radius: 10px; background: #eef2ea; }
  .materials-summary { grid-template-columns: 1fr; }
  .materials-summary > div { min-height: 112px; }
  .materials-actions .button { width: 100%; }
  .materials-how { margin-top: 50px; padding-top: 45px; }
}

@media (max-width: 430px) {
  .materials-table tr { grid-template-columns: 1fr; }
  .materials-table td:first-child { grid-column: auto; }
  .materials-table td:nth-child(6) { justify-content: stretch; }
  .remove-row { width: 100%; }
  .materials-list-controls { display: grid; grid-template-columns: 1fr; }
}

@media print {
  body { background: white; }
  .site-header, .materials-hero, .materials-list-controls, .materials-actions, .materials-status, .materials-privacy, .materials-how, footer, .mobile-table-hint { display: none !important; }
  main.materials-page { width: 100%; padding: 0; }
  .materials-tool { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .materials-tool-head { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
  .materials-meta { grid-template-columns: 1fr 1fr; }
  .materials-meta input, .money-input { background: white; }
  .materials-table-wrap { overflow: visible; }
  .materials-table { min-width: 0; }
  .remove-row, .materials-table th:last-child, .materials-table td:last-child { display: none !important; }
  .materials-summary { break-inside: avoid; }
}
