/* ==========================================================================
   Mavicovod — общий слой дизайна (подключается последним).
   Использует токены из modern.css (--bg, --surface, --text, --accent …),
   поэтому одинаково работает в светлой и тёмной теме.
   1. Общие детали: фокус, переходы, радиусы
   2. Загрузка страницы — тонкая полоса сверху вместо плашки
   3. Заглушки загрузки и пустые экраны
   4. Нижняя панель на телефоне
   5. Блок «Сегодня» на главной
   6. «печатает…» в переписке
   ========================================================================== */

/* ---------- 1. Общие детали ---------- */
:root {
  --ds-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  --ds-ease: cubic-bezier(.2, .7, .3, 1);
}
html { -webkit-tap-highlight-color: transparent; }
a, button, .button, .ln-btn, .npb, .mvt-chip { transition: background-color .15s var(--ds-ease), color .15s var(--ds-ease), box-shadow .15s var(--ds-ease), transform .1s var(--ds-ease); }
:where(a, button, [role='button'], input, select, textarea, summary):focus-visible { outline: none !important; box-shadow: var(--ds-ring) !important; border-radius: var(--r-sm); }
:where(.button, .ln-btn, .comments-button, .btn):active { transform: scale(.98); }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- 2. Загрузка страницы: полоса сверху ---------- */
.ajax_indication > div {
  position: fixed !important;
  left: 0 !important; right: 0 !important; top: 0 !important; bottom: auto !important;
  height: 3px; padding: 0 !important; border-radius: 0 !important;
  background: transparent !important;
  z-index: 3000 !important;
  overflow: hidden; font-size: 0 !important;
}
.ajax_indication > div::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%;
  background: var(--accent); border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: ds-bar 1.1s var(--ds-ease) infinite;
}
.ajax_indication > div > * { display: none !important; }
@keyframes ds-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- 3. Заглушки загрузки и пустые экраны ---------- */
.ds-skel, .pw-skel i {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%) !important;
  background-size: 200% 100% !important;
  animation: ds-sk 1.2s linear infinite;
}
@keyframes ds-sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* стандартный «пусто» движка (html::empty) */
.list2 { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 36px 16px !important; text-align: center; }
.list2 > span { display: grid !important; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--surface-2) !important; margin: 0 !important; }
.list2 > span i { font-size: 34px !important; width: auto !important; color: var(--muted) !important; }
.list2 > div { font-size: 15px !important; color: var(--muted) !important; max-width: 320px; line-height: 1.45; }
.right-list-empty .list2 { flex-direction: row; padding: 0 !important; }
.right-list-empty .list2 > span { width: auto; height: auto; background: none !important; }

/* ---------- 4. Нижняя панель на телефоне ---------- */
.mvb .npb { cursor: pointer; -webkit-user-select: none; user-select: none; }
.mvb .npb > b { position: relative !important; width: 56px; height: 30px; border-radius: 999px; transition: background-color .2s var(--ds-ease); }
.mvb .npb.active > b { background: var(--accent-soft); color: var(--accent); }
.mvb .npb.active { color: var(--text) !important; }
.mvb .npb.active > span { font-weight: 700 !important; }
.mvb .npb i { font-size: 23px !important; }
.mvb .npb .count-mess { top: -3px !important; right: 6px !important; }
.mvb .npb:active > b { background: var(--surface-2); }

/* ---------- 5. Блок «Сегодня» ---------- */
.mvt { display: block; margin: 0 0 12px; }
.mvt .pw-skel { margin: 0; }
.mvt.is-on { padding: 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--card-shadow); }
.mvt-head { display: flex; align-items: center; gap: 10px; }
.mvt-hello { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mvt-hello b { font-size: 19px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvt-hello span { font-size: 13px; color: var(--muted); }
.mvt-fold { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.mvt-fold i { font-size: 18px; transition: transform .2s var(--ds-ease); }
.mvt.is-folded .mvt-fold i { transform: rotate(180deg); }
.mvt.is-folded .mvt-body { display: none; }
.mvt-body { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; min-width: 0; }
.mvt-body > .pw-card, .mvt-body .pw-card { box-shadow: none; background: var(--surface-2); }
.mvt-body .pw-fw-nums > span, .mvt-body .pw-hr, .mvt-body .pw-date:not(.is-today) { background: var(--surface) !important; }
.mvt-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 0 2px 2px; }
.mvt-chips::-webkit-scrollbar { display: none; }
.mvt-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; background: var(--surface-2); color: var(--text) !important; font-size: 13.5px; font-weight: 500; text-decoration: none !important; white-space: nowrap; }
.mvt-chip i { font-size: 17px; }
.mvt-chip:hover { background: var(--surface-3); }
.mvt-chip.is-accent { background: var(--accent-soft); color: var(--accent) !important; }
.mvt-chip.is-warn { background: rgba(245, 165, 36, .16); color: #a66300 !important; }
.mvt-chip.is-ok { background: rgba(75, 179, 75, .15); color: #2f8f3a !important; }
html:has(#design-stylesheet) .mvt-chip.is-warn { color: #ffc261 !important; }
html:has(#design-stylesheet) .mvt-chip.is-ok { color: #6fdc7a !important; }
@media (max-width: 480px) {
  .mvt.is-on { border-radius: 0; padding: 12px; }
  .mvt-hello b { font-size: 17px; }
}

/* ---------- 6. «печатает…» ---------- */
.mv-typing { display: inline-flex; align-items: baseline; gap: 1px; color: var(--accent); font-weight: 500; }
.mv-typing i { display: inline-block; width: 4px; height: 4px; margin-left: 2px; border-radius: 50%; background: currentColor; animation: ds-dot 1.2s infinite ease-in-out; }
.mv-typing i:nth-child(2) { animation-delay: .15s; }
.mv-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ds-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
