/* зона: events — карточка тревоги (почему, не подтверждено, устройства, меры), журнал, пары в демо. См. docs/brief_safety.md */

/* ---------------------------------------------------------------- заголовки блоков карточки */
.sec-h { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--text-3); display: flex; align-items: baseline; gap: 8px; }
.sec-h span { font-weight: 400; }
.textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--p1); }
/* тело карточки — колонка блоков: сетка с неявными строками считала высоту блоков по узкой ширине и они наезжали друг на друга */
.detail-body { display: flex; flex-direction: column; }
.detail-body > * { flex: 0 0 auto; }

/* ---------------------------------------------------------------- шкала фрагмента: момент, шаги, «не подтверждено» */
.player-bar .ev-moment { margin-left: auto; gap: 4px; }
.player-bar .ev-moment .icon { width: 12px; height: 12px; }
.ev-track { display: grid; gap: 3px; }
.ev-rail { position: relative; height: 16px; background: var(--inset); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; overflow: hidden; }
.ev-rail:hover { border-color: var(--line-2); }
.ev-rail i { position: absolute; top: 0; bottom: 0; display: block; }
.ev-rail .obs { background: rgba(170, 177, 184, .16); border-left: 1px dashed var(--text-3); border-right: 1px dashed var(--text-3); }
.ev-rail .step { width: 2px; margin-left: -1px; top: 4px; bottom: 4px; background: var(--text-2); border-radius: 1px; }
.ev-rail .moment { width: 4px; margin-left: -2px; background: var(--p3); }
.ev-rail .moment.p1 { background: var(--p1); } .ev-rail .moment.p2 { background: var(--p2); } .ev-rail .moment.p4 { background: var(--p4); }
.ev-rail .head { width: 1px; background: #fff; opacity: .85; pointer-events: none; transition: left .25s linear; }
.ev-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); }

/* ---------------------------------------------------------------- почему тревога */
.why { display: grid; gap: 7px; padding: 10px 12px 12px; background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); }
.why p { margin: 0; }
.why-rule { font-size: 15px; font-weight: 600; line-height: 1.35; color: #eef0f2; text-wrap: balance; }
.why-basis { font-size: 12.5px; color: var(--text-2); }
.why-line { font-size: 13px; }
.why-line > span { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 1px; }
.why-line.todo { padding-top: 7px; border-top: 1px solid var(--line); }
.why-vis { font-size: 12.5px; padding: 6px 9px; border-radius: 3px; background: var(--p2-bg); color: #e8cf9c; }
.why-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin: 2px 0 0; }
.why-facts div { padding: 6px 8px; background: var(--panel); border-radius: 3px; min-width: 0; }
.why-facts dt { font-size: 12px; color: var(--text-3); }
.why-facts dd { margin: 1px 0 0; font-size: 15px; font-weight: 600; }
.why-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.why-more summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); width: max-content; }
.why-more[open] summary { margin-bottom: 6px; }
.why-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.why-steps button {
  display: grid; grid-template-columns: 42px 1fr; gap: 8px; width: 100%; padding: 5px 6px; text-align: left; font-size: 13px;
  background: none; border: 0; border-radius: 3px; cursor: pointer; color: var(--text);
}
.why-steps button:hover { background: var(--panel-2); }
.why-steps .t { color: var(--select); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- не подтверждено: спокойно, без цвета тревоги */
.unconf { display: grid; gap: 6px; padding: 9px 12px 10px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.unconf ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.unconf li { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: baseline; font-size: 13px; color: var(--text-2); }
.unconf li button, .ds-unconf button {
  background: none; border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; color: var(--text-2);
  font-size: 12px; cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.unconf li button:hover { border-color: var(--select); color: var(--text); }
.unconf .faint { font-size: 12.5px; }

/* ---------------------------------------------------------------- оповещение и останов, меры */
.ev-dev, .ev-meas { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.ev-dev p, .ev-meas p { margin: 0; font-size: 13px; }
.meas-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.meas-list li { display: grid; gap: 1px; }
.meas-list .faint { font-size: 12.5px; }
.ev-meas > .btn { justify-self: start; }
.false-box .input { height: 30px; }


/* ---------------------------------------------------------------- демо: пары «нарушение / норма» */
.dm-presale { padding: 16px; display: grid; gap: 14px; margin-top: 16px; }
.dm-presale-head { display: flex; gap: 16px; align-items: start; justify-content: space-between; flex-wrap: wrap; }
.dm-presale-head h2 { margin: 0; font-size: 16px; }
.dm-presale-head p { margin: 4px 0 0; color: var(--text-2); max-width: 70ch; }
.dm-pairs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 540px), 1fr)); }
.dm-side .dm-badge { top: auto; bottom: 8px; left: 8px; }
.dm-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dm-pair-title { grid-column: 1 / -1; padding: 9px 12px; font-weight: 600; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.dm-side { display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.dm-side + .dm-side { border-left: 1px solid var(--line); }
.dm-side .dm-media { aspect-ratio: 16 / 9; }
.dm-side-text { padding: 10px 12px 12px; display: grid; gap: 5px; align-content: start; font-size: 13px; }
.dm-side-text p { margin: 0; color: var(--text-2); }
.dm-verdict { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dm-verdict.quiet::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ok); flex: none; }
.dm-quiet { color: var(--text); }
.dm-bodycam { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.dm-bodycam p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
@media (max-width: 760px) {
  .dm-pair { grid-template-columns: 1fr; }
  .dm-side + .dm-side { border-left: 0; border-top: 1px solid var(--line); }
}

/* показ на весь экран: пара рядом */
.ds-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 0; }
.ds-pair-side { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
.ds-pair-side + .ds-pair-side { border-left: 1px solid var(--line); }
.ds-pair-side video { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #000; display: block; }
.ds-pair-cap { padding: 14px 18px 18px; background: var(--panel); border-top: 1px solid var(--line); display: grid; gap: 8px; align-content: start; min-height: 168px; }
.ds-pair-cap h2 { margin: 0; font-size: 19px; display: flex; gap: 10px; align-items: center; }
.ds-pair-cap h2.quiet::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ok); flex: none; }
.ds-pair-cap p { margin: 0; color: var(--text-2); font-size: 15px; }
.ds-pair-cap .ds-ev { margin: 0; }
.ds-why { display: grid; gap: 2px; font-size: 14px; }
.ds-why b { font-size: 15px; }
.ds-why span { color: var(--text-2); }
.ds-unconf { display: flex; gap: 8px; align-items: baseline; font-size: 14px; color: var(--text-2); padding: 6px 10px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.ds-unconf button { cursor: default; }
@media (max-width: 900px) {
  .ds-pair { grid-template-columns: 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .ds-pair-side + .ds-pair-side { border-left: 0; border-top: 1px solid var(--line); }
  .ds-pair-cap { min-height: 0; }
}
.dm-cam { justify-self: start; text-decoration: none; margin-top: 2px; }
.ds-unconf b { font-weight: 600; color: var(--text); white-space: nowrap; }
.dm-side .dm-badge { display: flex; gap: 6px; }
.dm-side .dm-badge .tag { background: rgba(17, 19, 22, .82); }
.ds-pair-cap .tag { margin-left: 6px; vertical-align: 1px; }
