/* ─── Рецептура (R&D) ─────────────────────────────────────────── */
.muted { color: var(--text-3); }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.main .card + .card, .lab-two { margin-top: 16px; }

.lab-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lab-filters .chip { cursor: pointer; font-size: 12px; padding: 4px 10px; }
.lab-row { cursor: pointer; }
.lab-row:hover td { background: var(--surface-2); }

.lab-requests { margin-bottom: 12px; border-color: var(--orange); }
.lab-req-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); margin-top: 8px; }

.lab-back { font-size: 12px; color: var(--accent); cursor: pointer; margin-bottom: 6px; }
.lab-family { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 12px; color: var(--text-2); }
.lab-family .chip { cursor: pointer; }
.lab-notes { margin-bottom: 12px; white-space: pre-wrap; font-size: 13px; color: var(--text-2); }

.lab-locked { text-align: center; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lab-locked-title { font-size: 15px; font-weight: 700; }

/* Защищённый блок формулы: без выделения, с водяным знаком поверх. */
.lab-protected { position: relative; }
.lab-protected.is-shown { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.lab-formula-head { gap: 12px; }
.lab-secret { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lab-watermark { position: absolute; inset: 0; pointer-events: none; background-repeat: repeat; z-index: 2; }
.lab-reveal-note { padding: 10px 16px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); background: var(--surface-2); }
@media print {
  .lab-protected, .lab-protected * { visibility: hidden !important; }
  .lab-protected::after { content: 'Печать формул запрещена'; visibility: visible; }
}

/* Редактор */
.lab-edit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.lab-edit-tbl td { padding: 4px 6px; vertical-align: top; }
.lab-edit-tbl .input { padding: 6px 8px; }
.lab-linked { font-size: 10px; color: var(--green); margin-top: 2px; }
.lab-edit-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.lab-edit-foot .chip { margin-left: auto; font-size: 12px; }

/* Статистика */
.lab-acked { opacity: .55; }
.lab-two { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.lab-two .card + .card { margin-top: 0; }
.lab-heat { display: grid; grid-template-columns: 24px repeat(24, 1fr); gap: 2px; align-items: center; }
.lab-hcell { aspect-ratio: 1; border-radius: 3px; min-width: 8px; }
.lab-hlabel, .lab-haxis { font-size: 10px; color: var(--text-3); }
.lab-haxis { text-align: center; }
.lab-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 140px; border-bottom: 1px solid var(--border); }
.lab-bar { flex: 1; max-width: 28px; height: 100%; display: flex; align-items: flex-end; }
.lab-bar-fill { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.lab-bar:hover .lab-bar-fill { background: var(--accent-2); }
.lab-bars-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-3); margin-top: 4px; }

@media (max-width: 768px) {
  .lab-edit-grid { grid-template-columns: 1fr 1fr; }
  .lab-two { grid-template-columns: 1fr; }
  .lab-req-row { flex-direction: column; align-items: flex-start; }
}
.lab-tbl .chip, .lab-protected .chip { white-space: nowrap; }
.lab-page .tbl td.num { white-space: nowrap; }
.lab-wm-wrap { position: relative; }
.lab-wm-wrap > .lab-watermark { z-index: 50; }
