:root{
  --bg:#0b0c0f;
  --text:#eef0f6;
  --muted:#a7adbf;
  --accent:#d71920;
  --danger:#d32f2f;
  --radius:16px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Arial,sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(215,25,32,.25), transparent 60%),
              radial-gradient(900px 500px at 90% 0%, rgba(40,150,255,.10), transparent 55%),
              var(--bg);
  color:var(--text);
}
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; gap:12px; align-items:center; justify-content:space-between;
  padding:12px 14px;
  background: rgba(10,11,14,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.brand{display:flex; align-items:center; gap:10px;}
.dot{width:12px; height:12px; border-radius:999px; background:var(--accent); box-shadow:0 0 0 6px rgba(215,25,32,.15);}
.title{font-weight:900; letter-spacing:.2px;}
.subtitle{color:var(--muted); font-size:12px; margin-top:2px;}
.top-actions{display:flex; gap:10px; align-items:center;}
.wrap{max-width:980px; margin:0 auto; padding:16px 12px 34px;}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  padding:14px;
  margin:12px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.card-h{display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:10px;}
h2{margin:0; font-size:16px;}
.muted{color:var(--muted); font-size:12px;}
.footer{padding:10px 2px; text-align:center;}

.grid{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
@media (max-width:760px){ .grid{grid-template-columns:1fr;} .topbar{gap:8px; flex-wrap:wrap} }

.field label{display:block; font-size:12px; color:var(--muted); margin:0 0 6px 2px;}
.field input,.field textarea,.field select{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
.field select{appearance:none;}
.field input:focus,.field textarea:focus,.field select:focus{border-color: rgba(215,25,32,.45); box-shadow: 0 0 0 4px rgba(215,25,32,.15);}

.row{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px;}

.btn{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  font-weight:800;
  cursor:pointer;
}
.btn:hover{border-color: rgba(255,255,255,.22);}
.btn:active{transform: translateY(1px);}
.btn.ghost{background: transparent;}
.btn.danger{background: rgba(211,47,47,.12); border-color: rgba(211,47,47,.35); color:#ffd5d5;}
.btn.primary{background: rgba(215,25,32,.22); border-color: rgba(215,25,32,.55);}

.criteria{display:flex; flex-direction:column; gap:10px; margin-top:8px;}
.crit{
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
}
.crit-top{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px;}
.crit-title{font-weight:900; font-size:13px;}
.crit-meta{display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px;}
.emoji{font-size:20px; width:28px; text-align:center;}
.notechip{
  padding:6px 10px; border-radius:999px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  font-weight:900; color:var(--text);
}

input[type="range"]{
  width:100%;
  -webkit-appearance:none;
  appearance:none;
  height:12px;
  border-radius:999px;
  outline:none;
  background: linear-gradient(90deg, #d32f2f 0%, #f57c00 33%, #fbc02d 66%, #388e3c 100%);
  border:1px solid rgba(255,255,255,.10);
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:28px; height:28px;
  border-radius:50%;
  background:#fff;
  border:3px solid rgba(0,0,0,.55);
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
}
input[type="range"]::-moz-range-thumb{
  width:28px; height:28px;
  border-radius:50%;
  background:#fff;
  border:3px solid rgba(0,0,0,.55);
  cursor:pointer;
}

.scorebox{display:flex; align-items:center; gap:10px;}
.scorebig{font-weight:950; font-size:24px;}
.scorebig .small{font-size:14px; color:var(--muted); margin-left:4px;}
.badge{
  padding:6px 10px; border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color:var(--text);
  font-weight:900;
}

.share{display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap;}
.hint{
  margin-top:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px dashed rgba(255,255,255,.18);
  color:var(--muted);
  font-size:12px;
}
.validate{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

/* Print-only sheet hidden on screen */
.print-only{display:none;}

/* Modal */
.modal-backdrop{
  position:fixed; inset:0;
  background: rgba(0,0,0,.55);
  display:flex; align-items:center; justify-content:center;
  padding:16px;
}
.modal{
  width:min(520px, 100%);
  border-radius:18px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(15,16,20,.96);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  padding:14px;
}
.modal-title{font-weight:900; font-size:18px;}
.modal-text{margin-top:6px; color:var(--muted);}
.modal-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px;}

/* PRINT fallback template only */
@media print{
  @page { size: A4; margin: 12mm; }
  .no-print{display:none !important;}
  .print-only{display:block !important;}
  body{background:#fff !important; color:#000 !important; font-family: Arial, Helvetica, sans-serif;}
  .print-title{font-weight:800; font-size:20px; letter-spacing:.3px;}
  .print-subtitle{margin-top:4px; font-size:13px; font-weight:700;}
  .print-fields{margin-top:14px; display:flex; flex-direction:column; gap:8px; font-size:12px;}
  .pf{display:flex; gap:8px;}
  .pfl{min-width:145px; font-weight:700;}
  .pfv{flex:1; border-bottom:1px solid #000; padding-bottom:2px; min-height:14px;}
  .print-table{margin-top:14px; border-top:1px solid #000; font-size:12px;}
  .pt-head,.pt-row,.pt-total{
    display:grid; grid-template-columns:1fr 110px; gap:12px;
    padding:6px 0; border-bottom:1px solid #000; align-items:center;
  }
  .pt-head{font-weight:700;}
  .pt-note{text-align:right; font-weight:700;}
  .pt-row .pt-note{font-weight:600;}
  .pt-total{font-weight:800;}
  .print-comments{margin-top:12px; font-size:12px;}
  .pc-label{font-weight:700; margin-bottom:6px;}
  .pc-box{border:1px solid #000; min-height:80px; padding:8px; white-space:pre-wrap;}
  .print-footer{margin-top:10px; font-size:11px;}
}
