/* Выбранный заезд: компактная полоса идентичности, под ней проигрыватель
   (транспортные кнопки + ползунок сессии одной строкой), затем кнопки камер. */
.session-focus {
  flex: none;
  padding: 10px 16px 9px;
  border-top: 1px solid var(--line);
  background: linear-gradient(125deg, #1b2431, var(--panel) 65%);
}
.session-focus-head {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0 16px;
}
.session-focus-thumb {
  display: grid;
  place-items: center;
  width: 124px;
  height: 70px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
}
.session-focus-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.session-focus p { margin: 0; }
.session-focus-copy { min-width: 0; display: grid; gap: 3px; }
.session-title { display: flex; align-items: baseline; flex-wrap: nowrap; gap: 2px 10px; min-width: 0; overflow: hidden; line-height: 1.15; }
.session-plate {
  font-size: clamp(19px, 1.55vw, 23px);
  font-weight: 750;
  letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.session-vehicle { flex: 1 1 auto; min-width: 0; color: #e0e7f2; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-context { color: #adb8ca; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-context b { color: var(--text); font-size: 13px; }
/* Робот работал дольше норматива оплаченной программы — цифра янтарём, как потери. */
.session-context b.over { color: var(--amber); }
.session-focus .session-verification { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.session-focus-total { display: grid; gap: 3px; justify-items: end; text-align: right; }
.session-total-line { display: flex; align-items: baseline; gap: 8px; line-height: 1.15; }
.session-total { font-size: 22px; }
.session-unpaid { color: var(--muted); font-size: 14px; font-weight: 600; }
.session-program { color: #c4cedc; font-size: 12px; white-space: nowrap; }
.session-services { color: #d5dce7; font-size: 12px; white-space: nowrap; }
.session-focus .session-payment-details { color: var(--muted); font-size: 11px; white-space: nowrap; }

.session-focus-verdict { display: grid; justify-items: center; gap: 4px; }
.session-focus-verdict .cause-chip { margin: 0; padding: 4px 10px 4px 5px; font-size: 12px; white-space: nowrap; }
.session-lost { color: var(--amber); font-size: 12px; }

/* Комментарий к заезду: кнопка в рамке под вердиктом. С текстом — заливка ярче и начало текста. */
.note-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 210px;
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid rgba(185, 149, 255, .6);
  border-radius: 7px;
  background: rgba(185, 149, 255, .1);
  color: #dccbff;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.note-button:hover { border-color: var(--note); background: rgba(185, 149, 255, .18); color: #f1e9ff; }
.note-button:focus-visible { outline: 2px solid var(--note); outline-offset: 2px; }
.note-button.filled { border-color: var(--note); background: rgba(185, 149, 255, .2); color: #f1e9ff; font-weight: 500; }
.note-icon { flex: none; color: var(--note); font-size: 13px; }
.note-button.filled .note-icon { color: #e6d9ff; }
.note-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Полный текст — первым блоком карточки результата. */
.note-block {
  margin: 0 0 10px;
  padding: 9px 12px 10px;
  border: 1px solid rgba(185, 149, 255, .4);
  border-left: 3px solid var(--note);
  border-radius: 8px;
  background: rgba(185, 149, 255, .07);
}
.note-block-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.note-block-head b { color: #e3d6ff; font-size: 12px; letter-spacing: .02em; }
.note-stamp { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.note-edit {
  flex: none;
  margin-left: auto;
  min-height: 24px;
  padding: 2px 10px;
  border: 1px solid rgba(185, 149, 255, .5);
  border-radius: 6px;
  background: transparent;
  color: #dccbff;
  font-size: 11px;
}
.note-edit:hover { border-color: var(--note); background: rgba(185, 149, 255, .14); }
.note-block .note-text { margin: 6px 0 0; color: var(--text); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-block .note-carried { margin: 6px 0 0; color: var(--amber); font-size: 11px; }

/* Окно ввода: общий dialog даёт 27px полей и узкую ширину — здесь своя раскладка. */
.note-modal {
  width: min(560px, 94vw);
  max-width: none;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
}
.note-modal::backdrop { background: rgba(5, 7, 10, .8); }
.note-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.note-head b { flex: none; font-size: 13px; }
.note-when { min-width: 0; margin-left: auto; overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.note-head .cam-modal-close { flex: none; }
.note-body { display: grid; gap: 8px; padding: 14px; }
.note-input {
  display: block;
  width: 100%;
  min-height: 150px;
  max-height: 60vh;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
}
.note-input:focus { outline: none; border-color: var(--note); box-shadow: 0 0 0 3px rgba(185, 149, 255, .16); }
.note-input[readonly] { color: #d5dce7; }
.note-meta { display: flex; justify-content: space-between; gap: 12px; }
.note-meta .note-stamp { white-space: normal; }
.note-count { flex: none; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.note-error { color: var(--red); font-size: 12px; }
.note-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.note-actions .note-delete { margin-right: auto; border-color: rgba(255, 97, 115, .45); background: transparent; color: #ff9aa6; }
.note-actions .note-delete:hover { border-color: var(--red); }
.note-actions .note-delete.confirm { border-color: var(--red); background: rgba(255, 97, 115, .16); color: #ffd3d8; }
.note-actions .note-save { border-color: #8d67d8; background: #3b2a60; }
.note-actions .note-save:hover:not(:disabled) { background: #4a3578; }

/* Проигрыватель: кнопки и ползунок в одной строке, без отдельной рамки. */
.session-player {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 5px;
  border-bottom: 1px solid var(--line);
  background: #12161d;
}
.session-scrub-slot { flex: 1; min-width: 160px; }
.sess-empty { display: block; padding: 0 10px; color: var(--faint); font-size: 11px; }
.session-player .sess-scrub-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "scrub now" "axis now";
  column-gap: 12px;
  align-items: center;
  margin: 0;
  padding: 0 6px;
}
.session-player .sess-scrub { grid-area: scrub; height: 22px; }
.session-player .sess-band {
  top: 7px;
  height: 8px;
  border-radius: 4px;
  background: #274569;
  box-shadow: 0 0 0 1px rgba(146, 191, 255, .15);
}
.session-player .sess-band i.ph-queue { background: #e8a33d; }
.session-player .sess-band i.ph-entry, .session-player .sess-band i.ph-exit { background: #27b2d0; }
.session-player .sess-band i.ph-wash { background: #4f99ff; }
/* Работа робота по кадрам (visit_timeline) — цветом мойки; стоянка на решётке после неё — янтарём простоя. */
.session-player .sess-band i.ph-robot { background: #4f99ff; }
.session-player .sess-band i.ph-grate_wait { background: #d9822b; }
.session-player .sess-band i.ph-dry { background: #a67bea; }
.session-player .sess-slider { height: 22px; touch-action: pan-y; }
.session-player .sess-slider:focus-visible { outline: 2px solid #80b8ff; outline-offset: 3px; border-radius: 6px; }
.session-player .sess-slider::-webkit-slider-runnable-track { height: 8px; }
.session-player .sess-slider::-webkit-slider-thumb {
  width: 14px;
  height: 22px;
  margin-top: -7px;
  border: 2px solid #eff7ff;
  border-radius: 6px;
  background: #438cf6;
  box-shadow: 0 0 0 1px #183859, 0 2px 8px rgba(67, 140, 246, .55);
}
.session-player .sess-slider::-moz-range-track { height: 8px; }
.session-player .sess-slider::-moz-range-thumb {
  box-sizing: border-box;
  width: 14px;
  height: 22px;
  border: 2px solid #eff7ff;
  border-radius: 6px;
  background: #438cf6;
  box-shadow: 0 0 0 1px #183859, 0 2px 8px rgba(67, 140, 246, .55);
}
.session-player .sess-slider.outside::-webkit-slider-thumb { opacity: .8; }
.session-player .sess-slider.outside::-moz-range-thumb { opacity: .8; }
.session-player .sess-now {
  grid-area: now;
  min-width: 62px;
  color: #fff;
  font-size: 15px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.session-player .sess-axis {
  grid-area: axis;
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  color: #8ea3c0;
  font-size: 9px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.sessions .session-body { border-top: 0; }

@media (min-width: 881px) and (max-width: 1350px) {
  .session-focus { padding: 9px 12px 8px; }
  .session-focus-head { grid-template-columns: 100px minmax(0, 1fr) auto auto; column-gap: 12px; }
  .session-focus-thumb { width: 100px; height: 62px; }
  .session-total { font-size: 20px; }
  .session-vehicle { font-size: 13px; }
  .session-services, .session-focus .session-payment-details { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 880px) {
  .session-focus { padding: 10px 12px 8px; }
  .session-focus-head {
    grid-template-columns: 88px minmax(0, 1fr) auto;
    grid-template-areas: "photo copy copy" "total total verdict";
    gap: 8px 10px;
  }
  .session-focus-thumb { grid-area: photo; width: 88px; height: 56px; }
  .session-focus-copy { grid-area: copy; }
  /* Чип вердикта — в строке с суммой, иначе он отъедает у номера и времени полширины. */
  .session-focus-verdict { grid-area: verdict; align-self: start; justify-self: end; }
  .session-focus-total { grid-area: total; min-width: 0; grid-template-columns: 1fr; justify-items: start; text-align: left; gap: 1px; }
  .session-total-line { grid-column: 1 / -1; }
  .session-plate { font-size: 19px; }
  .session-vehicle { font-size: 13px; }
  .session-context { font-size: 11px; }
  .session-context b { font-size: 12px; }
  .session-focus .session-verification { font-size: 10px; }
  .session-total { font-size: 20px; }
  .session-services { white-space: normal; font-size: 11px; }
  .session-focus .session-payment-details { white-space: normal; font-size: 10px; }
  .session-focus-verdict .cause-chip { padding: 4px 7px 4px 4px; font-size: 10px; }
  .note-button { max-width: 150px; min-height: 30px; }
  /* На телефоне ползунок занимает всю строку, кнопки — под ним, крупнее под палец. */
  .session-player { flex-wrap: wrap; gap: 5px; padding: 6px 8px 5px; }
  .session-scrub-slot { order: -1; flex: 0 0 100%; min-width: 0; }
  .session-player .sess-scrub-wrap { padding: 0 2px; }
  .session-player .sess-scrub, .session-player .sess-slider { height: 30px; }
  .session-player .sess-band { top: 11px; }
  .session-player .sess-slider::-webkit-slider-thumb { width: 22px; height: 30px; margin-top: -11px; border-radius: 8px; }
  .session-player .sess-slider::-moz-range-thumb { width: 22px; height: 30px; border-radius: 8px; }
  .session-player .sess-now { font-size: 14px; }
  .session-player > .subtle, .session-player > .transport, .session-player .rate-buttons button { height: 38px; min-height: 38px; }
  .session-player > .subtle { padding: 4px 10px; }
  .session-player .rate-buttons { margin-left: auto; }
  .center-panel > .control-stack { top: var(--mobile-topbar); }
}
@media (max-width: 360px) {
  .session-focus-head { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .session-focus-thumb { width: 72px; height: 48px; }
  .session-plate { font-size: 17px; }
  .session-total { font-size: 18px; }
}
