.tool-head.visual{display:flex;align-items:center;min-height:202px}
.tool-head .wrap{width:100%}
.tool-head-dimension{--bg:url(/img/metal.png)}
.tool-head-model{--bg:url(/img/printing-tray.jpg)}
.public-nav .weight-menu summary.on{font-weight:400}
.weight-tool h2{margin:0 0 14px;font-size:16px}
.tool-links{display:flex;gap:8px;margin:0 0 18px}
.tool-links a{padding:7px 12px;border:1px solid #d1d5db;border-radius:8px;color:#374151;font-size:14px;text-decoration:none;background:#fff}
.tool-links a:hover{background:#f1f5f9}
.tool-links a[aria-current=page]{border-color:#2563eb;color:#1d4ed8;background:#eef4ff;font-weight:600}
.tool-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;align-items:start;gap:16px}
.weight-tool [hidden]{display:none}
.tool-result{min-width:0;padding:16px}
.tool-result h2{margin:0 0 10px;font-size:14px;color:#475569}
.tool-result .form{margin-bottom:16px}
.tool-result #result-empty{margin:0 0 10px;font-size:13px;color:#64748b}
.tool-actions{display:grid;gap:8px;margin-top:12px}
.tool-actions .btn{font-size:14px;padding:10px 12px;border-radius:8px;text-align:center}
.tool-actions .btn.ghost{border-color:#d1d5db;color:#475569}
.tool-actions .btn.ghost:disabled{background:#fff;color:#64748b}
.tool-metrics{margin:0}
.tool-metrics div{display:flex;justify-content:space-between;align-items:baseline;gap:8px;padding:8px 0;border-bottom:1px solid #e5e7eb;font-size:13px}
.tool-metrics dt{color:#475569;flex-shrink:0}
.tool-metrics dd{margin:0;text-align:right;font-weight:700;overflow-wrap:anywhere}
.tool-metrics .tool-weight-value dd{font-size:22px;color:#1d4ed8}
.tool-note,.tool-density{color:#475569;font-size:13px}
.tool-result > .tool-note{margin:12px 0 0;padding:8px;border:1px solid #fde68a;border-radius:8px;background:#fffbeb;color:#92400e;font-size:12px}
.tool-density a{color:#1d4ed8}
.tool-density-field{display:flex;align-items:end;gap:8px}
.tool-density-field label{min-width:0;flex:1;margin:0}
.tool-density-field button{padding:9px 12px;font-size:13px;white-space:nowrap}
.weight-tool .msg:empty{display:none}
.weight-tool .msg{margin:8px 0 12px}
.weight-tool .msg textarea{display:block;width:100%;min-height:96px;margin-top:4px;font:inherit}
.tool-explanation{margin-top:16px;font-size:14px}
.tool-explanation p:last-child{margin-bottom:0}
.shape-figure{display:grid;justify-items:center;background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;margin-bottom:14px}
.shape-figure canvas{display:block;width:100%;max-width:360px;height:auto}
.weight-tool input[aria-invalid=true]{border-color:#b91c1c}
.weight-tool .filebox{margin:0 0 14px;padding:22px}
.weight-tool .filebox .btn{border-radius:8px;padding:10px 18px;font-size:14px}
.weight-tool .filebox input{position:absolute;width:1px;height:1px;opacity:0}
.weight-tool .filebox:focus-within label{outline:2px solid #1d4ed8;outline-offset:3px}
.weight-tool .filebox p{margin:10px 0 0;color:#475569;font-size:13px}
.weight-tool .filebox .tool-note{font-size:12px}
.model-empty{margin:0;padding:36px 0;text-align:center;color:#64748b;font-size:14px}
#model-status:not(:empty) ~ .model-empty{display:none}
.tool-name{margin:0 0 6px;font-size:14px;font-weight:600;overflow-wrap:anywhere}
.model-stage{width:100%;height:clamp(250px,35vw,430px);background:#f4f5f6;border-radius:10px;overflow:hidden}
.model-views{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0}
.model-views button{border:1px solid #cbd5e1;background:#fff;color:#334155;padding:6px 12px;border-radius:8px;font:inherit;cursor:pointer}
.model-views button[aria-pressed=true]{background:#eef4ff;border-color:#2563eb;color:#1d4ed8}
.model-help{margin:0 0 12px}
.model-help-touch{display:none}
@media(pointer:coarse){
  .model-help-mouse{display:none}
  .model-help-touch{display:inline}
}
@media(max-width:900px){
  .tool-grid{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:760px){
  .tool-result .row{grid-template-columns:1fr 1fr}
}
@media(max-width:640px){
  .tool-head.visual{min-height:0}
  .weight-tool .filebox{padding:18px}
}
