main > .container, main > .container-fluid
{
  padding: 70px 15px 20px;
}

.footer {
  background-color: #f5f5f5;
  font-size: .9em;
  height: 60px;
}

.footer > .container, .footer > .container-fluid {
  padding-right: 15px;
  padding-left: 15px;
}

.not-set {
  color: #c55;
  font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
  content: '';
  left: 3px;
  display: inline-block;
  width: 0;
  height: 0;
  border: solid 5px transparent;
  margin: 4px 4px 2px 4px;
  background: transparent;
}

a.asc:after {
  border-bottom: solid 7px #212529;
  border-top-width: 0;
}

a.desc:after {
  border-top: solid 7px #212529;
  border-bottom-width: 0;
}

.grid-view th,
.grid-view td:last-child {
  white-space: nowrap;
}

.grid-view .filters input,
.grid-view .filters select {
  min-width: 50px;
}

.hint-block {
  display: block;
  margin-top: 5px;
  color: #999;
}

.error-summary {
  color: #a94442;
  background: #fdf7f7;
  border-left: 3px solid #eed3d7;
  padding: 10px 20px;
  margin: 0 0 15px 0;
}

.auth__block {
  max-width: 480px;
}

.auth__form .input__group {
  margin-bottom: 1rem;
}

.auth__form .form-control {
  min-height: 42px;
}

.auth__form .input__checkbox {
  margin-bottom: 1rem;
}

.auth__form .input__checkbox .form-check {
  margin-bottom: 0;
}

.auth__footer {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
}

.auth__footer a {
  text-decoration: none;
}

/* align the logout "link" (button in form) of the navbar */
.navbar form > button.logout {
  padding-top: 7px;
  color: rgba(255, 255, 255, 0.5);
}

@media(max-width:767px) {
  .navbar form > button.logout {
    display:block;
    text-align: left;
    width: 100%;
    padding: 10px 0;
  }
}

.navbar form > button.logout:focus,
.navbar form > button.logout:hover {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75);
}

.navbar form > button.logout:focus {
  outline: none;
}

/* style breadcrumb widget as in previous bootstrap versions */
.breadcrumb {
  background-color: var(--bs-gray-200);
  border-radius: .25rem;
  padding: .75rem 1rem;
}

.breadcrumb-item > a
{
  text-decoration: none;
}

.skeleton-home code {
  display: inline-block;
  padding: .45rem .65rem;
  color: #213547;
  background: #eef3f8;
  border: 1px solid #d8e2ec;
  border-radius: .35rem;
}

.skeleton-status,
.skeleton-feature {
  border: 1px solid #d8e2ec;
  border-radius: .5rem;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.skeleton-status {
  padding: 1.25rem;
}

.skeleton-status > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid #eef3f8;
}

.skeleton-status > div:last-child {
  border-bottom: 0;
}

.skeleton-status span,
.skeleton-feature p {
  color: #6c757d;
}

.skeleton-feature {
  min-height: 160px;
  padding: 1.25rem;
}

.skeleton-feature h2 {
  font-size: 1.15rem;
}

/* Дело: ленты, решения, текст из Markdown */
.md p:last-child,
.md ul:last-child,
.md ol:last-child {
  margin-bottom: 0;
}

.md img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--bs-border-color);
  border-radius: .25rem;
}

.md img:not(a img) {
  cursor: zoom-in;
}

/* Вложение: ссылка на картинку сайта — миниатюра, щелчок открывает картинку целиком. */
.md a.md-attachment {
  display: inline-block;
  margin: 0 .375rem .375rem 0;
  vertical-align: top;
}

.md a.md-attachment img {
  width: auto;
  height: 96px;
  max-width: 180px;
  object-fit: cover;
  cursor: zoom-in;
}

/*
 * Файл: значок с именем, рамкой как у миниатюры. Длинное имя обрезается многоточием, целиком оно
 * в подсказке. Стоит в одной строке с миниатюрами и выравнивается по их верху.
 */
.md a.md-file {
  display: inline-flex;
  max-width: 100%;
  margin: 0 .375rem .375rem 0;
  padding: .375rem .625rem;
  align-items: center;
  gap: .375rem;
  vertical-align: top;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: .375rem;
  background: var(--bs-tertiary-bg, #f8f9fa);
}

.md a.md-file:hover {
  border-color: var(--bs-primary, #0d6efd);
}

.md a.md-file .md-file-icon {
  flex: none;
  color: var(--bs-primary, #0d6efd);
}

.md a.md-file .md-file-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.md pre,
.md table {
  max-width: 100%;
  overflow-x: auto;
}

/* Bootstrap обнуляет рамки ячеек у таблицы без класса `.table`, а Markdown класс не ставит. */
.md table {
  display: block;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.md table:last-child {
  margin-bottom: 0;
}

.md th,
.md td {
  padding: .375rem .625rem;
  border: 1px solid var(--bs-border-color);
  vertical-align: top;
}

.md thead th {
  background: var(--bs-tertiary-bg);
}

/*
 * Цитата: Markdown ставит голый `<blockquote>`, а Bootstrap оформляет только класс `.blockquote`,
 * поэтому без этого правила цитата не отличается от абзаца. Полоса и фон полупрозрачные — цитата
 * видна и в карточке, и внутри записи ленты любого цвета.
 */
.md blockquote {
  margin: 0 0 1rem;
  padding: .5rem .875rem;
  border-left: 4px solid rgba(var(--bs-emphasis-color-rgb, 0, 0, 0), .2);
  border-radius: 0 .25rem .25rem 0;
  background: rgba(var(--bs-emphasis-color-rgb, 0, 0, 0), .04);
}

.md blockquote:last-child,
.md blockquote > :last-child {
  margin-bottom: 0;
}

main,
main .card {
  overflow-wrap: anywhere;
}

.thread-item {
  padding: .6rem .75rem;
  margin-bottom: .5rem;
  border-left: 3px solid var(--bs-gray-300);
  background: var(--bs-gray-100);
  border-radius: .25rem;
  /* По ссылке #comment-N запись встаёт под фиксированным меню, а не за ним. */
  scroll-margin-top: 4.5rem;
}

/* Запись, на которую ведёт ссылка: вспыхивает жёлтым и остаётся в рамке, пока адрес на неё указывает. */
.thread-item:target {
  box-shadow: 0 0 0 2px var(--bs-primary);
  animation: thread-item-target 2.5s ease-out;
}

@keyframes thread-item-target {
  from {
    background-color: var(--bs-warning-bg-subtle);
  }
}

.thread-item--decision {
  border-left-color: var(--bs-success);
  background: var(--bs-success-bg-subtle);
}

.thread-item--status {
  border-left-color: var(--bs-primary);
  background: #fff;
}

.thread-item__head a {
  text-decoration: none;
}

/* Переход, к которому пояснение записали как решение, выделен как решение. */
.thread-item--status.thread-item--decision {
  border-left-color: var(--bs-success);
  background: var(--bs-success-bg-subtle);
}

.thread-item__transition {
  color: var(--bs-secondary-color);
}

/* Смена стадии без текста — тихая строка: её пишет приложение, обсуждать в ней нечего. */
.thread-item--event {
  margin-bottom: .25rem;
  padding: .1rem .75rem;
  background: transparent;
  border-left-color: transparent;
}

.thread-item--event .thread-item__transition::before {
  content: "";
  display: inline-block;
  width: .45rem;
  height: .45rem;
  margin-right: .35rem;
  border-radius: 50%;
  background: var(--bs-primary);
  vertical-align: .05rem;
}

/* Продолжение записей того же автора стоит вплотную к предыдущей: вместо имени и даты — только время. */
.thread-branch--continued {
  margin-top: -.25rem;
}

.thread-item__actions a {
  margin-left: .5rem;
}

/* Действия с записью — при наведении и фокусе. На сенсорном экране наведения нет: там они видны всегда. */
@media (hover: hover) {
  .thread-item__actions {
    opacity: 0;
    transition: opacity .15s;
  }

  .thread-item:hover .thread-item__actions,
  .thread-item:focus-within .thread-item__actions,
  .thread-item:target .thread-item__actions {
    opacity: 1;
  }
}

/* Под полем записи: отметка «решение» слева, кнопки — справа; на странице задачи к ним добавлены переходы. */
.thread-composer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}

.thread-composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
}

.list-group-item-action .badge {
  white-space: nowrap;
}
/* Всплывающие подсказки-легенды: стадии, приоритеты, пояснения полей */
.case-tooltip .tooltip-inner {
  max-width: min(360px, calc(100vw - 24px));
  text-align: left;
  padding: .5rem .75rem;
}

.case-tooltip .tooltip-inner ul {
  margin-top: .25rem;
}

[data-bs-toggle="tooltip"] {
  cursor: help;
}

/* Кнопка «?» рядом с действием: квадратная, по высоте соседней кнопки */
.hint-button {
  flex: 0 0 auto;
  aspect-ratio: 1;
  font-weight: 600;
}

.priority-mark {
  white-space: nowrap;
}

/* Визуальный редактор Markdown */
.markdown-editor {
  background: #fff;
}

.markdown-editor .toastui-editor-defaultUI {
  border-radius: .375rem;
}

.site-help th {
  width: 32%;
}

/* Телефон: перенос длинных названий и размер элементов для касания. */
@media (max-width: 575.98px) {
  main > .container,
  main > .container-fluid {
    padding: 64px 12px 16px;
  }

  .breadcrumb {
    padding: .5rem .75rem;
    font-size: .875rem;
  }

  h1.h3 {
    font-size: 1.35rem;
  }

  .navbar-toggler,
  .navbar .nav-link,
  .navbar .dropdown-item,
  main .btn,
  main .form-control,
  main .form-select,
  main .ts-control,
  main .page-link,
  .site-index .nav-link,
  .thread-item__head a {
    min-height: 40px;
  }

  main a.btn,
  .site-index .nav-link,
  .thread-item__head a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .navbar .dropdown-item,
  main .badge {
    white-space: normal;
  }

  .navbar .navbar-collapse.show {
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
  }

  main .pagination {
    flex-wrap: wrap;
  }

  .markdown-editor .toastui-editor-defaultUI-toolbar {
    padding-inline: .25rem;
  }

  /* Значки панели — спрайт под кнопку 32 px: растянутая кнопка их ломает. Палец попадает
     за счёт отступов между кнопками. */
  .markdown-editor .toastui-editor-defaultUI-toolbar button {
    margin: 4px;
  }

  .markdown-editor .toastui-editor-mode-switch,
  .markdown-editor .toastui-editor-mode-switch .tab-item {
    height: 40px;
    line-height: 40px;
  }

  .markdown-editor .toastui-editor-popup {
    max-width: calc(100vw - 4rem);
  }

  .markdown-editor .toastui-editor-popup button {
    min-height: 40px;
  }

  [data-bs-toggle="tooltip"]:not(a):not(button) {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
}
.markdown-editor .toastui-editor-contents {
  font-size: 1rem;
}

.thread-item--new {
  box-shadow: 0 0 0 2px var(--bs-warning);
}

/* Ветки ленты: запись верхнего уровня, под ней с отступом и линией слева — ответы и форма ответа. */
.thread-branch {
  margin-bottom: .5rem;
}

.thread-branch > .thread-item {
  margin-bottom: 0;
}

.thread-branch__replies,
.thread-branch__reply-slot:not(:empty),
.thread-branch__summary {
  margin-left: 1.25rem;
  padding-left: .75rem;
  border-left: 2px solid var(--bs-border-color);
}

.thread-branch__replies {
  padding-top: .5rem;
}

.thread-branch__replies > .thread-item:last-child {
  margin-bottom: 0;
}

.thread-branch__summary {
  padding-top: .25rem;
  padding-bottom: 0;
  border-radius: 0;
  text-decoration: none;
}

.thread-branch__reply-slot:not(:empty) {
  padding-top: .5rem;
}

.thread-item--deleted {
  font-style: italic;
}

.thread-reply-form {
  padding: .6rem .75rem;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: .25rem;
}

/* Кнопка «−/+» у начала ветки — как в SupportDesk. */
.thread-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: .25rem;
  padding: 0;
  font-size: .9rem;
  line-height: 1;
  color: var(--bs-secondary-color);
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: .2rem;
  vertical-align: text-bottom;
}

.thread-toggle:hover {
  color: var(--bs-body-color);
  border-color: var(--bs-secondary-color);
}

@media (max-width: 575.98px) {
  .thread-branch__replies,
  .thread-branch__reply-slot:not(:empty),
  .thread-branch__summary {
    margin-left: .5rem;
    padding-left: .5rem;
  }

  .thread-toggle {
    width: 2rem;
    height: 2rem;
  }
}

/* Кнопки панели редактора — спрайты фиксированной ширины: сжатие ломает значки на телефоне. */
.markdown-editor .toastui-editor-toolbar-icons {
  flex: 0 0 auto;
}

/* Под редактором — что сейчас загружается: большой PDF или архив грузится несколько секунд. */
.markdown-editor-status {
  padding: .25rem 0 0;
}

/* Ручка высоты под редактором (markdown-editor.js, addResizer): полоса с чертой посередине. */
.markdown-editor-resize {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 14px;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}

.markdown-editor-resize::before {
  content: "";
  width: 48px;
  height: 4px;
  background: var(--bs-gray-500);
  border-radius: 2px;
}

.markdown-editor-resize:hover::before,
.markdown-editor-resize:focus-visible::before,
.markdown-editor-resizing .markdown-editor-resize::before {
  background: var(--bs-secondary-color);
}

.markdown-editor-resize:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: -2px;
  border-radius: .25rem;
}

/* Пока тянут ручку, курсор не мигает на текст и кнопки, через которые проходит. */
.markdown-editor-resizing,
.markdown-editor-resizing * {
  cursor: ns-resize !important;
}

@media (max-width: 575.98px) {
  .markdown-editor-resize {
    height: 24px;
  }
}

/*
 * Своя кнопка «Прикріпити файл»: значок — SVG внутри, а не спрайт Toast UI. Toast UI кладёт её
 * в обёртку, у которой уже есть отступы кнопки панели: свои отступы сдвинули бы её ниже соседних.
 */
.markdown-editor .toastui-editor-toolbar-icons.markdown-editor-attach {
  display: flex;
  margin: 0;
  align-items: center;
  justify-content: center;
  color: #555;
  background-image: none;
}

/*
 * Подсказка-заглушка пустого редактора. Toast UI помечает её классом .placeholder, а у Bootstrap
 * это «скелет загрузки» — серая полоса с курсором ожидания. Возвращаем обычный серый текст.
 */
.markdown-editor .placeholder {
  display: inline;
  min-height: 0;
  vertical-align: baseline;
  cursor: text;
  background-color: transparent;
  opacity: 1;
}
/*
 * Колокольчик уведомлений — вне сворачиваемого меню: на телефоне рядом с кнопкой меню, на широком
 * экране — последним справа, после имени пользователя.
 */
.navbar .notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  margin-right: .5rem;
  padding: .375rem .5rem;
  color: var(--bs-secondary-color);
}

.navbar .notification-bell:hover,
.navbar .notification-bell:focus,
.navbar .notification-bell.active {
  color: var(--bs-emphasis-color);
}

/*
 * Светлое меню: текущий раздел подчёркнут синей чертой снизу, как вкладка. На телефоне меню
 * раскрывается списком — там раздел выделен полужирным, без черты.
 */
.case-navbar {
  --bs-navbar-color: var(--bs-secondary-color);
  --bs-navbar-hover-color: var(--bs-emphasis-color);
  --bs-navbar-active-color: var(--bs-emphasis-color);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.case-navbar .navbar-brand {
  font-weight: 700;
}

.case-navbar .nav-link.active {
  font-weight: 600;
}

@media (min-width: 992px) {
  .case-navbar {
    padding-block: 0;
  }

  .case-navbar .navbar-brand {
    padding-block: .875rem;
  }

  .case-navbar .navbar-nav > .nav-item > .nav-link {
    padding-block: 1rem calc(1rem - 2px);
    border-bottom: 2px solid transparent;
  }

  .case-navbar .navbar-nav > .nav-item > .nav-link.active {
    border-bottom-color: var(--bs-primary);
  }
}

.notification-bell__count {
  position: absolute;
  top: 0;
  right: -.125rem;
  font-size: .625rem;
}

@media (min-width: 992px) {
  .navbar .notification-bell {
    order: 3;
    margin-left: .75rem;
    margin-right: 0;
  }
}

/* Лента «Сповіщення»: новое — с синей полосой слева и жирным заголовком. */
.notification-item {
  display: block;
  border-left: 3px solid transparent;
}

.notification-item--unread {
  border-left-color: var(--bs-primary);
  background: var(--bs-primary-bg-subtle);
}

.notification-item--unread .notification-item__head {
  font-weight: 600;
}

.notification-item__details {
  display: -webkit-box;
  margin-top: .125rem;
  overflow: hidden;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/*
 * Последняя запись хронологии в списках квартир и задач: не длиннее двух строк, чтобы список
 * оставался списком.
 */
.thread-activity {
  display: -webkit-box;
  margin-top: .25rem;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.thread-activity__count {
  white-space: nowrap;
}

/* Контурные значки (Icon::svg) — цвета текста, размер строки. */
.case-icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.125em;
}

/* Кружок с инициалами (CaseHtml::avatar): цвет постоянный для человека. */
.case-avatar {
  --avatar-size: 28px;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  color: #fff;
  background: #64748b;
  font-size: calc(var(--avatar-size) * .43);
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.case-avatar--sm { --avatar-size: 24px; }
.case-avatar--xs { --avatar-size: 18px; }
.case-avatar--c0 { background: #2f5bea; }
.case-avatar--c1 { background: #0e9384; }
.case-avatar--c2 { background: #c11574; }
.case-avatar--c3 { background: #b54708; }
.case-avatar--c4 { background: #6941c6; }
.case-avatar--c5 { background: #3b7c0f; }
.case-avatar--cnone { background: #98a2b3; }

.case-avatar--none {
  color: var(--bs-secondary-color);
  background: transparent;
  border: 1.5px dashed var(--bs-border-color);
}
