/* LPS automatic checks (ČSN EN 62305-3) */
.lps-params-bar {
  background: #222;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.9em;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}
html[data-vr-theme="light"] .lps-params-bar {
  background: #eef3f9;
  border: 1px solid #d3deeb;
}
.lps-params-bar input,
.lps-params-bar select {
  height: 30px;
  box-sizing: border-box;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #151515;
  color: inherit;
  max-width: 100%;
}
html[data-vr-theme="light"] .lps-params-bar input,
html[data-vr-theme="light"] .lps-params-bar select {
  background: #fff;
  border-color: #c8d4e5;
}
.lps-params-bar label.lps-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.lps-params-bar .lps-hint {
  color: #94a3b8;
  font-size: 0.78rem;
}
html[data-vr-theme="light"] .lps-params-bar .lps-hint { color: #64748b; }

.lps-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0 2px;
  border-radius: 50%;
  border: 1px solid #64748b;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}
html[data-vr-theme="light"] .lps-help-btn {
  background: #f1f5f9;
  color: #334155;
  border-color: #94a3b8;
}
.lps-help-pop {
  position: absolute;
  z-index: 10050;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #475569;
  font-size: 0.82rem;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
html[data-vr-theme="light"] .lps-help-pop {
  background: #fff;
  color: #1e293b;
  border-color: #cbd5e1;
}

.lps-kc-panel {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #151a22;
}
html[data-vr-theme="light"] .lps-kc-panel {
  background: #fff;
  border-color: #d3deeb;
}
.lps-kc-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.lps-kc-explain {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.35;
}
.lps-kc-explain p { margin: 0 0 4px; }
html[data-vr-theme="light"] .lps-kc-explain { color: #475569; }

.lps-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  border: 1px solid transparent;
  white-space: normal;
}
.lps-badge.ok { color: #bbf7d0; background: #14532d; border-color: #22c55e88; }
.lps-badge.warn { color: #fde68a; background: #78350f; border-color: #f59e0b88; }
.lps-badge.bad { color: #fecaca; background: #7f1d1d; border-color: #ef444488; }
.lps-badge.na { color: #cbd5e1; background: #1e293b; border-color: #64748b88; }
html[data-vr-theme="light"] .lps-badge.ok { color: #166534; background: #dcfce7; border-color: #86efac; }
html[data-vr-theme="light"] .lps-badge.warn { color: #92400e; background: #fef3c7; border-color: #fcd34d; }
html[data-vr-theme="light"] .lps-badge.bad { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }
html[data-vr-theme="light"] .lps-badge.na { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }

.lps-assess-btn { white-space: nowrap; }
.lps-assess-count {
  display: inline-block;
  min-width: 1.2em;
  padding: 0 5px;
  border-radius: 999px;
  background: #334155;
  font-size: 0.75rem;
  font-weight: 700;
}
html[data-vr-theme="light"] .lps-assess-count { background: #e2e8f0; }
.lps-row-actions {
  white-space: normal;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.lps-row-sep-badge {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
  max-width: 100%;
}
.lps-hint-row td {
  padding: 0 8px 8px !important;
  border: none !important;
  background: transparent !important;
}
.lps-row-hint {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.35;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px dashed rgba(96, 165, 250, 0.45);
}
html[data-vr-theme="light"] .lps-row-hint {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #93c5fd;
}
#tblLPS select.lps-status-sel.lps-status-locked,
#tblLPS select.lps-status-sel:disabled {
  opacity: 0.85;
  cursor: not-allowed;
  font-weight: 700;
  color: #fecaca;
  border-color: #ef444488;
}
html[data-vr-theme="light"] #tblLPS select.lps-status-sel.lps-status-locked,
html[data-vr-theme="light"] #tblLPS select.lps-status-sel:disabled {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}
.lps-row-sep-badge .lps-badge {
  font-size: 0.72rem;
  padding: 2px 6px;
  white-space: nowrap;
}
#tblLPS td:nth-child(4) input { max-width: 100%; }
#tblLPS col.lps-col-desc,
#tblLPS th:nth-child(4),
#tblLPS td:nth-child(4) { width: 120px; max-width: 140px; }
/* Stav: Vyhovuje / Nevyhovuje nesmí být uříznuté */
#tblLPS th:nth-child(8),
#tblLPS td:nth-child(8) { width: 120px; min-width: 110px; }
#tblLPS select.lps-status-sel {
  width: 100%;
  min-width: 7.5rem;
  max-width: 100%;
  box-sizing: border-box;
}
/* Pozn. zbytečně netahat na celou šířku */
#tblLPS th:nth-child(9),
#tblLPS td:nth-child(9) { width: 90px; max-width: 110px; }
#tblLPS input.lps-notes-inp {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
#tblLPS th:nth-child(10),
#tblLPS td:nth-child(10),
#tblLPS td.lps-row-actions { width: 250px; min-width: 220px; }

.lps-print-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}

.lps-summary {
  margin-top: 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 12px;
  background: #151a22;
}
html[data-vr-theme="light"] .lps-summary {
  background: #fff;
  border-color: #d3deeb;
}
.lps-summary h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.lps-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.lps-summary-box {
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 8px;
  background: #0f141c;
}
html[data-vr-theme="light"] .lps-summary-box {
  background: #f8fafc;
  border-color: #d3deeb;
}
.lps-summary-box .lbl { display: block; font-size: 0.72rem; color: #94a3b8; }
.lps-summary-box .val { display: block; font-size: 0.95rem; font-weight: 700; margin-top: 2px; }
html[data-vr-theme="light"] .lps-summary-box .lbl { color: #64748b; }

.lps-alerts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.lps-alert-group {
  border-radius: 8px;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.35;
  border: 1px solid transparent;
}
.lps-alert-group.warn { background: #3a2a10; border-color: #f59e0b88; color: #fde68a; }
.lps-alert-group.bad { background: #3a1212; border-color: #ef444488; color: #fecaca; }
.lps-alert-group.na { background: #1e293b; border-color: #64748b88; color: #cbd5e1; }
html[data-vr-theme="light"] .lps-alert-group.warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
html[data-vr-theme="light"] .lps-alert-group.bad { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
html[data-vr-theme="light"] .lps-alert-group.na { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
.lps-alert-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 600;
}
.lps-alert-group > summary::-webkit-details-marker { display: none; }
.lps-alert-group > summary::before {
  content: '▸ ';
  opacity: 0.7;
}
.lps-alert-group[open] > summary::before { content: '▾ '; }
.lps-alert-detail {
  padding: 0 10px 8px;
  font-weight: 400;
  opacity: 0.95;
}
.lps-alert-detail ul { margin: 6px 0 0 1.1em; padding: 0; }
.lps-alert-actions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.lps-alert-actions .btn,
.lps-alert .btn { min-height: 30px; height: 30px; padding: 0 10px; font-size: 0.8rem; }
.lps-alert {
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
  line-height: 1.35;
  border: 1px solid transparent;
}
.lps-alert.na { background: #1e293b; border-color: #64748b88; color: #cbd5e1; }
html[data-vr-theme="light"] .lps-alert.na { background: #f8fafc; border-color: #cbd5e1; color: #475569; }

/* Assess dialog */
.lps-assess-dlg {
  border: 1px solid #475569;
  border-radius: 12px;
  padding: 0;
  max-width: min(900px, 96vw);
  width: 900px;
  background: #0f141c;
  color: inherit;
}
html[data-vr-theme="light"] .lps-assess-dlg {
  background: #fff;
  border-color: #cbd5e1;
}
.lps-assess-dlg::backdrop { background: rgba(0,0,0,.55); }
.lps-assess-form { margin: 0; display: flex; flex-direction: column; max-height: min(90vh, 720px); }
.lps-assess-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #334155;
  flex: 0 0 auto;
}
.lps-assess-head h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.lps-assess-intro {
  margin: 0;
  padding: 10px 14px 0;
  font-size: 0.82rem;
  color: #94a3b8;
  flex: 0 0 auto;
}
html[data-vr-theme="light"] .lps-assess-intro { color: #64748b; }
.lps-assess-body {
  padding: 12px 14px;
  overflow: auto;
  flex: 1 1 auto;
}
.lps-assess-empty { color: #94a3b8; font-size: 0.9rem; margin: 8px 0; }
.lps-assess-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 14px;
  border-top: 1px solid #334155;
  flex: 0 0 auto;
}

/* One assessment place = compact card */
.lps-place-row {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #151a22;
}
html[data-vr-theme="light"] .lps-place-row {
  background: #f8fafc;
  border-color: #d3deeb;
}

.lps-place-fields {
  display: grid;
  grid-template-columns: minmax(140px, 1.6fr) minmax(130px, 1.1fr) minmax(110px, 1fr) minmax(140px, 1.2fr);
  gap: 10px 12px;
  align-items: end;
}
.lps-pf {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.lps-pf-lab {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
html[data-vr-theme="light"] .lps-pf-lab { color: #64748b; }
.lps-pf input,
.lps-pf select {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #111;
  color: inherit;
  box-sizing: border-box;
}
.lps-pf input[readonly] {
  opacity: 0.85;
  background: #1a222d;
}
html[data-vr-theme="light"] .lps-pf input,
html[data-vr-theme="light"] .lps-pf select {
  background: #fff;
  border-color: #c8d4e5;
}
html[data-vr-theme="light"] .lps-pf input[readonly] {
  background: #eef2f7;
}

.lps-place-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #334155;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 12px;
  align-items: center;
}
html[data-vr-theme="light"] .lps-place-foot { border-top-color: #d3deeb; }

.lps-place-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  font-size: 0.8rem;
}
.lps-place-verdict .lps-sep-meta {
  color: #94a3b8;
  line-height: 1.3;
}
html[data-vr-theme="light"] .lps-place-verdict .lps-sep-meta { color: #64748b; }

.lps-place-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.lps-place-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.lps-place-btns .lps-defect-place { background: #822; }

@media (max-width: 720px) {
  .lps-place-fields {
    grid-template-columns: 1fr 1fr;
  }
  .lps-pf-place,
  .lps-pf-bond { grid-column: 1 / -1; }
  .lps-place-foot {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .lps-place-btns { justify-content: flex-start; }
}

#tblLPS .lps-defect-btn,
#tblLPS .lps-defect-place { margin-left: 4px; background: #822; }

th .lps-help-btn { margin-left: 4px; }

/* Rolling sphere calculator */
.lps-sphere-dlg { width: min(640px, 96vw); max-width: 640px; }
.lps-sphere-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 12px;
}
.lps-sphere-result { margin-bottom: 12px; }
.lps-sphere-card {
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 12px;
  background: #0f141c;
}
html[data-vr-theme="light"] .lps-sphere-card {
  background: #f8fafc;
  border-color: #d3deeb;
}
.lps-sphere-card.bad { border-color: #ef444488; }
.lps-sphere-card.bad p { margin: 6px 0 0; font-size: 0.85rem; }
.lps-sphere-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.lps-sphere-grid .lbl {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 700;
}
.lps-sphere-grid .val {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 2px;
}
.lps-sphere-grid .val.accent { color: #38bdf8; }
html[data-vr-theme="light"] .lps-sphere-grid .val.accent { color: #0369a1; }
.lps-sphere-lead {
  margin: 10px 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
}
.lps-sphere-compare {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
}
.lps-sphere-compare.ok { background: #14532d44; border: 1px solid #22c55e66; }
.lps-sphere-compare.warn { background: #78350f44; border: 1px solid #f59e0b66; }
html[data-vr-theme="light"] .lps-sphere-compare.ok { background: #dcfce7; border-color: #86efac; }
html[data-vr-theme="light"] .lps-sphere-compare.warn { background: #fef3c7; border-color: #fcd34d; }
.lps-sphere-compare p { margin: 0 0 6px; }
.lps-sphere-compare p:last-child { margin-bottom: 0; }
.lps-sphere-note {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.35;
}
html[data-vr-theme="light"] .lps-sphere-note { color: #64748b; }
.lps-sphere-report {
  border-top: 1px dashed #334155;
  padding-top: 10px;
}
html[data-vr-theme="light"] .lps-sphere-report { border-top-color: #d3deeb; }
@media (max-width: 560px) {
  .lps-sphere-fields,
  .lps-sphere-grid { grid-template-columns: 1fr; }
}
