/* Presentation only. Deliberately excluded from paper/print styles. */
@media screen {
  html[data-theme="dark"] .status-pill.ok,
  html[data-theme="dark"] .status-badge.done,
  html[data-theme="dark"] .fmba-day-count,
  html[data-theme="dark"] .fmba-special-count b,
  html[data-theme="dark"] .fmba-center-switch button.selected,
  html[data-theme="dark"] .portal-file-picker em,
  html[data-theme="dark"] .cmdai-subtitle,
  html[data-theme="dark"] .cmdai-sources summary,
  html[data-theme="dark"] .cmdai-jump-bottom,
  html[data-theme="dark"] .fmba-participant-stats b,
  html[data-theme="dark"] .fmba-participant-crm-link,
  html[data-theme="dark"] .sch-month-row.is-me .sch-month-person { color: #f3a6c2; }
  html[data-theme="dark"] .maintenance-group-head b {
    color: color-mix(in srgb, var(--center-color) 55%, white);
  }
  .ui-load-notice { margin-top: 16px; padding: 24px; }
  .ui-load-notice p { margin: 0 0 10px; color: var(--text); }
  .ui-load-notice small { color: var(--muted); }
  html[data-theme="dark"] .crm-tile.is-old,
  html[data-theme="dark"] .crm-table tr.is-old {
    background: #302332;
    border-color: #765065;
  }
  html[data-theme="dark"] .crm-tile.is-warn,
  html[data-theme="dark"] .crm-table tr.is-warn {
    background: #302a24;
    border-color: #796348;
  }
  html[data-theme="dark"] .crm-tile.is-old b,
  html[data-theme="dark"] .crm-table tr.is-old .crm-age b { color: #ffadc0; }
  html[data-theme="dark"] .crm-tile.is-warn b,
  html[data-theme="dark"] .crm-table tr.is-warn .crm-age b { color: #f4ca85; }
  html[data-theme="dark"] .crm-tile span,
  html[data-theme="dark"] .crm-tile em,
  html[data-theme="dark"] .crm-course { color: #c5cfdf; }
  html[data-theme="dark"] .crm-open,
  html[data-theme="dark"] .crm-filters button.is-ghost,
  html[data-theme="dark"] .calendar-month-more,
  html[data-theme="dark"] .calendar-sidebar-link,
  html[data-theme="dark"] .link-group.is-favorites .link-group-head,
  html[data-theme="dark"] .link-row-star.is-on,
  html[data-theme="dark"] .useful-links-page .quiet,
  html[data-theme="dark"] .fmba-stat-tile b,
  html[data-theme="dark"] .fmba-appt-card h4,
  html[data-theme="dark"] .fmba-day-capacity,
  html[data-theme="dark"] .documents-tabs button.selected,
  html[data-theme="dark"] .fmba-person-crm { color: #f3a6c2; }
  html[data-theme="dark"] .link-tabs button.selected {
    background: #402a3d; color: #ffd0e1; border-color: #9d6c83;
  }
  .sup-page > .mobile-filter-group .sup-actions { padding-top: 4px; }
}
@media screen and (max-width: 1024px) {
  .calendar-page-narrow .calendar-month-cell { min-height: 66px; }
  .calendar-page-narrow .calendar-month-cell-body { padding: 2px 5px 6px; }
  .calendar-page-narrow .cal-month-dots span { font-size: 11px; }
}
@media screen and (max-width: 720px) {
  dialog form, dialog form > *, dialog label { min-width: 0; }
  dialog input:not([type="checkbox"]):not([type="radio"]),
  dialog select, dialog textarea { min-width: 0; max-width: 100%; }
  dialog input[type="file"] { width: 100%; }
  dialog .dialog-actions { flex-wrap: wrap; }
  .cmdai-page {
    min-height: 0;
    height: calc(100dvh - 56px - 66px - env(safe-area-inset-bottom));
    padding-bottom: 10px;
  }
  .cmdai-composer { padding-bottom: 10px; }
  .sup-page > .mobile-filter-group > .mobile-filter-body { padding: 12px; }
  .sup-page .sup-bar { margin-bottom: 0; }
  .sup-page .sup-actions button { min-height: 44px; }
  .announcements-list-page .mobile-filter-body .list-filter-grid { padding: 12px; }
  .useful-links-page .mobile-filter-body .links-filter-bar {
    margin: 0; border: 0; box-shadow: none; background: transparent;
  }
  .useful-links-page .link-row { min-height: 44px; }
  .useful-links-page .link-row-star { min-width: 44px; min-height: 44px; }
}

/* ---- Выбранные файлы: список с кнопкой «убрать» ----
   Раньше имена шли одной строкой через запятую, и убрать лишний файл было
   нельзя — приходилось выбирать всю пачку заново. */
.portal-file-picker em,
.comment-file-selection { color: inherit; }
.picked-files { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.picked-files li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--line, #e3e8f0);
  border-radius: 10px;
  background: var(--surface-card, #fff);
}
.picked-files li > i { font-style: normal; opacity: .65; }
.picked-files li > b { min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; font-weight: 650; }
.picked-files li > small { color: var(--muted, #71819b); font-size: 11px; white-space: nowrap; }
.picked-file-remove {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line, #e3e8f0);
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #71819b);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.picked-file-remove:hover { border-color: rgba(162, 26, 71, .45); background: var(--surface-hover, #f7f9fd); color: #a21a47; }
.picked-files-total { display: block; margin-top: 6px; color: var(--muted, #71819b); font-size: 11.5px; }
[data-theme=dark] .picked-files li { background: var(--surface-card-2, #172336); }

/* Уже сохранённые файлы в форме правки — тот же список, что и у новых. */
.existing-files { margin: 0; padding: 0; border: 0; background: none; }
.existing-files h3 { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--muted, #71819b); }
.existing-files .picked-files { margin-top: 0; }

@media screen and (max-width: 720px) {
  .picked-file-remove { width: 44px; height: 44px; min-width: 44px; }
  .picked-files li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; }
  .picked-files li > i { display: none; }
  .picked-files li > b { grid-column: 1; grid-row: 1; }
  .picked-files li > small { grid-column: 1; grid-row: 2; }
  .picked-file-remove { grid-column: 2; grid-row: 1 / 3; }
  .picked-file-remove:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
}
@media screen {
  html[data-theme="dark"] .picked-file-remove:hover { color: #f3a6c2; }
}

/* ---- Календарь: разовая заметка и отменённое занятие ----
   Раньше и то и другое было видно только внутри карточки: приходилось
   открывать каждое занятие, чтобы узнать, что у одного сменилась локация,
   а другое сегодня не состоится. */
.calendar-note-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 5px;
  background: rgba(168, 109, 8, .16);
  color: #8a5a06;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  vertical-align: text-bottom;
}
.calendar-cancel-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(162, 26, 71, .14);
  color: #a21a47;
  font-style: normal;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .03em;
  white-space: nowrap;
}
.calendar-block.is-cancelled,
.calendar-month-pill.is-cancelled,
.cal-agenda-item.is-cancelled { opacity: .62; }
.calendar-block.is-cancelled .calendar-block-title,
.calendar-month-pill.is-cancelled,
.cal-agenda-item.is-cancelled .cal-agenda-body > b { text-decoration: line-through; }
.calendar-block.is-cancelled { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(120,130,150,.14) 6px 12px); }
.cal-agenda-note { display: block; margin-top: 2px; color: #8a5a06; overflow-wrap: anywhere; }

/* Заметка на день и причина отмены в карточке занятия. */
.cal-card-desc.is-note > div > small { color: #8a5a06; }
.cal-card-cancelled > div > small { color: #a21a47; }
.cal-card-cancelled > div > p { margin: 2px 0 0; font-weight: 650; }

[data-theme=dark] .calendar-note-badge { background: rgba(232, 193, 107, .2); color: #e8c16b; }
[data-theme=dark] .calendar-cancel-badge { background: rgba(232, 140, 165, .2); color: #e88ca5; }
[data-theme=dark] .cal-agenda-note,
[data-theme=dark] .cal-card-desc.is-note > div > small { color: #e8c16b; }
[data-theme=dark] .cal-card-cancelled > div > small { color: #e88ca5; }

/* ---- Центры ссылки: список галочек вместо одного выпадающего списка ----
   Одна и та же ссылка часто нужна двум центрам сразу; раньше её заводили
   дважды или помечали «важной для проекта», раздавая всем. */
.link-center-field > b { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--muted, #71819b); }
.link-center-checks { display: grid; gap: 4px; }
.link-center-checks .check-row { margin: 0; }
.link-center-field.is-disabled { opacity: .5; }
.link-center-field.is-disabled .check-row { pointer-events: none; }
