.history-materials-dialog{box-sizing:border-box;width:min(590px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:26px;border:1px solid var(--border);border-radius:18px;background:var(--panel);color:var(--text);box-shadow:0 24px 80px #0006}.history-materials-dialog::backdrop{background:#10151fb3;backdrop-filter:blur(3px)}.history-materials-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.history-materials-heading h2{margin:0;font-size:21px}.history-materials-close{width:34px;height:34px;flex:none;padding:0;font-size:23px;line-height:1;background:transparent;border-color:transparent;color:var(--muted)}.history-materials-name{font-size:14px;font-weight:600;overflow-wrap:anywhere;margin:10px 0}.history-materials-dialog .hint{font-size:12px;line-height:1.7}.history-materials-estimate{padding:13px 16px;background:var(--accent-soft);border:1px solid var(--accent-border);border-radius:9px;font-size:13px;color:var(--accent)}.history-materials-inputs>label:first-child{display:grid;gap:8px;font-size:12px;color:var(--muted);margin:20px 0 14px}.history-materials-inputs select{box-sizing:border-box;width:100%;min-height:44px;border:1px solid var(--border);border-radius:8px;background:var(--inset);color:var(--text);padding:10px 12px}.history-materials-preview,.history-materials-receipt{padding:16px;background:var(--inset);border:1px solid var(--border);border-radius:10px;margin:14px 0}.history-materials-preview>span{display:block;color:var(--muted);font-size:11px;margin-bottom:7px}.history-materials-preview>strong{font-size:18px;line-height:1.6}.history-materials-preview p,.history-materials-receipt p{margin:7px 0 0}.history-materials-receipt>strong{font-size:13px;line-height:1.7}.history-materials-confirm{display:flex;align-items:flex-start;gap:10px;font-size:13px;line-height:1.6;margin:18px 0}.history-materials-confirm input{accent-color:var(--accent);width:17px;height:17px;flex:none;margin:2px 0}.history-materials-warning{font-size:12px;line-height:1.7;color:var(--warning)}.history-materials-undo h3{font-size:13px;margin:20px 0 0}.history-materials-message{font-size:12px;color:var(--muted);line-height:1.7;min-height:1.7em;margin:20px 0 0}.history-materials-message[data-error=true]{color:var(--danger)}.history-materials-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;border-top:1px solid var(--border);padding-top:18px;margin-top:20px}.history-materials-actions button{font-size:12px;min-height:40px}.history-materials-dialog :focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.materials-usage{margin-top:26px;padding:22px;background:var(--panel);border:1px solid var(--border);border-radius:var(--radius)}.materials-usage>summary{font-size:14px;font-weight:600;cursor:pointer;line-height:1.7}.materials-usage>.hint{font-size:12px;line-height:1.7;margin:14px 0}.materials-usage-tools{display:grid;grid-template-columns:minmax(0,1fr) 180px auto;gap:10px;margin:18px 0 12px}.materials-usage-tools input,.materials-usage-tools select{box-sizing:border-box;width:100%;min-height:40px;padding:9px 11px;border:1px solid var(--border);border-radius:8px;background:var(--inset);color:var(--text);font-size:12px}.materials-usage-tools button{min-height:40px;font-size:12px}.materials-usage-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,.8fr) auto;gap:16px;align-items:center;padding:16px 0;border-top:1px solid var(--border)}.materials-usage-row>div{display:flex;min-width:0;flex-direction:column;gap:5px}.materials-usage-row strong{font-size:12px;line-height:1.7;overflow-wrap:anywhere}.materials-usage-row span,.materials-usage-row small{font-size:11px;line-height:1.6;color:var(--muted);overflow-wrap:anywhere}.materials-usage-row button{font-size:11px;min-height:36px}.materials-usage .list-pagination{margin-bottom:0}
@media(max-width:650px){.history-materials-dialog{padding:20px}.history-materials-heading h2{font-size:19px}.history-materials-actions{display:grid;grid-template-columns:1fr 1fr}.history-materials-actions .primary{grid-column:1/-1}.history-materials-preview>strong{font-size:16px}.materials-usage{padding:18px}.materials-usage-tools{grid-template-columns:1fr 1fr}.materials-usage-tools input{grid-column:1/-1}.materials-usage-row{grid-template-columns:minmax(0,1fr) minmax(120px,1fr);gap:12px}.materials-usage-row button{grid-column:1/-1;justify-self:start}}
@media(prefers-reduced-motion:reduce){.history-materials-dialog::backdrop{backdrop-filter:none}}
