/* Calcolatore prezzi stampa 3D: stile proprio della pagina (font di sistema, niente risorse esterne) */
  :root{
    --bg:#EDF1EC;
    --panel:#FFFFFF;
    --ink:#17201B;
    --muted:#66736B;
    --line:#D8DFD8;
    --green:#00A650;   /* filamento */
    --amber:#F0B03C;   /* elettricità */
    --rust:#E2703A;    /* manutenzione */
    --blue:#4E7BD0;    /* ammortamento */
    --purple:#9B6BD0;  /* componenti */
    --red:#D05555;     /* fallimenti */
    --teal:#3AA6A0;    /* lavoro */
    --gray:#8E9C93;    /* commissioni */
    --tax:#6B7FA3;     /* tasse */
  }
  *{box-sizing:border-box;margin:0;padding:0}
  body{
    background:var(--bg);
    color:var(--ink);
    font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
    font-size:15px;
    line-height:1.45;
    background-image:repeating-linear-gradient(0deg,transparent,transparent 27px,rgba(23,32,27,.045) 27px,rgba(23,32,27,.045) 28px);
    min-height:100vh;
    padding:20px 14px 60px;
  }
  .wrap{max-width:560px;margin:0 auto}
  header{margin-bottom:22px}
  .eyebrow{
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
    font-size:11px;letter-spacing:.14em;text-transform:uppercase;
    color:var(--green);font-weight:600;margin-bottom:6px;
  }
  h1{
    font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
    font-size:clamp(26px,6vw,34px);
    font-weight:700;letter-spacing:-.02em;line-height:1.05;
  }
  header p{color:var(--muted);margin-top:6px;font-size:13.5px}

  .card{
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:12px;
    padding:18px 16px;
    margin-bottom:14px;
  }
  .card h2{
    font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
    font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
    display:flex;align-items:center;gap:8px;margin-bottom:14px;
  }
  .dot{width:9px;height:9px;border-radius:2px;flex:none}
  .grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
  .field{display:flex;flex-direction:column;gap:4px}
  .field.full{grid-column:1/-1}
  label{font-size:12.5px;font-weight:500;color:var(--muted)}
  .inputbox{
    display:flex;align-items:center;
    border:1px solid var(--line);border-radius:8px;
    background:#FAFBFA;overflow:hidden;
  }
  .inputbox:focus-within{border-color:var(--green);box-shadow:0 0 0 3px rgba(0,166,80,.14)}
  input{
    border:none;background:transparent;outline:none;
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:16px;font-weight:600;
    color:var(--ink);width:100%;padding:9px 10px;
  }
  input.txt{font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;font-weight:500;font-size:14px}
  input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none}
  input[type=number]{-moz-appearance:textfield}
  .unit{
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;color:var(--muted);
    padding:0 10px 0 4px;white-space:nowrap;
  }
  .hint{font-size:11px;color:var(--muted);margin-top:2px}

  /* componenti extra */
  .extra-row{display:flex;gap:8px;margin-bottom:8px;align-items:center}
  .extra-row .inputbox.name{flex:2}
  .extra-row .inputbox.cost{flex:1}
  .btn-x{
    flex:none;width:34px;height:38px;border:1px solid var(--line);border-radius:8px;
    background:#FAFBFA;color:var(--muted);font-size:16px;cursor:pointer;line-height:1;
  }
  .btn-x:hover{color:var(--red);border-color:var(--red)}
  .btn-add{
    width:100%;padding:9px;border:1px dashed var(--line);border-radius:8px;
    background:transparent;color:var(--muted);font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
    font-size:13px;font-weight:500;cursor:pointer;
  }
  .btn-add:hover{border-color:var(--purple);color:var(--purple)}

  /* ── Risultato ── */
  .result{
    background:var(--ink);color:#F2F5F1;
    border-radius:12px;padding:20px 18px;margin-top:20px;
  }
  .result .eyebrow{color:#7ED9A6}
  .price-row{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:6px;margin:4px 0 2px}
  .price{
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
    font-size:clamp(34px,9vw,46px);font-weight:600;letter-spacing:-.02em;
  }
  .per-piece{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:14px;color:#AEBBB2}
  .subline{font-size:12.5px;color:#8E9C93;margin-bottom:16px}

  .stackbar{
    display:flex;height:26px;border-radius:6px;overflow:hidden;
    outline:1px solid rgba(255,255,255,.15);margin-bottom:12px;
  }
  .stackbar div{transition:width .25s ease;min-width:0}
  .legend{display:flex;flex-direction:column;gap:7px}
  .legend-row{display:flex;align-items:center;gap:8px;font-size:13px}
  .legend-row .dot{border-radius:2px}
  .legend-row .name{flex:1;color:#CBD6CE}
  .legend-row .val{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-weight:600}
  .legend-row .pct{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;color:#8E9C93;width:48px;text-align:right}
  .divider{border:none;border-top:1px solid rgba(255,255,255,.14);margin:13px 0}
  .totrow{display:flex;justify-content:space-between;font-size:13.5px;color:#CBD6CE}
  .totrow .val{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-weight:600;color:#F2F5F1}
  footer{margin-top:18px;font-size:11.5px;color:var(--muted);text-align:center}
  .dot.c-green{background:var(--green)}
  .dot.c-amber{background:var(--amber)}
  .dot.c-blue{background:var(--blue)}
  .dot.c-teal{background:var(--teal)}
  .dot.c-purple{background:var(--purple)}
  .dot.c-red{background:var(--red)}
  .green-val{color:#7ED9A6}
  .mt5{margin-top:5px}
  .hint.mt8{margin-top:8px}
