/* Общие стили калькуляторов (SCORAD, DLQI …): строка итога, части, итог, пациент, кнопки, лист печати.
   Цвет индекса задаёт страница: .calc { --idx: … } в своём css. */
.calc main { padding: 0 var(--gut); }

/* ---------- Строка итога ---------- */
.scorebar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.55rem var(--gut); background: var(--ink); color: var(--paper-2);
}
.sb-main { display: flex; align-items: baseline; gap: 0.75rem; }
.sb-label { font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: 0.02em; color: #b8cbc6; }
.sb-num { font-family: var(--display); font-weight: 900; font-size: 2.6rem; line-height: 1; min-width: 3.2ch; }
.sb-empty { color: #b8cbc6; font-size: var(--fs-0); }
.sb-parts { display: flex; gap: 1.25rem; margin: 0; }
.sb-parts div { display: flex; align-items: baseline; gap: 0.35rem; }
.sb-parts dt { color: #b8cbc6; font-size: var(--fs-0); font-weight: 600; }
.sb-parts dd { margin: 0; font-weight: 600; }
.sb-fill { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--idx); transition: transform 0.5s var(--ease-out); }
.sev { font-size: var(--fs-0); font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 2rem; align-self: center; }
.scorebar .sev-mild { background: #d8e9d3; color: #24461f; }
.scorebar .sev-moderate { background: #f6e2c2; color: #5b3505; }
.scorebar .sev-severe { background: var(--idx); color: #fff; }

/* ---------- Название ---------- */
.calc .page-title h1 { color: var(--idx); }
.calc main { padding-top: 0.5rem; }

/* ---------- Части ---------- */
.part { padding: 2.25rem 0 2.5rem; border-top: 2px solid var(--ink); }
.part-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.25rem; align-items: start; margin-bottom: 1.5rem; }
.letter { font-family: var(--display); font-weight: 900; font-size: 5.5rem; line-height: 0.75; color: var(--idx); width: 1ch; }
.letter.eq { color: var(--ink); }
.part-head h2 { font-family: var(--display); font-weight: 800; font-size: 2.3rem; line-height: 1; }
.part-head .help { color: var(--ink-2); margin-top: 0.4rem; max-width: 60ch; }
.part-val { font-family: var(--display); font-weight: 800; font-size: 2.6rem; line-height: 1; white-space: nowrap; }
.part-val small { font-size: 1.2rem; color: var(--ink-3); font-weight: 600; }
h3 { font-size: var(--fs-1); font-weight: 600; margin: 0 0 0.5rem; }

/* Поля ввода */
select, input:not([type]), input[type='number'], input[type='date'] {
  font: inherit; color: var(--ink); background: var(--sheet); width: 100%;
  border: 1px solid var(--rule-strong); border-radius: 0.5rem; padding: 0.5rem 0.65rem; min-height: 2.6rem;
}
input:hover, select:hover { border-color: var(--ink-3); }

/* Итог */
.warn { margin-top: 0.75rem; color: var(--moderate); font-size: var(--fs-0); font-weight: 600; }
.scales { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; margin-top: 2rem; }
.s-cap { margin-bottom: 0.6rem; }
.scale { position: relative; height: 0.9rem; border-radius: 1rem; overflow: visible; margin-bottom: 2rem; }
.band { position: absolute; top: 0; height: 100%; }
.b-mild { background: #b9d4b3; border-radius: 1rem 0 0 1rem; }
.b-moderate { background: #ecc98c; }
.b-severe { background: #e19aa6; border-radius: 0 1rem 1rem 0; }
.marker { position: absolute; top: -0.45rem; left: var(--m); width: 0.3rem; height: 1.8rem; translate: -50% 0; background: var(--ink); border-radius: 0.2rem; transition: left 0.6s var(--ease-out); }
.ticks i { position: absolute; top: 1.3rem; translate: -50% 0; font-style: normal; font-size: var(--fs-0); color: var(--ink-3); }
.report-head { display: flex; gap: 2rem; align-items: start; flex-wrap: wrap; margin-bottom: 1.5rem; }
.big-score { display: flex; flex-direction: column; line-height: 1; min-width: 9rem; }
.big-score span { font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: var(--ink-3); }
.big-score b { font-family: var(--display); font-weight: 900; font-size: 5.2rem; color: var(--idx); }
.big-score em { font-style: normal; font-weight: 600; font-size: var(--fs-0); margin-top: 0.4rem; }
.big-score em.sev-mild { color: var(--mild); } .big-score em.sev-moderate { color: var(--moderate); } .big-score em.sev-severe { color: var(--severe); }
.patient { flex: 1 1 32rem; max-width: 48rem; min-width: 0; margin: 0; border: 1px solid var(--rule-strong); border-radius: 1rem; padding: 0.8rem 1.1rem 1.1rem; background: var(--sheet); }
.patient legend { font-weight: 600; padding: 0 0.35rem; }
.patient legend small { color: var(--ink-3); font-weight: 400; margin-left: 0.3rem; }
.pfields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.7rem; }
.pfields label { grid-column: span 2; }
.pfields label.wide { grid-column: span 4; }
.pfields label.full { grid-column: 1 / -1; }
.pfields label span { display: block; font-size: var(--fs-0); color: var(--ink-2); font-weight: 600; margin-bottom: 0.25rem; }
.pfields textarea { font: inherit; color: var(--ink); background: var(--sheet); width: 100%; min-height: 3.6rem; resize: vertical; border: 1px solid var(--rule-strong); border-radius: 0.5rem; padding: 0.5rem 0.65rem; }
.age-note { margin-top: 0.6rem; font-size: var(--fs-0); color: var(--ink-2); }
.age-note:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.btn {
  font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule-strong); border-radius: 0.5rem; padding: 0.6rem 1.1rem; min-height: 2.75rem;
}
.btn:hover { border-color: var(--ink); }
.btn.erase { color: var(--severe); }
.btn.primary { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.btn.primary:hover { background: #1b4541; }

.toast { position: fixed; left: 50%; bottom: 1.5rem; translate: -50% 1rem; opacity: 0; background: var(--ink); color: var(--paper-2); padding: 0.6rem 1.1rem; border-radius: 2rem; pointer-events: none; transition: opacity 0.25s, translate 0.35s var(--ease-out); z-index: 30; }
.toast.on { opacity: 1; translate: -50% 0; }

@media (max-width: 900px) {
  .pfields { grid-template-columns: 1fr 1fr; }
  .pfields label, .pfields label.wide { grid-column: span 1; }
  .pfields label.wide, .pfields label.full { grid-column: 1 / -1; }
  .big-score b { font-size: 4rem; }
  .part-head { grid-template-columns: auto minmax(0, 1fr); }
  .part-val { grid-column: 2; }
  .letter { font-size: 4rem; }
  .sb-parts { gap: 0.8rem; font-size: var(--fs-0); }
  .sb-num { font-size: 2rem; }
}
@media (max-width: 900px) { .scales { grid-template-columns: 1fr; } }

/* ---------- Лист для печати (на экране скрыт) ---------- */
.print-sheet { display: none; }
@page { size: A4 portrait; margin: 10mm 12mm; }
@media print {
  html { font-size: 9pt; }
  body { background: #fff; }
  body.calc > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-head { display: flex; align-items: center; gap: 3mm; border-bottom: 0.6mm solid var(--ink); padding-bottom: 2mm; }
  .ps-head img { width: 10mm; height: 10mm; }
  .ps-head h1 { font-family: var(--display); font-weight: 900; font-size: 22pt; line-height: 0.9; color: var(--idx); }
  .ps-head p { color: var(--ink-2); }
  .ps-total { margin-left: auto; text-align: right; line-height: 1; }
  .ps-total b { display: block; font-family: var(--display); font-weight: 900; font-size: 30pt; color: var(--idx); }
  .ps-total span { font-weight: 600; }
  .ps-line { margin-top: 1.6mm; }
  .ps-sums { display: flex; gap: 6mm; flex-wrap: wrap; margin: 3mm 0; padding: 2mm 3mm; background: var(--paper-2); border-radius: 2mm; }
  .ps-sums div { display: flex; flex-direction: column; }
  .ps-sums span { font-size: 7.5pt; color: var(--ink-3); font-weight: 600; }
  .ps-sums b { font-size: 12pt; }
  .ps-sums small { font-size: 7.5pt; }
  .ps-sums .ps-f { margin-left: auto; text-align: right; }
  .print-sheet h2 { font-size: 10pt; font-weight: 700; margin: 2.5mm 0 1mm; }
  .print-sheet h2:first-child { margin-top: 0; }
  .print-sheet h2 small { font-weight: 400; }
  .print-sheet table { width: 100%; border-collapse: collapse; }
  .print-sheet th, .print-sheet td { padding: 0.5mm 1.5mm; border-bottom: 0.2mm solid #c3d0cb; text-align: right; font-weight: 400; }
  .print-sheet th { text-align: left; }
  .print-sheet thead td, .print-sheet thead th { color: var(--ink-3); font-size: 7.5pt; }
  .print-sheet tfoot th, .print-sheet tfoot td { font-weight: 700; border-bottom: 0; }
  .ps-scales { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; margin-top: 4mm; }
  .ps-scales p { margin-bottom: 1.5mm; }
  .ps-scales .scale { margin: 0 3mm 5mm 0; }
  .ps-foot { margin-top: 2mm; font-size: 7.5pt; color: var(--ink-3); }
}
